/* Deeplight project page. One typeface (Schibsted Grotesk, OFL, self-hosted).
   The page sinks from fjord surface to 300 m: the background darkens with depth,
   and an echo-sounder style depth scale on the left reads out how deep you are. */

@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(../fonts/schibsted-grotesk-latin.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: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(../fonts/schibsted-grotesk-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: "Schibsted Grotesk"; font-style: italic; font-weight: 400 900; font-display: swap;
  src: url(../fonts/schibsted-grotesk-latin-italic.woff2) format("woff2"); }

:root {
  --surface: #17414f;     /* fjord surface, the top of the page */
  --mid: #0a2230;         /* 100-200 m */
  --deep: #03090e;        /* 300 m */
  --ink: #dde8ef;         /* body text */
  --ink-dim: #93adbc;     /* secondary text, captions */
  --glow: #3f7dff;        /* the LED's blue, for light and links */
  --glow-soft: rgba(63, 125, 255, .18);
  --rule: rgba(221, 232, 239, .13);
  --gutter: clamp(16px, 4vw, 40px);
  --rail: 132px;          /* left column that carries the depth numbers on wide screens */
  --measure: 64ch;
  color-scheme: dark;
}

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

body {
  margin: 0;
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--deep) linear-gradient(180deg, var(--surface) 0, #0f3140 900px, var(--mid) 2600px, #06141d 5200px, var(--deep) 7600px) no-repeat;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}

a { color: #9ec0ff; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #cfe0ff; }
:focus-visible { outline: 2px solid #9ec0ff; outline-offset: 3px; border-radius: 4px; }
em, i, .latin { font-style: italic; }
img, video { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
figcaption { font-size: .875rem; line-height: 1.5; color: var(--ink-dim); margin-top: .6rem; max-width: var(--measure); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--deep); color: var(--ink); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- depth scale (echo-sounder style), wide screens only ---------- */
.sounder { display: none; }
@media (min-width: 1100px) {
  .sounder { display: block; position: fixed; left: 28px; top: 12vh; bottom: 12vh; width: 56px; z-index: 2; pointer-events: none; }
  .sounder-scale { position: absolute; left: 34px; top: 0; bottom: 0; width: 1px; background: var(--rule); }
  .sounder-tick { position: absolute; left: 0; width: 34px; text-align: right; padding-right: 8px; transform: translateY(-.65em);
    font-size: .75rem; color: var(--ink-dim); font-variant-numeric: tabular-nums; opacity: .7; }
  .sounder-tick::after { content: ""; position: absolute; right: -6px; top: .65em; width: 6px; height: 1px; background: var(--ink-dim); opacity: .6; }
  .sounder-mark { position: absolute; left: 30px; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%;
    background: var(--glow); box-shadow: 0 0 10px 3px var(--glow-soft), 0 0 2px #cfe0ff; }
  .sounder-read { position: absolute; left: 44px; transform: translateY(-.7em); font-size: .8125rem; font-weight: 600; color: #cfe0ff;
    font-variant-numeric: tabular-nums; white-space: nowrap; }
}

/* ---------- layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 1100px) { .wrap { padding-left: calc(var(--rail) + 24px); } }

section { padding: clamp(64px, 10vw, 128px) 0 0; }
.sec-head { position: relative; max-width: var(--measure); }
.depth { font-size: .875rem; font-weight: 600; color: var(--ink-dim); font-variant-numeric: tabular-nums; margin: 0 0 .4rem; }
@media (min-width: 1100px) {
  .depth { position: absolute; left: calc(-1 * var(--rail)); top: .55rem; width: calc(var(--rail) - 28px); text-align: right; margin: 0; }
}
h1, h2, h3 { color: #f3f8fb; line-height: 1.12; margin: 0; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); font-weight: 760; letter-spacing: -.015em; }
h3 { font-size: 1.25rem; font-weight: 680; letter-spacing: -.005em; }
.prose { max-width: var(--measure); }
.prose p { margin: 1rem 0 0; }
.lede { font-size: 1.1875rem; color: #e7f0f5; }

/* ---------- hero ---------- */
.hero { min-height: 100svh; display: grid; align-items: center; padding: 0; position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: clamp(24px, 6vw, 88px); align-items: start; }
.hero-stick { position: relative; height: min(88svh, 760px); }
.hero-stick canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.hero-text { padding-top: clamp(80px, 18svh, 200px); }
.hero h1 { font-size: clamp(2.5rem, 6.2vw, 5.2rem); font-weight: 820; letter-spacing: -.03em; line-height: .98; max-width: 13ch; }
.hero .lede { margin-top: 1.5rem; max-width: 52ch; }
.hero-note { font-size: .875rem; color: var(--ink-dim); margin-top: 1.25rem; max-width: 46ch; }
.cta { display: inline-flex; align-items: center; gap: .6rem; margin-top: 1.75rem; padding: .75rem 1.25rem; border-radius: 999px;
  border: 1px solid rgba(63, 125, 255, .6); color: #e9f1ff; text-decoration: none; font-weight: 620;
  background: rgba(63, 125, 255, .1); box-shadow: 0 0 24px rgba(63, 125, 255, .18); }
.cta:hover { background: rgba(63, 125, 255, .2); color: #fff; }
@media (max-width: 720px) {
  .hero { min-height: auto; padding-top: 24px; }
  .hero-grid { grid-template-columns: 96px 1fr; gap: 18px; }
  .hero-stick { height: 460px; }
  .hero-text { padding-top: 140px; }
}

/* ---------- patterns as field-guide entries ---------- */
.species { list-style: none; margin: 2.5rem 0 0; padding: 0; max-width: 980px; }
.sp { display: grid; grid-template-columns: 120px 1fr; gap: clamp(18px, 4vw, 44px); padding: 2rem 0; border-top: 1px solid var(--rule); }
.sp:last-child { border-bottom: 1px solid var(--rule); }
.sp-stick { height: 260px; position: relative; }
@media (max-width: 560px) { .sp { grid-template-columns: 72px 1fr; gap: 14px; } .sp-stick { height: 210px; } }
.sp-stick canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sp-play { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); font: inherit; font-size: .75rem; color: var(--ink-dim);
  background: none; border: 1px solid var(--rule); border-radius: 999px; padding: 2px 10px; cursor: pointer; display: none; }
.reduced .sp-play { display: block; }
.sp-name { font-size: 1.5rem; font-weight: 640; font-style: italic; color: #f3f8fb; margin: 0; letter-spacing: -.01em; }
.sp-common { color: var(--ink-dim); margin: .15rem 0 0; }
.sp-body { max-width: var(--measure); }
.sp-body p { margin: .8rem 0 0; }
.sp-src { font-size: .9375rem; color: var(--ink-dim); }
.sp-mode { font-weight: 640; color: #cfe0ff; font-style: normal; }

/* ---------- measurement ---------- */
.kymo { margin-top: 2.5rem; max-width: 980px; }
.kymo-img { position: relative; border-radius: 6px; overflow: hidden; border: 1px solid var(--rule); }
.kymo-img img { width: 100%; image-rendering: auto; }
.kymo-axis { position: relative; height: 1.4em; font-size: .75rem; color: var(--ink-dim); font-variant-numeric: tabular-nums; margin-top: .3rem; }
.kymo-axis span { position: absolute; top: 0; transform: translateX(-50%); }
.kymo-axis span:first-child { transform: none; } .kymo-axis span:last-child { transform: translateX(-100%); }
.chart { margin-top: 2.5rem; max-width: 980px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--ink-dim); font-size: 12px; font-family: inherit; }
.legend { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: .875rem; color: var(--ink-dim); margin-top: .75rem; }
.legend span::before { content: ""; display: inline-block; width: 22px; height: 0; border-top: 2px solid #9ec0ff; vertical-align: middle; margin-right: .5rem; }
.legend .stick::before { border-top-style: dashed; border-color: #f0c674; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem 2rem; margin: 2.5rem 0 0; max-width: 980px; padding: 0; list-style: none; }
.facts li { border-left: 2px solid var(--glow); padding-left: .9rem; }
.facts b { display: block; font-size: 1.6rem; color: #f3f8fb; font-weight: 720; font-variant-numeric: tabular-nums; line-height: 1.1; }
.facts span { font-size: .9rem; color: var(--ink-dim); }

/* ---------- build ---------- */
.step { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; margin-top: 3.5rem; max-width: 1040px; }
.step > *, .gallery > *, .sp > * { min-width: 0; }
.step h3 { max-width: var(--measure); }
.step .prose p:first-child { margin-top: .5rem; }
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.gallery.wide { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.gallery figure img, .gallery video { width: 100%; border-radius: 6px; background: #06121a; }
.gallery .tall img, .gallery video { aspect-ratio: 3 / 4; object-fit: cover; }
.render { background: #0b1d27; border: 1px solid var(--rule); border-radius: 6px; padding: 14px; }
.render img { border-radius: 3px; }
.drawing { max-width: 820px; }
.section-drawing { max-width: 600px; }
.drawing svg { width: 100%; height: auto; }
.drawing svg text { fill: #cfdde6; font-family: "Schibsted Grotesk", system-ui, sans-serif; }

/* ---------- app ---------- */
.app-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)) minmax(0, 1fr); gap: clamp(16px, 3vw, 36px); margin-top: 2.5rem; align-items: start; max-width: 1040px; }
.app-grid img { border-radius: 26px; border: 1px solid var(--rule); }
.app-grid .prose p:first-child { margin-top: 0; }
@media (max-width: 860px) { .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .app-grid .prose { grid-column: 1 / -1; } }

/* ---------- log ---------- */
.log { list-style: none; margin: 2.5rem 0 0; padding: 0; max-width: 820px; }
.log li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1.25rem; padding: 1rem 0; border-top: 1px solid var(--rule); }
.log time, .log .when { font-variant-numeric: tabular-nums; color: var(--ink-dim); font-weight: 600; font-size: .9375rem; padding-top: .1rem; }
.log .next .when { color: #9ec0ff; }
.log p { margin: 0; }
@media (max-width: 560px) { .log li { grid-template-columns: 1fr; gap: .2rem; } }

/* ---------- sources ---------- */
.sources { max-width: var(--measure); margin: 2rem 0 0; padding: 0; list-style: none; }
.sources li { padding: .7rem 0; border-top: 1px solid var(--rule); font-size: .9375rem; color: var(--ink-dim); }
.sources li b { color: var(--ink); font-weight: 600; }

footer { padding: clamp(64px, 10vw, 120px) 0 64px; }
footer .small { font-size: .875rem; color: var(--ink-dim); max-width: var(--measure); }
