/* Ethereal — marketing + legal site. Dependency-free, mirrors the app aesthetic. */

:root {
  --bg-0: #05060e;
  --bg-1: #0a0a1f;
  --ink: #f0f0ff;
  --muted: rgba(240, 240, 255, 0.55);
  --faint: rgba(240, 240, 255, 0.52);
  --line: rgba(255, 255, 255, 0.10);
  --card: rgba(255, 255, 255, 0.04);
  --indigo: #7b9eff;
  --magenta: #c77dff;
  --cyan: #56e8c2;
  --gold: #ffd166;
  --grad: linear-gradient(135deg, #7b9eff, #c77dff);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* Never allow sideways scroll on small screens (clip doesn't create a
   scroll container, so the sticky nav keeps working). */
html, body { overflow-x: hidden; overflow-x: clip; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: radial-gradient(120% 80% at 50% -10%, #161033 0%, var(--bg-1) 45%, var(--bg-0) 100%);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* ---- Nav ---- */
nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(5, 6, 14, 0.55);
  border-bottom: 1px solid var(--line);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 300; letter-spacing: 4px; font-size: 1.05rem; }
.brand b { font-weight: 600; }
.navlinks { display: flex; gap: 26px; font-size: 0.9rem; }
.navlinks a { color: var(--muted); transition: color 0.15s; }
.navlinks a:hover { color: var(--ink); }
@media (max-width: 640px) {
  /* Let the nav break into two centred rows instead of forcing sideways scroll. */
  nav .wrap { height: auto; min-height: 56px; flex-wrap: wrap; justify-content: center; column-gap: 18px; padding-top: 6px; padding-bottom: 2px; }
  .navlinks { flex-wrap: wrap; justify-content: center; gap: 0 12px; font-size: 0.8rem; }
  html { scroll-padding-top: 116px; } /* two-row nav is taller */
}

/* ---- Buttons ---- */
.btn {
  display: inline-block; padding: 0.95rem 1.5rem; border-radius: 14px;
  font-weight: 600; font-size: 0.95rem; cursor: pointer; border: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary { background: var(--grad); color: #05060e; box-shadow: 0 10px 40px rgba(124, 100, 255, 0.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 50px rgba(124, 100, 255, 0.5); }
.btn-ghost { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.08); }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero .wrap {
  position: relative; z-index: 1;
  padding-top: 96px; padding-bottom: 110px; text-align: center;
}
.hero h1 {
  font-weight: 200; font-size: clamp(2.6rem, 9vw, 5rem);
  letter-spacing: clamp(6px, 3vw, 16px); margin-bottom: 0.4rem;
}
/* Brand device: the REAL in ETHEREAL carries the weight. */
.hero h1 b { font-weight: 500; }
.hero .tag { color: var(--muted); font-size: clamp(1rem, 3.5vw, 1.3rem); font-weight: 300; max-width: 620px; margin: 0 auto 2rem; }
.hero .btn-row { justify-content: center; }
.kicker { color: var(--faint); letter-spacing: 5px; font-size: 0.75rem; text-transform: uppercase; margin-bottom: 1.2rem; }

/* ---- Sections ---- */
section { padding: 80px 0; }
section h2 { font-weight: 300; font-size: clamp(1.6rem, 5vw, 2.4rem); letter-spacing: 1px; margin-bottom: 0.6rem; text-align: center; }
section .sub { color: var(--muted); text-align: center; max-width: 560px; margin: 0 auto 3rem; font-weight: 300; }

/* ---- Worlds grid ---- */
.worlds { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.world {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 22px; overflow: hidden;
  transition: transform 0.18s, border-color 0.18s;
}
.world:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.22); }
.world .dot { width: 38px; height: 38px; border-radius: 50%; margin-bottom: 14px; filter: blur(0.5px); box-shadow: 0 0 26px 6px currentColor; }
.world h3 { font-weight: 500; font-size: 1.1rem; margin-bottom: 4px; letter-spacing: 0.5px; }
.world p { color: var(--muted); font-size: 0.9rem; font-weight: 300; }
.tag-pro {
  position: absolute; top: 16px; right: 16px; font-size: 0.62rem; font-weight: 700;
  letter-spacing: 1.5px; padding: 3px 8px; border-radius: 7px;
  background: rgba(255, 255, 255, 0.12); color: #fff;
}
.tag-free {
  position: absolute; top: 16px; right: 16px; font-size: 0.62rem; font-weight: 700;
  letter-spacing: 1.5px; padding: 3px 8px; border-radius: 7px;
  background: rgba(86, 232, 194, 0.18); color: var(--cyan);
}
/* TV pill on cast-ready world cards; stacks under the FREE/PRO pill. */
.tag-tv {
  position: absolute; top: 42px; right: 16px; font-size: 0.62rem; font-weight: 700;
  letter-spacing: 1.5px; padding: 3px 8px; border-radius: 7px;
  background: rgba(255, 204, 128, 0.14); color: var(--gold);
}

/* ---- Pricing ---- */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; max-width: 760px; margin: 0 auto; }
.tier { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 32px; }
.tier.featured { border-color: rgba(199, 125, 255, 0.5); box-shadow: 0 20px 60px rgba(124, 100, 255, 0.18); }
.tier h3 { font-weight: 400; font-size: 1.3rem; margin-bottom: 6px; }
.tier .price { font-size: 2.2rem; font-weight: 200; margin: 10px 0 4px; }
.tier .price small { font-size: 0.9rem; color: var(--faint); font-weight: 300; }
.tier ul { list-style: none; margin: 18px 0 24px; }
.tier li { padding: 7px 0 7px 26px; position: relative; color: var(--muted); font-size: 0.92rem; }
.tier li::before { content: "✦"; position: absolute; left: 0; color: var(--magenta); }

/* ---- Article (legal) ---- */
.article { max-width: 760px; margin: 0 auto; padding: 56px 0 80px; }
.article h1 { font-weight: 300; font-size: 2.2rem; margin-bottom: 0.3rem; letter-spacing: 1px; }
.article .updated { color: var(--faint); font-size: 0.85rem; margin-bottom: 2.4rem; }
.article h2 { text-align: left; font-size: 1.25rem; font-weight: 500; margin: 2rem 0 0.6rem; }
.article p, .article li { color: var(--muted); margin-bottom: 0.9rem; }
.article ul { padding-left: 1.3rem; }
.article a { color: var(--indigo); }
.article a:hover { text-decoration: underline; }

/* ---- Footer ---- */
footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--faint); font-size: 0.85rem; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }
.footlinks { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---- Hidden-until-hover visitor counter (page views, no cookies/IDs) ---- */
.viewcount {
  position: fixed; right: 12px; bottom: 10px; z-index: 60;
  font-size: 11px; letter-spacing: 0.02em; color: var(--faint);
  padding: 4px 8px; border-radius: 8px;
  opacity: 0; transition: opacity 0.3s ease;
  pointer-events: auto; user-select: none; cursor: default;
}
.viewcount:hover, .viewcount:focus, .viewcount:active { opacity: 0.85; }
.viewcount:empty { display: none; }

/* ---- Nav logo mark (mini orb + orbits) ---- */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.logo-orb { width: 34px; height: 34px; flex: none; }
.logo-orb .orbits { transform-box: view-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .logo-orb .orbits { transition: transform 2.4s cubic-bezier(0.22, 1, 0.36, 1); }
  .brand:hover .logo-orb .orbits { transform: rotate(1turn); }
}

/* ---- Tester promo banner ---- */
.promobar {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 24px; text-align: center; font-size: 0.9rem; color: var(--ink);
  background: linear-gradient(135deg, rgba(123, 158, 255, 0.18), rgba(199, 125, 255, 0.18));
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}
.promobar:hover { background: linear-gradient(135deg, rgba(123, 158, 255, 0.28), rgba(199, 125, 255, 0.28)); }
.promobar-tag { font-weight: 700; letter-spacing: 1px; font-size: 0.7rem; text-transform: uppercase; color: var(--magenta); }
.promobar-cta { font-weight: 700; color: var(--ink); }
.promobar:hover .promobar-cta { text-decoration: underline; }

/* keep .btn links looking like buttons inside article prose */
.article a.btn { color: #05060e; }
.article a.btn-ghost { color: var(--ink); }
.article a.btn:hover { text-decoration: none; }

/* ---- Early-access note (under the request buttons) ---- */
.req-note { color: var(--faint); font-size: 0.85rem; }

/* ---- Early-access cross-promo tiles ---- */
.xpromo { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 1rem; }
.xpromo .tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; color: var(--ink); transition: transform 0.18s, border-color 0.18s; }
.xpromo .tile:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.22); text-decoration: none; }
.xpromo .tile h3 { font-weight: 500; font-size: 1.05rem; margin-bottom: 4px; }
.xpromo .tile p { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* ---- Accessibility (WCAG 2.2 AA) ---- */
/* Reserve space so the sticky nav never hides a focused or anchored target (2.4.11). */
html { scroll-padding-top: 84px; }
/* Visible keyboard focus on every interactive element (2.4.7 / 2.4.11). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.btn:focus-visible,
.promobar:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 3px;
}
/* Comfortable tap targets (>= 24px) for nav & footer links (2.5.8). */
.navlinks a,
.footlinks a { display: inline-block; padding: 8px 4px; }
/* Respect "reduce motion" — the hero/card canvases render static frames instead (worlds.js, 2.2.2 / 2.3.3). */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Live world previews (worlds.js) */
.world .world-canvas {
  display: block;
  width: 100%;
  height: 120px;
  border-radius: 12px;
  margin-bottom: 14px;
  background: #05060e;
}

/* ---- Nightstand (live demo) ---- */
.ns-demo { display: flex; justify-content: center; margin-bottom: 0.6rem; }
.ns-phone {
  width: min(620px, 94%);
  background: #070812;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 12px 12px 12px 22px;
  position: relative;
  box-shadow: 0 24px 80px rgba(123, 158, 255, 0.14), 0 6px 24px rgba(0, 0, 0, 0.5);
}
/* Camera dot on the left bezel — the phone lies in landscape, bedside style. */
.ns-phone::before {
  content: ""; position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(240, 240, 255, 0.18);
}
.ns-screen {
  position: relative; aspect-ratio: 19.5 / 9;
  border-radius: 18px; overflow: hidden; background: #000;  /* OLED-true */
}
.ns-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ns-clock {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  animation: ns-breathe 10s ease-in-out infinite;
}
.ns-time {
  font-weight: 200; font-size: clamp(2.4rem, 9vw, 4rem); letter-spacing: 3px;
  /* Jellyfish-sky tint — the app tints the clock toward each world's accent. */
  color: #d1eff8; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75); line-height: 1.1;
}
.ns-date {
  font-weight: 300; font-size: 0.82rem; letter-spacing: 3px; text-transform: uppercase;
  color: rgba(209, 239, 248, 0.7); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75); margin-top: 4px;
}
@keyframes ns-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.62; } }
.ns-points {
  list-style: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px; max-width: 1000px; margin: 2.6rem auto 2.2rem;
}
.ns-points li {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 18px; color: var(--muted); font-size: 0.92rem; font-weight: 300;
}
.ns-points .glyph { display: block; font-size: 1.15rem; color: var(--cyan); margin-bottom: 6px; }
.ns-points li:nth-child(2) .glyph { color: var(--indigo); }
.ns-points li:nth-child(3) .glyph { color: var(--magenta); }
.ns-points li:nth-child(4) .glyph { color: var(--gold); }
#nightstand .btn-row { justify-content: center; }
/* ☾ pill on nightstand-ready world cards (top-left, mirroring the app gallery). */
.tag-night {
  position: absolute; top: 16px; left: 16px; font-size: 0.72rem;
  padding: 2px 7px; border-radius: 7px;
  background: rgba(123, 158, 255, 0.16); color: var(--indigo);
}

/* ---- Google TV (live demo) ---- */
.tv-demo { display: flex; justify-content: center; margin-bottom: 0.6rem; }
.tv-set { width: min(640px, 94%); }
.tv-frame {
  position: relative; aspect-ratio: 16 / 9;
  background: #000; border-radius: 10px; overflow: hidden;  /* OLED-true */
  border: 6px solid #070812;
  box-shadow: 0 24px 80px rgba(86, 232, 194, 0.10), 0 6px 24px rgba(0, 0, 0, 0.5);
}
.tv-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* The TV app's side-placement clock — time only, resting at the right. */
.tv-clock {
  position: absolute; top: 0; bottom: 0; right: 7%; z-index: 1; pointer-events: none;
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  animation: ns-breathe 10s ease-in-out infinite;
}
.tv-time {
  font-weight: 200; font-size: clamp(1.8rem, 6vw, 3rem); letter-spacing: 3px;
  color: #d8f6e9; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75); line-height: 1.1;
}
.tv-stand { width: 120px; height: 8px; margin: 0 auto; border-radius: 0 0 8px 8px; background: #070812; }
#tv .btn-row { justify-content: center; }
