/* ═══════════════════════════════════════════════════════════════
   NOWILL/OS — "THE TERMINAL" · mockup 2/5
   Faked-3D continuous scroll journey through a dark machine world.
   Flat-first (readable without JS); .js3d enables the camera rig.
   One accent: brand teal #0fb5ba. JetBrains Mono only.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg:      #05080b;
  --bg-1:    #0a1016;
  --bg-2:    #0e161e;
  --line:    #16222c;
  --line-2:  #24363f;
  --txt:     #d9e7ef;
  --dim:     #8ba0ad;
  --faint:   #51646f;
  --acc:     #0fb5ba;
  --acc-hi:  #19d3d9;
  --acc-ink: #032022;
  --font:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --chrome-top: 96px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
html.js3d { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--acc); }
s { color: var(--faint); }

/* ── global overlays ─────────────────────────────────────────── */

.crt {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: repeating-linear-gradient(180deg,
    rgba(255,255,255,.022) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

.fog {
  position: fixed; inset: 0; z-index: 4; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 44%, transparent 42%, rgba(3,5,7,.55) 78%, rgba(2,4,6,.9) 100%);
}

.sweep { position: fixed; inset: 0; z-index: 61; pointer-events: none; overflow: hidden; }
.sweep::before {
  content: ""; position: absolute; left: 0; right: 0; top: -8%;
  height: 26vh;
  background: linear-gradient(180deg, transparent, rgba(15,181,186,.045), transparent);
  animation: sweep 9s linear infinite;
}
@keyframes sweep { to { transform: translateY(140vh); } }

/* ── shared atoms ────────────────────────────────────────────── */

.dot {
  display: inline-block; width: 7px; height: 7px; margin-right: 7px;
  background: var(--faint); vertical-align: 1px;
}
.dot--on { background: var(--acc); box-shadow: 0 0 8px rgba(15,181,186,.9); animation: pulse 2.4s steps(2) infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.cursor {
  display: inline-block; width: .62em; height: 1.05em;
  background: var(--acc); vertical-align: -0.14em; margin-left: 2px;
  animation: blink 1.06s steps(1) infinite;
}
.cursor--big { width: .5em; height: .82em; vertical-align: -0.04em; margin-left: .12em; }
@keyframes blink { 50% { opacity: 0; } }

.ok-tick { color: var(--acc); font-weight: 700; white-space: nowrap; }

.bar {
  display: inline-block; width: 100%; height: 8px;
  border: 1px solid var(--line-2); background: var(--bg-1);
  vertical-align: middle; position: relative;
}
.bar i {
  position: absolute; inset: 1px auto 1px 1px; width: var(--w, 40%);
  background: repeating-linear-gradient(90deg, var(--acc) 0 5px, transparent 5px 8px);
  opacity: .85;
}

.btn {
  display: inline-block; padding: 13px 20px;
  border: 1px solid var(--line-2);
  font-family: var(--font); font-size: 12px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--txt); background: transparent;
  transition: background .12s steps(2), color .12s steps(2), border-color .12s steps(2);
}
.btn:hover, .btn:focus-visible { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.btn--solid { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.btn--solid:hover, .btn--solid:focus-visible { background: var(--acc-hi); border-color: var(--acc-hi); }
:focus-visible { outline: 1px dashed var(--acc); outline-offset: 3px; }

/* ── fixed chrome · bootbar ──────────────────────────────────── */

.bootbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; gap: 22px; align-items: center;
  height: 30px; padding: 0 18px;
  background: rgba(4,7,9,.92);
  border-bottom: 1px solid var(--line);
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--dim);
}
.bootbar__seg { white-space: nowrap; }
.bootbar__seg--dim { color: var(--faint); }
.bootbar__spacer { flex: 1; }

/* ── fixed chrome · header ───────────────────────────────────── */

.site-head {
  position: fixed; top: 30px; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 34px;
  height: 66px; padding: 0 26px;
  background: linear-gradient(180deg, rgba(4,7,9,.94), rgba(4,7,9,.82));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(3px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__mark { width: 34px; height: 26px; }
.brand__name { font-weight: 800; letter-spacing: .34em; font-size: 15px; }
.site-nav { display: flex; gap: 6px; flex: 1; }
.site-nav a {
  padding: 6px 10px; font-size: 12.5px; color: var(--dim);
  transition: background .1s steps(2), color .1s steps(2);
}
.site-nav a:hover, .site-nav a:focus-visible { background: var(--acc); color: var(--acc-ink); }

/* ── fixed chrome · depth HUD ────────────────────────────────── */

.hud {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%);
  z-index: 45; display: none;
  flex-direction: column; gap: 14px; text-align: right;
  font-size: 10.5px; letter-spacing: .1em; color: var(--faint);
}
.js3d .hud { display: flex; }
.hud__depth b { color: var(--acc); font-weight: 700; }
.hud__stations { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.hud__stations li {
  padding: 3px 8px; cursor: pointer; color: var(--faint);
  border-right: 2px solid var(--line);
  transition: color .12s, border-color .12s;
}
.hud__stations li i { font-style: normal; margin-right: 8px; color: var(--line-2); }
.hud__stations li:hover { color: var(--txt); }
.hud__stations li.on { color: var(--acc); border-right-color: var(--acc); }
.hud__stations li.on i { color: var(--acc); }
.hud__hint { color: var(--faint); animation: pulse 2.4s steps(2) infinite; }

/* ── fixed chrome · syslog ticker ────────────────────────────── */

.ticker {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  height: 28px; overflow: hidden;
  background: rgba(4,7,9,.92);
  border-top: 1px solid var(--line);
}
.ticker__track {
  display: inline-flex; gap: 56px; white-space: nowrap;
  padding: 5px 0 0 0; font-size: 11px; color: var(--faint);
  animation: tick 46s linear infinite;
}
.ticker__track span::before { content: "▸ "; color: var(--acc); }
@keyframes tick { to { transform: translateX(-50%); } }

/* ═══ JOURNEY RIG ═════════════════════════════════════════════ */

.runway { height: 0; }

.js3d .viewport {
  position: fixed; inset: 0; z-index: 10;
  perspective: 1100px; perspective-origin: 50% 46%;
  overflow: hidden;
}
.js3d .world {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

/* environment elements (JS-injected) */
.env { position: absolute; left: 50%; top: 50%; pointer-events: none; will-change: opacity; }

.env--gate {
  border: 1px solid var(--line-2);
  box-shadow: 0 0 22px rgba(15,181,186,.05), inset 0 0 22px rgba(15,181,186,.03);
}
.env--gate::before, .env--gate::after {
  content: ""; position: absolute; width: 26px; height: 26px;
}
.env--gate::before {
  left: -1px; top: -1px;
  border-left: 2px solid var(--acc); border-top: 2px solid var(--acc);
  opacity: .5;
}
.env--gate::after {
  right: -1px; bottom: -1px;
  border-right: 2px solid var(--acc); border-bottom: 2px solid var(--acc);
  opacity: .5;
}
.env--gate .env__label {
  position: absolute; top: -20px; left: 0;
  font-size: 10px; letter-spacing: .18em; color: var(--faint);
  white-space: nowrap;
}

.env--rack {
  width: 210px; height: 560px;
  background:
    repeating-linear-gradient(180deg, rgba(14,22,30,.9) 0 30px, rgba(23,35,45,.9) 30px 31px),
    linear-gradient(180deg, #0b1218, #080d12);
  border: 1px solid var(--line-2);
  box-shadow: 0 0 40px rgba(0,0,0,.7);
}
.env--rack::after {
  content: ""; position: absolute; top: 8px; bottom: 8px; right: 10px; width: 4px;
  background: repeating-linear-gradient(180deg,
    var(--acc) 0 3px, transparent 3px 30px);
  opacity: .55; filter: blur(.4px);
}

.env--pane {
  width: 250px; padding: 12px 14px;
  background: rgba(8,14,19,.88);
  border: 1px solid var(--line-2);
  box-shadow: 0 0 30px rgba(15,181,186,.06);
  font-size: 10.5px; line-height: 1.75; color: var(--faint);
  white-space: pre; letter-spacing: .04em;
}
.env--pane b { color: var(--acc); font-weight: 700; display: block; letter-spacing: .16em; margin-bottom: 4px; }

.env--dust { width: 3px; height: 3px; background: var(--acc); opacity: .4; box-shadow: 0 0 6px rgba(15,181,186,.8); }

.env--cable {
  height: 1px; background: linear-gradient(90deg, transparent, var(--line-2) 12%, var(--line-2) 88%, transparent);
}

/* ── stations · flat-first defaults (no JS / reduced motion) ── */

.journey { padding-top: var(--chrome-top); }

.station { border-top: 1px solid var(--line); }
.station:first-of-type { border-top: 0; }
.station__frame { max-width: 1240px; margin: 0 auto; }
.station__scroll { padding: 92px 26px; }

/* stations in 3D mode: panes hanging in space */
.js3d .journey { padding-top: 0; }
.js3d .station {
  position: absolute; inset: 0; border: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 106px 4vw 60px;
  backface-visibility: hidden;
}
.js3d .station__frame {
  position: relative;
  width: min(1180px, 93vw);
  max-height: calc(100dvh - 178px);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(10,16,22,.93), rgba(6,10,14,.9));
  border: 1px solid var(--line-2);
  box-shadow:
    0 0 0 1px rgba(15,181,186,.05),
    0 0 70px rgba(15,181,186,.06),
    0 40px 90px rgba(0,0,0,.65);
}
.js3d .station__frame::before, .js3d .station__frame::after {
  content: ""; position: absolute; width: 22px; height: 22px; z-index: 2;
}
.js3d .station__frame::before { left: -1px; top: -1px; border-left: 2px solid var(--acc); border-top: 2px solid var(--acc); }
.js3d .station__frame::after { right: -1px; bottom: -1px; border-right: 2px solid var(--acc); border-bottom: 2px solid var(--acc); }
.js3d .station__scroll { padding: 34px 40px 38px; will-change: transform; }

/* hero floats free in open space */
.js3d .station--open .station__frame { background: transparent; border-color: transparent; box-shadow: none; }
.js3d .station--open .station__frame::before, .js3d .station--open .station__frame::after { display: none; }

/* line-flicker reveal (terminal physics: appear, don't slide) */
.js3d .station .reveal { opacity: 0; }
.js3d .station.arrived .reveal { animation: lineon .22s steps(3) forwards; }
@keyframes lineon { 0% { opacity: 0; } 45% { opacity: .35; } 100% { opacity: 1; } }

/* ── HERO / STATION 00 ───────────────────────────────────────── */

.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 56px; align-items: center;
}

.termline { font-size: 14px; color: var(--dim); margin-bottom: 14px; }
.termline__prompt { color: var(--acc); font-weight: 700; margin-right: 10px; }
.termline__cmd { color: var(--txt); }

.bootlog { list-style: none; font-size: 12.5px; color: var(--faint); margin-bottom: 34px; }
.bootlog li { display: flex; align-items: baseline; gap: 8px; max-width: 470px; }
.bootlog__dots { flex: 1; border-bottom: 1px dotted var(--line-2); transform: translateY(-3px); }
.bootlog__ok { color: var(--acc); font-weight: 700; }
.js3d .bootlog li { opacity: 0; }
.js3d .bootlog li.on { animation: lineon .18s steps(2) forwards; }

.hero__title {
  font-size: clamp(2.45rem, 5.4vw, 4.35rem);
  font-weight: 800; line-height: 1.04; letter-spacing: -0.015em;
  text-transform: uppercase; margin-bottom: 26px;
}
.hero__line { display: block; }
.hero__line--acc { color: var(--acc); text-shadow: 0 0 26px rgba(15,181,186,.35); }

.hero__sub { max-width: 560px; color: var(--dim); font-size: 14.5px; margin-bottom: 34px; }
.hero__sub strong { color: var(--txt); }

.hero__ctas { display: flex; gap: 14px; flex-wrap: wrap; }

/* status rack */
.rack {
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(12,19,26,.94), rgba(7,11,15,.94));
  box-shadow: 0 0 50px rgba(15,181,186,.07), 0 24px 60px rgba(0,0,0,.5);
  font-size: 12.5px;
}
.rack__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line-2);
  background: rgba(15,181,186,.05);
}
.rack__title { font-weight: 800; letter-spacing: .22em; font-size: 11px; }
.rack__live { font-size: 10.5px; letter-spacing: .18em; color: var(--acc); font-weight: 700; }
.rack__row {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 9px 16px; border-bottom: 1px solid var(--line);
}
.rack__key { color: var(--faint); font-size: 10.5px; letter-spacing: .14em; padding-top: 2px; white-space: nowrap; }
.rack__val { text-align: right; color: var(--txt); }
.rack__val--zero { color: var(--acc); font-weight: 800; font-size: 15px; }
.rack__meter { padding: 12px 16px 6px; }
.rack__meterrow {
  display: grid; grid-template-columns: 34px 1fr 38px; gap: 10px;
  align-items: center; margin-bottom: 8px;
  font-size: 10.5px; color: var(--faint);
}
.rack__foot { padding: 8px 16px 12px; color: var(--faint); font-size: 10px; letter-spacing: .08em; }

/* ── section scaffold ────────────────────────────────────────── */

.section__head {
  display: flex; align-items: baseline; gap: 16px;
  padding-bottom: 14px; margin-bottom: 30px;
  border-bottom: 1px solid var(--line-2);
}
.section__num { font-size: 13px; font-weight: 800; color: var(--acc); letter-spacing: .2em; }
.section__name { font-size: 13px; font-weight: 800; letter-spacing: .3em; }
.section__cmd { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.section__intro { color: var(--dim); font-size: 13.5px; max-width: 620px; margin-bottom: 22px; }

/* ── STATION 01 · MANIFEST ───────────────────────────────────── */

.manifest__line {
  font-size: clamp(1.15rem, 2.1vw, 1.7rem);
  line-height: 1.5; font-weight: 500; max-width: 900px;
  margin-bottom: 26px; color: var(--dim);
}
.manifest__line--big { color: var(--txt); font-weight: 700; }
.manifest__line mark {
  background: var(--acc); color: var(--acc-ink); padding: 0 .3em; font-weight: 800;
}
.manifest__meta { margin-top: 34px; color: var(--faint); font-size: 12px; letter-spacing: .12em; }

/* ── STATION 02 · PROCESS TABLE ──────────────────────────────── */

.proc__table { width: 100%; border-collapse: collapse; font-size: 13px; }
.proc__table th {
  text-align: left; padding: 8px 12px;
  font-size: 10.5px; letter-spacing: .2em; color: var(--faint); font-weight: 700;
  border-bottom: 1px solid var(--line-2);
  background: rgba(15,181,186,.04);
}
.proc__table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.proc__table tbody tr { transition: background .1s steps(2); }
.proc__table tbody tr:hover { background: rgba(15,181,186,.09); }
.proc__table tbody tr:hover .proc__pid { color: var(--acc); }
.proc__pid { color: var(--faint); width: 52px; font-weight: 700; }
.proc__name b { display: block; font-weight: 700; font-size: 13.5px; }
.proc__desc { display: block; color: var(--faint); font-size: 11.5px; line-height: 1.5; margin-top: 1px; }
.proc__load { width: 130px; }
.proc__status { width: 116px; color: var(--acc); font-weight: 700; font-size: 11.5px; letter-spacing: .1em; white-space: nowrap; }
.proc__summary {
  margin-top: 14px; padding: 10px 12px;
  border: 1px dashed var(--line-2);
  color: var(--faint); font-size: 11.5px; letter-spacing: .05em;
}
.proc__summary strong { color: var(--acc); }

/* ── STATION 03 · TRUST WALL ─────────────────────────────────── */

.flags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.flag {
  padding: 7px 12px; border: 1px solid var(--line-2);
  font-size: 10.5px; letter-spacing: .16em; color: var(--dim);
  background: rgba(8,14,19,.8);
}
.flag b { color: var(--acc); margin-left: 8px; }

.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel {
  position: relative; padding: 26px 26px 56px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(12,19,26,.8), rgba(7,11,15,.8));
  transition: border-color .12s steps(2), box-shadow .12s steps(2);
}
.panel:hover { border-color: var(--acc); box-shadow: 0 0 34px rgba(15,181,186,.12); }
.panel__title { font-size: 14.5px; font-weight: 800; letter-spacing: .04em; margin-bottom: 12px; }
.panel__body { color: var(--dim); font-size: 13px; max-width: 46ch; }
.panel__tag {
  position: absolute; left: 26px; bottom: 18px;
  font-size: 10.5px; letter-spacing: .2em; color: var(--acc); font-weight: 700;
}

/* ── STATION 04 · RUNBOOK ────────────────────────────────────── */

.steps { list-style: none; }
.step {
  display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 30px;
  padding: 20px 0; border-bottom: 1px solid var(--line);
}
.step:last-child { border-bottom: 0; }
.step__cmd { font-size: 13px; color: var(--dim); }
.step__cmd b { color: var(--acc); font-weight: 700; }
.step__idx { color: var(--faint); margin-right: 8px; }
.step__title { font-size: 15px; font-weight: 800; letter-spacing: .24em; margin-bottom: 6px; }
.step__out p { color: var(--dim); font-size: 13px; max-width: 62ch; }

/* ── STATION 05 · CORE (CONTACT + FOOTER) ────────────────────── */

.contact { padding: 8px 0 34px; }
.contact__kicker { font-size: 12px; letter-spacing: .26em; color: var(--faint); margin-bottom: 18px; }
.contact__mail {
  display: inline-block;
  font-size: clamp(1.5rem, 4.4vw, 3.1rem);
  font-weight: 800; letter-spacing: -0.01em;
  margin-bottom: 18px;
  transition: color .12s steps(2), text-shadow .12s steps(2);
}
.contact__prompt { color: var(--faint); font-weight: 400; margin-right: .35em; }
.contact__mail:hover { color: var(--acc); text-shadow: 0 0 30px rgba(15,181,186,.4); }
.contact__sub { color: var(--dim); font-size: 13.5px; max-width: 560px; margin-bottom: 26px; }
.contact__ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.site-foot { border-top: 1px solid var(--line-2); padding-top: 30px; }
.site-foot__grid {
  display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 30px;
  padding-bottom: 26px;
}
.site-foot__tag { color: var(--dim); font-size: 12px; margin-top: 12px; max-width: 30ch; }
.site-foot__nav { display: flex; flex-direction: column; gap: 6px; }
.site-foot__nav a { color: var(--dim); font-size: 12.5px; width: fit-content; padding: 1px 4px; }
.site-foot__nav a:hover { background: var(--acc); color: var(--acc-ink); }
.site-foot__meta { color: var(--faint); font-size: 12px; text-align: right; }
.site-foot__meta p { margin-bottom: 6px; }
.site-foot__legal {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 14px 0 4px;
  color: var(--faint); font-size: 11px; letter-spacing: .08em;
}
.site-foot__legal b { color: var(--acc); }

/* ── responsive ≤ 1000px ─────────────────────────────────────── */

@media (max-width: 1000px) {
  .hero__grid { grid-template-columns: 1fr; gap: 34px; }
  .rack { max-width: 480px; }
  .step { grid-template-columns: 1fr; gap: 8px; }
  .site-foot__grid { grid-template-columns: 1fr 1fr; }
  .site-foot__meta { text-align: left; }
}

/* ── responsive ≤ 720px (mobile) ─────────────────────────────── */

@media (max-width: 720px) {
  body { font-size: 14px; }
  .bootbar { gap: 12px; padding: 0 12px; }
  .bootbar__seg--dim { display: none; }
  .site-head { padding: 0 14px; gap: 14px; }
  .site-nav { display: none; }
  .site-head__cta { margin-left: auto; padding: 10px 12px; font-size: 11px; }
  .hud { display: none !important; }

  .station__scroll { padding: 64px 18px; }
  .js3d .station { padding: 96px 3vw 48px; }
  .js3d .station__frame { width: 94vw; max-height: calc(100dvh - 150px); }
  .js3d .station__scroll { padding: 22px 18px 26px; }

  .hero__title { font-size: clamp(2.1rem, 9.6vw, 2.9rem); }
  .termline { font-size: 12.5px; }
  .bootlog { font-size: 11.5px; }

  .section__head { flex-wrap: wrap; row-gap: 4px; }
  .section__cmd { margin-left: 0; width: 100%; order: 3; }

  /* process table → log cards */
  .proc__table, .proc__table tbody, .proc__table tr, .proc__table td { display: block; width: 100%; }
  .proc__table thead { display: none; }
  .proc__table tr {
    position: relative; border: 1px solid var(--line);
    margin-bottom: 10px; padding: 12px 14px 12px 58px;
  }
  .proc__table td { border: 0; padding: 0; }
  .proc__pid { position: absolute; left: 14px; top: 13px; }
  .proc__load { margin-top: 8px; width: 100%; max-width: 220px; }
  .proc__status { margin-top: 6px; width: auto; }

  .why-grid { grid-template-columns: 1fr; }
  .panel { padding: 20px 18px 50px; }
  .panel__tag { left: 18px; }

  .site-foot__grid { grid-template-columns: 1fr; gap: 22px; }
  .contact__mail { word-break: break-all; }
}

/* ── reduced motion: freeze everything, flat layout ──────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sweep, .crt { display: none; }
  .cursor, .dot--on, .hud__hint { animation: none; }
  .ticker__track { animation: none; }
  .reveal, .bootlog li { opacity: 1 !important; animation: none !important; }
}
