/* Jante shared styles */
:root {
  --bg: #F1ECE3;
  --ink: #152E34;
  --muted: #152E3499;
  --line: #152E341F;
  --teal: #152E34;
  --terra: #CD512F;
  --sand: #DCD3C2;
  --paper: #F7F2E9;
  --accent: #CD512F;

  --serif: "Fraunces", "Times New Roman", serif;
  --sans: "Rajdhani", system-ui, sans-serif;
  --mono: "Rajdhani", system-ui, sans-serif;
}
[data-theme="dark"] {
  --bg: #152E34;
  --ink: #F1ECE3;
  --muted: #F1ECE399;
  --line: #F1ECE324;
  --teal: #2A4A52;
  --terra: #CD512F;
  --sand: #1F3D44;
  --paper: #1B383F;
  --accent: #CD512F;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 600ms ease, color 600ms ease;
  overflow-x: hidden;
}
::selection { background: var(--ink); color: var(--bg); }

.wrap { max-width: 1440px; margin: 0 auto; padding: 0 40px; }
@media (max-width: 720px) { .wrap { padding: 0 20px; } }

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 28px 40px;
  color: var(--ink);
  background: transparent;
  transition: background 300ms ease, box-shadow 300ms ease;
}
.nav.scrolled {
  background: var(--bg);
  box-shadow: 0 1px 0 var(--line);
}
.nav .logo {
  font-family: var(--serif); font-weight: 400;
  font-size: 22px; letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  text-decoration: none; color: inherit;
}
.nav .logo em { font-style: italic; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }
.nav .logo img { filter: invert(1); }
.nav .meta {
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.12em;
  text-align: center; opacity: .8;
}
.nav .links {
  display: flex; gap: 28px; justify-self: end; align-items: center;
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.12em;
}
.nav a { color: inherit; text-decoration: none; }
.nav a:hover { opacity: .6; }
.nav a.current { border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.nav-menu-toggle {
  display: none;
  width: 34px;
  height: 34px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  padding: 0;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-menu-toggle span {
  position: relative;
  width: 14px;
  height: 1px;
  background: currentColor;
  display: block;
  transition: background 180ms ease;
}
.nav-menu-toggle span::before,
.nav-menu-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 14px;
  height: 1px;
  background: currentColor;
  transition: transform 240ms ease, top 240ms ease;
}
.nav-menu-toggle span::before { top: -5px; }
.nav-menu-toggle span::after { top: 5px; }
.nav.open .nav-menu-toggle span { background: transparent; }
.nav.open .nav-menu-toggle span::before { top: 0; transform: rotate(45deg); }
.nav.open .nav-menu-toggle span::after { top: 0; transform: rotate(-45deg); }
.theme-toggle {
  background: transparent; border: 1px solid currentColor;
  color: inherit; width: 28px; height: 28px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; margin-right: 4px;
  transition: background 240ms ease, color 240ms ease;
}
.theme-toggle:hover { background: currentColor; }
.theme-toggle:hover svg { color: var(--bg); }
.theme-toggle svg { width: 14px; height: 14px; display: block; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.lang-toggle { display: inline-flex; align-items: center; gap: 4px; border: 1px solid currentColor; border-radius: 999px; padding: 4px; font: inherit; }
.lang-toggle button { background: transparent; border: 0; color: inherit; padding: 4px 10px; border-radius: 999px; font: inherit; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; }
.lang-toggle button.active { background: currentColor; }
.lang-toggle button.active span { color: var(--bg); }
@media (max-width: 720px) {
  .nav {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 14px 20px 12px;
    background: var(--bg);
    box-shadow: 0 1px 0 var(--line);
  }
  .nav .logo { display: inline-flex; width: fit-content; }
  .nav .logo svg { max-width: 116px; height: auto; }
  .nav .meta { display: none; }
  .nav-menu-toggle { display: inline-flex; justify-self: end; }
  .nav .links {
    grid-column: 1 / -1;
    width: 100%;
    justify-self: stretch;
    justify-content: flex-start;
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    margin-top: 0;
    padding-top: 0;
    max-height: none;
    overflow: visible;
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: 0.1em;
    transition: max-height 280ms ease, padding-top 280ms ease, opacity 200ms ease;
  }
  .nav.nav-enhanced .links {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
  }
  .nav.nav-enhanced.open .links {
    max-height: 360px;
    padding-top: 18px;
    opacity: 1;
  }
  .theme-toggle {
    width: 26px;
    height: 26px;
    margin: 2px 0 0;
    order: 0;
  }
  .lang-toggle {
    display: inline-flex;
    margin: 0;
    padding: 3px;
  }
  .lang-toggle button { padding: 4px 8px; }
}

/* Section bits */
.section-tag {
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--muted);
  display: flex; align-items: center; gap: 12px;
}
.section-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* Page header (detail pages) */
.page-head {
  padding: 180px 0 100px;
}
.page-head .eyebrow {
  margin-bottom: 32px;
}
.page-head h1 {
  font-family: var(--serif);
  font-size: clamp(72px, 11vw, 200px);
  line-height: 0.9; letter-spacing: -0.04em;
  font-weight: 300; margin: 0;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  text-wrap: balance;
}
.page-head h1 em {
  font-style: italic; color: var(--accent);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
.page-head .lede {
  margin-top: 40px;
  max-width: 720px;
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.45;
  font-weight: 300;
  color: var(--muted);
  font-variation-settings: "opsz" 144;
}

/* Footer (shared) */
.footer-block {
  padding: 60px 0 40px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted);
  flex-wrap: wrap; gap: 16px;
}
@media (max-width: 720px) {
  .footer-block {
    align-items: flex-start;
    flex-direction: column;
    padding: 36px 0 28px;
    gap: 10px;
    font-size: 10px;
    line-height: 1.5;
  }
}

/* Reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 900ms ease, transform 900ms cubic-bezier(.2,.7,0,1); }
.reveal.on { opacity: 1; transform: none; }
