/* ==========================================================================
   Direction F — "Carrier Wave" · app/styles.css
   Layered broadside in the locked Night Signal world. Depth from scale,
   overlap, and navy tint steps — one idea per viewport, never clutter.

   Locked palette (round-1 Direction B, verbatim):
     ground   #0B1120   surface #111A2E   tint #18233A
     headings #E6ECF5 (15.9:1 on ground)
     body     #9AA8BF (7.8:1 ground · 7.2:1 surface · 6.5:1 tint)
     muted    #8593AC (6.1:1 ground · 5.1:1 tint)
     accent   #4CC3F7 (9.4:1 on ground; alpha tints at 8/15/25%)
   Never pure white text, never pure black ground.

   Screened numerals ("20+", cascade 01–07) are DECORATIVE: aria-hidden,
   deliberately low-contrast against their band (≈1.4:1), while real text
   composited over them keeps AA (ratios verified in QA notes).

   Fonts: Inter 400/500/600 bundled locally (copied from the verified
   direction-b set) + system mono for metadata.
   ========================================================================== */

/* ---- Fonts ---------------------------------------------------------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-400.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter-500.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-600.woff2") format("woff2");
}

/* ---- Direction-local design tokens ---------------------------------- */

:root {
  --ground: #0B1120;
  --surface: #111A2E;
  --tint: #18233A;
  --ink: #E6ECF5;
  --body: #9AA8BF;
  --muted: #8593AC;
  --accent: #4CC3F7;
  --accent-hover: #6FD0F9;
  --accent-8: rgba(76, 195, 247, 0.08);
  --accent-15: rgba(76, 195, 247, 0.15);
  --accent-25: rgba(76, 195, 247, 0.25);
  --hairline: rgba(76, 195, 247, 0.15);

  /* Screened decorative numerals — low contrast against navy is required
     (they carry no information; aria-hidden in markup). */
  --screen-num: rgba(230, 236, 245, 0.07);

  /* How far each section header climbs over the preceding band. */
  --head-overlap: clamp(1.25rem, 3vw, 2.5rem);
  --nav-h: 3.5rem;

  --font-sans: "Inter", -apple-system, "Segoe UI", system-ui, Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas,
    "Liberation Mono", monospace;
}

/* ---- Base ------------------------------------------------------------ */

html {
  scroll-padding-top: calc(var(--nav-h) + var(--head-overlap) + 1rem);
}

body {
  background: var(--ground);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
}

h1,
h2,
h3 {
  color: var(--ink);
  font-weight: 600;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--accent-hover);
}

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

::selection {
  background: var(--accent-25);
  color: var(--ink);
}

/* ---- Layout primitives ----------------------------------------------- */

.container {
  max-width: var(--container-default);
  margin-inline: auto;
  padding-inline: var(--container-pad-x);
}

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

.band-surface {
  background: var(--surface);
}

/* ---- Skip link ------------------------------------------------------- */

.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-top);
  padding: var(--space-3) var(--space-5);
  background: var(--accent);
  color: var(--ground);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
  color: var(--ground);
}

/* ---- Sticky nav ------------------------------------------------------ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(11, 17, 32, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.site-nav.is-scrolled {
  border-bottom-color: var(--hairline);
}

.nav-inner {
  flex: 1;
  max-width: var(--container-default);
  margin-inline: auto;
  padding: var(--space-2) var(--container-pad-x);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-brand {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-brand:hover {
  color: var(--accent);
}

.nav-links {
  display: none;
  margin-left: auto;
}

.nav-links a {
  color: var(--body);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
}

.nav-links a:hover {
  color: var(--ink);
  background: var(--accent-8);
}

.btn-nav {
  margin-left: auto;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
    gap: var(--space-1);
  }

  /* Tablet range is tight: brand + 6 links + CTA must fit 768 exactly. */
  .nav-links a {
    padding: var(--space-2) var(--space-1);
  }

  .nav-inner {
    gap: var(--space-3);
  }

  .btn-nav {
    margin-left: 0;
  }
}

@media (min-width: 1024px) {
  .nav-links a {
    padding: var(--space-2) var(--space-3);
  }

  .nav-inner {
    gap: var(--space-5);
  }
}

/* ---- Buttons --------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1.2;
  transition: background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

/* Full-strength sky is reserved for this button — the conversion action. */
.btn-primary {
  background: var(--accent);
  color: var(--ground);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--ground);
}

.btn-ghost {
  color: var(--body);
  border: 1px solid var(--accent-25);
  background: transparent;
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--accent-8);
  border-color: var(--accent);
}

.btn-lg {
  padding: var(--space-4) var(--space-7);
  font-size: var(--text-base);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-7);
}

/* ---- Typography helpers ---------------------------------------------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent);
}

/* ---- S1 Hero — the name over the huge screened "20+" ----------------- */

.hero {
  padding-bottom: var(--section-pad-y);
}

.hero-stage {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  display: flex;
  align-items: center;
  padding-block: var(--space-8);
}

.hero-num {
  position: absolute;
  right: -0.08em;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-base);
  font-size: clamp(15rem, 40vw, 34rem);
  font-weight: 600;
  line-height: 0.75;
  letter-spacing: -0.06em;
  color: var(--screen-num);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.hero-copy {
  position: relative;
  z-index: var(--z-raised);
}

.hero h1 {
  font-size: clamp(3rem, 2.2rem + 5.5vw, 6.75rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-top: var(--space-4);
  max-width: 12ch;
}

.hero-tagline {
  color: var(--ink);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: var(--leading-snug);
  margin-top: var(--space-5);
  max-width: 26ch;
}

.hero-support {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: var(--space-4);
}

/* ---- Marquee — binding shared spec (deployed twice) ------------------ */

.mq-rows {
  border-block: 1px solid var(--hairline);
  padding-block: var(--space-5);
  display: grid;
  gap: var(--space-4);
}

.mq-row {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.mq-track {
  display: flex;
  width: max-content;
  animation: mq-scroll 55s linear infinite;
}

.mq-row-2 .mq-track {
  animation-duration: 70s;
  animation-direction: reverse;
}

@keyframes mq-scroll {
  to {
    transform: translateX(-50%);
  }
}

.mq-seg {
  display: flex;
  align-items: center;
  flex: none;
}

.mq-seg li {
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-size: clamp(1.375rem, 3vw, 2.5rem); /* 22→40px, per spec */
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--body);
}

.mq-seg li::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-inline: clamp(1.25rem, 2.5vw, 1.75rem);
}

/* Pause on hover and on keyboard focus within the band; .mq-paused is the
   WCAG 2.2.2 toggle state (one logical control, both bands, both instances
   kept in sync by app.js). */
.mq-band:hover .mq-track,
.mq-band:focus-within .mq-track,
body.mq-paused .mq-track {
  animation-play-state: paused;
}

.mq-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-block: var(--space-4);
}

/* The toggle is a JS enhancement: hidden until app.js adds html.js so a
   dead control never renders. Hover/focus-within pause still works CSS-only. */
.mq-toggle {
  display: none;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.25rem; /* 36px target */
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--accent-25);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--body);
  transition: background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

html.js .mq-toggle {
  display: inline-flex;
}

.mq-toggle:hover {
  color: var(--ink);
  background: var(--accent-8);
  border-color: var(--accent);
}

.mq-toggle[aria-pressed="true"] {
  color: var(--ink);
  background: var(--accent-15);
  border-color: var(--accent);
}

.mq-ic {
  width: 12px;
  height: 12px;
  flex: none;
}

/* ---- Overlapping band headers ---------------------------------------- */
/* Each header climbs --head-overlap above its own band, sitting on the
   preceding band's bottom edge. Vertical shift only — no horizontal
   overflow risk. Preceding bands keep >= --section-pad-y bottom padding,
   which always exceeds the overlap. */

.band-head {
  position: relative;
  z-index: var(--z-raised);
  margin-top: calc(-1 * (var(--section-pad-y) + var(--head-overlap)));
  max-width: 52rem;
}

.band-head h2 {
  font-size: clamp(2.1rem, 1.6rem + 3vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-top: var(--space-3);
}

.band-intro {
  margin-top: var(--space-5);
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  max-width: 44rem;
}

/* ---- S2 Services — ruled editorial index ----------------------------- */

.svc-list {
  margin-top: var(--space-8);
}

.svc {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  border-top: 1px solid var(--hairline);
  padding-block: var(--space-6);
}

.svc-name {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
}

.svc-num {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent);
}

.svc h3 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
}

.svc > p {
  font-size: var(--text-base);
  max-width: 38rem;
}

@media (min-width: 768px) {
  .svc {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-7);
  }
}

/* ---- S3 Highlights — staggered cascade with screened numerals -------- */

.cascade {
  margin-top: var(--space-8);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
}

.cascade li {
  position: relative;
  padding-top: clamp(3.2rem, 2.4rem + 3vw, 4.6rem);
}

.cascade-num {
  position: absolute;
  top: 0;
  left: 0;
  z-index: var(--z-base);
  font-size: clamp(6rem, 5rem + 6vw, 9.5rem); /* 96px+ everywhere */
  font-weight: 600;
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: var(--screen-num);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.cascade li p {
  position: relative;
  z-index: var(--z-raised);
  margin-left: clamp(1.5rem, 4vw, 3rem);
  max-width: 30rem;
  font-size: var(--text-base);
}

@media (min-width: 768px) {
  .cascade {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-8);
    row-gap: var(--space-9);
  }

  .cascade li:nth-child(even) {
    margin-top: var(--space-9);
  }
}

/* ---- S4 Experience — ruled asymmetric list --------------------------- */

.xp-list {
  margin-top: var(--space-8);
}

.xp {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  border-top: 1px solid var(--hairline);
  padding-block: var(--space-6);
}

.xp-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.xp h3 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
}

.xp-role {
  color: var(--accent);
  font-weight: 500;
  margin-top: var(--space-1);
}

.xp-sum {
  font-size: var(--text-base);
  max-width: 38rem;
}

@media (min-width: 768px) {
  .xp {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-7);
  }
}

/* ---- S5 Skills — ruled rows with dot-separated items ----------------- */

.skills-list {
  margin-top: var(--space-8);
}

.skills-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  border-top: 1px solid var(--hairline);
  padding-block: var(--space-5);
}

.skills-cat {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
}

.skills-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-2);
}

.skills-items li {
  display: flex;
  align-items: center;
  font-size: var(--text-sm);
  color: var(--body);
}

.skills-items li:not(:last-child)::after {
  content: "";
  flex: none;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-25);
  margin-left: var(--space-3);
}

.skills-row-accent {
  border-top-color: var(--accent-25);
}

.skills-row-accent .skills-cat {
  color: var(--accent);
}

.skills-row-accent .skills-items li {
  color: var(--ink);
}

.skills-row-accent .skills-items li:not(:last-child)::after {
  background: var(--accent);
}

@media (min-width: 768px) {
  .skills-row {
    grid-template-columns: 12rem minmax(0, 1fr);
    align-items: baseline;
  }
}

/* ---- S6 Education ---------------------------------------------------- */

.edu-grid {
  margin-top: var(--space-8);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-7);
}

.edu {
  border-top: 1px solid var(--hairline);
  padding-top: var(--space-5);
}

.edu h3 {
  font-size: var(--text-lg);
  margin-top: var(--space-1);
}

.edu-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.edu-list li {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  padding-left: var(--space-4);
  position: relative;
}

.edu-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-25);
}

@media (min-width: 768px) {
  .edu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-8);
  }
}

/* ---- S7 Contact — second marquee, then the full-bleed closing panel -- */

.contact {
  padding-top: var(--section-pad-y);
}

.contact .mq-band {
  margin-bottom: var(--section-pad-y);
}

.contact-bleed {
  background: var(--tint);
  border-block: 1px solid var(--hairline);
  padding-block: calc(var(--section-pad-y) * 1.15);
}

.contact-inner {
  max-width: var(--container-default);
}

.contact-inner h2 {
  font-size: clamp(2.1rem, 1.6rem + 3vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 18ch;
}

.contact-email {
  margin-top: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-base);
}

.contact-availability {
  margin-top: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- S8 Footer ------------------------------------------------------- */

.site-footer {
  background: var(--ground);
  padding-block: var(--space-7);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-brand {
  color: var(--ink);
  font-weight: 600;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-5);
}

.footer-links a {
  color: var(--body);
  font-size: var(--text-sm);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
}

/* ---- Scroll reveal ---------------------------------------------------
   Hidden state applied ONLY by JS (app.js adds .js-reveal, and only when
   IntersectionObserver exists and reduced motion is not requested). With
   JS off or under reduced motion nothing is ever hidden. Single pass,
   360 ms (< 400 ms), opacity + short translate only. Marquee elements
   never receive reveals (locked element, excluded from the motion axis). */

.js-reveal {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition: opacity 360ms var(--ease-out), transform 360ms var(--ease-out);
}

.js-reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---- Reduced motion --------------------------------------------------
   Reveals: forced visible. Marquees: animation removed entirely; both
   rows freeze into static wrapped tag lines inside the page column, the
   duplicated aria-hidden loop copies collapse, edge masks come off, and
   the (now purposeless) pause toggles are hidden. */

@media (prefers-reduced-motion: reduce) {
  .js-reveal {
    opacity: 1;
    transform: none;
  }

  .mq-track {
    animation: none;
    width: auto;
    display: block; /* segs become width-constrained blocks so items wrap */
  }

  .mq-seg {
    flex-wrap: wrap;
    row-gap: var(--space-2);
    min-width: 0;
  }

  .mq-seg li {
    white-space: normal;
  }

  .mq-seg[aria-hidden="true"] {
    display: none;
  }

  .mq-seg li:last-child::after {
    display: none; /* no trailing dot once the row is a static wrapped line */
  }

  .mq-row {
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .mq-rows {
    max-width: var(--container-default);
    margin-inline: auto;
    padding-inline: var(--container-pad-x);
  }

  .mq-toggle {
    display: none !important;
  }
}
