/* ==========================================================================
   Vinay Swaminathan — visual system (2026 redesign, implemented from the
   Claude Design canvas project "Vinay Swaminathan redesign")
   Deep navy ground, sky-blue accent, warm-white text.
   ========================================================================== */

:root {
  --ink-1:      #0E1428;   /* default page ground */
  --ink-2:      #151C34;   /* alternating band */
  --ink-3:      #1B2448;   /* hover / raised surface */
  --line:       #2A3563;
  --text:       #F7F6F2;
  --muted:      #B4BCD4;
  --accent:     #5DB8F0;
  --accent-bg:  #2A44B8;   /* highlight-sweep fill, sits under accent text */
  --warn:       #E0955C;

  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --ui: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --t-body: clamp(1rem, 3.8vw, 1.125rem);
  --t-h1:   clamp(2.5rem, 10vw, 4.75rem);
  --t-h2:   clamp(1.5rem, 5.5vw, 2.4rem);
  --t-h3:   clamp(1rem, 3.8vw, 1.125rem);

  --header-h: 60px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

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

/* Guard against inline `style="display:…"` on elements that also carry the
   `hidden` attribute (e.g. #form-sent) — inline styles otherwise win over the
   UA stylesheet's `[hidden]{display:none}` and the element stays visible. */
[hidden] { display: none !important; }

/* Anchor targets land below the sticky header, with a little breathing
   room, on every browser's native hash-jump — no hardcoded JS offset needed. */
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

/* Each page's opening section always fills at least one full screen, even
   on mobile browsers whose address bar changes the viewport height. */
.page-hero { min-height: 100vh; min-height: 100dvh; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink-1);
  color: var(--text);
  font-family: var(--ui);
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
p { margin: 0; }
a { color: var(--text); }
a:hover { color: var(--text); }
[id] { scroll-margin-top: 76px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: rgba(93, 184, 240, .28); color: var(--text); }
input, textarea, button { font: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 300; margin: 0; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--ink-1);
  padding: 0.8rem 1.25rem; font-size: 0.9rem; font-weight: 500;
}
.skip-link:focus { left: 0; }

.wrap { max-width: 1120px; margin: 0 auto; }

/* --------------------------------------------------------------------------
   Highlight sweep — a filled backdrop that draws in behind emphasised text
   -------------------------------------------------------------------------- */
[data-hl] {
  background: linear-gradient(var(--accent-bg), var(--accent-bg)) no-repeat;
  background-size: 0% 100%;
  color: var(--text);
  padding: 0 .12em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.js [data-hl] { background-size: 100% 100%; } /* fail-open: filled without JS */
.js.motion-ready [data-hl] { background-size: 0% 100%; transition: background-size 1.1s cubic-bezier(.65,0,.35,1); }
.js.motion-ready [data-hl].is-in { background-size: 100% 100%; }

/* --------------------------------------------------------------------------
   Reveal-on-scroll — content is visible by default; JS only adds motion
   -------------------------------------------------------------------------- */
[data-reveal], [data-seq] { opacity: 1; }
.js.motion-ready [data-reveal] { opacity: 0; transform: translate3d(0,22px,0); }
.js.motion-ready [data-reveal].is-in { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js.motion-ready [data-stagger] > * { opacity: 0; transform: translate3d(0,16px,0); }
.js.motion-ready [data-stagger].is-in > * { opacity: 1; transform: none; transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js.motion-ready [data-stagger].is-in > *:nth-child(1) { transition-delay: 0ms; }
.js.motion-ready [data-stagger].is-in > *:nth-child(2) { transition-delay: 80ms; }
.js.motion-ready [data-stagger].is-in > *:nth-child(3) { transition-delay: 160ms; }
.js.motion-ready [data-stagger].is-in > *:nth-child(4) { transition-delay: 240ms; }
.js.motion-ready [data-stagger].is-in > *:nth-child(5) { transition-delay: 320ms; }
.js.motion-ready [data-stagger].is-in > *:nth-child(6) { transition-delay: 400ms; }
.js.motion-ready [data-stagger].is-in > *:nth-child(7) { transition-delay: 480ms; }
.js.motion-ready [data-stagger].is-in > *:nth-child(8) { transition-delay: 560ms; }
.js.motion-ready [data-stagger].is-in > *:nth-child(9) { transition-delay: 640ms; }
.js.motion-ready [data-seq] { opacity: 0; transform: translate3d(0,16px,0); }
.js.motion-ready [data-seq].is-in { opacity: 1; transform: none; transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.js.motion-ready [data-draw] { stroke-dasharray: 700; stroke-dashoffset: 700; }
.js.motion-ready .is-in [data-draw] { stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s cubic-bezier(.65,0,.35,1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js.motion-ready [data-reveal], .js.motion-ready [data-stagger] > *, .js.motion-ready [data-seq] {
    opacity: 1 !important; transform: none !important;
  }
  .js [data-hl] { background-size: 100% 100% !important; }
  .js.motion-ready [data-draw] { stroke-dashoffset: 0 !important; }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 60;
  background: rgba(14,20,40,.94);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  font-family: var(--ui); font-size: var(--t-body);
  transition: transform .4s var(--ease);
}
.site-head.is-hidden { transform: translateY(-100%); }
.site-head__inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 500; letter-spacing: .01em;
  min-height: 44px;
}
.brand img { width: 28px; height: auto; }

.nav { display: flex; align-items: center; gap: 22px; }
.nav__link {
  color: var(--muted); text-decoration: none; min-height: 44px;
  display: flex; align-items: center; border-bottom: 2px solid transparent;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.nav__link:hover, .nav__link:focus-visible { color: var(--text); }
.nav__link[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

.nav-toggle {
  display: none; background: transparent; border: 1px solid var(--line); color: var(--text);
  min-height: 44px; padding: 0 14px; align-items: center; gap: 10px; border-radius: 999px; cursor: pointer;
}
.nav-toggle__bars { display: grid; gap: 4px; }
.nav-toggle__bars i { display: block; width: 16px; height: 1.5px; background: var(--text); }

.nav-mobile {
  position: absolute; top: 100%; left: 0; right: 0;
  box-shadow: 0 12px 24px rgba(0,0,0,.35); border-top: 1px solid var(--line);
  background: var(--ink-1); padding: 8px 20px 20px;
}
.nav-mobile[hidden] { display: none; }
.nav-mobile a {
  display: flex; align-items: center; justify-content: space-between; min-height: 52px;
  border-bottom: 1px solid var(--line); color: var(--muted); text-decoration: none;
}
.nav-mobile a[aria-current="page"] { color: var(--text); }
.nav-mobile a span:last-child { color: var(--accent); }
.nav-mobile a.btn { color: var(--ink-1); border-bottom: none; min-height: 44px; }
.nav-mobile a.btn span:last-child { color: inherit; }

@media (min-width: 960px) { .nav-mobile, .nav-toggle { display: none; } }
@media (max-width: 959px) { .nav { display: none; } .nav-toggle { display: inline-flex; } }

/* --------------------------------------------------------------------------
   Buttons & links
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px;
  padding: 0 20px; border-radius: 999px; text-decoration: none; font-weight: 500;
  transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
  cursor: pointer; border: 1px solid transparent;
}
.btn--solid { background: var(--text); color: var(--ink-1); border-color: var(--text); }
.btn--solid:hover, .btn--solid:focus-visible { background: #DCE3FF; border-color: #DCE3FF; }
.btn--outline { border-color: var(--accent); color: var(--text); font-weight: 400; }
.btn--outline:hover, .btn--outline:focus-visible { background: var(--ink-3); }

.link-u {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  color: var(--text); font-weight: 500; text-decoration: underline; text-underline-offset: 4px;
  transition: opacity .3s var(--ease);
}
.link-u:hover, .link-u:focus-visible { opacity: .82; }
.link-plain {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  color: var(--text); text-decoration: none; font-weight: 500;
}

/* --------------------------------------------------------------------------
   Choice pills (checkboxes / radios) & form fields
   -------------------------------------------------------------------------- */
.choice {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 4px 14px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.choice:has(input:checked) { border-color: var(--accent); background: var(--ink-3); }
.choice input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }

.finput {
  min-height: 48px; padding: 10px 12px; background: var(--ink-1);
  border: 1px solid var(--line); border-radius: 12px; color: var(--text); width: 100%;
  transition: border-color .3s var(--ease);
}
.finput:focus { outline: none; border-color: var(--accent); }
textarea.finput { min-height: 96px; resize: vertical; }
.flabel { font-weight: 500; display: block; margin-bottom: 6px; }
.ffield { display: grid; gap: 6px; }

details.crucible summary, details.doorway-detail summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  min-height: 48px; font-weight: 500; color: var(--text);
}
details.crucible summary::-webkit-details-marker, details.doorway-detail summary::-webkit-details-marker { display: none; }
.chev { display: inline-block; transition: transform .2s var(--ease); }
details[open] .chev { transform: rotate(180deg); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-foot {
  background: var(--ink-1); color: var(--muted);
  font-family: var(--ui); font-size: var(--t-body);
  border-top: 1px solid var(--line);
}
.site-foot__top {
  max-width: 1200px; margin: 0 auto; padding: 40px 20px 28px;
  display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between;
}
.site-foot__brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.site-foot__brand img { width: 56px; height: auto; }
.site-foot__brand p { color: var(--text); margin: 0; }
.site-foot__nav { display: grid; grid-template-columns: repeat(2, minmax(0,max-content)); column-gap: 32px; }
.site-foot__nav a {
  color: var(--muted); text-decoration: none; min-height: 44px; display: flex; align-items: center;
  transition: color .3s var(--ease);
}
.site-foot__nav a:hover, .site-foot__nav a:focus-visible { color: var(--text); }
.site-foot__bottom {
  max-width: 1200px; margin: 0 auto; padding: 16px 20px 28px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
}
.site-foot__bottom a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.site-foot__bottom a:hover { color: var(--text); }
