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

:root[data-theme="dark"] {
  --bh-bg: #000;
  --bh-text: #fff;
  --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%; }
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; }
}