/* Wayglow website. Colours from the app's default "Lost Atlas" appearance
   (Sources/WayglowCore/AdventureAppearance.swift). No web fonts: the system
   font loads instantly and sends no request to a font service. */

:root {
  --night: #0b1611;
  --forest: #1a2e24;
  --ink: #1f3329;
  --paper: #ebdec0;
  --paper-light: #f6f0e2;
  --brass: #d9b066;
  --muted: #5d6b5f;
  --rust: #a64529;
  --line: #d8ccb0;
  --error: #9b2c12;

  --bg: var(--paper-light);
  --text: var(--ink);
  --card: #fffdf7;
  --link: #1a4a35;
  --focus: var(--rust);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--night);
    --text: var(--paper);
    --card: #13241b;
    --link: var(--brass);
    --muted: #a6b099;
    --line: #2c4436;
    --error: #f0a08a;
    --focus: var(--brass);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

img { max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

.wrap { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--brass); color: var(--night); padding: 0.6rem 1rem; border-radius: 6px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

main:focus { outline: none; }

/* Header */
.site-header { background: var(--night); color: var(--paper); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.9rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--paper); text-decoration: none; font-weight: 700; font-size: 1.2rem; letter-spacing: 0.02em; }
.brand img { border-radius: 9px; }
.nav { list-style: none; display: flex; gap: 0.25rem; margin: 0; padding: 0; }
.nav a { display: block; color: var(--paper); text-decoration: none; padding: 0.45rem 0.8rem; border-radius: 999px; }
.nav a:hover { background: var(--forest); }
.nav a[aria-current="page"] { background: var(--forest); color: var(--brass); }
.nav .nav-cta { background: var(--brass); color: var(--night); font-weight: 650; }
.nav .nav-cta:hover, .nav .nav-cta[aria-current="page"] { background: #e6c483; color: var(--night); }

/* Hero */
.hero { background: linear-gradient(180deg, var(--night) 0%, var(--forest) 100%); color: var(--paper); padding-block: 3.5rem 4rem; }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 52rem) { .hero-grid { grid-template-columns: 1.4fr 1fr; } }
.hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); line-height: 1.1; margin: 0.3rem 0 1rem; letter-spacing: -0.01em; }
.hero .lead { font-size: 1.2rem; max-width: 36rem; color: #e3d6b8; }
.hero a:not(.button) { color: var(--brass); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.8rem; font-weight: 700; color: var(--brass); margin: 0; }
.hero-icon { justify-self: center; width: min(16rem, 60vw); border-radius: 22%; box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.45); }
.store-soon { font-weight: 600; color: var(--brass); }

/* Buttons */
.button {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none; font: inherit; font-weight: 650;
  background: var(--forest); color: var(--paper); padding: 0.75rem 1.4rem; border-radius: 999px;
}
.button:hover { background: var(--ink); }
.hero .button, .button-light { background: var(--brass); color: var(--night); }
.hero .button:hover, .button-light:hover { background: #e6c483; }
@media (prefers-color-scheme: dark) {
  .button { background: var(--brass); color: var(--night); }
  .button:hover { background: #e6c483; }
}
.button[disabled] { opacity: 0.6; cursor: progress; }
.button-quiet { background: transparent; color: var(--link); border: 2px solid currentColor; }
.button-quiet:hover { background: transparent; text-decoration: underline; }
@media (prefers-color-scheme: dark) { .button-quiet { background: transparent; color: var(--brass); } }

/* Sections */
section { padding-block: 3rem; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); line-height: 1.2; margin: 0 0 1rem; }
h3 { font-size: 1.15rem; margin: 0 0 0.4rem; }
.feature-grid { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.feature-grid li { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.25rem 1.3rem; }
.feature-grid p { margin: 0; color: var(--muted); }
.band { background: var(--forest); color: var(--paper); }
.band a { color: var(--brass); }
.band p { max-width: 44rem; }

/* Cards and forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.5rem; max-width: 40rem; }
.form .field { margin: 0 0 1.2rem; }
.form label, .form legend { display: block; font-weight: 650; margin-bottom: 0.35rem; }
.form fieldset { border: 0; padding: 0; margin: 0 0 1.2rem; }
.optional { font-weight: 400; color: var(--muted); }
.form input[type="email"], .form input[type="text"], .form select, .form textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 2px solid var(--line); border-radius: 10px; padding: 0.65rem 0.8rem;
}
.form textarea { min-height: 9rem; resize: vertical; }
.form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible { border-color: var(--focus); outline-offset: 1px; }
.form [aria-invalid="true"] { border-color: var(--error); }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.checks label { font-weight: 400; display: inline-flex; gap: 0.45rem; align-items: center; margin: 0; }
.consent { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: start; }
.consent label { font-weight: 400; margin: 0; }
.consent .field-error { grid-column: 1 / -1; }
input[type="checkbox"] { width: 1.2rem; height: 1.2rem; margin: 0.2rem 0 0; accent-color: var(--forest); }
@media (prefers-color-scheme: dark) { input[type="checkbox"] { accent-color: var(--brass); } }
.field-error, .form-error { color: var(--error); font-weight: 600; margin: 0.35rem 0 0; }
.field-error:empty, .form-error:empty { display: none; }
.form-status:empty { display: none; }
.form-status { margin: 0.8rem 0 0; }
.hint { color: var(--muted); font-size: 0.95rem; margin: 0.3rem 0 0; }
.success { border-color: var(--brass); }
.success h2, .success h3 { margin-top: 0; }

/* The spam trap: off-screen, never shown to people or read by screen readers. */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Long-form pages (privacy, support) */
.prose { max-width: 46rem; padding-block: 2.5rem 3.5rem; }
.prose h1 { font-size: clamp(2rem, 4.5vw, 2.6rem); line-height: 1.15; margin: 0 0 0.5rem; }
.prose h2 { margin-top: 2.4rem; font-size: 1.5rem; }
.prose h3 { margin-top: 1.6rem; }
.prose li { margin-bottom: 0.4rem; }
.updated { color: var(--muted); margin-top: 0; }
.summary { background: var(--card); border-left: 4px solid var(--brass); padding: 1rem 1.25rem; border-radius: 0 12px 12px 0; }
.summary p:first-child { margin-top: 0; }
.summary p:last-child { margin-bottom: 0; }
.prose .card { margin-top: 1.5rem; }
.prose .card h2, .prose .card h3 { margin-top: 0; }
details { border-bottom: 1px solid var(--line); padding: 0.8rem 0; }
details summary { cursor: pointer; font-weight: 650; }
details[open] summary { margin-bottom: 0.5rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); padding-block: 1.5rem 2rem; font-size: 0.95rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.footer-row p { margin: 0; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); }

/* Join page */
.lead-quiet { color: var(--muted); font-size: 1.1rem; max-width: 36rem; }

/* Visually hidden, still read by screen readers. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------------------------------------------------------------------------
   Landing page: always dark, motion first, almost no words.
   Videos and posters are this site's own files (the CSP allows nothing else).
   --------------------------------------------------------------------------- */
.page-index { background: var(--night); color: var(--paper); }
.page-index .site-header { position: absolute; inset: 0 0 auto; z-index: 20; background: linear-gradient(rgba(5, 10, 8, 0.6), rgba(5, 10, 8, 0)); }
.page-index .site-footer { border-top-color: #22362b; color: #a6b099; }
.page-index .footer-links a { color: #a6b099; }
.page-index section { padding-block: 0; }
/* On a phone the landing header keeps one row: Support and Privacy are in the footer. */
@media (max-width: 30rem) { .page-index .nav li:not(:last-child) { display: none; } }

.stage {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh; display: grid; place-items: center;
  background: var(--night) url("/assets/media/hero-wide.jpg") center / cover no-repeat;
}
@media (max-aspect-ratio: 4/5) { .stage { background-image: url("/assets/media/hero-tall.jpg"); } }
.stage-video { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.stage-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 50% 55%, rgba(11, 22, 17, 0.05) 0%, rgba(11, 22, 17, 0.55) 80%),
    linear-gradient(180deg, rgba(11, 22, 17, 0.35) 0%, rgba(11, 22, 17, 0) 28%, rgba(11, 22, 17, 0) 62%, var(--night) 100%);
}
.stage-copy { text-align: center; padding: 7rem 1.25rem 8rem; }
.stage h1 {
  margin: 0 auto 1.5rem; max-width: 17ch;
  font-size: clamp(2.8rem, 9vw, 6.6rem); line-height: 0.98; font-weight: 800; letter-spacing: -0.035em;
  color: #fff8ea; text-wrap: balance;
  text-shadow: 0 0 42px rgba(217, 176, 102, 0.55), 0 2px 20px rgba(0, 0, 0, 0.6);
}
.stage .store-soon {
  display: inline-block; margin: 0 0 1.4rem; padding: 0.45rem 1.05rem; border-radius: 999px;
  background: rgba(11, 22, 17, 0.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(235, 222, 192, 0.25); color: var(--paper); font-weight: 600; font-size: 0.95rem;
}
.stage .store { margin: 0 0 1.4rem; }
.stage p { margin: 0; }
.button-glow, .page-index .button { background: var(--brass); color: var(--night); font-size: 1.1rem; padding: 0.95rem 1.9rem; }
.button-glow:hover, .page-index .button:hover { background: #e6c483; }
.stage-next { position: absolute; left: 50%; bottom: 1.25rem; transform: translateX(-50%); padding: 0.6rem; color: var(--paper); opacity: 0.85; border-radius: 999px; }
.stage-next:hover { opacity: 1; }

.section-title {
  text-align: center; margin: 0 auto 2.25rem; padding-inline: 1rem;
  font-size: clamp(2rem, 5.5vw, 3.6rem); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; color: #fff8ea;
}
.moments { padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 5vw, 4rem); }
.moment-grid {
  list-style: none; margin: 0 auto; padding: 0 1rem; max-width: 80rem;
  display: grid; gap: 0.75rem; grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 48rem) { .moment-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; padding: 0 0.6rem; } }
.moment { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 18px; background: var(--forest); }
.moment video { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); transition: transform 0.7s ease; }
.moment:hover video { transform: scale(1.08); }
.moment::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.6)); pointer-events: none; }
.moment span {
  position: absolute; left: 0.95rem; bottom: 0.8rem; z-index: 1;
  font-size: clamp(1.05rem, 2.3vw, 1.45rem); font-weight: 800; letter-spacing: -0.01em; color: #fff;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7);
}

.screens { padding-block: clamp(3rem, 8vw, 6rem); overflow: hidden; background: radial-gradient(ellipse at 50% 60%, #1a2e24 0%, var(--night) 70%); }
.phones {
  list-style: none; margin: 0 auto; padding: 1rem 1rem 3.5rem; max-width: 84rem;
  display: flex; justify-content: center; align-items: center; gap: clamp(0.75rem, 2vw, 1.75rem);
}
.phone {
  position: relative; flex: 0 0 auto; width: clamp(9rem, 15vw, 13.5rem); aspect-ratio: 9 / 19.5;
  padding: 0.5rem; border-radius: 2.3rem; background: linear-gradient(145deg, #313734, #0b0d0c);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 30px 60px -22px rgba(0, 0, 0, 0.85);
}
.phone::before {
  content: ""; position: absolute; top: 1.05rem; left: 50%; z-index: 2; width: 30%; height: 1.1rem;
  transform: translateX(-50%); border-radius: 999px; background: #000;
}
.phone img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 1.85rem; }
/* A finished video frame, shown as the phone plays it: whole, with black bars. */
.phone-video img { object-fit: contain; object-position: center; background: #000; }
.phone-lead {
  width: clamp(11rem, 19vw, 16.5rem); z-index: 1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 90px -8px rgba(217, 176, 102, 0.4), 0 40px 80px -24px rgba(0, 0, 0, 0.9);
}
.phone:nth-child(1) { rotate: -7deg; translate: 0 2.6rem; }
.phone:nth-child(2) { rotate: -3deg; translate: 0 1rem; }
.phone:nth-child(4) { rotate: 3deg; translate: 0 1rem; }
.phone:nth-child(5) { rotate: 7deg; translate: 0 2.6rem; }
@media (max-width: 48rem) {
  .phones { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; padding-inline: 19vw; scrollbar-width: none; }
  .phones::-webkit-scrollbar { display: none; }
  .phone, .phone-lead { width: 62vw; scroll-snap-align: center; rotate: none; translate: none; }
  .phone-lead { order: -1; }
}

.finale { padding-block: clamp(3rem, 8vw, 6rem) clamp(4rem, 10vw, 7rem); text-align: center; }
.finale p { margin: 0; }

/* Sound and motion controls: bottom right, always reachable. */
.controls { position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 30; display: flex; gap: 0.5rem; }
.control {
  display: inline-flex; align-items: center; gap: 0.45rem; height: 3rem; min-width: 3rem; padding: 0 0.85rem; justify-content: center;
  border: 1px solid rgba(235, 222, 192, 0.3); border-radius: 999px; cursor: pointer; font: inherit; font-weight: 650; font-size: 0.95rem;
  background: rgba(11, 22, 17, 0.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--paper);
}
.control:hover { background: rgba(11, 22, 17, 0.88); }
.control[data-motion] { padding: 0; }
.control .icon-on { display: none; }
.control[aria-pressed="true"] .icon-on { display: block; }
.control[aria-pressed="true"] .icon-off { display: none; }
.control[data-sound][aria-pressed="true"] { color: var(--brass); border-color: var(--brass); box-shadow: 0 0 22px rgba(217, 176, 102, 0.5); }
@media (max-width: 30rem) { .control-text { display: none; } .control[data-sound] { padding: 0; } }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .button-glow { animation: glow 2.8s ease-in-out infinite; }
  .stage-next { animation: bob 2.2s ease-in-out infinite; }
  .phone { animation: float 6s ease-in-out infinite; }
  .phone:nth-child(2) { animation-delay: -1.2s; }
  .phone:nth-child(3) { animation-delay: -2.4s; }
  .phone:nth-child(4) { animation-delay: -3.6s; }
  .phone:nth-child(5) { animation-delay: -4.8s; }
}
@keyframes glow { 50% { box-shadow: 0 0 34px 6px rgba(217, 176, 102, 0.45); } }
@keyframes bob { 50% { transform: translate(-50%, 7px); } }
@keyframes float { 50% { transform: translateY(-10px); } }
