/* ============================================================
   SECTIONS — hero, pipelines, work, lab, career, contact, footer
   ============================================================ */

/* ================= HERO ================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--space-5)) var(--gutter) var(--space-4);
  max-width: none;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  color: var(--ink2);
  margin-bottom: var(--space-3);
}

.hero-title {
  font-size: var(--fs-hero);
  font-variation-settings: "wdth" 122, "wght" 900;
  font-weight: 900;
  font-stretch: 122%;
  line-height: 0.93;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.hero-title .serif { font-size: 1.05em; }

/* line mask reveal (triggered after slate) */
.hline { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hmask {
  display: inline-block;
  transform: translateY(112%);
  transition: transform 1.1s var(--ease-snap);
}
body.is-ready .hmask { transform: none; }
body.is-ready .hline:nth-child(2) .hmask { transition-delay: 0.12s; }

.hero-sub {
  max-width: 560px;
  color: var(--ink2);
  font-size: clamp(1.02rem, 1.3vw, 1.2rem);
  margin-bottom: var(--space-3);
}

.hero-sub strong { color: var(--ink); }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.hero-status { color: var(--ink3); }

/* staggered entrance for hero children after slate drops */
.hero .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
body.is-ready .hero .reveal { opacity: 1; transform: none; }
body.is-ready .hero-eyebrow { transition-delay: 0.05s; }
body.is-ready .hero-sub { transition-delay: 0.35s; }
body.is-ready .hero-cta { transition-delay: 0.5s; }
body.is-ready .hero-status { transition-delay: 0.65s; }

/* stats — bottom right block */
.hero-stats {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: var(--space-4) auto 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: clamp(1.5rem, 5vw, 4.5rem);
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
  opacity: 0;
  transition: opacity 1s var(--ease-out) 0.8s;
}
body.is-ready .hero-stats { opacity: 1; }

.stat b {
  display: block;
  font-family: var(--font-display);
  font-variation-settings: "wdth" 120, "wght" 880;
  font-weight: 880;
  font-stretch: 120%;
  font-size: clamp(1.7rem, 3.4vw, 3rem);
  line-height: 1;
  color: var(--ink);
}

.stat .stat-slash { color: var(--acc); }

.stat span { color: var(--ink3); font-size: 0.66rem; letter-spacing: 0.16em; }

@media (max-width: 720px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

/* scroll cue */
.scroll-cue {
  position: absolute;
  right: calc(var(--gutter));
  bottom: var(--space-3);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--ink3);
  letter-spacing: 0.3em;
  writing-mode: vertical-rl;
}

.scroll-cue span {
  width: 1px;
  height: 54px;
  background: var(--line-strong);
  position: relative;
  overflow: hidden;
}

.scroll-cue span::after {
  content: "";
  position: absolute;
  left: 0; top: -40%;
  width: 100%; height: 40%;
  background: var(--acc);
  animation: cue 1.8s var(--ease-snap) infinite;
}

@keyframes cue { to { top: 110%; } }

@media (max-width: 720px) { .scroll-cue { display: none; } }

/* ================= PIPELINES ================= */
.pipes-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-3);
  align-items: stretch;
}

.pipe {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg1);
  padding: var(--space-3);
}

.pipe-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.pipe-label {
  font-variation-settings: "wdth" 122, "wght" 880;
  font-weight: 880;
  font-stretch: 122%;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  letter-spacing: 0.01em;
}

.pipe--systems .pipe-label { color: var(--acc); }

.pipe-since { color: var(--ink3); }

.pipe-blurb { color: var(--ink2); margin-bottom: var(--space-3); }

.pipe-list { list-style: none; }

.pipe-list li {
  display: grid;
  grid-template-columns: minmax(9em, auto) 1fr;
  gap: 1rem;
  padding: 0.72rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}

.pipe-list b {
  font-weight: 700;
  font-variation-settings: "wdth" 105, "wght" 700;
  white-space: nowrap;
}

.pipe-list span { color: var(--ink3); font-size: var(--fs-small); }

.pipes-x {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pipes-x-glyph {
  width: 58px; height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--acc);
  font-size: 1.5rem;
  background: var(--bg0);
  animation: spin-slow 14s linear infinite;
}

@keyframes spin-slow { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .pipes-grid { grid-template-columns: 1fr; }
  .pipes-x { padding: 0.4rem 0; }
  .pipes-x-glyph { width: 44px; height: 44px; }
}

.pipes-thesis {
  margin-top: var(--space-4);
  border-left: 2px solid var(--acc);
  padding: 0.6rem 0 0.6rem var(--space-3);
}

.pipes-thesis-main {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.pipes-thesis-note { color: var(--ink2); max-width: 640px; }

/* ================= WORK ================= */
.work-list { border-top: 1px solid var(--line); }

.work-row {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto 300px;
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  padding: clamp(1.2rem, 2.6vw, 2rem) 0;
  border-bottom: 1px solid var(--line);
  width: 100%;
  text-align: left;
  transition: padding 0.4s var(--ease-out);
}

.work-row:hover { padding-left: 0.8rem; }

.work-idx {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  color: var(--ink3);
  transition: color 0.3s;
}

.work-row:hover .work-idx { color: var(--acc); }

.work-main { min-width: 0; }

.work-title {
  font-variation-settings: "wdth" 118, "wght" 850;
  font-weight: 850;
  font-stretch: 118%;
  font-size: clamp(1.6rem, 4vw, 3.4rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  transition: color 0.3s;
}

.work-row:hover .work-title { color: var(--acc-ink); }

.work-kicker { color: var(--acc); margin-bottom: 0.5rem; display: block; }

.work-role { color: var(--ink2); margin-top: 0.5rem; font-size: var(--fs-small); }

.work-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  color: var(--ink3);
  text-align: right;
  white-space: nowrap;
}

.work-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg1);
}

.work-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 0.7s var(--ease-out), opacity 0.4s;
}

.work-row:hover .work-thumb img.cover { transform: scale(1.1); }

.work-thumb img.gifPreview {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.work-thumb img.gifPreview.is-on { opacity: 1; }

.work-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(0deg, rgba(5,5,6,0.45), rgba(5,5,6,0.1));
  opacity: 0;
  transition: opacity 0.35s;
}

.work-row:hover .work-play { opacity: 1; }

.work-play i {
  width: 54px; height: 54px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--bg0) 40%, transparent);
}

.work-play i::after {
  content: "";
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent var(--ink);
  margin-left: 3px;
}

@media (max-width: 900px) {
  .work-row { grid-template-columns: auto 1fr; }
  .work-meta { display: none; }
  .work-thumb { grid-column: 1 / -1; width: 100%; max-width: 460px; }
}

/* ================= LAB ================= */
.lab-intro { max-width: 620px; color: var(--ink2); margin-top: var(--space-2); }

.flow {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg1);
  padding: clamp(1rem, 3vw, 2.4rem);
  margin-bottom: var(--space-3);
  overflow-x: auto;
}

.flow svg { width: 100%; min-width: 620px; height: auto; color: var(--ink3); }

.flow .wire {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.2;
  marker-end: url(#arr);
  stroke-dasharray: 5 6;
  animation: wire-flow 1.4s linear infinite;
}

@keyframes wire-flow { to { stroke-dashoffset: -11; } }

.flow .pkt { fill: var(--acc); filter: drop-shadow(0 0 5px var(--acc)); }

.fnode rect {
  fill: var(--bg2);
  stroke: var(--line-strong);
  stroke-width: 1;
}

.fnode text {
  fill: var(--ink2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-anchor: middle;
  dominant-baseline: middle;
}

.fnode--acc rect { stroke: var(--acc); fill: color-mix(in srgb, var(--acc) 10%, var(--bg2)); }
.fnode--acc text { fill: var(--acc-ink); }

.fnode--sm text { font-size: 9.5px; }

.flow figcaption {
  margin-top: 1rem;
  color: var(--ink3);
  letter-spacing: 0.1em;
  text-transform: none;
}

.agents {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.agent {
  background: var(--bg0);
  padding: var(--space-3);
  position: relative;
  transition: background 0.35s;
}

.agent:hover { background: var(--bg1); }

.agent-status {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  color: var(--ok);
  margin-bottom: var(--space-2);
  display: inline-flex;
  align-items: center;
}

.agent-status.is-pilot { color: var(--amber); }

.agent-name {
  font-variation-settings: "wdth" 112, "wght" 800;
  font-weight: 800;
  font-stretch: 112%;
  font-size: var(--fs-h3);
  text-transform: uppercase;
  line-height: 1.05;
  margin-bottom: 0.7rem;
}

.agent-desc { color: var(--ink2); font-size: var(--fs-small); margin-bottom: 1.2rem; }

.agent-stack { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.agent-stack span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--ink3);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0.28em 0.75em;
  transition: color 0.3s, border-color 0.3s;
}

.agent:hover .agent-stack span { color: var(--ink2); border-color: var(--line-strong); }

@media (max-width: 1020px) { .agents { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .agents { grid-template-columns: 1fr; } }

/* ================= CAREER / TIMELINE ================= */
.tl {
  position: relative;
  margin-left: 8px;
  padding-left: clamp(1.6rem, 4vw, 3rem);
}

/* the rail */
.tl::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--line);
}

/* the playhead fill (height driven by scroll.js via --tl-progress) */
.tl::after {
  content: "";
  position: absolute;
  left: -0.5px; top: 6px;
  width: 2px;
  height: calc(var(--tl-progress, 0) * (100% - 12px));
  background: linear-gradient(var(--acc), var(--amber));
  box-shadow: 0 0 12px var(--acc-soft);
}

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: clamp(1rem, 3vw, 2.6rem);
  padding: clamp(1.1rem, 2.4vw, 1.8rem) 0;
  border-bottom: 1px solid var(--line);
}

.tl-item:last-child { border-bottom: 0; }

/* keyframe diamond on the rail */
.tl-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * clamp(1.6rem, 4vw, 3rem) - 4.5px);
  top: 50%;
  width: 9px; height: 9px;
  background: var(--bg0);
  border: 1px solid var(--line-strong);
  transform: translateY(-50%) rotate(45deg);
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.tl-item.is-in::before {
  background: var(--acc);
  border-color: var(--acc);
  box-shadow: 0 0 10px var(--acc);
}

.tl-years {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  color: var(--ink3);
  padding-top: 0.35em;
  white-space: nowrap;
}

.tl-item.is-current .tl-years { color: var(--acc); }

.tl-role {
  font-variation-settings: "wdth" 112, "wght" 800;
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(1.2rem, 2.4vw, 1.9rem);
  text-transform: uppercase;
  line-height: 1.1;
}

.tl-org { color: var(--ink2); margin-top: 0.25rem; }

.tl-note { color: var(--ink3); font-size: var(--fs-small); margin-top: 0.5rem; max-width: 560px; }

@media (max-width: 640px) {
  .tl-item { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* credentials strip */
.creds {
  margin-top: var(--space-5);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.cred { background: var(--bg1); padding: var(--space-3); }

.cred-title {
  font-variation-settings: "wdth" 112, "wght" 800;
  font-weight: 800;
  font-stretch: 112%;
  text-transform: uppercase;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.cred-detail { color: var(--ink3); font-size: var(--fs-small); }

.cred a {
  display: inline-block;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--acc);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.cred a:hover { border-color: var(--acc); }

@media (max-width: 860px) { .creds { grid-template-columns: 1fr; } }

/* ================= CONTACT ================= */
.contact { padding-bottom: var(--space-6); }

.contact-sub { max-width: 600px; color: var(--ink2); margin-bottom: var(--space-4); }

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.contact-meta { color: var(--ink3); }

/* ================= FOOTER ================= */
.footer {
  border-top: 1px solid var(--line);
  margin-top: var(--space-5);
}

.footer-marquee {
  overflow: hidden;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink3);
}

.footer-marquee > div {
  display: flex;
  gap: 3rem;
  width: max-content;
  white-space: nowrap;
  animation: marquee 30s linear infinite reverse;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding: 1.4rem var(--gutter) calc(1.4rem + var(--hud-inset));
  color: var(--ink3);
}

.footer-row a { transition: color 0.3s; }
.footer-row a:hover { color: var(--acc); }

@media (max-width: 720px) {
  .footer-row { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}
