/* Craner Labs. Black, and one long descent: the page starts in orbit above
   a planet's horizon and sinks through the ocean zones to the Challenger
   Deep. The stars, marine snow and bioluminescence are drawn by
   assets/site.js on one fixed canvas that sits under the content. */

:root {
  --ink: #EEF1F5;
  --text: #A9B1BC;
  --muted: #7C8591;
  --hair: rgba(255, 255, 255, 0.12);
  --hair-strong: rgba(255, 255, 255, 0.22);
  --glow: #7FD8FF;
  --glow-violet: #8E9BFF;
  --sea-top: #071A2B;

  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --edge: 16px;                    /* header and gauge inset */
  --gutter: 16px;                  /* content inset; wide enough on desktop to clear the gauge */
  --measure: 1040px;
  --horizon: max(16vh, 8vw);       /* how much of the planet shows at the bottom of the first screen */

  color-scheme: dark;
}
@media (min-width: 640px) {
  :root { --edge: 32px; --gutter: 32px; }
}
@media (min-width: 1200px) {
  :root { --edge: 40px; --gutter: 176px; }
}

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

html {
  background: #000;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #000;
  color: var(--text);
  font: 350 1rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

a { color: inherit; }
img { max-width: 100%; }
::selection { background: rgba(127, 216, 255, 0.28); color: #fff; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 4px; border-radius: 6px; }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #000;
  font: 500 14px/1 var(--sans);
  text-decoration: none;
}
.skip:focus { top: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The canvas paints above the page backgrounds and below the content. */
.sky {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
}

/* ---------- Type ---------- */

.eyebrow {
  margin: 0 0 20px;
  font: 400 11.5px/1.4 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.readout {
  font: 400 11px/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

h1, h2, .floor-title {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.02em;
}

h1 em, h2 em, .floor-title em {
  font-style: italic;
  padding-right: 0.08em;
  background: linear-gradient(105deg, var(--ink) 0%, #BFE6FF 45%, var(--glow-violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1px solid var(--hair-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font: 450 15px/1 var(--sans);
  text-decoration: none;
  transition: border-color 0.25s, background-color 0.25s, box-shadow 0.25s;
}
.button span { transition: transform 0.25s; }
.button:hover {
  border-color: rgba(127, 216, 255, 0.7);
  background: rgba(127, 216, 255, 0.06);
  box-shadow: 0 0 0 4px rgba(127, 216, 255, 0.07), 0 0 32px rgba(127, 216, 255, 0.22);
}
.button:hover span { transform: translate(2px, -2px); }
.button-quiet:hover span { transform: translateY(-3px); }
.button:focus-visible { border-radius: 999px; }

/* ---------- Header ---------- */

.top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(18px, env(safe-area-inset-top)) var(--edge) 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.mark { width: 24px; height: 24px; flex: none; overflow: visible; }
.mark-ring, .mark-horizon { fill: none; stroke: var(--ink); stroke-width: 1.3; }
.mark-sea { fill: rgba(127, 216, 255, 0.22); }
.mark-star { fill: var(--glow); }

.top-link {
  padding: 10px 0;
  color: var(--text);
  font: 400 11.5px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}
.top-link:hover { color: var(--ink); }

/* ---------- Orbit: the first screen ---------- */

.orbit {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 128px 0 calc(var(--horizon) + 112px);
  overflow: hidden;
}

.orbit-copy {
  position: relative;
  z-index: 2;
  width: min(var(--measure), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

h1 {
  margin: 0 0 28px;
  font-size: clamp(3.6rem, 1.4rem + 9vw, 9.5rem);
  line-height: 0.9;
}

.lede {
  max-width: 36rem;
  margin: 0;
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
  font-weight: 300;
  line-height: 1.65;
}

.descend {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(var(--horizon) + 32px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}
.descend:hover { color: var(--ink); }
.descend::after {
  content: "";
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, transparent 0%, var(--glow) 50%, transparent 100%) 0 0 / 100% 300% no-repeat;
  animation: drip 2.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes drip {
  from { background-position: 0 100%; }
  to { background-position: 0 0%; }
}

/* The planet: a huge disc whose top shows at the bottom of the first screen.
   Its colour runs straight on into the sea below, so the horizon is the surface. */
.planet {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: calc(100% - var(--horizon));
  width: 400vw;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(180deg, #0F2F4D 0, var(--sea-top) 11vh);
  box-shadow:
    inset 0 1px 0 rgba(205, 232, 255, 0.55),
    inset 0 10px 40px rgba(120, 185, 255, 0.22),
    0 -1px 24px rgba(120, 185, 255, 0.35),
    0 -12px 120px rgba(70, 120, 255, 0.22);
}

/* Sunrise on the limb. */
.orbit::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: calc(var(--horizon) - 40px);
  width: min(80vw, 1000px);
  height: 80px;
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(235, 245, 255, 0.5) 0%, rgba(150, 205, 255, 0.2) 30%, rgba(80, 140, 255, 0.06) 60%, transparent 100%);
  mix-blend-mode: screen;
  pointer-events: none;
}

/* ---------- The sea ---------- */

/* Not positioned, so its background paints under the canvas. */
.sea {
  background:
    radial-gradient(140% 70vh at 50% 0, rgba(56, 128, 200, 0.18), transparent 70%),
    linear-gradient(180deg, var(--sea-top) 0, #06172A 25vh, #041120 70vh, #020912 140vh, #01040A 220vh, #000 320vh);
}
.sea > * { position: relative; z-index: 1; }

.sea-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(170, 215, 255, 0.35) 25%, rgba(170, 215, 255, 0.35) 75%, transparent);
}
.sea-line .readout {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  color: rgba(170, 215, 255, 0.7);
}

.work, .experience, .floor {
  width: min(var(--measure), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

h2 {
  margin: 0 0 24px;
  font-size: clamp(3rem, 1.8rem + 4.5vw, 6.25rem);
  line-height: 0.95;
}

/* Latest project */

.work {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
  padding: clamp(120px, 22vh, 220px) 0 clamp(80px, 14vh, 160px);
}

.work-tg { padding-top: clamp(40px, 8vh, 96px); }
.screens {
  position: relative;
  margin: 0 0 0 auto;
  width: 100%;
  max-width: 560px;
}
.screens-stack { position: relative; padding-bottom: 48px; }
.screens img { display: block; height: auto; }
.screens-web {
  width: 88%;
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--hair), 0 40px 90px -30px rgba(0, 0, 0, 0.9);
}
.screens-phone {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 30%;
  border-radius: 18px;
  box-shadow: 0 0 0 5px #0A0D11, 0 0 0 6px rgba(255, 255, 255, 0.1), 0 30px 60px -20px rgba(0, 0, 0, 0.9);
}
.screens figcaption { margin-top: 20px; text-align: center; }

.work-copy > p:not(.eyebrow) { max-width: 38rem; }

.work-copy > p:not(.eyebrow) {
  max-width: 31rem;
  margin: 0 0 32px;
  font-size: 1.075rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 16px 28px;
  max-width: 31rem;
  margin: 0 0 36px;
  padding: 18px 0 0;
  border-top: 1px solid var(--hair);
}
.facts dt {
  margin-bottom: 6px;
  font: 400 10.5px/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.4;
}

.device {
  position: relative;
  justify-self: center;
  width: min(300px, 72vw);
  margin: 0;
}
.device-glow {
  position: absolute;
  left: 8%;
  top: 6%;
  width: 84%;
  height: auto;
  transform: scale(1.08);
  filter: blur(56px) saturate(1.6);
  opacity: 0.5;
  pointer-events: none;
}
.device-frame {
  position: relative;
  padding: 9px;
  border-radius: 42px;
  background: linear-gradient(155deg, #1B2129 0%, #0A0D11 45%, #050608 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 40px 90px -20px rgba(0, 0, 0, 0.8);
}
.device-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 34px;
}
.device figcaption {
  margin-top: 20px;
  text-align: center;
}

.specimens {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 28px);
  margin: clamp(24px, 6vh, 64px) 0 0;
  padding: 0;
  list-style: none;
}
.specimens figure { margin: 0; }
.specimens img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 0 0 1px var(--hair), 0 30px 70px -30px rgba(0, 0, 0, 0.9);
}
.specimens figcaption { margin-top: 16px; }
.specimens h3 {
  margin: 0 0 4px;
  font: 400 1.6rem/1.1 var(--serif);
  color: var(--ink);
}
.specimens p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* Experience */

.experience { padding: clamp(100px, 18vh, 200px) 0; }
.experience h2 { max-width: 12em; }
.experience-intro {
  max-width: 34rem;
  margin: 0 0 clamp(40px, 7vh, 72px);
  font-size: 1.075rem;
}

.experience-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hair);
}
.experience-list li {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: baseline;
  gap: 24px;
  padding: 30px 0;
  border-bottom: 1px solid var(--hair);
}
.experience-list .readout { color: var(--glow); }
.experience-list h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font: 450 1.35rem/1.25 var(--sans);
  letter-spacing: -0.01em;
}
.experience-list h3:last-child { margin-bottom: 0; }
.experience-list p { max-width: 38rem; margin: 0; }

/* The floor */

.floor {
  padding: clamp(160px, 34vh, 360px) 0 calc(28px + env(safe-area-inset-bottom));
  text-align: center;
}
.floor-title {
  margin: 0 0 20px;
  font-size: clamp(2.8rem, 1.8rem + 4.5vw, 6rem);
  line-height: 1;
}
.floor-note { max-width: 28rem; margin: 0 auto 40px; }

.floor-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: clamp(120px, 22vh, 220px);
  padding-top: 22px;
  border-top: 1px solid var(--hair);
  color: var(--muted);
  font: 400 11px/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.floor-legal p { margin: 0; }

/* ---------- Gauge ---------- */

/* Shown once the script runs. A pill at the bottom on phones and laptops,
   a depth scale down the right edge on wide screens. */
.gauge { display: none; }
.gauge p { margin: 0; }
.gauge-track { display: none; }

.js .gauge {
  position: fixed;
  z-index: 5;
  left: var(--edge);
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 14px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-family: var(--mono);
  text-transform: uppercase;
  pointer-events: none;
}
.gauge-value {
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}
.gauge-zone {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.16em;
}

@media (max-width: 1199px) {
  .floor { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}

@media (min-width: 1200px) {
  .js .gauge {
    left: auto;
    right: var(--edge);
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    padding: 0;
    border: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gauge-value { order: 1; font-size: 13px; }
  .gauge-zone { order: 2; margin-top: 6px; }
  .gauge-track {
    order: 3;
    display: block;
    position: relative;
    width: 12px;
    height: 44vh;
    margin-top: 22px;
  }
  .gauge-track::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 1px;
    background: var(--hair-strong);
  }
  .gauge-track::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 6px;
    background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.2) 0 1px, transparent 1px 11px);
  }
  .gauge-sea {
    position: absolute;
    z-index: 1;
    right: 0;
    top: calc(var(--sea, 0.2) * 100%);
    width: 18px;
    height: 1px;
    background: rgba(170, 215, 255, 0.75);
  }
  .gauge-marker {
    position: absolute;
    z-index: 2;
    right: -4px;
    top: calc(var(--p, 0) * 100%);
    width: 9px;
    height: 9px;
    margin-top: -4.5px;
    border-radius: 50%;
    background: var(--glow);
    box-shadow: 0 0 0 3px rgba(127, 216, 255, 0.15), 0 0 14px rgba(127, 216, 255, 0.8);
  }
}

/* ---------- Smaller screens ---------- */

@media (max-width: 899px) {
  .work { grid-template-columns: minmax(0, 1fr); }
  .device { margin-top: 16px; }
  .screens { margin: 16px auto 0; }
  /* A swipeable row on phones, so the next flower peeks in from the edge. */
  .specimens {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(68%, 280px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .specimens::-webkit-scrollbar { display: none; }
  .specimens li { scroll-snap-align: start; }
}

@media (max-width: 639px) {
  .orbit { padding-top: 112px; }
  .top-link { font-size: 10.5px; letter-spacing: 0.1em; }
  .experience-list li { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 26px 0; }
}

/* ---------- 404 ---------- */

.lost .orbit { padding-bottom: 128px; }
.lost .orbit::after { display: none; }
.lost h1 { font-size: clamp(3.2rem, 1.4rem + 7vw, 7.5rem); }
.lost .lede { margin-bottom: 40px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .descend::after { animation: none; background-position: 0 50%; }
  .button, .button span, .descend, .top-link { transition: none; }
}
