@font-face {
  font-family: "Roboto Slab";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/roboto-slab-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Roboto Slab";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/roboto-slab-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bh-bg: #FFFDF8;
  --bh-text: #1F2937;
  --bh-accent: #C2410C;
  --hover-bg: #F3EDE0;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bh-bg: #1F2937;
  --bh-text: #FFFDF8;
  --bh-accent: #F97316;
  --hover-bg: #1F1F1F;
  color-scheme: dark;
}

/* No-JS fallback: only applies if the head script hasn't set data-theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bh-bg: #000;
    --bh-text: #fff;
    --bh-accent: #F97316;
    --hover-bg: #1F1F1F;
    color-scheme: dark;
  }
  :root:not([data-theme]) .logo-light { display: none; }
  :root:not([data-theme]) .logo-dark { display: inline; }
}

/* The toggle can't work without JS */
:root:not([data-theme]) .mode-toggle { display: none; }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-block-size: 100dvh;
  padding: 24px;
  background: var(--bh-bg);
  color: var(--bh-text);
  font-family: system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.5;
}

:lang(ja) { line-height: 1.7; }
:lang(zh-Hans) { line-height: 1.7; }
:lang(ar) { line-height: 1.8; 
  text-align: start;
}


main { max-inline-size: 65ch; inline-size: 100%; }
main, article, section {  text-align: start; }


h1 {
  font-family: "Roboto Slab", serif;
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1.25;
  margin-block: 0 6px;
}

h2 {
  font-family: "Roboto Slab", serif;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.3;
  margin-block: 2rem 0.75rem;
}

h3 {
  font-family: "Roboto Slab", serif;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.4;
  margin-block: 1.75rem 0.5rem;
}

h4 {
  font-family: "Roboto Slab", serif;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.4;
  margin-block: 1.5rem 0.5rem;
}


.sub { margin-block: 0 24px; }

a { color: var(--bh-accent); text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--bh-accent);
  outline-offset: 2px;
}

/* Logo swap: render both, show one */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline; }
.hero img { block-size: 120px; inline-size: auto; max-inline-size: 100%; }

/* Mortar divider */
.mortar {
  border: 0;
  block-size: 2px;
  background: var(--bh-text);
  margin-block: 36px 24px;
}

/* Skip link: hidden until you tab to it */
.skip-link {
  position: absolute;
  inset-block-start: -72px;
  inset-inline-start: 12px;
  padding: 12px 18px;
  background: var(--bh-bg);
  border: 2px solid var(--bh-text);
}
.skip-link:focus { inset-block-start: 12px; 
z-index: 1000;
}

/* Centered page (language picker and 404) */
.centered {
  display: grid;
  place-content: center;
  text-align: center;
}

/* Row of buttons */
.button-list {
  list-style: none;
  margin: 0 0 36px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.button-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-block-size: 44px;
  padding-block: 0.75rem;
  padding-inline: 1.5rem;
  border: 2px solid var(--bh-text);
  border-radius: 8px;
  text-decoration: none;
  min-inline-size: 12rem;
  min-block-size: 48px;
  white-space: nowrap;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-block-size: 48px;
  min-inline-size: 44px;
  padding-block: 12px;
  padding-inline: 24px;
  border: 2px solid var(--bh-text);
  border-radius: 0;
  background: transparent;
  color: var(--bh-text);
  font-family: "Roboto Slab", serif;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
}

.button-link:hover { background: var(--hover-bg); text-decoration: underline; }

.mode-toggle:hover { background: var(--hover-bg); }
.mode-toggle[aria-pressed="true"] { background: var(--bh-text); color: var(--bh-bg); }
.mode-toggle img { inline-size: 24px; block-size: 24px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (forced-colors: active) {
  .button-link, .mode-toggle { border-color: LinkText; }
  .mortar {background: CanvasText; }
  :focus-visible { outline-color: Highlight; }
}

/* Quote on 404 pages */
figure.quote { margin: 24px auto; max-inline-size: 40ch; }
figure.quote blockquote {
  margin: 0;
  padding-inline-start: 16px;
  border-inline-start: 4px solid var(--bh-accent);
  font-style: italic;
  text-align: start;
}
figure.quote p { margin: 0; }
figure.quote figcaption { margin-block-start: 8px; padding-inline-start: 20px; font-size: 0.95rem; text-align: start; }

