/* ============================================================
   styles.css — layout + components. Consumes tokens.css only.
   LinkedIn-familiar light theme. Signature element = the node map.
   ============================================================ */

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + var(--s-3)); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--brand); color: var(--bg); }

a { color: inherit; }

/* ---- Shared eyebrow / label type ---- */
.eyebrow,
.panel__kicker,
.hero__map-cap,
.foot__mono {
  font-size: var(--t-md);
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

/* ---- Nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--s-4);
  background: color-mix(in srgb, var(--nav-bg) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav__mark {
  font-weight: 700;
  font-size: var(--t-md);
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text-on-dark);
}
.nav__links { display: flex; gap: var(--s-3); }
.nav__links a {
  font-size: var(--t-md);
  font-weight: 600;
  text-decoration: none;
  color: color-mix(in srgb, var(--text-on-dark) 82%, transparent);
  padding: var(--s-1) 0;
  transition: color var(--dur) var(--ease);
}
.nav__links a:hover { color: var(--text-on-dark); }

/* ---- Layout container shared by hero + sections ---- */
.hero, .story, .case, .links, .foot {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--s-4);
}

/* ---- Hero (Tier 0) — intro stacked above a full-width map ---- */
.hero {
  max-width: var(--maxw-wide);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  padding-top: var(--s-5);
  padding-bottom: var(--s-6);
}
.hero__top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-5);
  align-items: center;
}
.hero__photo {
  width: 184px;
  height: 184px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow);
}
.hero__intro { max-width: 60ch; }
.eyebrow { color: var(--brand); margin: 0 0 var(--s-3); }
.hero__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-2xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0;
  color: var(--text);
}
.hero__role {
  margin: var(--s-2) 0 var(--s-4);
  color: var(--text-dim);
  font-size: var(--t-md);
  font-weight: 600;
}
.hero__narrative { padding-top: var(--s-2); }
/* "the work, up front" strip — sits between the hero intro and the narrative */
.hero__links { margin: 0 0 var(--s-4); }
.hero__links .links__list { margin-top: 0; }
.hero__hint {
  margin: var(--s-4) 0 0;
  color: var(--brand);
  font-weight: 600;
  font-size: var(--t-md);
}

/* ---- Transformer map (the signature) ---- */
.hero__map {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--s-3);
}
.nodemap { opacity: 0; transition: opacity 0.6s var(--ease); }
.nodemap.ready { opacity: 1; }
.nodemap svg { width: 100%; height: auto; display: block; overflow: visible; }

/* curated forward-pass wiring, straight wires */
.nm-edge {
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 1;
  opacity: 0.26;
  transition: stroke var(--dur) var(--ease), opacity var(--dur) var(--ease),
              stroke-width var(--dur) var(--ease);
  transition-delay: calc(var(--stage, 0) * 0.12s);
}

/* travelling signal pulses ("thoughts" along the wires) — every wire has
   one; only a random idle subset shows at rest, hover forces the rest */
.nm-spark {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0;
  stroke-dasharray: 9 var(--len);
  animation: nm-flow var(--spd) linear var(--dly) infinite;
  transition: opacity var(--dur) var(--ease);
}
.nm-spark--idle { opacity: 0.55; }
@keyframes nm-flow {
  from { stroke-dashoffset: var(--len); }
  to   { stroke-dashoffset: 0; }
}

/* neurons (black-box dots) — solid, so they read as nodes */
.nm-dot {
  fill: var(--text);
  stroke: var(--surface);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  transition: fill var(--dur) var(--ease), stroke var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}

/* input domains + output block (labelled boxes) */
.nm-node-box {
  fill: var(--surface);
  stroke: color-mix(in srgb, var(--text-dim) 48%, var(--surface));
  stroke-width: 1.5;
  transition: stroke var(--dur) var(--ease), fill var(--dur) var(--ease);
}

/* output block = the payoff, styled in brand */
.nm-out .nm-node-box { fill: var(--brand-tint); stroke: var(--brand); stroke-width: 2; }
.nm-out .nm-node-label { fill: var(--brand-deep); font-weight: 700; }
.nm-node-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  fill: var(--text);
  dominant-baseline: middle;
}

/* column headings over the three hidden layers */
.nm-head {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  fill: var(--text-dim);
  text-anchor: middle;
  transition: fill var(--dur) var(--ease);
}
.nm-col { cursor: default; }
.nm-col[data-target] { cursor: pointer; }
.nm-col[data-target] .nm-head { fill: var(--brand); }
.nm-node { cursor: default; }
.nm-node:focus-visible, .nm-col:focus-visible { outline: none; }
.nm-node:focus-visible .nm-node-box,
.nm-col:focus-visible .nm-head { fill: var(--brand-deep); }
.nm-node:focus-visible .nm-node-box { stroke: var(--brand); stroke-width: 2.5; }

/* hover/focus highlighting (JS-driven) — .is-active rules are deliberately
   scoped under .nodemap.is-hovering so they always outrank the dimming
   rules above regardless of source order (equal class-count otherwise) */
.nodemap.is-hovering .nm-edge { opacity: 0.05; }
.nodemap.is-hovering .nm-spark { opacity: 0; }
.nodemap.is-hovering .nm-dot,
.nodemap.is-hovering .nm-node-box { opacity: 0.3; }
.nodemap.is-hovering .nm-edge.is-active {
  stroke: var(--brand-deep);
  opacity: 1;
  stroke-width: 3.5;
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--brand) 65%, transparent));
}
.nodemap.is-hovering .nm-spark.is-active { opacity: 1; stroke-width: 3; }
.nodemap.is-hovering .nm-dot.is-active {
  opacity: 1;
  fill: var(--brand-deep);
  stroke: var(--brand-tint);
  stroke-width: 4;
  transform: scale(1.5);
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--brand) 70%, transparent));
}
.nodemap.is-hovering .nm-node.is-active .nm-node-box { opacity: 1; stroke: var(--brand-deep); stroke-width: 2.5; fill: var(--brand-tint); }
.nodemap.is-hovering .nm-node.is-active .nm-node-label { fill: var(--brand-deep); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .nm-spark { animation: none; }
  .nm-spark--idle { opacity: 0.5; }
  .nodemap { opacity: 1; transition: none; }
}

/* ---- Narrative sections (recipe spine) ---- */
.story, .case, .links { padding-block: var(--s-6); }
.story + .case, .case + .case, .case + .story, .story + .story,
.case + .links { border-top: 1px solid var(--line); }

/* full container measure — matches the flow diagram / video width; left-aligned ragged-right flow */
.story__inner { margin-inline: auto; }
.story__inner > p {
  margin: 0 0 var(--s-3);
  font-size: var(--t-md);
  line-height: var(--lh-body);
  color: var(--text);
  text-align: left;
}
.story__inner > p:last-child { margin-bottom: 0; }

.story__inner > p.story__kicker {
  font-size: var(--t-md);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 var(--s-2);
  text-align: center;
}
.story__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-lg);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  margin: 0 auto var(--s-3);
  max-width: 28ch;
  text-align: center;
}

/* ---- Case-study experience mounts (filled by later components) ---- */
.case__exp { margin: var(--s-4) 0 0; }
.case__exp--apps { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.exp-mount {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: var(--s-4);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.exp-mount__tag {
  font-size: var(--t-md);
  font-weight: 600;
  color: var(--text-dim);
}
/* filled mount (chart/animation injected) switches from centred placeholder to block */
.exp-mount.is-filled {
  display: block;
  text-align: left;
  padding: var(--s-4);
}
.exp-chart { position: relative; height: 420px; width: 100%; }
.exp-caption {
  margin: var(--s-3) 0 0;
  color: var(--text-dim);
  font-size: var(--t-md);
  line-height: var(--lh-snug);
  max-width: 70ch;
}
.exp-caption strong { color: var(--text); }

/* ---- Studio acoustics video ---- */
.studio-video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #0E1330;
}
.studio-cap {
  margin: var(--s-3) 0 0;
  color: var(--text-dim);
  font-size: var(--t-md);
  line-height: var(--lh-snug);
  max-width: 72ch;
}

/* ---- App demo cards (launch + describe; live apps, read-only) ---- */
.case__exp--apps { align-items: start; }
.demo {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.demo__media {
  display: block;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}
.demo__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1280 / 760;
  object-fit: cover;
  object-position: top center;
  transition: transform var(--dur) var(--ease);
}
.demo__media:hover img { transform: scale(1.015); }
.demo__rail { padding: var(--s-4); }
.demo__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-md);
  margin: 0 0 var(--s-1);
  color: var(--text);
}
.demo__blurb { margin: 0 0 var(--s-2); color: var(--text); }
.demo__points {
  list-style: none;
  margin: 0 0 var(--s-3);
  padding: 0;
}
.demo__points li {
  position: relative;
  padding-left: var(--s-3);
  margin-bottom: var(--s-1);
  font-size: var(--t-md);
  color: var(--text-dim);
}
.demo__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.btn {
  display: inline-block;
  background: var(--brand);
  color: var(--bg);
  font-weight: 700;
  font-size: var(--t-md);
  text-decoration: none;
  padding: var(--s-1) var(--s-3);
  border-radius: 999px;
  transition: filter var(--dur) var(--ease);
}
.btn:hover { filter: brightness(1.12); }

/* ---- Links list ---- */
.links__list {
  list-style: none;
  margin: var(--s-2) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.links__list a {
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.links__list a:hover { border-bottom-color: var(--brand); }
.links__list a[data-pending] { color: var(--text-dim); }

/* ---- Footer ---- */
.foot {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: var(--s-3);
  padding-top: var(--s-5);
  padding-bottom: var(--s-5);
  border-top: 1px solid var(--line);
  color: var(--text-dim);
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--s-5);
    padding-top: var(--s-4);
  }
  .hero__top { grid-template-columns: minmax(0, 1fr); gap: var(--s-3); justify-items: start; }
  .hero__photo { width: 132px; height: 132px; }
  .hero__name { font-size: var(--t-xl); }
  .nav__links { gap: var(--s-2); }
  .case__exp--apps { grid-template-columns: 1fr; }
  .exp-mount { min-height: 260px; }
  .foot { flex-direction: column; gap: var(--s-1); }
}


@media (max-width: 480px) {
  .nav { padding-inline: var(--s-2); }
  .hero, .panels, .foot { padding-inline: var(--s-2); }
  /* all 5 links fit one line: drop the mark, shrink type, spread evenly */
  .nav__mark { display: none; }
  .nav__links { flex: 1; justify-content: space-between; gap: 6px; }
  .nav__links a { font-size: 11px; }
}
