/* Departed — landing page. Plain CSS, no framework, nothing loaded from elsewhere. */

@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

/* ── Tokens ──────────────────────────────────────────────────────
   Dusk is the default. Light preference gets the same scene at dawn. */
:root {
  color-scheme: dark;
  --bg: #05070c;
  --bg-deep: #04060a;
  --fg: #eceef4;
  --fg-soft: #b4bac9;
  --muted-fg: #8b91a3;
  --panel: #10141f;
  --panel-border: rgba(255, 255, 255, .10);
  --rule: rgba(255, 255, 255, .09);
  --accent: #fbc711;
  --accent-text: #fbc711;
  --on-accent: #3d3005;
  --accent-hover: #ffd442;

  /* the scene */
  --sky-1: #060a14;
  --sky-2: #101a33;
  --sky-3: #3a2b46;
  --sky-4: #7a4a54;
  --glow-1: #ffb46a;
  --glow-2: #a85a5e;
  --glow-o1: .5;
  --glow-o2: .22;
  --hill-far: #26293f;
  --hill-mid: #151829;
  --hill-near: #080a12;
  --ground-far: #1c2033;
  --ground-near: #101320;
  --mist: #cbd6f0;
  --mist-o: .09;
  --mote: #ffe9b0;
  --env: #171b28;
  --house: #05070c;
  --house-dark: #020306;
  --env-line: rgba(255, 255, 255, .16);
  --scrim: linear-gradient(97deg, rgba(6,10,20,.94) 0%, rgba(6,10,20,.82) 30%, rgba(6,10,20,.34) 58%, rgba(6,10,20,0) 78%);
  --scrim-foot: linear-gradient(180deg, rgba(5,7,12,0) 76%, var(--bg) 100%);

  --radius: .875rem;
  --panel-radius: 1.375rem;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f7f4ef;
    --bg-deep: #f2ede6;
    --fg: #14161d;
    --fg-soft: #3f4552;
    --muted-fg: #5c6270;
    --panel: #ffffff;
    --panel-border: rgba(24, 24, 40, .12);
    --rule: rgba(24, 24, 40, .12);
    --accent-text: #8a6702;
    --on-accent: #4a3a04;

    --sky-1: #a8bcd8;
    --sky-2: #c9d3e2;
    --sky-3: #f0dfd0;
    --sky-4: #f9e2bd;
    --glow-1: #ffd9a0;
    --glow-2: #f0b48a;
    --glow-o1: .55;
    --glow-o2: .3;
    --hill-far: #98a4bb;
    --hill-mid: #6f7d96;
    --hill-near: #4a5468;
    --ground-far: #a8b4c8;
    --ground-near: #7d8ba3;
    --mist: #ffffff;
    --mist-o: .38;
    --mote: #ffffff;
    --env: #ffffff;
    --house: #3b4356;
    --house-dark: #2b3243;
    --env-line: rgba(24, 24, 40, .22);
    --scrim: linear-gradient(97deg, rgba(247,244,239,.94) 0%, rgba(247,244,239,.82) 30%, rgba(247,244,239,.32) 58%, rgba(247,244,239,0) 78%);
    --scrim-foot: linear-gradient(180deg, rgba(247,244,239,0) 76%, var(--bg) 100%);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.022em; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; }

.skip {
  position: absolute; left: -9999px; top: .5rem; z-index: 50;
  background: var(--accent); color: var(--on-accent);
  padding: .625rem 1rem; border-radius: var(--radius); font-weight: 700;
}
.skip:focus { left: .75rem; }

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

/* ── Beta bar and header ────────────────────────────────────────── */
.topstack { position: absolute; inset: 0 0 auto; z-index: 10; }
.beta {
  background: var(--panel); border-bottom: 1px solid var(--rule);
  padding: .75rem clamp(1.25rem, 4vw, 3rem);
  font-size: .875rem; color: var(--fg-soft); line-height: 1.55;
}
.beta .tag {
  display: inline-block; margin-right: .625rem;
  background: var(--accent-container); color: var(--on-accent-container);
  font-size: .6875rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  padding: .1875rem .5rem; border-radius: 999px;
}
.site {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
}
.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; letter-spacing: -.01em; text-decoration: none; font-size: 1.0625rem;
}
.brand svg { color: var(--accent); }
.site nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 1.9rem); }
.site nav a {
  text-decoration: none; font-size: .9375rem; font-weight: 500;
  color: var(--fg-soft); padding: .375rem 0;
  border-bottom: 1px solid transparent; transition: color .2s, border-color .2s;
}
.site nav a:hover { color: var(--fg); border-bottom-color: var(--accent); }
.site nav .nav-cta { color: var(--fg); font-weight: 600; }
@media (max-width: 46rem) {
  .site nav a:not(.nav-cta) { display: none; }
}

/* ── Hero ───────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: min(100svh, 62rem);
  display: grid; align-items: center;
  padding: clamp(11rem, 22vh, 14rem) clamp(1.25rem, 4vw, 3rem) clamp(5rem, 12vh, 9rem);
  isolation: isolate;
}
.scene { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.scene::after { content: ""; position: absolute; inset: 0; background: var(--scrim); }
.scene::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--scrim-foot); }
.sky { position: absolute; inset: 0; width: 100%; height: 100%; }

.sky-1 { stop-color: var(--sky-1); }
.sky-2 { stop-color: var(--sky-2); }
.sky-3 { stop-color: var(--sky-3); }
.sky-4 { stop-color: var(--sky-4); }
.glow-1 { stop-color: var(--glow-1); stop-opacity: var(--glow-o1); }
.glow-2 { stop-color: var(--glow-2); stop-opacity: var(--glow-o2); }
.glow-3 { stop-color: var(--glow-2); stop-opacity: 0; }

.horizon-glow { animation: breathe 19s ease-in-out infinite; transform-origin: 1010px 690px; }
@keyframes breathe {
  0%, 100% { opacity: .82; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.05); }
}

.hill { transform-box: fill-box; }
.hill.far  { fill: var(--hill-far);  animation: sway 61s ease-in-out infinite; }
.hill.mid  { fill: var(--hill-mid);  animation: sway 43s ease-in-out infinite reverse; }
.hill.near { fill: var(--hill-near); animation: sway 79s ease-in-out infinite; }
@keyframes sway {
  0%, 100% { transform: translate3d(-9px, 0, 0); }
  50%      { transform: translate3d(9px, 1px, 0); }
}

.mist ellipse { fill: var(--mist); opacity: var(--mist-o); }
.mist .m1 { animation: drift 74s linear infinite; }
.mist .m2 { animation: drift 108s linear infinite reverse; }
.mist .m3 { animation: drift 91s linear infinite; }
@keyframes drift {
  from { transform: translate3d(-340px, 0, 0); }
  to   { transform: translate3d(340px, 0, 0); }
}

.lamp-core { fill: #fff3cf; animation: flicker 7s ease-in-out infinite; }
.lamp-halo { animation: flicker 7s ease-in-out infinite; }
@keyframes flicker {
  0%, 100% { opacity: .92; }
  38%      { opacity: 1; }
  63%      { opacity: .8; }
}

/* the check-in, made visible: a signal every ten seconds */
.ring { stroke: var(--accent); stroke-width: 1.2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.ring.r1 { animation: signal 10s ease-out infinite; }
.ring.r2 { animation: signal 10s ease-out infinite 1.5s; }
@keyframes signal {
  0%       { transform: scale(.35); opacity: 0; }
  6%       { opacity: .55; }
  55%, 100% { transform: scale(6.5); opacity: 0; }
}

.motes { position: absolute; inset: 0; overflow: hidden; }
.motes i {
  position: absolute; bottom: -6vh;
  width: var(--size); height: var(--size);
  background: var(--mote); border-radius: 50%; opacity: 0;
  animation: rise var(--dur) linear infinite var(--delay);
}
@keyframes rise {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  12%  { opacity: var(--peak); }
  78%  { opacity: var(--peak); }
  100% { transform: translate3d(var(--drift), -104vh, 0); opacity: 0; }
}

.hero-copy { position: relative; max-width: 42rem; }
.hero h1 {
  font-size: clamp(2.25rem, 6.2vw, 4.125rem);
  font-weight: 600; line-height: 1.08; letter-spacing: -.035em;
  text-wrap: balance;
}
.lede {
  margin-top: 1.75rem; max-width: 34rem;
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem); color: var(--fg-soft);
}
.cta { display: flex; flex-wrap: wrap; gap: .875rem; margin-top: 2.5rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: .8125rem 1.625rem;
  border-radius: var(--radius); text-decoration: none;
  font-weight: 700; font-size: .9375rem; letter-spacing: .005em;
  border: 1px solid transparent; transition: background .2s, border-color .2s, color .2s;
}
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { border-color: var(--rule); color: var(--fg); }
.btn.ghost:hover { border-color: var(--fg-soft); }

  35%, 65% { opacity: 1; }
  100%     { transform: translateY(3.6rem); opacity: 0; }
}
/* On a narrow screen the copy fills the width, so the scrim falls from the top
   instead of the side and the horizon stays visible underneath. */
@media (max-width: 52rem) {
  :root {
    --scrim: linear-gradient(180deg, rgba(6,10,20,.9) 0%, rgba(6,10,20,.78) 40%, rgba(6,10,20,.2) 74%, rgba(6,10,20,0) 90%);
  }
  @media (prefers-color-scheme: light) {
    :root { --scrim: linear-gradient(180deg, rgba(247,244,239,.9) 0%, rgba(247,244,239,.78) 40%, rgba(247,244,239,.2) 74%, rgba(247,244,239,0) 90%); }
  }
  .hero h1 br { display: none; }
}

/* ── Shared rhythm ──────────────────────────────────────────────── */
section { padding-inline: clamp(1.25rem, 4vw, 3rem); }
.opening, .how, .sealed, .app, .care, .home, .run { max-width: 74rem; margin-inline: auto; }

.reveal {
  opacity: 0; transform: translate3d(0, 1.25rem, 0);
  transition: opacity .85s var(--ease), transform .85s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Creed ──────────────────────────────────────────────────────── */
.opening { padding-block: clamp(4.5rem, 12vh, 8rem); }
.opening p {
  max-width: 34rem;
  font-size: clamp(1.3125rem, 2.7vw, 1.75rem);
  font-weight: 500; line-height: 1.45; letter-spacing: -.018em;
}

/* ── Timeline ───────────────────────────────────────────────────── */
.how { padding-block: 0 clamp(4rem, 9vh, 7rem); }
.head { max-width: 38rem; margin-bottom: clamp(2.5rem, 6vh, 4rem); }
.head h2, .sealed h2, .home h2, .run h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.625rem); letter-spacing: -.03em;
}
.head p { margin-top: 1rem; color: var(--fg-soft); }

.timeline { list-style: none; margin: 0; padding: 0; max-width: 46rem; }
.step { display: grid; grid-template-columns: 2.25rem 1fr; gap: clamp(1.25rem, 3vw, 2.25rem); }
.rail { position: relative; display: block; }
.rail::before {
  content: ""; position: absolute; left: 50%; top: .75rem; bottom: 0;
  width: 1px; translate: -50% 0; background: var(--rule);
  transform: scaleY(0); transform-origin: top;
  transition: transform 1.1s var(--ease) .15s;
}
.step.in .rail::before { transform: scaleY(1); }
.step.last .rail::before { display: none; }
.dot {
  position: absolute; left: 50%; top: .5rem; translate: -50% 0;
  width: .625rem; height: .625rem; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 0 rgba(251, 199, 17, .4);
  transform: scale(0); transition: transform .5s var(--ease);
}
.step.in .dot { transform: scale(1); }
.step.in .dot { animation: halo 4.5s ease-out infinite 1s; }
@keyframes halo {
  0%      { box-shadow: 0 0 0 0 rgba(251, 199, 17, .35); }
  70%     { box-shadow: 0 0 0 12px rgba(251, 199, 17, 0); }
  100%    { box-shadow: 0 0 0 0 rgba(251, 199, 17, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .dot { transform: scale(1); animation: none; }
  .rail::before { transform: scaleY(1); }
}
.step .body { padding-bottom: clamp(2.75rem, 6vh, 4rem); max-width: 40rem; }
.step.last .body { padding-bottom: 0; }
.step h3 { font-size: clamp(1.1875rem, 2.2vw, 1.5rem); letter-spacing: -.022em; max-width: 30ch; }
.step .dot-year { display: none; }
.step .body p:last-child { margin-top: .875rem; color: var(--fg-soft); }

/* ── Two illustrated sections ───────────────────────────────────── */
.sealed, .home {
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: clamp(2rem, 6vw, 4.5rem); align-items: center;
  padding-block: clamp(3.5rem, 8vh, 6rem);
}
.home { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); }
.home .art { order: 2; }
@media (max-width: 54rem) {
  .sealed, .home { grid-template-columns: 1fr; }
  .home .art { order: 0; }
}
.sealed .art svg, .home .art svg { width: 100%; max-width: 30rem; height: auto; display: block; margin-inline: auto; }
.sealed .words p, .home .words p { margin-top: 1.25rem; color: var(--fg-soft); max-width: 36rem; }
.sealed .words p.quiet {
  color: var(--fg); font-size: 1.1875rem; font-weight: 500;
  border-top: 1px solid var(--rule); padding-top: 1.25rem; margin-top: 2rem;
}

.env { fill: var(--env); stroke: var(--env-line); stroke-width: 1.5; }
.fold { fill: none; stroke: var(--env-line); stroke-width: 1.5; }
.fold.back { opacity: .6; }
.wax { fill: var(--accent); opacity: .92; }
.wax-ring { fill: none; stroke: var(--on-accent); stroke-width: 1.6; opacity: .5; }
.sheen { animation: sweep 13s ease-in-out infinite; }
@keyframes sweep {
  0%, 62% { transform: translateX(0); }
  100%    { transform: translateX(620px); }
}

.house .ridge.far  { fill: var(--ground-far); }
.house .ridge.near { fill: var(--ground-near); }
.house .roof, .house .walls, .house .chimney { fill: var(--house); }
.house .door { fill: var(--house-dark); }
.house .eave { stroke: var(--glow-1); stroke-width: 1.2; opacity: .22; fill: none; }
.house .bar { stroke: var(--house); stroke-width: 2.6; }
.house .pool { fill: var(--glow-1); opacity: .1; }
.house .lit, .house .spill { animation: lamplight 13s ease-in-out infinite; }
@keyframes lamplight {
  0%, 100% { opacity: .78; }
  46%      { opacity: 1; }
}

/* ── Care ───────────────────────────────────────────────────────── */
.care { padding-block: clamp(3.5rem, 8vh, 5.5rem); }
.mishaps {
  margin: 0; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr));
  column-gap: clamp(2rem, 5vw, 4rem);
}
.mishaps > div { padding: 1.375rem 0; border-top: 1px solid var(--rule); max-width: 34rem; }
.mishaps dt { font-weight: 700; font-size: 1.0625rem; }
.mishaps dd { margin: .5rem 0 0; color: var(--fg-soft); font-size: .9688rem; }

/* ── Install ────────────────────────────────────────────────────── */
.run { padding-block: clamp(2rem, 5vh, 3.5rem) clamp(3.5rem, 8vh, 5rem); }
.run p { margin-top: .875rem; color: var(--fg-soft); }
.run .head p { margin-top: 1rem; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; max-width: 48rem; }
.steps > li {
  counter-increment: step;
  position: relative; padding: 0 0 clamp(2rem, 4vh, 2.75rem) 3.25rem;
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  color: var(--accent-text); font-weight: 700; font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}
.steps h3, .after h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -.015em; }
.after h3 { margin-top: 2rem; }
.after h3:first-child { margin-top: 0; }
.steps h3 code, .run p code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .875em; background: var(--muted); padding: .1em .35em; border-radius: .35em;
  overflow-wrap: anywhere;
}
.run pre {
  margin: 1.125rem 0 0; padding: 1rem 1.125rem; overflow-x: auto;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); box-shadow: var(--shadow-panel);
}
.run pre code {
  display: block; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .8125rem; line-height: 1.7; color: var(--fg); white-space: pre; background: none; padding: 0;
}
.run .aside { font-size: .9375rem; }
.after { border-top: 1px solid var(--rule); padding-top: clamp(2rem, 4vh, 2.75rem); max-width: 48rem; }
.after .cta { margin-top: 2rem; }
@media (max-width: 34rem) {
  .steps > li { padding-left: 0; padding-top: 3rem; }
  .steps > li::before { top: 0; }
}


/* ── Footer ─────────────────────────────────────────────────────── */
.site-foot {
  border-top: 1px solid var(--rule);
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem) 3.5rem;
  max-width: 74rem; margin-inline: auto;
  color: var(--muted-fg); font-size: .9375rem;
}
.site-foot p + p { margin-top: .5rem; }
.site-foot strong { color: var(--fg); font-weight: 700; }
.site-foot a { display: inline-block; padding: .375rem 0; color: var(--fg-soft); text-decoration-color: var(--rule); text-underline-offset: 3px; }
.site-foot a:hover { color: var(--fg); text-decoration-color: var(--accent); }
.site-foot .tiny { font-size: .8125rem; margin-top: 1rem; }

/* ── Motion off ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .horizon-glow, .hill, .mist ellipse, .lamp-core, .lamp-halo, .ring,
  .sheen, .lit, .spill, .motes i, .dot, .step.in .dot {
    animation: none !important;
  }
  .ring { opacity: .3; }
  .hill { transform: none; }
}

/* ── Legal sub-footer ───────────────────────────────────────────── */
.subfoot {
  border-top: 1px solid var(--rule);
  padding: 1.75rem clamp(1.25rem, 4vw, 3rem) 2.5rem;
  max-width: 74rem; margin-inline: auto;
  color: var(--muted-fg); font-size: .8125rem; line-height: 1.7;
}
.subfoot .legal-nav { margin-top: .875rem; display: flex; flex-wrap: wrap; gap: .375rem 1.5rem; }
.subfoot a { display: inline-block; padding: .3125rem 0; color: var(--fg-soft); text-decoration-color: var(--rule); text-underline-offset: 3px; }
.subfoot a:hover { color: var(--fg); text-decoration-color: var(--accent); }

/* ── Legal and error pages ──────────────────────────────────────── */
.doc {
  max-width: 44rem; margin-inline: auto;
  padding: clamp(9rem, 20vh, 12rem) clamp(1.25rem, 4vw, 3rem) clamp(3.5rem, 8vh, 5rem);
}
.doc h1 { font-size: clamp(1.875rem, 4vw, 2.5rem); letter-spacing: -.03em; }
.doc .stamp { margin-top: .75rem; color: var(--muted-fg); font-size: .875rem; }
.doc h2 {
  font-size: 1.25rem; font-weight: 600; letter-spacing: -.015em;
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule);
}
.doc p, .doc li { color: var(--fg-soft); }
.doc p { margin-top: 1rem; }
.doc ul { margin: 1rem 0 0; padding-left: 1.25rem; }
.doc li { margin-top: .5rem; }
.doc .back { margin-top: 3rem; }
.doc .back a { display: inline-block; padding: .625rem 0; font-weight: 600; }
.doc code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .875em; background: var(--panel); padding: .1em .4em; border-radius: .35em; }
.doc .lede-p { color: var(--fg); font-size: 1.125rem; }
.notfound { text-align: left; }

/* ── The app section ────────────────────────────────────────────── */
.app { padding-block: clamp(3.5rem, 8vh, 5.5rem); }
.shot { margin: 0 auto clamp(2.5rem, 6vh, 3.5rem); max-width: 54rem; }
.shot img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--rule); border-radius: 1rem;
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.75);
  background: var(--panel);
}
.shot figcaption { margin-top: .875rem; text-align: center; font-size: .8125rem; color: var(--muted-fg); }
