/* =========================================================================
   Next Wave Advisory — Web extension
   Builds on colors_and_type.css with web-specific tokens, type scale, and
   layout primitives. Import AFTER colors_and_type.css.
   ========================================================================= */

@import url('./tokens.css');

:root {
  /* -----------------------------------------------------------------------
     RESPONSIVE TYPE SCALE — for web (vs the 1920 slide scale)
     Uses clamp() between mobile (375px) and desktop (1440px+) bounds.
     ----------------------------------------------------------------------- */
  --web-fs-hero:    clamp(56px, 10vw, 168px);  /* hero wordmark-scale */
  --web-fs-h1:      clamp(40px, 5.6vw, 84px);
  --web-fs-h2:      clamp(32px, 4vw, 56px);
  --web-fs-h3:      clamp(24px, 2.4vw, 32px);
  --web-fs-lede:    clamp(20px, 1.7vw, 26px);
  --web-fs-body:    clamp(17px, 1.2vw, 19px);
  --web-fs-body-s:  clamp(15px, 1.1vw, 17px);
  --web-fs-meta:    13px;
  --web-fs-micro:   11px;

  /* Web layout */
  --web-max:        1280px;   /* content max-width */
  --web-max-narrow: 880px;    /* prose max-width */
  --web-gutter-x:   clamp(20px, 4vw, 64px);
  --web-section-y:  clamp(80px, 10vw, 160px);

  /* Nav */
  --web-nav-h:      72px;

  /* Surfaces (already inherited): --nwa-ink, --nwa-cream, --nwa-olive */
}

/* =========================================================================
   RESET / BASE
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* Cross-page view transitions — Chrome/Edge get a soft fade between / and /startups/ */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 280ms;
  }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--web-fs-body);
  line-height: var(--lh-body);
  color: var(--nwa-ink);
  background: var(--nwa-cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* Selection */
::selection { background: var(--nwa-olive); color: var(--nwa-cream); }

/* =========================================================================
   LAYOUT PRIMITIVES
   ========================================================================= */

.web-container {
  width: 100%;
  max-width: var(--web-max);
  margin: 0 auto;
  padding-inline: var(--web-gutter-x);
}

.web-container--narrow {
  max-width: var(--web-max-narrow);
}

.web-section {
  padding-block: var(--web-section-y);
}

.web-section--dark  { background: var(--nwa-ink);   color: var(--fg-on-dark); }
.web-section--cream { background: var(--nwa-cream); color: var(--fg-on-cream); }

/* =========================================================================
   NAV
   ========================================================================= */

.web-nav {
  height: var(--web-nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--web-gutter-x);
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nwa-ink);
  color: var(--fg-on-dark);
  border-bottom: 1px solid var(--fg-on-dark-rule);
}

.web-nav__brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.web-nav__brand img {
  height: 32px;
  width: auto;
}

.web-nav__links {
  display: flex;
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
}
.web-nav__link {
  font-family: var(--font-mono);
  font-size: var(--web-fs-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(240, 237, 216, 0.72);
  transition: color var(--dur-fast) var(--ease-standard);
}
.web-nav__link:hover { color: var(--accent-on-dark); }
.web-nav__link.is-active { color: var(--fg-on-dark); }

/* Olive CTA button — used for cross-page links in nav (Archives / Home) */
.web-nav__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 110px;
  padding: 0 18px;
  background: var(--nwa-olive);
  color: var(--nwa-cream);
  font-family: var(--font-mono);
  font-size: var(--web-fs-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  border-radius: 2px;
  transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
  margin-right: 8px;
}
.web-nav__cta:hover {
  background: var(--nwa-olive-soft);
  color: var(--nwa-ink);
}

/* On mobile, hide the section-anchor link list — keep logo + CTA visible */
@media (max-width: 760px) {
  .web-nav__links {
    gap: 12px;
  }
  .web-nav__link {
    display: none;
  }
}

/* =========================================================================
   BUTTONS
   ========================================================================= */

.web-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 26px;
  font-family: var(--font-body);
  font-size: var(--web-fs-body-s);
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 2px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard),
              transform 100ms var(--ease-standard);
}
.web-btn:active { transform: translateY(1px); }

/* On cream */
.web-btn--primary {
  background: var(--nwa-ink);
  color: var(--nwa-cream);
}
.web-btn--primary:hover { background: #1a1a1a; }

.web-btn--ghost {
  background: transparent;
  color: var(--nwa-ink);
  border: 1px solid rgba(10, 10, 10, 0.24);
}
.web-btn--ghost:hover { background: var(--nwa-cream-2); }

/* On dark — applies inside any dark surface.
   .web-on-dark is the canonical modifier; .web-section--dark, .web-hero,
   and .web-footer all carry it implicitly via the rules below for backwards
   compatibility, but new code should add the .web-on-dark class directly. */
.web-on-dark .web-btn--primary,
.web-section--dark .web-btn--primary,
.web-hero .web-btn--primary,
.web-footer .web-btn--primary {
  background: var(--nwa-cream);
  color: var(--nwa-ink);
}
.web-on-dark .web-btn--primary:hover,
.web-section--dark .web-btn--primary:hover,
.web-hero .web-btn--primary:hover,
.web-footer .web-btn--primary:hover { background: #fff8e0; }

.web-on-dark .web-btn--ghost,
.web-section--dark .web-btn--ghost,
.web-hero .web-btn--ghost,
.web-footer .web-btn--ghost {
  background: transparent;
  color: var(--nwa-cream);
  border: 1px solid rgba(240, 237, 216, 0.32);
}
.web-on-dark .web-btn--ghost:hover,
.web-section--dark .web-btn--ghost:hover,
.web-hero .web-btn--ghost:hover,
.web-footer .web-btn--ghost:hover { background: var(--nwa-ink-2); }

/* Link with olive underline */
.web-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--nwa-olive-deep);
  border-bottom: 1px solid var(--nwa-olive);
  padding-bottom: 2px;
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease-standard);
}
.web-on-dark .web-link,
.web-section--dark .web-link,
.web-hero .web-link,
.web-footer .web-link {
  color: var(--accent-on-dark);
  border-bottom-color: var(--accent-on-dark);
}
.web-link::after { content: "→"; transition: transform var(--dur-fast) var(--ease-standard); }
.web-link:hover::after { transform: translateX(3px); }

/* =========================================================================
   ETC — eyebrow, accent rule, section header
   ========================================================================= */

.web-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--web-fs-meta);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: rgba(10, 10, 10, 0.6);
}
.web-eyebrow::before {
  content: "";
  display: inline-block;
  width: 32px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.web-section--dark .web-eyebrow { color: rgba(240, 237, 216, 0.6); }

.web-rule-accent {
  width: 64px;
  height: 2px;
  background: var(--accent);
  border: 0;
  margin: 0;
}
.web-section--dark .web-rule-accent { background: var(--accent-on-dark); }

/* =========================================================================
   HERO
   ========================================================================= */

.web-hero {
  padding-block: clamp(96px, 14vw, 200px) clamp(80px, 10vw, 140px);
  background: var(--nwa-ink);
  color: var(--fg-on-dark);
}
.web-hero__rule { margin-bottom: 36px; }
.web-hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--web-fs-hero);
  line-height: 0.94;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--fg-on-dark);
  text-wrap: balance;
}
.web-hero__lede {
  margin-top: clamp(28px, 3vw, 48px);
  max-width: 56ch;
  font-size: var(--web-fs-lede);
  line-height: 1.4;
  color: var(--fg-on-dark-2);
  text-wrap: pretty;
}
.web-hero__cta {
  margin-top: clamp(36px, 4vw, 56px);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* =========================================================================
   SERVICE LIST — numbered, horizontal-rule rows
   Inspired by NWA's "What we do" — but stripped to evidence-led prose.
   ========================================================================= */

.web-service-list { list-style: none; padding: 0; margin: 0; }
.web-service-list__item {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: baseline;
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(28px, 4vw, 48px) 0;
  border-top: 1px solid currentColor;
  /* tame the rule */
  border-top-color: rgba(10, 10, 10, 0.14);
}
.web-section--dark .web-service-list__item { border-top-color: rgba(240, 237, 216, 0.18); }
.web-service-list__item:last-child {
  border-bottom: 1px solid rgba(10, 10, 10, 0.14);
}
.web-section--dark .web-service-list__item:last-child {
  border-bottom-color: rgba(240, 237, 216, 0.18);
}

.web-service-list__num {
  font-family: var(--font-mono);
  font-size: var(--web-fs-meta);
  letter-spacing: 0.14em;
  color: rgba(10, 10, 10, 0.5);
  font-variant-numeric: tabular-nums;
  padding-top: 8px;
}
.web-section--dark .web-service-list__num { color: rgba(240, 237, 216, 0.5); }

.web-service-list__body { display: grid; gap: 16px; max-width: 80ch; }
.web-service-list__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--web-fs-h2);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
}
.web-service-list__desc {
  font-size: var(--web-fs-body);
  line-height: 1.5;
  margin: 0;
  color: rgba(10, 10, 10, 0.74);
  text-wrap: pretty;
}
.web-section--dark .web-service-list__desc { color: var(--fg-on-dark-2); }

/* =========================================================================
   PEOPLE GRID
   ========================================================================= */

.web-people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(24px, 3vw, 48px);
}
.web-person__avatar {
  aspect-ratio: 1 / 1;
  background: var(--nwa-cream-3);
  border-radius: 2px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 56px;
  color: rgba(10, 10, 10, 0.32);
  letter-spacing: -0.02em;
}
.web-section--dark .web-person__avatar {
  background: var(--nwa-ink-2);
  color: rgba(240, 237, 216, 0.32);
}
.web-person__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--web-fs-h3);
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.web-person__role {
  font-family: var(--font-mono);
  font-size: var(--web-fs-meta);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(10, 10, 10, 0.6);
  margin: 0 0 14px;
}
.web-section--dark .web-person__role { color: rgba(240, 237, 216, 0.6); }
.web-person__bio {
  font-size: var(--web-fs-body-s);
  line-height: 1.5;
  color: rgba(10, 10, 10, 0.7);
  margin: 0;
}
.web-section--dark .web-person__bio { color: var(--fg-on-dark-2); }

/* =========================================================================
   FOOTER
   ========================================================================= */

.web-footer {
  background: var(--nwa-ink);
  color: var(--fg-on-dark-2);
  padding-block: clamp(60px, 7vw, 96px) 32px;
  border-top: 1px solid var(--fg-on-dark-rule);
  position: sticky;
  bottom: 0;
  z-index: 0;
}

/* Footer reveal-from-behind — main scrolls over the sticky footer */
main {
  position: relative;
  z-index: 1;
  background: var(--nwa-cream);
}

/* =========================================================================
   Cookie consent — banner on first visit, shrinks to pill on scroll
   ========================================================================= */
.nwa-cookie {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 100;
  pointer-events: none;
}

.nwa-cookie__panel {
  pointer-events: auto;
  background: var(--nwa-ink);
  color: var(--fg-on-dark);
  border: 1px solid rgba(240, 237, 216, 0.16);
  border-radius: 4px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  max-width: 720px;
  margin: 0 auto;
  box-shadow: 0 12px 32px rgba(10, 10, 10, 0.18), 0 2px 6px rgba(10, 10, 10, 0.08);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 280ms var(--ease-standard), transform 280ms var(--ease-standard);
}

.nwa-cookie__text {
  margin: 0;
  font-size: var(--web-fs-body-s);
  line-height: 1.5;
  color: rgba(240, 237, 216, 0.84);
  flex: 1 1 280px;
}
.nwa-cookie__text a {
  color: var(--accent-on-dark);
  border-bottom: 1px solid var(--accent-on-dark);
  padding-bottom: 1px;
}

.nwa-cookie__actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.nwa-cookie__actions .web-btn {
  height: 40px;
  padding: 0 18px;
  font-size: var(--web-fs-body-s);
}

.nwa-cookie__pill {
  pointer-events: auto;
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--nwa-ink);
  color: var(--nwa-cream);
  border: 1px solid rgba(240, 237, 216, 0.2);
  border-radius: 999px;
  padding: 9px 16px;
  font-family: var(--font-mono);
  font-size: var(--web-fs-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms var(--ease-standard), transform 220ms var(--ease-standard), background 140ms var(--ease-standard);
  box-shadow: 0 4px 12px rgba(10, 10, 10, 0.16);
}
.nwa-cookie__pill:hover {
  background: var(--nwa-ink-2);
  color: var(--accent-on-dark);
}

/* States */
.nwa-cookie[data-state="hidden"] { display: none; }

.nwa-cookie[data-state="open"] .nwa-cookie__panel {
  opacity: 1;
  transform: translateY(0);
}
.nwa-cookie[data-state="open"] .nwa-cookie__pill {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.nwa-cookie[data-state="pill"] .nwa-cookie__panel {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}
.nwa-cookie[data-state="pill"] .nwa-cookie__pill {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .nwa-cookie__panel,
  .nwa-cookie__pill {
    transition: none;
  }
}
.web-footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: clamp(24px, 4vw, 64px);
  margin-bottom: clamp(48px, 6vw, 80px);
}
@media (max-width: 760px) {
  .web-footer__top { grid-template-columns: 1fr; }
}
.web-footer__brand img { height: 28px; width: auto; margin-bottom: 20px; }
.web-footer__tag {
  max-width: 36ch;
  font-size: var(--web-fs-body-s);
  line-height: 1.5;
  color: var(--fg-on-dark-2);
}
.web-footer__col-title {
  font-family: var(--font-mono);
  font-size: var(--web-fs-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-on-dark-3);
  margin: 0 0 14px;
}
.web-footer__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.web-footer__list a {
  font-size: var(--web-fs-body-s);
  color: var(--fg-on-dark);
  transition: color var(--dur-fast) var(--ease-standard);
}
.web-footer__list a:hover { color: var(--accent-on-dark); }

.web-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--fg-on-dark-rule);
  font-family: var(--font-mono);
  font-size: var(--web-fs-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-on-dark-3);
}

/* =========================================================================
   FIGURE STRIP — small numeric proof bar between sections
   ========================================================================= */

.web-figure-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  border-top: 1px solid rgba(10, 10, 10, 0.14);
  border-bottom: 1px solid rgba(10, 10, 10, 0.14);
}
.web-section--dark .web-figure-strip {
  border-top-color: rgba(240, 237, 216, 0.18);
  border-bottom-color: rgba(240, 237, 216, 0.18);
}
.web-figure-strip__cell {
  padding: clamp(28px, 3vw, 40px) clamp(16px, 2vw, 32px);
  border-right: 1px solid rgba(10, 10, 10, 0.14);
}
.web-section--dark .web-figure-strip__cell { border-right-color: rgba(240, 237, 216, 0.18); }
.web-figure-strip__cell:last-child { border-right: 0; }
.web-figure-strip__label {
  font-family: var(--font-mono);
  font-size: var(--web-fs-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(10, 10, 10, 0.55);
  margin-bottom: 12px;
}
.web-section--dark .web-figure-strip__label { color: rgba(240, 237, 216, 0.55); }
.web-figure-strip__fig {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(44px, 5vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.web-figure-strip__fig .unit { color: var(--accent); font-weight: 600; }
.web-section--dark .web-figure-strip__fig .unit { color: var(--accent-on-dark); }
