/* web-landing/styles.css — Emerge landing page.
 *
 * Follows docs/design.md: cosmic void canvas, solid five-level surfaces,
 * #2BEE79 as the only saturated accent, Spline Sans in three weights.
 *
 * Two rules from the design doc drive most of this file:
 *   §2.4  glass is an L3 overlay treatment only. Nothing here is glass.
 *   §12.4 one accent fill per screen. Green fills the primary button and the
 *         day cells, and nothing else.
 *
 * Evidence for every structural choice is in COMMIT-SHEET.md and DECISIONS.md.
 */

:root {
  /* Surfaces: L0 canvas, L1 content, L2 inset, L4 floating (design.md §2.4). */
  --void: #0a0a1a;
  --l1: #15152b;
  --l2: #1f1f3a;
  --l4: #35355c;

  --hair: rgba(255, 255, 255, 0.06);
  --hair-strong: rgba(255, 255, 255, 0.13);

  --ink: #f4f3ff;
  --body: #c6c4de;
  --muted: #9a98b8;

  --green: #2bee79;
  --green-ink: #04210f;

  --ease: cubic-bezier(0.23, 1, 0.32, 1);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --gutter: clamp(20px, 5vw, 56px);
  --maxw: 1180px;
}

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

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

body {
  margin: 0;
  overflow-x: clip;
  color: var(--body);
  font-family: "Spline Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  background-color: var(--void);
  /* One low-chroma ember in one corner. Not a purple-to-blue pair. */
  background-image:
    radial-gradient(46rem 34rem at 88% -8%, rgba(66, 32, 86, 0.5), transparent 68%),
    radial-gradient(34rem 30rem at 6% 4%, rgba(30, 18, 52, 0.55), transparent 70%);
  background-repeat: no-repeat;
}

/* Static grain. A texture, not an animated fullscreen pass. */
.field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Shared type ---- */
h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.08;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.55rem, 6.6vw, 5rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.7rem, 3.3vw, 2.7rem);
  letter-spacing: -0.022em;
}

h3 {
  font-size: clamp(1.06rem, 1.4vw, 1.22rem);
  letter-spacing: -0.012em;
  line-height: 1.25;
}

p { margin: 0; text-wrap: pretty; }

a { color: inherit; }

.lede {
  font-size: clamp(1.02rem, 1.45vw, 1.22rem);
  line-height: 1.55;
  color: var(--body);
  max-width: 58ch;
}

b.fig {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---- Focus: designed, not default blue ---- */
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--green);
  color: var(--green-ink);
  font-weight: 700;
  border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

/* ---- Masthead: a wordmark, not a status bar ---- */
.masthead {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(20px, 3vw, 34px) var(--gutter) 0;
}

.wordmark {
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

/* ---- Shared section shell ---- */
main,
footer { position: relative; z-index: 1; }

/* Anchor targets under a page with no header: just a little breathing room. */
.band,
.contents,
.hero { scroll-margin-top: 28px; }

main {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.band {
  padding-block: clamp(64px, 9vw, 116px);
  border-top: 1px solid var(--hair);
}

.band--tight { padding-block: clamp(48px, 6vw, 78px); }

.evidence-band { padding-block: clamp(80px, 11vw, 140px); }

.section-head {
  display: grid;
  gap: 18px;
  max-width: 62ch;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.section-head p {
  color: var(--body);
  max-width: 60ch;
}

.section-head--inline { margin-bottom: clamp(22px, 3vw, 34px); }

/* ================= HERO ================= */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(36px, 6vw, 76px) clamp(56px, 8vw, 92px);
}

.hero-copy { max-width: 34rem; }

.hero-copy h1 { margin-bottom: 22px; }

.hero-copy .lede { margin-bottom: 30px; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    transform 140ms var(--ease),
    background-color 140ms var(--ease),
    border-color 140ms var(--ease),
    color 140ms var(--ease);
}

/* The single accent fill: the primary action. */
.btn-primary {
  background-color: var(--green);
  color: var(--green-ink);
}

.btn-quiet {
  color: var(--ink);
  border-color: var(--hair-strong);
  background-color: transparent;
}

.btn:active { transform: scale(0.975); }

.btn svg { width: 17px; height: 17px; flex: none; }

.cta-note {
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* Three facts, three cards: the hero stopped being a paragraph. */
.hero-facts {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
}

.hero-facts li {
  padding: 12px 13px;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  background-color: rgba(21, 21, 43, 0.6);
}

.fact-num {
  display: block;
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.fact-label {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
}

.signin {
  margin-top: 22px;
  font-size: 0.88rem;
  color: var(--muted);
}

.signin a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--hair-strong);
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background-color: #4ade80; transform: translateY(-1px); }
  .btn-quiet:hover { border-color: var(--green); color: #fff; }
  .signin a:hover { text-decoration-color: var(--green); }
}

/* ---- The 66-day grid: the page's signature ---- */
.hero-art {
  position: relative;
  display: grid;
  align-content: center;
}

.daygrid-figure { margin: 0; }

.daygrid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: clamp(6px, 0.9vw, 11px);
  /* Fades into the page instead of glowing at it. */
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}

.cell {
  display: block;
  aspect-ratio: 1;
  border-radius: 2px;
  background-color: var(--green);
  opacity: 0.14;
  transition: opacity 520ms var(--ease);
  transition-delay: calc(var(--i) * 8ms);
}

/* No JavaScript: still a readable matrix of 66 days. */
.no-js .cell { opacity: 0.34; transition: none; }

.daygrid.is-lit .cell { opacity: 0.62; }

.daygrid-figure figcaption {
  margin-top: 18px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 46ch;
}

.daygrid-figure figcaption strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.daygrid-figure figcaption a {
  color: var(--body);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--hair-strong);
}

/* Pointer flare: one composited element, transform only. */
.flare {
  position: absolute;
  top: 0;
  left: 0;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms var(--ease);
  will-change: transform;
}

.flare.is-on { opacity: 0.5; }

/* ---- Phone: the product, standing on the timeline ---- */
.phone {
  position: absolute;
  left: -8%;
  bottom: -104px;
  width: clamp(176px, 16vw, 208px);
  margin: 0;
  padding: 8px;
  border-radius: 38px;
  background-color: #08080f;
  border: 1px solid var(--hair-strong);
  box-shadow: 0 34px 70px rgba(0, 0, 0, 0.55);
}

.phone-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 11px 13px;
  border-radius: 30px;
  background-color: #0d0d1c;
  background-image: radial-gradient(120% 70% at 50% 0%, rgba(66, 32, 86, 0.55), transparent 72%);
  overflow: hidden;
}

.screen-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-bottom: 2px;
}

.screen-day { color: var(--ink); font-weight: 600; }

.screen-streak {
  color: var(--green);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.habit-list { display: grid; gap: 7px; }

.habit-card {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 9px 26px 9px 10px;
  border-radius: 12px;
  background-color: var(--l1);
  border: 1px solid var(--hair);
}

.h-name {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink);
  transition: color 300ms var(--ease);
}

.h-bar {
  height: 3px;
  border-radius: 2px;
  background-color: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.h-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background-color: var(--green);
  transition: width 900ms var(--ease);
}

.h-check {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid var(--hair-strong);
  font-size: 8px;
  line-height: 10px;
  text-align: center;
  color: var(--green-ink);
  transition: background-color 240ms var(--ease), border-color 240ms var(--ease);
}

.habit-card.done .h-fill { width: 100%; }
.habit-card.done .h-name { color: var(--muted); }
.habit-card.done .h-check {
  background-color: var(--green);
  border-color: var(--green);
}
.habit-card.done .h-check::after { content: "✓"; }

.xp-row {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding-top: 6px;
  font-size: 8.5px;
  color: var(--muted);
}

.xp-label { font-weight: 600; color: var(--body); }

.xp-bar {
  height: 4px;
  border-radius: 2px;
  background-color: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.xp-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background-color: var(--green);
  transition: width 1100ms var(--ease);
}

.xp-num { font-variant-numeric: tabular-nums; }

.level-toast {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) scale(0.97);
  padding: 7px 14px;
  border-radius: 999px;
  background-color: var(--l4);
  border: 1px solid rgba(43, 238, 121, 0.4);
  color: var(--ink);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 260ms var(--ease), transform 260ms var(--ease);
}

.level-toast.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ================= CONTENTS (demoted navigation) ================= */

.contents {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 26px;
  padding-block: 20px;
  border-top: 1px solid var(--hair-strong);
  font-size: 0.86rem;
}

.contents-label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
  margin-right: 6px;
}

.contents a {
  color: var(--body);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 140ms var(--ease), border-color 140ms var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .contents a:hover { color: var(--ink); border-bottom-color: var(--green); }
}

/* ================= FEATURES ================= */

.features {
  display: grid;
  grid-template-columns: minmax(0, 52fr) minmax(0, 48fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.capabilities {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cap {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  background-color: var(--l1);
  background-image: radial-gradient(120% 90% at 0% 0%, rgba(43, 238, 121, 0.05), transparent 62%);
}

.cap-icon,
.step-icon,
.path-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid var(--hair-strong);
  color: var(--green);
  background-color: rgba(43, 238, 121, 0.06);
}

.cap-icon svg { width: 18px; height: 18px; }
.step-icon svg { width: 18px; height: 18px; }
.path-icon svg { width: 20px; height: 20px; }

.cap dt {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.008em;
}

.cap dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* The lead capability gets weight, not another identical card. */
.cap--lead {
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  padding: 22px;
  border-color: var(--hair-strong);
  background-image: radial-gradient(90% 120% at 0% 0%, rgba(43, 238, 121, 0.09), transparent 60%);
}

.cap--lead .cap-icon { grid-row: 1 / span 2; width: 42px; height: 42px; border-radius: 13px; }
.cap--lead .cap-icon svg { width: 22px; height: 22px; }
.cap--lead dt { grid-column: 2; align-self: end; font-size: clamp(1.25rem, 2vw, 1.5rem); }
.cap--lead dd { grid-column: 2; color: var(--body); font-size: 0.98rem; }

/* ---- The realm: a product artifact, in the app's own palette ---- */
.realm { margin: 0; }

.realm-plate {
  position: relative;
  aspect-ratio: 4 / 3.9;
  border-radius: var(--r-lg);
  background-color: var(--l1);
  background-image: radial-gradient(70% 60% at 50% 50%, rgba(43, 238, 121, 0.07), transparent 72%);
  border: 1px solid var(--hair);
  overflow: hidden;
}

/* The galaxy, streaming past. One element, one 240px tile for every layer, so
   a -240px translate loops with no seam. The system does not move; only this
   does, which is what makes the plate read as travel rather than a diagram. */
.galaxy {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -240px;
  width: calc(100% + 240px);
  /* One 240×240 SVG tile: specks for depth, drawn streaks for speed. A tile
     rather than stacked gradient layers, so the streaks stay 1–2px tall at
     any size instead of stretching into columns. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='18' cy='26' r='1.1' opacity='.9'/%3E%3Ccircle cx='74' cy='64' r='.9' opacity='.6'/%3E%3Ccircle cx='132' cy='18' r='1' opacity='.75'/%3E%3Ccircle cx='196' cy='52' r='.9' opacity='.5'/%3E%3Ccircle cx='46' cy='118' r='1' opacity='.7'/%3E%3Ccircle cx='150' cy='104' r='1.2' opacity='.85'/%3E%3Ccircle cx='222' cy='140' r='.9' opacity='.6'/%3E%3Ccircle cx='92' cy='168' r='.9' opacity='.5'/%3E%3Ccircle cx='34' cy='196' r='1' opacity='.75'/%3E%3Ccircle cx='178' cy='214' r='1.1' opacity='.65'/%3E%3C/g%3E%3Cg stroke='%23ffffff' stroke-linecap='round'%3E%3Cline x1='12' y1='44' x2='58' y2='44' opacity='.16' stroke-width='1.5'/%3E%3Cline x1='96' y1='86' x2='166' y2='86' opacity='.28' stroke-width='2'/%3E%3Cline x1='188' y1='132' x2='232' y2='132' opacity='.2' stroke-width='1.5'/%3E%3Cline x1='120' y1='190' x2='152' y2='190' opacity='.12' stroke-width='1.5'/%3E%3Cline x1='40' y1='164' x2='74' y2='164' opacity='.14' stroke-width='1.5'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 240px 240px;
  background-repeat: repeat;
  animation: galaxy-stream 26s linear infinite;
  pointer-events: none;
}

@keyframes galaxy-stream {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-240px, 0, 0); }
}

/* The sun's own tail: the direction of travel, falling away to the left.
   A radial gradient anchored on the core, so the tail has no hard edge — a
   gradient rectangle read as a grey panel dropped into space. */
.wake {
  position: absolute;
  left: 0;
  top: 50%;
  width: 52%;
  height: 30%;
  transform: translateY(-50%);
  background-image: radial-gradient(
    62% 55% at 100% 50%,
    rgba(191, 247, 214, 0.24) 0%,
    rgba(191, 247, 214, 0.1) 42%,
    transparent 74%
  );
  pointer-events: none;
}

/* The spine: one hairline, so the tail has a direction not just a haze. */
.wake::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(191, 247, 214, 0.3));
}

/* The centre is the user, not a sun: the badge the app puts at the core. */
.core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  gap: 1px;
  /* A world may pass in front of another; never in front of the user. */
  z-index: 20;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  text-align: center;
  background: radial-gradient(circle at 34% 28%, #f3fff8, #bff7d6 50%, #2bee79);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 46px rgba(43, 238, 121, 0.24);
}

.core::before {
  content: "";
  position: absolute;
  inset: -13px;
  border: 1px solid rgba(43, 238, 121, 0.18);
  border-radius: 50%;
}

.core-lv {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #06210f;
  font-variant-numeric: tabular-nums;
}

.core-name {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(6, 33, 15, 0.68);
}

/* Each world is a door: the body is the planet, the name is its label.
   --d (0 far, 1 near) is how much of your life lives in that world, and it is
   the only thing that changes size, brightness or stacking order here. */
.planet {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  z-index: calc(var(--d, 0.5) * 10);
  opacity: calc(0.72 + var(--d, 0.5) * 0.28);
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  padding: 4px;
  border: 0;
  background: none;
  color: var(--body);
  font: inherit;
  cursor: pointer;
}

.planet-body {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--c) 62%, transparent);
  background: radial-gradient(circle at 34% 28%, color-mix(in srgb, var(--c) 42%, #ffffff) 0%, var(--c) 46%, color-mix(in srgb, var(--c) 38%, #05040f) 100%);
  box-shadow: 0 0 18px color-mix(in srgb, var(--c) 28%, transparent);
  scale: calc(0.88 + var(--d, 0.5) * 0.24);
  transition: scale 160ms var(--ease), box-shadow 160ms var(--ease);
}

/* The line each world drags behind it — longer and brighter when nearer. */
.planet-body::before {
  content: "";
  position: absolute;
  right: calc(100% + 3px);
  top: 50%;
  width: calc(16px + var(--d, 0.5) * 52px);
  height: 1px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, calc(0.1 + var(--d, 0.5) * 0.34)));
  pointer-events: none;
}

.planet[data-world="ocean"] .planet-body {
  box-shadow: 0 0 18px rgba(224, 64, 251, 0.26), inset 0 0 0 5px rgba(5, 4, 15, 0.14);
}

.planet-name {
  font-size: 0.7rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  color: var(--body);
}

@media (hover: hover) and (pointer: fine) {
  .planet:hover .planet-body,
  .planet:focus-visible .planet-body {
    scale: calc((0.88 + var(--d, 0.5) * 0.24) * 1.08);
    box-shadow: 0 0 26px color-mix(in srgb, var(--c) 44%, transparent);
  }
  .planet:hover .planet-name,
  .planet:focus-visible .planet-name { color: var(--ink); }
}

.planet:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
  border-radius: 14px;
}

.realm figcaption {
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---- The world gate ---- */
.world-gate {
  width: min(380px, calc(100vw - 40px));
  padding: 0;
  border: 1px solid var(--hair-strong);
  border-radius: var(--r-lg);
  background: var(--l1);
  color: var(--body);
  overflow: hidden;
}

.world-gate::backdrop {
  background: rgba(5, 4, 15, 0.74);
}

.world-gate[open] { animation: gate-in 220ms var(--ease); }

@keyframes gate-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.gate-body {
  display: grid;
  gap: 10px;
  padding: 26px 24px 22px;
}

.gate-kicker {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.gate-body h3 {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.gate-lore { font-size: 0.94rem; line-height: 1.55; color: var(--body); }

.gate-status {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
  border-top: 1px solid var(--hair);
  padding-top: 10px;
}

.gate-enter { margin-top: 8px; }

.gate-close {
  justify-self: center;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
}

.gate-close:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .world-gate[open] { animation: none; }
  .planet-body { transition: none; }
  .galaxy { animation: none; }
}

/* ================= HOW IT WORKS ================= */

.protocol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.step {
  display: grid;
  align-content: start;
  gap: 10px;
  max-width: none;
  padding: 22px;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  background-color: var(--l1);
}

.when {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.step h3 { margin: 0; }

.step p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: none;
}

/* ================= EVIDENCE ================= */

.evidence {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: none;
}

.claim {
  padding: 22px;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  background-color: var(--l1);
  background-image: radial-gradient(120% 90% at 100% 0%, rgba(43, 238, 121, 0.045), transparent 60%);
}

.claim:first-child { border-top: 1px solid var(--hair); padding-top: 22px; }

.claim > p:first-child {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--body);
}

.claim > p:first-child .fig {
  display: block;
  margin-bottom: 7px;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.claim-use {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--ink);
}

.claim-use::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 1px;
  margin-right: 9px;
  vertical-align: 4px;
  background-color: var(--green);
}

.claim-src {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--muted);
}

.claim-src a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--hair-strong);
}

@media (hover: hover) and (pointer: fine) {
  .claim-src a:hover { color: var(--body); text-decoration-color: var(--green); }
}

/* ================= ACCESS ================= */

.access h2 { margin-bottom: clamp(24px, 3vw, 36px); }

.paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.path {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 24px;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  background-color: var(--l1);
  background-image: radial-gradient(120% 100% at 0% 0%, rgba(43, 238, 121, 0.05), transparent 60%);
}

.path p {
  color: var(--muted);
  max-width: 42ch;
  font-size: 0.93rem;
}

.path .btn { justify-self: start; margin-top: 6px; }

.paths-note {
  margin-top: 28px;
  font-size: 0.84rem;
  color: var(--muted);
}

/* ================= FAQ ================= */

.faq-list {
  display: grid;
  gap: 8px;
  max-width: 62rem;
}

details {
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  background-color: var(--l1);
  transition: border-color 140ms var(--ease);
}

details[open] { border-color: var(--hair-strong); }

summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding: 17px 48px 17px 20px;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "";
  position: absolute;
  right: 21px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 200ms var(--ease), border-color 140ms var(--ease);
}

details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
  border-color: var(--green);
}

details p {
  padding: 0 48px 20px 20px;
  color: var(--body);
  font-size: 0.92rem;
  max-width: 68ch;
}

/* ================= FOOTER ================= */

footer {
  border-top: 1px solid var(--hair);
  padding: clamp(44px, 6vw, 72px) var(--gutter) clamp(36px, 5vw, 56px);
  max-width: var(--maxw);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(28px, 5vw, 64px);
}

.footer-brand p {
  margin-top: 12px;
  font-size: 0.86rem;
  color: var(--muted);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.footer-cols h3 {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--body);
  margin-bottom: 10px;
}

.footer-cols a {
  display: block;
  font-size: 0.86rem;
  color: var(--body);
  text-decoration: none;
  padding: 4px 0;
  transition: color 140ms var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .footer-cols a:hover { color: var(--ink); }
}

.footer-copy {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 8px;
}

/* ---- Custom cursor (dot + trailing ring), per the landing spec §4 ---- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  opacity: 0;
}

.cursor-dot {
  z-index: 60;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--green);
  transform: translate(-50%, -50%);
  transition: opacity 160ms var(--ease);
}

.cursor-ring {
  z-index: 59;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(43, 238, 121, 0.55);
  transform: translate(-50%, -50%);
  transition: width 160ms var(--ease), height 160ms var(--ease), opacity 160ms var(--ease);
}

.cursor-ring.is-hover { width: 40px; height: 40px; }

body.cursor-on .cursor-dot,
body.cursor-on .cursor-ring { opacity: 1; }

@media (pointer: coarse) {
  .cursor-dot,
  .cursor-ring { display: none; }
}

/* ================= REVEALS ================= */
/* Only armed when JS ran, so the page is complete without it. */

.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
}

.js [data-reveal="art"] { transform: scale(1.015); }

.js [data-reveal].in {
  opacity: 1;
  transform: none;
  transition:
    opacity 640ms var(--ease),
    transform 640ms var(--ease);
}

.js [data-reveal="art"].in { transition-duration: 900ms; }

/* ================= RESPONSIVE ================= */

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
    gap: clamp(36px, 6vw, 56px);
    padding-bottom: clamp(40px, 6vw, 64px);
  }

  .hero-copy { max-width: 40rem; }

  /* No overlap once the columns stack: the phone sits below the grid. */
  .phone {
    position: relative;
    left: auto;
    bottom: auto;
    width: 190px;
    margin: 30px 0 0;
  }

  .features { grid-template-columns: 1fr; }

  .protocol, .evidence { grid-template-columns: 1fr; }

  .realm-plate { aspect-ratio: 4 / 3; }

  .paths { grid-template-columns: 1fr; gap: 28px; }

  footer { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  h1 { font-size: clamp(2.2rem, 9.4vw, 2.9rem); }

  .band { padding-block: clamp(52px, 12vw, 72px); }

  .contents { gap: 8px 18px; font-size: 0.82rem; }

  .contents-label { width: 100%; margin-bottom: 2px; }

  .daygrid { gap: 5px; }

  .capabilities { grid-template-columns: 1fr; }

  .footer-cols { grid-template-columns: 1fr 1fr; }

  .footer-cols > div:last-child { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
  .btn { width: 100%; }
  .cta-row { gap: 10px; }
}

/* ================= REDUCED MOTION ================= */
/* A gentler cut, not a broken one: everything is present, nothing moves. */

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

  .cell {
    opacity: 0.5 !important;
    transition: none !important;
  }

  .flare,
  .cursor-ring { display: none !important; }

  .js [data-reveal],
  .js [data-reveal="art"] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .h-fill,
  .xp-fill,
  .level-toast { transition: none !important; }
}
