/* HADAL INSTITUTE — descent stylesheet */

:root {
  --abyss: #01060c;
  --surface: #0d6272;
  --ink: #eaf6f6;
  --dim: rgba(234, 246, 246, 0.64);
  --faint: rgba(234, 246, 246, 0.38);
  --cyan: #6ef4ff;
  --violet: #a88cff;
  --amber: #ffb057;
  --hairline: rgba(110, 244, 255, 0.18);
  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;
  --rail: 124px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--abyss);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(110, 244, 255, 0.28); color: #fff; }

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

.mono { font-family: var(--mono); }

/* ---------- canvas ---------- */
#ocean {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* ---------- header ---------- */
.site-head {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.6rem;
  background: linear-gradient(rgba(1, 6, 12, 0.55), rgba(1, 6, 12, 0));
  pointer-events: none;
}
.site-head > * { pointer-events: auto; }
.brand {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-decoration: none;
}
.brand em { font-style: normal; color: var(--cyan); }
.site-head nav { display: flex; align-items: center; gap: 1.4rem; }
.nav-link {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.25s;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .brand { white-space: nowrap; }
  .nav-link, .brand { font-size: 0.58rem; letter-spacing: 0.14em; }
}
.nav-link:hover { color: var(--cyan); }
.btn-amber {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--amber);
  text-decoration: none;
  border: 1px solid rgba(255, 176, 87, 0.55);
  padding: 0.6em 1.1em;
  border-radius: 3px;
  transition: background 0.25s, color 0.25s;
  white-space: nowrap;
}
.btn-amber:hover { background: var(--amber); color: #140a00; }

/* ---------- depth HUD ---------- */
.hud {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--rail);
  z-index: 30;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.4rem;
  padding: 5.5rem 0 3rem 1.4rem;
  font-family: var(--mono);
  color: var(--amber);
  pointer-events: none;
  user-select: none;
}
.hud-block { font-size: 0.56rem; letter-spacing: 0.12em; line-height: 1.5; }
.hud-block .lbl { color: rgba(255, 176, 87, 0.55); display: block; font-size: 0.5rem; }
.hud-depth {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.hud-unit { font-size: 0.55rem; color: rgba(255, 176, 87, 0.55); }
.hud-track {
  position: relative;
  width: 2px;
  flex: 0 1 200px;
  background: rgba(255, 176, 87, 0.22);
  margin: 0.4rem 0 0.4rem 3px;
}
.hud-track i {
  position: absolute;
  left: -2px;
  width: 6px; height: 1px;
  background: rgba(255, 176, 87, 0.45);
}
.hud-track .hud-pos {
  position: absolute;
  left: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(255, 176, 87, 0.9);
  transform: translateY(-4px);
}
.hud-zone { min-height: 2.4em; }

/* mobile HUD bar */
.hud-bar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  font-family: var(--mono);
  color: var(--amber);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  padding: 0.65rem 1rem 0.75rem;
  background: linear-gradient(rgba(1, 6, 12, 0), rgba(1, 6, 12, 0.82));
  justify-content: space-between;
  gap: 0.8rem;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.hud-bar span b { font-weight: 700; }

/* ---------- layout ---------- */
main {
  position: relative;
  z-index: 10;
  padding-left: var(--rail);
  padding-right: clamp(1.2rem, 4vw, 4rem);
}

.wp { display: block; height: 0; }

/* hero */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 5rem;
  padding-bottom: 4rem;
  max-width: 1180px;
}
.eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  color: var(--cyan);
  margin-bottom: 1.6rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 5.9rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 15ch;
  text-wrap: balance;
}
.hero .lede {
  margin-top: 2rem;
  max-width: 52ch;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  color: var(--dim);
}
.descend-cue {
  margin-top: 3.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--amber);
  text-decoration: none;
}
.descend-cue .arrow { animation: sink 2.2s ease-in-out infinite; display: inline-block; }
@keyframes sink { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { .descend-cue .arrow { animation: none; } }

/* zone chapters */
.zone {
  min-height: 118vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 0;
  max-width: 1180px;
}
/* the dive drifts with the current: alternating chapters sit offset right */
@media (min-width: 1100px) {
  .zone.drift { margin-left: clamp(6rem, 24vw, 24rem); }
}
.zone h2 {
  font-size: clamp(2rem, 4.6vw, 4rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.015em;
  max-width: 17ch;
  text-wrap: balance;
}
.zone .body {
  margin-top: 2rem;
  max-width: 56ch;
  color: var(--dim);
  font-size: clamp(1rem, 1.25vw, 1.15rem);
}
.zone .body + .body { margin-top: 1.2rem; }
.zone .body strong { color: var(--ink); font-weight: 600; }

.callout {
  margin-top: 2.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.8;
  letter-spacing: 0.06em;
  color: var(--cyan);
  border-left: 2px solid var(--hairline);
  padding-left: 1.2rem;
  max-width: 46ch;
}

/* stat rows */
.stats {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  max-width: 760px;
}
.stats > div { background: rgba(1, 6, 12, 0.6); padding: 1.1rem 1.2rem; }
.stats .n {
  font-family: var(--mono);
  font-size: clamp(1rem, 1.8vw, 1.45rem);
  font-weight: 700;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}
.stats .l {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  color: var(--faint);
  line-height: 1.6;
}

/* depth marks between zones */
.mark {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: var(--faint);
  max-width: 1180px;
  padding: 1rem 0;
}
.mark::before, .mark::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline), transparent);
}

/* spec sheet (lander) */
.spec {
  margin-top: 2.6rem;
  max-width: 640px;
  border: 1px solid rgba(255, 176, 87, 0.32);
  border-radius: 4px;
  overflow: hidden;
}
.spec header {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--amber);
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid rgba(255, 176, 87, 0.32);
  background: rgba(255, 176, 87, 0.06);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.spec dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  font-family: var(--mono);
  font-size: 0.66rem;
  line-height: 1.6;
  letter-spacing: 0.05em;
}
.spec dt {
  color: rgba(255, 176, 87, 0.6);
  padding: 0.55rem 1.6rem 0.55rem 1.2rem;
  border-top: 1px solid rgba(255, 176, 87, 0.14);
  white-space: nowrap;
}
.spec dd {
  color: var(--ink);
  padding: 0.55rem 1.2rem 0.55rem 0;
  border-top: 1px solid rgba(255, 176, 87, 0.14);
}
.spec dt:first-of-type, .spec dd:first-of-type { border-top: 0; }

/* trench table */
.trenches {
  margin-top: 2.6rem;
  max-width: 760px;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  border-top: 1px solid var(--hairline);
}
.trenches li {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 0.8rem 0.2rem;
  border-bottom: 1px solid var(--hairline);
  color: var(--dim);
  transition: background 0.3s, padding-left 0.3s, color 0.3s;
}
.trenches li:hover {
  background: rgba(110, 244, 255, 0.06);
  padding-left: 0.9rem;
  color: var(--ink);
}
.trenches li b { color: var(--ink); font-weight: 600; }
.trenches li .d {
  color: var(--cyan);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.trenches li.here { color: var(--ink); }
.trenches li.here .d { color: var(--amber); }
.trenches li .tag {
  font-size: 0.52rem;
  color: var(--amber);
  letter-spacing: 0.18em;
  margin-left: 0.6rem;
}

/* bottom */
.bottom {
  min-height: 130vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10rem 0 6rem;
  max-width: 1180px;
}
.bottom h2 {
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.cta-row {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.4rem;
}
.btn-big {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-decoration: none;
  color: #140a00;
  background: var(--amber);
  padding: 1.05em 1.8em;
  border-radius: 3px;
  box-shadow: 0 0 26px rgba(255, 176, 87, 0.35);
  transition: transform 0.25s, box-shadow 0.25s;
}
.btn-big:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(255, 176, 87, 0.55); }
.btn-ghost {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(110, 244, 255, 0.4);
  padding-bottom: 0.3em;
  transition: border-color 0.25s;
}
.btn-ghost:hover { border-color: var(--cyan); }

/* footer */
.site-foot {
  position: relative;
  z-index: 10;
  padding: 2.4rem clamp(1.2rem, 4vw, 4rem) 3.4rem;
  padding-left: var(--rail);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  border-top: 1px solid rgba(110, 244, 255, 0.08);
}
.site-foot a { color: var(--dim); text-decoration: none; }
.site-foot a:hover { color: var(--cyan); }

/* page-load sequence: the hero surfaces, everything below is already there */
.hero > * { opacity: 0; transform: translateY(22px); animation: rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.hero .eyebrow { animation-delay: 0.15s; }
.hero h1 { animation-delay: 0.3s; }
.hero .lede { animation-delay: 0.55s; }
.hero .descend-cue { animation-delay: 0.85s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .hero > * { animation: none; opacity: 1; transform: none; }
}

/* zone-change blink on the HUD */
.hud-zone.blink #hud-zone { animation: zblink 0.9s steps(2, jump-none) 2; }
@keyframes zblink { 50% { color: #fff; text-shadow: 0 0 12px rgba(255, 176, 87, 0.9); } }

/* ---------- guide page ---------- */
.guide-wrap {
  position: relative;
  z-index: 10;
  max-width: 880px;
  margin: 0 auto;
  padding: 7rem 1.4rem 6rem;
}
.guide-wrap h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: 1rem;
}
.guide-wrap h2 {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  color: var(--amber);
  margin: 3.6rem 0 1.2rem;
}
.guide-wrap p { color: var(--dim); max-width: 62ch; margin-bottom: 1rem; }
.guide-wrap p strong, .guide-wrap li strong { color: var(--ink); font-weight: 600; }
.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.8rem;
  margin: 1.4rem 0;
}
.swatch {
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: hidden;
}
.swatch i { display: block; height: 56px; }
.swatch span {
  display: block;
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  color: var(--dim);
  padding: 0.55rem 0.6rem;
  line-height: 1.5;
}
.guide-wrap pre {
  background: rgba(110, 244, 255, 0.05);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  margin: 1.2rem 0 1.6rem;
}
.guide-wrap code {
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1.75;
  color: var(--cyan);
}
.guide-wrap ol, .guide-wrap ul { margin: 0.6rem 0 1.4rem 1.2rem; color: var(--dim); }
.guide-wrap li { margin-bottom: 0.7rem; max-width: 60ch; }
.guide-wrap li::marker { font-family: var(--mono); font-size: 0.7rem; color: var(--amber); }
.pass-list { list-style: none; margin-left: 0; }
.pass-list li {
  border-left: 2px solid rgba(255, 176, 87, 0.4);
  padding-left: 1.1rem;
  margin-bottom: 1.1rem;
}
.pass-list .p-name {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: var(--amber);
  display: block;
  margin-bottom: 0.3rem;
}
.back-link {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--cyan);
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }
.type-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
  margin: 1.4rem 0;
}
.type-card {
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 1.2rem;
}
.type-card .sample { font-size: 1.9rem; line-height: 1.15; }
.type-card .sample.m { font-family: var(--mono); font-size: 1.15rem; color: var(--cyan); }
.type-card .who {
  display: block;
  margin-top: 0.8rem;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  color: var(--faint);
  line-height: 1.7;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  :root { --rail: 0px; }
  .hud { display: none; }
  .hud-bar { display: flex; }
  main { padding-left: clamp(1.2rem, 5vw, 2rem); }
  .site-foot { padding-left: clamp(1.2rem, 5vw, 2rem); padding-bottom: 4.6rem; }
  .zone { min-height: 100vh; padding: 6rem 0; }
  .stats { grid-template-columns: 1fr; max-width: 480px; }
  .spec dl { grid-template-columns: 1fr; }
  .spec dt { padding-bottom: 0; border-top: 1px solid rgba(255, 176, 87, 0.14); }
  .spec dd { border-top: 0; padding-left: 1.2rem; padding-bottom: 0.7rem; }
  .trenches li { grid-template-columns: 1fr; gap: 0.2rem; }
  .nav-link.hide-s { display: none; }
}
