/* =========================================================
   Hugo Sanches, personal site
   Concept: a descent. The page starts at the sea surface
   (light chart paper) and gets deeper and darker as you
   scroll, with a depth gauge acting as the scroll indicator.
   ========================================================= */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "Archivo"; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url(../assets/fonts/archivo-latin-wdth-normal.woff2) format("woff2-variations"), url(../assets/fonts/archivo-latin-wdth-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url(../assets/fonts/archivo-latin-ext-wdth-normal.woff2) format("woff2-variations"), url(../assets/fonts/archivo-latin-ext-wdth-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader"; font-style: italic; font-display: swap;
  font-weight: 200 800;
  src: url(../assets/fonts/newsreader-latin-opsz-italic.woff2) format("woff2-variations"), url(../assets/fonts/newsreader-latin-opsz-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Newsreader"; font-style: italic; font-display: swap;
  font-weight: 200 800;
  src: url(../assets/fonts/newsreader-latin-ext-opsz-italic.woff2) format("woff2-variations"), url(../assets/fonts/newsreader-latin-ext-opsz-italic.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root {
  /* Water, from surface to trench */
  --paper:   #EAF0F1;
  --shallow: #D5E4EA;
  --shelf:   #B7D0DA;
  --slope:   #173B53;
  --abyss:   #0C2130;
  --trench:  #071520;

  /* Ink and accents */
  --ink:       #0F2A3D;
  --ink-soft:  #2F4F65;
  --foam:      #EAF0F1;
  --foam-soft: #A3BCCB;
  --signal:    #FF4F00;   /* international orange: graphics, focus, highlights */

  --rule-light: rgba(15, 42, 61, .18);
  --rule-dark:  rgba(234, 240, 241, .16);

  --f-sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-note: "Newsreader", Georgia, "Times New Roman", serif;
  --f-mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;

  --gutter: clamp(16px, 5vw, 72px);
  --maxw: 1240px;
  --section-pad: clamp(96px, 16vh, 180px);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; }
a { color: inherit; }

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

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.h2 {
  font-size: clamp(2.5rem, 5.6vw, 5rem);
  font-weight: 650;
  font-stretch: 118%;
  line-height: 1;
  letter-spacing: -.015em;
  margin-bottom: .6em;
}

.note {
  font-family: var(--f-note);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px;
  border: 1.5px solid currentColor; border-radius: 999px;
  background: transparent; color: inherit;
  font: inherit; font-size: 1rem; font-weight: 600; font-stretch: 108%;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--signal); border-color: var(--signal); color: var(--trench); }
.btn--solid { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--light { color: var(--foam); }
.btn--small { min-height: 40px; padding: 8px 18px; font-size: .9rem; }
.btn--ghost { border-color: transparent; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px var(--gutter);
  color: var(--ink);
  font-weight: 600; font-stretch: 108%;
  transition: color .35s;
}
.nav[data-theme="dark"] { color: var(--foam); }
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: rgba(234, 240, 241, .78);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: opacity .35s, background-color .35s;
}
.nav[data-theme="dark"]::before { background: rgba(12, 33, 48, .72); }
.nav.is-scrolled::before { opacity: 1; }
.nav a { text-decoration: none; }
.nav__links { display: flex; gap: clamp(16px, 3vw, 36px); }
.nav__links a { position: relative; padding: 6px 0; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--signal); transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.nav__links a:hover::after, .nav__links a[aria-current="true"]::after { transform: scaleX(1); }

/* ---------- Depth gauge ---------- */
.gauge {
  position: fixed; right: 20px; bottom: 28px; z-index: 40;
  display: none;
  text-align: right; color: var(--ink);
  pointer-events: none; transition: color .35s;
}
.gauge[data-theme="dark"] { color: var(--foam); }
@media (min-width: 900px) { .js .gauge { display: block; } }
.gauge__scale {
  position: relative; margin-left: auto; width: 14px; height: 34vh; margin-bottom: 12px;
  background:
    repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 10px) right / 6px 100% no-repeat,
    repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 50px) right / 14px 100% no-repeat;
  opacity: .55;
}
.gauge__marker {
  position: absolute; right: 0; top: 0; width: 26px; height: 2px;
  background: var(--signal); transform: translateY(calc(var(--p, 0) * 34vh));
}
.gauge__depth {
  margin: 0; font-size: 1rem; font-weight: 600; font-stretch: 92%;
  font-variant-numeric: tabular-nums;
}
.gauge__zone { margin: 0; font-family: var(--f-note); font-style: italic; font-size: .95rem; opacity: .8; }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  padding: 120px 0 clamp(72px, 13vh, 140px);
  background: var(--paper);
  overflow: hidden;
}
.hero__sea { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__inner { position: relative; z-index: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.hero__name {
  font-size: clamp(4.25rem, 13vw, 12rem);
  line-height: .84;
  font-weight: 640;
  letter-spacing: -.025em;
  margin: 0 0 .28em -.04em;
}
.hero__line { display: block; white-space: nowrap; }
.hero__name .ch { font-variation-settings: "wdth" 100, "wght" 640; }

.hero__lede {
  max-width: 30ch;
  font-size: clamp(1.3rem, 2.1vw, 1.75rem);
  line-height: 1.3; font-weight: 500; font-stretch: 102%;
  margin-bottom: .6em;
}
.hero__note { font-family: var(--f-note); font-style: italic; font-size: 1.15rem; color: var(--ink-soft); margin-bottom: 28px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__hint {
  position: absolute; z-index: 1; right: var(--gutter); bottom: 28px; margin: 0;
  font-family: var(--f-note); font-style: italic; color: var(--ink-soft);
}
@media (min-width: 900px) { .hero__hint { right: calc(var(--gutter) + 110px); } }
@media (prefers-reduced-motion: reduce) { .hero__hint { display: none; } }

/* Load sequence: the one orchestrated moment */
.js .hero__name .hero__line { opacity: 0; transform: translateY(.18em); }
.js .hero__lede, .js .hero__note, .js .hero__actions, .js .hero__hint { opacity: 0; }
.js .is-loaded .hero__line { opacity: 1; transform: none; transition: opacity .9s ease, transform 1.1s cubic-bezier(.2,.7,.2,1); }
.js .is-loaded .hero__line + .hero__line { transition-delay: .12s; }
.js .is-loaded .hero__lede, .js .is-loaded .hero__note, .js .is-loaded .hero__actions { opacity: 1; transition: opacity .8s ease .55s; }
.js .is-loaded .hero__hint { opacity: 1; transition: opacity 1s ease 1.4s; }
@media (prefers-reduced-motion: reduce) {
  .js .hero__name .hero__line, .js .hero__lede, .js .hero__note, .js .hero__actions, .js .hero__hint { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   STORY
   ========================================================= */
.story {
  background: linear-gradient(to bottom, var(--paper), var(--shallow));
  padding: var(--section-pad) 0;
}
.story__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.story__photo { margin: 0; position: sticky; top: 120px; }
.story__photo img { width: 100%; max-width: 380px; height: auto; aspect-ratio: 1; object-fit: cover; }
.story__text {
  font-size: clamp(1.3rem, 2.2vw, 1.85rem);
  line-height: 1.4; font-weight: 450;
  max-width: 34em;
  margin-bottom: 2.4em;
}
.js .story__text .w { color: rgba(15, 42, 61, .2); transition: color .35s; }
.js .story__text .w.on { color: var(--ink); }

.soundings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 0; border-top: 1px solid var(--rule-light); padding-top: 24px; }
.soundings dt { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 650; font-stretch: 116%; line-height: 1.1; font-variant-numeric: tabular-nums; }
.soundings dd { margin: 6px 0 0; font-family: var(--f-note); font-style: italic; font-size: 1.05rem; line-height: 1.35; color: var(--ink-soft); }

/* =========================================================
   JOURNEY
   ========================================================= */
.journey {
  background: linear-gradient(to bottom, var(--shallow), var(--shelf));
  padding: var(--section-pad) 0 calc(var(--section-pad) * .7);
}
.timeline { list-style: none; margin: 0; padding: 0 0 0 36px; position: relative; }
.timeline::before, .timeline::after {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--rule-light);
}
.timeline::after { background: var(--signal); transform-origin: top; transform: scaleY(var(--p, 0)); }

.role {
  position: relative;
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px;
  padding: 40px 0; border-top: 1px solid var(--rule-light);
}
.role:first-child { border-top: 0; padding-top: 8px; }
.role::before {
  content: ""; position: absolute; left: -36px; top: 50px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--shallow); border: 2px solid var(--ink-soft); transition: background-color .3s, border-color .3s;
}
.role:first-child::before { top: 18px; }
.role.passed::before { background: var(--signal); border-color: var(--signal); }

.role__years {
  margin: 0; font-size: 2.1rem; font-weight: 600; font-stretch: 122%; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.role__years span { display: block; font-size: 1.05rem; font-family: var(--f-note); font-style: italic; font-weight: 400; color: var(--ink-soft); margin-top: 8px; }
.role__years span::before { content: "to "; }
.role__title { font-size: clamp(1.35rem, 2vw, 1.7rem); font-weight: 650; font-stretch: 106%; line-height: 1.2; margin-bottom: .6em; }
.role__org { display: block; margin-top: 4px; font-family: var(--f-note); font-style: italic; font-weight: 400; font-size: 1.15rem; color: var(--ink-soft); }
.role__path { font-size: .95rem; color: var(--ink-soft); }
.role__body { max-width: 44em; }
.role__body > p:last-child { margin-bottom: 0; }
.role__points { margin: 0; padding-left: 1.1em; }
.role__points li { margin-bottom: .35em; }
.role__points li::marker { color: var(--ink-soft); }

/* Transition strip between light and dark */
.thermocline { height: 40vh; background: linear-gradient(to bottom, var(--shelf), var(--slope)); }

/* =========================================================
   WORK (horizontal on desktop, stacked on mobile)
   ========================================================= */
.work { background: var(--slope); color: var(--foam); position: relative; }
.work .note { color: var(--foam-soft); }
.work__pin { position: relative; }
.work__track { display: flex; flex-direction: column; }

.panel { padding: 72px var(--gutter); border-top: 1px solid var(--rule-dark); }
.panel--intro { border-top: 0; padding-top: var(--section-pad); }
.panel--intro p { max-width: 30em; font-size: 1.2rem; }
.work__hint { display: none; }
.panel__title { font-size: clamp(1.8rem, 3vw, 2.7rem); font-weight: 650; font-stretch: 110%; line-height: 1.05; margin-bottom: .6em; }
.panel__text { max-width: 36em; }
.panel__text p { color: var(--foam); }
.panel__points { padding-left: 1.1em; margin: 0 0 1.2em; color: var(--foam-soft); }
.panel__points li { margin-bottom: .35em; }
.panel__stack.note { color: var(--foam-soft); margin: 0; }
.panel__visual {
  margin-top: 40px;
  min-height: 360px;
  display: grid; place-items: center;
  border: 1px solid var(--rule-dark); border-radius: 6px;
  background: rgba(7, 21, 32, .35);
  padding: 28px;
  overflow: hidden;
}
.work__progress { display: none; }

@media (min-width: 900px) {
  .js .work__pin { position: sticky; top: 0; height: 100vh; overflow: hidden; }
  .js .work__track { flex-direction: row; height: 100%; width: max-content; will-change: transform; }
  .js .panel {
    width: min(1180px, 88vw); height: 100%;
    padding: clamp(96px, 15vh, 150px) 4vw clamp(72px, 12vh, 120px);
    border-top: 0; border-left: 1px solid var(--rule-dark);
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 4vw; align-items: center;
  }
  .js .panel--intro {
    width: min(720px, 60vw); border-left: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 0;
    padding-left: var(--gutter);
  }
  .js .work__hint { display: block; margin-top: 12px; }
  .js .panel__visual { margin-top: 0; height: min(60vh, 520px); min-height: 0; }
  .js .work__progress {
    display: block; position: absolute; left: var(--gutter); right: calc(var(--gutter) + 110px); bottom: 6vh; height: 2px;
    background: var(--rule-dark);
  }
  .js .work__progress span { display: block; height: 100%; background: var(--signal); transform-origin: left; transform: scaleX(var(--p, 0)); }
}

/* ---------- Demo: 3270 terminal ---------- */
.term { width: 100%; max-width: 520px; }
.term__screen {
  margin: 0; padding: 20px 22px; border-radius: 4px;
  background: #031A0E; color: #7CFF9B;
  font-family: var(--f-mono); font-size: clamp(11px, 1.05vw, 14px); line-height: 1.5;
  box-shadow: inset 0 0 40px rgba(124, 255, 155, .08);
  text-shadow: 0 0 6px rgba(124, 255, 155, .45);
  white-space: pre; overflow: hidden;
}
.term__f { color: #E8FFEE; }
.term__f.flash { background: #7CFF9B; color: #031A0E; }
.term__cursor { display: inline-block; width: .6em; height: 1.1em; background: #7CFF9B; vertical-align: text-bottom; margin-left: 4px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term__log {
  list-style: none; margin: 14px 0 0; padding: 0; min-height: 7.5em;
  font-family: var(--f-mono); font-size: 12.5px; line-height: 1.5; color: var(--foam-soft);
}
.term__log li::before { content: "› "; color: var(--signal); }

/* ---------- Demo: Graph calls ---------- */
.http { width: 100%; max-width: 540px; position: relative; }
.http__log {
  margin: 0; min-height: 15em;
  font-family: var(--f-mono); font-size: clamp(11px, 1vw, 13.5px); line-height: 1.65; color: var(--foam);
  white-space: pre-wrap; word-break: break-word;
}
.http__log .ok { color: #8FE3B0; }
.http__log .dim { color: var(--foam-soft); }
.http__label {
  display: inline-flex; gap: 10px; align-items: baseline; margin: 18px 0 0;
  padding: 8px 14px; border: 2px solid var(--signal); border-radius: 4px; color: var(--foam);
  font-weight: 650; font-stretch: 110%;
  transform: rotate(-3deg) scale(1.6); opacity: 0;
}
.http__label span { font-family: var(--f-note); font-style: italic; font-weight: 400; color: var(--foam-soft); }
.http__label.stamp { opacity: 1; transform: rotate(-3deg) scale(1); transition: transform .35s cubic-bezier(.3,1.6,.5,1), opacity .2s; }

/* ---------- Demo: TOON ---------- */
.toon { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.toon__col { min-width: 0; }
.toon__head { margin: 0 0 8px; font-weight: 650; font-stretch: 110%; }
.toon__head span { font-family: var(--f-note); font-style: italic; font-weight: 400; color: var(--foam-soft); font-variant-numeric: tabular-nums; }
.toon__code {
  margin: 0; height: 13.5em; overflow: auto;
  padding: 12px; border-radius: 4px; background: rgba(7, 21, 32, .6);
  font-family: var(--f-mono); font-size: 11.5px; line-height: 1.5; color: var(--foam);
  white-space: pre-wrap; word-break: break-all;
}
.toon__bars { grid-column: 1 / -1; display: grid; gap: 6px; }
.toon__bar { display: block; height: 8px; border-radius: 4px; transform-origin: left; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.toon__bar--json { background: var(--foam-soft); }
.toon__bar--toon { background: var(--signal); }
.toon__saving { grid-column: 1 / -1; margin: 0; color: var(--foam-soft); }
.toon__saving strong { color: var(--foam); font-size: 1.4rem; font-stretch: 112%; }
.toon__actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Demo: document extraction ---------- */
.doc { --cycle: 7s; width: 100%; max-width: 560px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: center; }
.doc__page {
  position: relative; aspect-ratio: 1 / 1.3; padding: 10% 9%;
  background: #E9E4D8; border-radius: 2px; overflow: hidden;
  display: flex; flex-direction: column; gap: 5.5%;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}
.doc__line { display: block; height: 3.2%; min-height: 4px; background: #B9B3A5; border-radius: 2px; }
.w60 { width: 60%; } .w65 { width: 65%; } .w70 { width: 70%; } .w75 { width: 75%; } .w80 { width: 80%; } .w85 { width: 85%; } .w90 { width: 90%; }
.doc__field { display: block; height: 6%; width: 52%; border: 2px solid transparent; border-radius: 2px; background: #CFC8B8; }
.doc__sig { width: 46%; height: auto; margin-top: auto; }
.doc__sig path { fill: none; stroke: #2B3A55; stroke-width: 2.4; stroke-linecap: round; }
.doc__page .f4 { position: absolute; left: 7%; bottom: 7%; width: 50%; height: 16%; background: transparent; }
.doc__scan {
  position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--signal);
  box-shadow: 0 0 18px 4px rgba(255, 79, 0, .55);
  animation: scan var(--cycle) linear infinite;
}
@keyframes scan { 0% { top: -3%; } 70%, 100% { top: 102%; } }
.doc__field.f1 { animation: hit var(--cycle) infinite; animation-delay: calc(var(--cycle) * .12); }
.doc__field.f2 { animation: hit var(--cycle) infinite; animation-delay: calc(var(--cycle) * .29); }
.doc__field.f3 { animation: hit var(--cycle) infinite; animation-delay: calc(var(--cycle) * .43); }
.doc__field.f4 { animation: hit var(--cycle) infinite; animation-delay: calc(var(--cycle) * .62); }
@keyframes hit {
  0% { border-color: transparent; }
  4%, 70% { border-color: var(--signal); }
  80%, 100% { border-color: transparent; }
}
.doc__out { margin: 0; display: grid; gap: 14px; }
.doc__out div { opacity: 0; animation: reveal var(--cycle) infinite backwards; }
.doc__out .o1 { animation-delay: calc(var(--cycle) * .14); }
.doc__out .o2 { animation-delay: calc(var(--cycle) * .31); }
.doc__out .o3 { animation-delay: calc(var(--cycle) * .45); }
.doc__out .o4 { animation-delay: calc(var(--cycle) * .64); }
@keyframes reveal { 0% { opacity: 0; transform: translateX(-8px); } 5%, 66% { opacity: 1; transform: none; } 78%, 100% { opacity: 0; } }
.doc__out dt { font-family: var(--f-note); font-style: italic; color: var(--foam-soft); font-size: 1rem; }
.doc__out dd { margin: 0; font-weight: 650; font-stretch: 108%; font-size: 1.15rem; }

/* ---------- Demo: near-real-time flow ---------- */
.nrt { width: 100%; max-width: 560px; }
.nrt__flow { display: flex; align-items: center; gap: 0; }
.nrt__node {
  flex: none; position: relative;
  padding: 10px 12px; border: 1.5px solid var(--foam-soft); border-radius: 4px;
  font-size: .85rem; font-weight: 600; font-stretch: 100%; text-align: center;
}
.nrt__node--bots { padding-bottom: 22px; }
.nrt__node--bots b { position: absolute; bottom: 7px; width: 8px; height: 8px; border-radius: 2px; background: var(--foam-soft); animation: busy 1.2s infinite; }
.nrt__node--bots b:nth-child(1) { left: calc(50% - 18px); }
.nrt__node--bots b:nth-child(2) { left: calc(50% - 4px); animation-delay: .4s; }
.nrt__node--bots b:nth-child(3) { left: calc(50% + 10px); animation-delay: .8s; }
@keyframes busy { 50% { background: var(--signal); } }
.nrt__node--out { border-color: var(--signal); }
.nrt__pipe { flex: 1; position: relative; height: 2px; min-width: 18px; background: var(--rule-dark); overflow: hidden; }
.nrt__pipe i { position: absolute; top: -2px; left: -8px; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); animation: flow 1.5s linear infinite; }
.nrt__pipe i:nth-child(2) { animation-delay: .5s; }
.nrt__pipe i:nth-child(3) { animation-delay: 1s; }
@keyframes flow { to { left: 100%; } }
.nrt__timer {
  margin: 36px 0 4px; font-size: clamp(3rem, 6vw, 5.5rem); font-weight: 650; font-stretch: 120%; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.nrt__target { margin: 0; }

/* ---------- Demo: XML to diagram ---------- */
.xml { --cycle: 8s; width: 100%; max-width: 600px; display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 24px; align-items: center; }
.xml__src { margin: 0; font-family: var(--f-mono); font-size: clamp(10px, .82vw, 12px); line-height: 2.4; color: var(--foam-soft); white-space: pre; overflow: hidden; }
.xml__src span { display: block; border-radius: 3px; padding: 0 6px; animation: xl var(--cycle) infinite backwards; }
@keyframes xl { 0% { background: transparent; color: var(--foam-soft); } 3%, 12% { background: rgba(255, 79, 0, .18); color: var(--foam); } 18%, 100% { background: transparent; color: var(--foam-soft); } }
.xml__chart { width: 100%; max-height: 46vh; }
.xml__chart rect, .xml__chart path { fill: none; stroke: var(--foam); stroke-width: 2; stroke-dasharray: 340; stroke-dashoffset: 340; animation: draw var(--cycle) infinite backwards; }
.xml__chart .s3 { stroke: var(--signal); }
@keyframes draw { 0% { stroke-dashoffset: 340; } 8%, 80% { stroke-dashoffset: 0; } 92%, 100% { stroke-dashoffset: 340; } }
.x1, .s1 { animation-delay: 0s !important; }
.s1l { animation-delay: calc(var(--cycle) * .06) !important; }
.x2, .s2 { animation-delay: calc(var(--cycle) * .1) !important; }
.s2l { animation-delay: calc(var(--cycle) * .16) !important; }
.x3, .s3 { animation-delay: calc(var(--cycle) * .2) !important; }
.s3l { animation-delay: calc(var(--cycle) * .26) !important; }
.x4, .s4 { animation-delay: calc(var(--cycle) * .3) !important; }
.s4l { animation-delay: calc(var(--cycle) * .36) !important; }
.x5, .s5 { animation-delay: calc(var(--cycle) * .4) !important; }

/* Pause demo animations while off screen */
.panel__visual.is-paused *, .panel__visual.is-paused *::before, .panel__visual.is-paused *::after { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  .panel__visual *, .panel__visual *::before, .panel__visual *::after { animation: none !important; }
  .doc__out div { opacity: 1; }
  .doc__field { border-color: var(--signal); }
  .doc__scan { display: none; }
  .xml__chart rect, .xml__chart path { stroke-dashoffset: 0; }
  .nrt__pipe i { left: 45%; }
}

/* =========================================================
   LEADERSHIP, TOOLBOX, CONTACT
   ========================================================= */
.lead { background: linear-gradient(to bottom, var(--slope), var(--abyss)); color: var(--foam); padding: var(--section-pad) 0 calc(var(--section-pad) * .6); }
.lead__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(32px, 6vw, 96px); }
.lead__item { border-top: 1px solid var(--rule-dark); padding: 28px 0 36px; }
.lead__item h3 { font-family: var(--f-note); font-style: italic; font-weight: 400; font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.15; margin-bottom: .5em; }
.lead__item p { color: var(--foam-soft); max-width: 32em; margin: 0; }

.tools { background: var(--abyss); color: var(--foam); padding: calc(var(--section-pad) * .6) 0 var(--section-pad); }
.tools__list { margin: 0; }
.tools__list div { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 18px 0; border-top: 1px solid var(--rule-dark); }
.tools__list dt { font-family: var(--f-note); font-style: italic; font-size: 1.2rem; color: var(--foam-soft); }
.tools__list dd { margin: 0; font-size: clamp(1.1rem, 1.6vw, 1.35rem); font-weight: 500; font-stretch: 104%; }

.contact { background: linear-gradient(to bottom, var(--abyss), var(--trench)); color: var(--foam); padding: var(--section-pad) 0 0; }
.contact__title { font-size: clamp(3rem, 10vw, 9rem); font-weight: 650; font-stretch: 122%; line-height: .95; letter-spacing: -.02em; margin-bottom: .35em; }
.contact__text { max-width: 30em; font-size: clamp(1.15rem, 1.8vw, 1.45rem); color: var(--foam-soft); }
.contact__email {
  display: inline-block; margin: .4em 0 1em;
  font-size: clamp(1.4rem, 4vw, 3rem); font-weight: 600; font-stretch: 105%;
  text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 3px; text-underline-offset: .18em;
  overflow-wrap: anywhere;
}
.contact__email:hover { color: var(--signal); }
.contact__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.footer { margin-top: var(--section-pad); padding-bottom: 40px; }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 28px; border-top: 1px solid var(--rule-dark); color: var(--foam-soft); font-size: .95rem; }
.footer p { margin: 0; }
.footer .note { color: var(--foam-soft); font-size: 1rem; }

/* =========================================================
   SMALL SCREENS
   ========================================================= */
@media (max-width: 899px) {
  .story__grid { grid-template-columns: 1fr; }
  .story__photo { position: static; max-width: 240px; }
  .soundings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role { grid-template-columns: 1fr; gap: 12px; }
  .role::before { top: 46px; }
  .role__years { font-size: 1.7rem; }
  .role__years span { display: inline; margin-left: 10px; }
  .lead__grid { grid-template-columns: 1fr; }
  .tools__list div { grid-template-columns: 1fr; gap: 4px; }
  .hero__hint { left: var(--gutter); right: auto; bottom: 20px; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .hero__name { font-size: 18vw; }
  .nav__name { display: none; }
  .nav { justify-content: flex-end; }
  .panel__visual { padding: 18px; }
  .toon { grid-template-columns: 1fr; }
  .toon__code { height: 9em; }
  .doc { grid-template-columns: 1fr 1fr; gap: 16px; }
  .xml { grid-template-columns: 1fr; }
  .xml__chart { max-height: 260px; }
  .nrt__node { font-size: .72rem; padding: 8px 6px; }
  .nrt__node--bots { padding-bottom: 20px; }
}
