/* =====================================================================
   CTSD site styles: base, utilities, buttons, cards, header, footer.
   Requires tokens.css.
   ===================================================================== */

/* ---- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
html.menu-open { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); line-height: 1.02; letter-spacing: -.03em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--ember-ink); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--navy); }
ul { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }

/* Focus (WCAG 1.4.11, 3:1 against the adjacent background):
   light sections: darkest-wood outer ring (14.5:1 on cream, 15.7:1 on off-white)
                   with a gold inner ring for the brand accent;
   wood sections:  gold outer ring (6.6:1 on deep brown, 7.9:1 on #0A1322,
                   3.6:1 on wood brown) with a dark inner ring. */
:focus-visible {
  outline: 3px solid var(--navy-950);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--ember);
}
.section--dark :focus-visible,
.site-header :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--ember);
  box-shadow: 0 0 0 3px var(--navy-950);
}
:focus:not(:focus-visible) { outline: none; }

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

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--ember);
  color: var(--navy-950);
  font-family: var(--font-label);
  font-weight: 500;
  font-size: var(--fs-small);
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; color: var(--navy-950); }

/* ---- Layout utilities ---------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section--dark {
  position: relative;
  background-color: var(--navy);
  color: var(--ivory);
}
.section--dark a:not(.btn) { color: var(--ember); }
.section--dark a:not(.btn):hover { color: var(--ivory); }

.section--ivory {
  position: relative;
  background-color: var(--ivory);
  color: var(--ink);
}

/* Vertical wood panels, the board's signature texture (pure CSS, no image) */
.panels {
  background-color: var(--navy-950);
  background-image:
    linear-gradient(180deg, rgba(148, 170, 204, .18), rgba(10, 19, 34, 0) 38%, rgba(10, 19, 34, .55)),
    repeating-linear-gradient(90deg,
      #0A1322 0 2px,
      #16263F 2px 5px,
      #1F3A5F 5px 12px,
      #1A2F4D 12px 20px,
      #13223A 20px 26px,
      #0A1322 26px 28px);
}

/* ---- Type utilities ------------------------------------------------------ */
.eyebrow {
  display: inline-block;
  margin: 0;
  font-family: var(--font-label);
  font-weight: 500;
  font-size: var(--fs-eyebrow);
  line-height: 1.4;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ember-ink);
}
.section--dark .eyebrow { color: var(--ember); }

.lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--slate); max-width: 52ch; }
.section--dark .lead { color: var(--ivory-muted); }

/* ---- Buttons --------------------------------------------------------------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: currentColor;
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 50px;
  padding: 0 26px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-label);
  font-weight: 500;
  font-size: .9375rem;
  letter-spacing: .02em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .25s var(--ease-out), border-color .25s var(--ease-out),
    color .25s var(--ease-out), transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn--sm { min-height: 40px; padding: 0 18px; font-size: .875rem; }

/* Tan with the darkest wood as text: 6.6:1 */
.btn--primary {
  --btn-bg: var(--ember);
  --btn-fg: var(--navy-950);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 8px 20px -10px rgba(242, 162, 58, .7);
}
.btn--primary:hover { --btn-bg: #F5B254; color: var(--navy-950); }

/* Ghost: cream text on wood; deep brown text on cream */
.btn--ghost {
  --btn-fg: var(--navy);
  --btn-bd: rgba(15, 27, 45, .35);
}
.btn--ghost:hover { --btn-bd: var(--navy); --btn-bg: rgba(15, 27, 45, .05); color: var(--navy); }
.section--dark .btn--ghost { --btn-fg: var(--ivory); --btn-bd: rgba(247, 244, 238, .38); }
.section--dark .btn--ghost:hover { --btn-bd: var(--ivory); --btn-bg: rgba(247, 244, 238, .06); color: var(--ivory); }

.btn .arrow { transition: transform .25s var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---- Badges + cards --------------------------------------------------------- */
/* Gold with darkest wood text: 7.9:1 */
.badge-concept {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--ember);
  color: var(--navy-950);
  font-family: var(--font-label);
  font-weight: 500;
  font-size: .6875rem;
  line-height: 1.2;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.card {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: var(--space-5);
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.section--dark .card {
  background: var(--navy-700);
  color: var(--ivory);
  border-color: var(--line-dark);
}

/* ---- Reveal (enabled by shell.js; off under reduced motion) ----------------- */
.reveal-on .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal-on .reveal.is-visible { opacity: 1; transform: none; }

/* =====================================================================
   Header
   ===================================================================== */
#site-header { display: block; min-height: var(--header-h); }
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  transition: transform .45s var(--ease-out);
}
.site-header.is-hidden { transform: translateY(-110%); }
.site-header .btn.is-magnet { transition: transform .5s var(--ease-out), background-color .2s var(--ease-out), color .2s var(--ease-out); }
/* Background + blur live on a pseudo-element: a backdrop-filter on the header
   itself would make it the containing block for the fixed mobile menu. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--navy);
  border-bottom: 1px solid transparent;
  transition: background-color .35s var(--ease-out), border-color .35s var(--ease-out);
}
.site-header.is-scrolled::before {
  background: rgba(15, 27, 45, .84);
  border-bottom-color: rgba(148, 170, 204, .16);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header.is-scrolled::before { background: rgba(15, 27, 45, .97); }
}
.site-header__bar {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  height: 100%;
  max-width: calc(1320px + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.brand { display: flex; align-items: center; flex: none; border-radius: 6px; }
.brand img { height: 42px; width: auto; }

.site-menu { margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ivory-muted);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .875rem;
  letter-spacing: .01em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: color .2s var(--ease-out), background-color .2s var(--ease-out);
  white-space: nowrap;
}
/* Eight items share the bar between the mobile breakpoint and full width. */
@media (min-width: 960px) and (max-width: 1199.98px) {
  .nav-link { padding: 10px 8px; font-size: .8125rem; }
}
.site-header .nav-link:hover,
.site-header .nav-link[aria-expanded="true"] { color: var(--ivory); background: rgba(247, 244, 238, .06); }
.site-header .nav-link[aria-current="page"],
.site-header .is-current > .nav-link { color: var(--ivory); }
.nav-link[aria-current="page"]::after,
.is-current > .nav-link::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 1px;
  background: var(--ember);
}
.nav-chevron { transition: transform .25s var(--ease-out); }
[aria-expanded="true"] > .nav-chevron { transform: rotate(180deg); }

.nav-sub {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  padding: 8px;
  list-style: none;
  background: var(--navy-950);
  border: 1px solid rgba(148, 170, 204, .2);
  border-radius: 14px;
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .55);
}
.nav-sub[hidden] { display: none; }
.nav-sub a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--ivory-muted);
  font-size: .9375rem;
  text-decoration: none;
}
.nav-sub a:hover, .nav-sub a[aria-current="page"] { color: var(--ivory); background: rgba(148, 170, 204, .12); }
@media (prefers-reduced-motion: no-preference) {
  .nav-sub:not([hidden]) { animation: sub-in .22s var(--ease-out); }
  @keyframes sub-in { from { opacity: 0; transform: translateY(-4px); } }
}

.nav-cta { margin-left: 12px; }
.site-header .nav-cta .btn { box-shadow: none; }

/* Mobile toggle */
.menu-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-height: 44px;
  padding: 0 4px 0 14px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ivory);
  font-family: var(--font-label);
  font-weight: 500;
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  cursor: pointer;
}
.menu-toggle__icon { position: relative; width: 22px; height: 12px; }
.menu-toggle__icon span {
  position: absolute; left: 0; right: 0;
  height: 1.5px; border-radius: 2px;
  background: currentColor;
  transition: transform .3s var(--ease-out), top .3s var(--ease-out);
}
.menu-toggle__icon span:first-child { top: 1px; }
.menu-toggle__icon span:last-child { top: 9px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon span:first-child { top: 5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon span:last-child { top: 5px; transform: rotate(-45deg); }

@media (max-width: 959.98px) {
  .menu-toggle { display: inline-flex; }
  .brand img { height: 38px; }
  .site-menu {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    margin: 0;
    padding: var(--space-5) var(--gutter) var(--space-7);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--navy);
    background-image: linear-gradient(180deg, rgba(10, 19, 34, .0), rgba(10, 19, 34, .65));
    border-top: 1px solid rgba(148, 170, 204, .16);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .3s var(--ease-out), transform .3s var(--ease-out), visibility 0s linear .3s;
  }
  .site-menu.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity .3s var(--ease-out), transform .3s var(--ease-out), visibility 0s;
  }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-item { border-bottom: 1px solid rgba(148, 170, 204, .14); }
  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 18px 4px;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.375rem;
    letter-spacing: -.01em;
    color: var(--ivory);
  }
  .site-header .nav-link:hover, .site-header .nav-link[aria-expanded="true"] { background: none; }
  .nav-link[aria-current="page"]::after, .is-current > .nav-link::after { display: none; }
  .nav-link[aria-current="page"] { color: var(--ember); }
  .nav-chevron { width: 16px; height: 16px; }
  .nav-sub {
    position: static;
    min-width: 0;
    margin: -4px 0 14px;
    padding: 0 0 0 14px;
    background: none;
    border: 0;
    border-left: 1px solid rgba(242, 162, 58, .3);
    border-radius: 0;
    box-shadow: none;
  }
  .nav-sub a { padding: 10px 12px; font-size: 1rem; }
  .nav-cta { margin: var(--space-6) 0 0; border-bottom: 0; }
  .nav-cta .btn { width: 100%; min-height: 54px; font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header::before, .site-menu, .site-menu.is-open, .menu-toggle__icon span, .nav-chevron, .btn, .card { transition: none; }
}

/* =====================================================================
   Footer
   ===================================================================== */
.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--navy-950);
  padding: var(--space-8) 0 var(--space-6);
  font-size: .9375rem;
}
.site-footer__lamp {
  position: absolute; left: 0; top: 0; width: 760px; height: 760px; margin: -380px 0 0 -380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 162, 58, .22), rgba(148, 170, 204, .1) 40%, rgba(10, 19, 34, 0) 70%);
  pointer-events: none; opacity: 0; transition: opacity .8s var(--ease-out); mix-blend-mode: screen;
}
.site-footer__lamp.is-on { opacity: 1; }
/* Touch screens: every text link in the footer and the small "see more" links get a 44 px target. */
@media (pointer: coarse) {
  .site-footer__cols a, .site-footer__base a, .featured__all a, .reel__build, .ind-card__more, .d-link {
    display: inline-flex; align-items: center; min-height: 44px;
  }
  .site-footer__cols ul { gap: 0; }
}
.site-footer .container { position: relative; z-index: 1; }
.site-footer__big {
  margin: 0 0 var(--space-7);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.6rem, 1.2rem + 5.4vw, 6.4rem);
  line-height: .98;
  letter-spacing: -.025em;
  color: var(--ivory);
}
.site-footer__big em { font-style: normal; color: var(--ember); }
.site-footer .btn.is-magnet { transition: transform .5s var(--ease-out), background-color .2s var(--ease-out), color .2s var(--ease-out), border-color .2s var(--ease-out); }
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: repeating-linear-gradient(90deg, #1F3A5F 0 18px, #5A3F2B 18px 22px, #0A1322 22px 26px);
  opacity: .9;
}
.site-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr);
  gap: var(--space-7);
}
.site-footer__brand img { height: 56px; width: auto; }
.site-footer__tagline {
  margin: var(--space-5) 0 var(--space-5);
  max-width: 24ch;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--ivory);
}
.site-footer__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}
.site-footer__cols .eyebrow { margin-bottom: var(--space-4); font-size: .6875rem; }
.site-footer__cols ul { list-style: none; display: grid; gap: 10px; }
.site-footer .site-footer__cols a,
.site-footer .site-footer__base a {
  color: var(--ivory-muted);
  text-decoration: none;
  transition: color .2s var(--ease-out);
}
.site-footer .site-footer__cols a:hover,
.site-footer .site-footer__base a:hover { color: var(--ivory); text-decoration: underline; }
.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(148, 170, 204, .16);
  font-size: .8125rem;
  color: var(--ivory-muted);
}
@media (max-width: 879.98px) {
  .site-footer { padding-top: var(--space-7); }
  .site-footer__top { grid-template-columns: 1fr; gap: var(--space-6); }
}
@media (max-width: 559.98px) {
  .site-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__cols > div:last-child { grid-column: 1 / -1; }
}
