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

html { min-width: 320px; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color 180ms ease, color 180ms ease;
}

body.is-locked { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
svg { width: 1em; height: 1em; }
input[type="search"]::-webkit-search-cancel-button { display: none; }

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

::selection { color: var(--reverse-ink); background: var(--gold-600); }

.page-shell {
  width: min(calc(100% - (var(--page-gutter) * 2)), var(--content-max));
  margin-inline: auto;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.skip-link {
  position: fixed;
  z-index: 9999;
  left: 16px;
  top: 12px;
  padding: 10px 14px;
  color: #fff;
  background: #17242f;
  border-radius: 4px;
  transform: translateY(-180%);
  transition: transform 120ms ease;
}
.skip-link:focus { transform: translateY(0); }

/* Header */
.site-header {
  position: relative;
  z-index: 100;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.header-primary {
  min-height: var(--header-primary-height);
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(360px, 1fr) auto;
  align-items: center;
  gap: 28px;
}
.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.brand-emblem {
  flex: 0 0 auto;
  width: 70px;
  height: 70px;
  color: var(--gold-600);
  filter: drop-shadow(0 3px 9px rgba(161, 113, 29, 0.10));
}
.brand-copy { min-width: 0; display: grid; gap: 1px; }
.brand-name {
  font-family: var(--font-editorial);
  font-size: clamp(28px, 2.3vw, 42px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.brand-name span { color: var(--gold-700); }
.brand-subtitle {
  margin-top: 5px;
  color: var(--lavender-700);
  font-family: var(--font-editorial);
  font-size: 15px;
  letter-spacing: 0.012em;
  white-space: nowrap;
}

.global-search-trigger {
  width: 100%;
  min-width: 0;
  height: 52px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 0 14px 0 18px;
  color: var(--muted);
  text-align: left;
  background: color-mix(in srgb, var(--surface-soft) 62%, transparent);
  border: 1px solid var(--lavender-300);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--surface) 60%, transparent);
  cursor: text;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
.global-search-trigger:hover {
  color: var(--ink-soft);
  border-color: var(--gold-500);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}
.global-search-trigger > svg { width: 23px; height: 23px; color: var(--ink-soft); }
.global-search-trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd {
  min-width: 26px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.header-meta { display: flex; align-items: center; gap: 18px; }
.release-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
}
.release-summary > svg { width: 34px; height: 34px; color: var(--gold-600); }
.release-summary > span { display: grid; gap: 1px; }
.release-summary strong {
  color: var(--gold-700);
  font-family: var(--font-editorial);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}
.release-summary small { color: var(--muted); font-size: 12px; white-space: nowrap; }

.theme-toggle {
  width: 58px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.theme-track {
  position: relative;
  width: 58px;
  height: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  color: var(--lavender-700);
  background: var(--lavender-75);
  border: 1px solid var(--lavender-300);
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(34, 23, 45, 0.08);
}
.theme-track > svg { position: relative; z-index: 2; width: 15px; height: 15px; }
.theme-sun { color: var(--gold-700); }
.theme-moon { color: var(--lavender-700); }
.theme-thumb {
  position: absolute;
  z-index: 1;
  left: 3px;
  top: 3px;
  width: 24px;
  height: 24px;
  background: var(--surface-raised);
  border: 1px solid var(--gold-300);
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(42, 28, 52, 0.22);
  transition: transform 180ms cubic-bezier(.2, 0, 0, 1);
}
html[data-theme="dark"] .theme-thumb { transform: translateX(27px); }

.mobile-menu-button {
  width: 44px;
  height: 44px;
  display: none;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.mobile-menu-button svg { width: 22px; height: 22px; }

.primary-navigation {
  min-height: var(--header-nav-height);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border-top: 1px solid var(--line);
}
.primary-navigation-inner {
  height: var(--header-nav-height);
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: clamp(34px, 5vw, 78px);
}
.primary-navigation a {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0 7px;
  color: var(--ink-soft);
  font-family: var(--font-editorial);
  font-size: 17px;
  transition: color 120ms ease;
}
.primary-navigation a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--gold-600);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 150ms ease;
}
.primary-navigation a:hover,
.primary-navigation a.is-active { color: var(--gold-700); }
.primary-navigation a:hover::after,
.primary-navigation a.is-active::after { transform: scaleX(1); }

/* Mobile navigation */
.mobile-navigation {
  position: fixed;
  z-index: 700;
  inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(8px);
}
.mobile-navigation-panel {
  width: min(410px, 92vw);
  height: 100%;
  margin-left: auto;
  padding: 0 20px 28px;
  color: var(--ink);
  background: var(--surface-raised);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-dialog);
  overflow-y: auto;
}
.mobile-navigation-header {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-editorial);
  font-size: 21px;
  font-weight: 600;
}
.mobile-navigation-header button,
.search-dialog-header button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.mobile-navigation-header button:hover,
.search-dialog-header button:hover { background: var(--surface-soft); }
.mobile-navigation-header svg { width: 22px; height: 22px; }
.mobile-search-trigger {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 18px 0 12px;
  padding: 0 13px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}
.mobile-search-trigger svg { width: 20px; height: 20px; }
.mobile-navigation nav { display: grid; }
.mobile-navigation nav a {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-editorial);
  font-size: 17px;
}
.mobile-navigation nav a.is-active { color: var(--gold-700); }
.mobile-navigation nav svg { width: 18px; height: 18px; color: var(--gold-600); }
.mobile-release {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.mobile-release svg { width: 30px; height: 30px; color: var(--gold-600); }
.mobile-release span { display: grid; }
.mobile-release strong { color: var(--gold-700); font-family: var(--font-editorial); }
.mobile-release small { color: var(--muted); }

/* Footer */
.site-footer {
  position: relative;
  overflow: hidden;
  padding: 26px 0;
  color: var(--ink-soft);
  background: var(--surface);
  border-top: 1px solid var(--line-strong);
}
.footer-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  gap: 28px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand > svg { width: 38px; height: 38px; color: var(--gold-600); }
.footer-brand div { display: grid; }
.footer-brand strong { font-family: var(--font-editorial); font-size: 16px; }
.footer-brand span { color: var(--muted); font-size: 10px; }
.site-footer nav { display: flex; align-items: center; justify-content: center; gap: 20px; font-family: var(--font-editorial); font-size: 14px; }
.site-footer nav a:hover { color: var(--gold-700); text-decoration: underline; text-underline-offset: 4px; }
.site-footer nav > span { color: var(--gold-600); font-size: 9px; }
.footer-release { justify-self: end; display: grid; text-align: right; }
.footer-release span { color: var(--gold-700); font-family: var(--font-editorial); font-size: 13px; }
.footer-release small { color: var(--muted); font-size: 10px; }
.footer-illustration {
  position: absolute;
  bottom: -22px;
  width: 210px;
  height: 94px;
  opacity: 0.55;
  background-image: var(--footer-botanical);
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}
.footer-illustration-left { left: -30px; }
.footer-illustration-right { right: -30px; transform: scaleX(-1); }
:root { --footer-botanical: url("../illustrations/footer-botanical-light.4f94fc756087.svg"); }
html[data-theme="dark"] { --footer-botanical: url("../illustrations/footer-botanical-dark.80f0105e77e0.svg"); }

/* Search overlay */
.search-overlay {
  position: fixed;
  z-index: 900;
  inset: 0;
  display: grid;
  place-items: start center;
  padding: min(12vh, 110px) 16px 30px;
  background: var(--backdrop);
  backdrop-filter: blur(10px);
}
.search-dialog {
  width: min(720px, 100%);
  max-height: min(720px, 78vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-dialog);
  overflow: hidden;
}
.search-dialog-header {
  height: 68px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 20px;
  border-bottom: 1px solid var(--line);
}
.search-dialog-header > svg { width: 23px; height: 23px; color: var(--gold-700); }
.search-dialog-header input {
  width: 100%;
  height: 100%;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 18px;
}
.search-dialog-header input::placeholder { color: var(--muted-faint); }
.search-dialog-header button svg { width: 20px; height: 20px; }
.search-dialog-body { padding: 17px 14px 19px; overflow-y: auto; }
.search-section-label {
  margin: 0 10px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.search-result-list { display: grid; gap: 3px; }
.search-result-list a {
  min-height: 61px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  padding: 8px 11px;
  border-radius: 8px;
}
.search-result-list a:hover,
.search-result-list a.is-keyboard-active { background: var(--lavender-75); }
.search-result-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--lavender-700);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.search-result-icon svg { width: 24px; height: 24px; }
.search-result-list a > span:nth-child(2) { min-width: 0; display: grid; }
.search-result-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.search-result-list small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.search-result-arrow { width: 17px; height: 17px; color: var(--gold-600); }
.search-empty { margin: 26px 10px; color: var(--muted); text-align: center; }
.search-dialog-footer {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 18px;
  color: var(--muted);
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
  font-size: 11px;
}
.search-dialog-footer span { display: flex; align-items: center; gap: 5px; }
.search-dialog-footer kbd { min-width: 23px; height: 22px; padding: 0 5px; font-size: 10px; }

/* Secondary utility pages included for working links */
.utility-page { min-height: 62vh; padding-block: 76px 100px; }
.utility-eyebrow { margin: 0 0 8px; color: var(--gold-700); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.utility-page h1 { margin: 0 0 30px; font-family: var(--font-editorial); font-size: clamp(38px, 5vw, 66px); line-height: 1; }
.utility-search { max-width: 860px; min-height: 58px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 5px 5px 5px 18px; background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: 9px; box-shadow: var(--shadow-sm); }
.utility-search > svg { width: 23px; height: 23px; }
.utility-search input { width: 100%; height: 46px; padding: 0; color: var(--ink); background: transparent; border: 0; outline: 0; }
.utility-search button { height: 46px; padding: 0 23px; color: var(--reverse-ink); background: var(--gold-600); border: 0; border-radius: 6px; font-weight: 700; cursor: pointer; }
.utility-message { max-width: 860px; display: grid; grid-template-columns: 30px 1fr; gap: 14px; margin-top: 28px; padding: 20px; background: var(--surface-soft); border: 1px solid var(--line); border-left: 3px solid var(--gold-600); }
.utility-message > svg { width: 26px; height: 26px; color: var(--gold-700); }
.utility-message strong { font-family: var(--font-editorial); font-size: 18px; }
.utility-message p { margin: 4px 0 0; color: var(--muted); }
.utility-back { display: inline-block; margin-top: 26px; color: var(--gold-700); font-weight: 700; }

[hidden] { display: none !important; }

@media (max-width: 1180px) {
  .header-primary { grid-template-columns: minmax(235px, 300px) minmax(300px, 1fr) auto; gap: 18px; }
  .brand-emblem { width: 58px; height: 58px; }
  .brand-subtitle { font-size: 13px; }
  .release-summary small { display: none; }
  .release-summary > svg { width: 29px; height: 29px; }
  .theme-toggle { width: 54px; }
  .theme-track { width: 54px; }
  html[data-theme="dark"] .theme-thumb { transform: translateX(23px); }
  .footer-grid { grid-template-columns: 1fr auto; }
  .footer-brand { display: none; }
}

@media (max-width: 900px) {
  .header-primary { grid-template-columns: minmax(220px, 1fr) minmax(270px, .9fr) auto; }
  .release-summary { display: none; }
  .primary-navigation-inner { gap: 34px; }
  .footer-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer-release { justify-self: center; text-align: center; }
}

@media (max-width: 760px) {
  .site-header { position: sticky; top: 0; }
  .header-primary { min-height: 64px; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .brand { gap: 9px; }
  .brand-emblem { width: 40px; height: 40px; }
  .brand-name { font-size: 26px; }
  .brand-subtitle { display: none; }
  .global-search-trigger, .primary-navigation { display: none; }
  .header-meta { gap: 8px; }
  .mobile-menu-button { display: grid; }
  .footer-illustration { width: 150px; opacity: .35; }
  .site-footer nav { flex-wrap: wrap; gap: 10px 16px; }
  .site-footer nav > span { display: none; }
  .search-overlay { padding: 0; place-items: stretch; }
  .search-dialog { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; }
  .search-dialog-header { height: 64px; }
  .search-dialog-footer { overflow-x: auto; }
  .utility-page { padding-block: 48px 72px; }
}

@media (max-width: 430px) {
  .brand-name { font-size: 23px; }
  .brand-emblem { width: 36px; height: 36px; }
  .theme-toggle { width: 50px; }
  .theme-track { width: 50px; height: 30px; }
  .theme-thumb { width: 22px; height: 22px; }
  html[data-theme="dark"] .theme-thumb { transform: translateX(21px); }
  .mobile-menu-button { width: 40px; height: 40px; }
  .search-dialog-footer { gap: 10px; padding-inline: 10px; }
  .search-dialog-footer span { white-space: nowrap; }
  .utility-search { grid-template-columns: 20px minmax(0, 1fr); padding-right: 12px; }
  .utility-search button { grid-column: 1 / -1; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
