:root {
  --bg: #0b0b16;
  --bg-2: #101024;
  --bg-3: #151532;
  --ink: #e8e8f8;
  --dim: #9aa0c3;
  --dim-2: #5a608a;
  --line: #23234a;

  --mint: #3ee6b0;
  --amber: #ffb347;
  --coral: #ff5f87;
  --violet: #7c5cff;
  --cyan: #43d9ff;

  --font-pixel: "Press Start 2P", monospace;
  --font-term: "VT323", monospace;

  --ease: cubic-bezier(0.25, 1, 0.4, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-term);
  font-size: 21px;
  line-height: 1.5;
  color: var(--dim);
  background: var(--bg);
  -webkit-font-smoothing: none;
  text-rendering: optimizeSpeed;
}

/* CRT scanlines + vignette overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.28) 100%);
}

/* pixel world canvas */
#world {
  position: fixed;
  inset: 0;
  z-index: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

main { position: relative; z-index: 1; }

::selection { background: rgba(62, 230, 176, 0.35); color: var(--ink); }

img, svg { display: block; }
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; }
p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

/* ---------- reveal (JS-gated) ---------- */

html.anim .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

html.anim .reveal.in { opacity: 1; transform: none; }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 3px solid var(--line);
}

.nav-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 22px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--ink);
  letter-spacing: 0.06em;
}

.nav-wordmark {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--ink);
  letter-spacing: 0.06em;
}

.nav-cta {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--cyan);
  border: 2px solid var(--cyan);
  padding: 8px 14px;
  box-shadow: 4px 4px 0 #000;
  transition: background 0.15s, color 0.15s, transform 0.1s, box-shadow 0.1s;
}

.nav-cta:hover { background: var(--cyan); color: var(--bg); }
.nav-cta:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #000; }

/* ---------- hero ---------- */

.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 90px 22px 60px;
  position: relative;
}

.hero-copy { max-width: 920px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

html.anim .hero-copy > * { animation: rise 1s var(--ease) both; }
html.anim .hero-copy > *:nth-child(1) { animation-delay: 0.05s; }
html.anim .hero-copy > *:nth-child(2) { animation-delay: 0.2s; }
html.anim .hero-copy > *:nth-child(3) { animation-delay: 0.35s; }
html.anim .hero-copy > *:nth-child(4) { animation-delay: 0.5s; }

.hero-tagline {
  font-family: var(--font-pixel);
  font-size: clamp(9px, 1.4vw, 12px);
  color: var(--cyan);
  letter-spacing: 0.1em;
  margin-bottom: 34px;
  text-shadow: 0 0 18px rgba(67, 217, 255, 0.45);
}

.blink { animation: blink 1s steps(1) infinite; }

@keyframes blink { 50% { opacity: 0; } }

.hero h1 {
  font-family: var(--font-pixel);
  font-size: clamp(26px, 5.6vw, 56px);
  line-height: 1.5;
  color: #eef2ff;
  letter-spacing: 0.02em;
  text-shadow: 4px 4px 0 #000;
}

.hero h1 .chrome {
  background: linear-gradient(180deg, #ffffff 0%, #cfe9ff 30%, #43d9ff 52%, #7c5cff 72%, #43318f 100%);
  background-size: 100% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(3px 3px 0 #000) drop-shadow(0 0 14px rgba(67, 217, 255, 0.3));
}

@keyframes sheen {
  from { background-position: 50% 0%; }
  to { background-position: 50% 100%; }
}

html.anim .hero h1 .chrome { animation: sheen 5s var(--ease) infinite alternate; }

@media (prefers-reduced-motion: reduce) {
  .hero h1 .chrome { animation: none; background-position: 50% 40%; }
}

.hero-sub {
  margin-top: 30px;
  font-size: clamp(21px, 2.6vw, 27px);
  color: var(--dim);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-top: 44px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--bg);
  background: var(--cyan);
  padding: 16px 26px;
  border: 2px solid var(--cyan);
  box-shadow: 5px 5px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
}

.btn-primary:hover { background: #6ee2ff; }
.btn-primary:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 #000; }

.btn-link {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--amber);
  text-shadow: 2px 2px 0 #000;
  transition: color 0.15s;
}

.btn-link:hover { color: #ffd28a; }

.scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--dim-2);
}

@keyframes cue-drift {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

html.anim .scroll-cue { animation: cue-drift 1.8s steps(4) infinite; }

/* ---------- marquee ---------- */

.marquee {
  overflow: hidden;
  background: var(--bg-2);
  border-top: 3px solid var(--line);
  border-bottom: 3px solid var(--line);
  padding: 13px 0;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.marquee-track span {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.08em;
  white-space: nowrap;
  padding-right: 2em;
}

@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- cinematic tour ---------- */

.tour {
  position: relative;
  height: 340vh;
}

.tour-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: 6vh;
}

.tour-word {
  position: absolute;
  top: 9vh;
  left: 50%;
  translate: -50% 0;
  margin: 0;
  font-family: var(--font-pixel);
  font-size: clamp(20px, 5vw, 52px);
  color: var(--bg);
  -webkit-text-stroke: 2px var(--cyan);
  text-stroke: 2px var(--cyan);
  opacity: 0;
  visibility: hidden;
  white-space: nowrap;
  user-select: none;
  will-change: opacity, transform;
  z-index: 0;
}

.tour-mock {
  position: relative;
  z-index: 1;
  width: min(92vw, 760px);
  margin-top: 13vh;
  will-change: transform, opacity;
}

/* ---------- app mock ---------- */

.mock {
  background: var(--bg-2);
  border: 3px solid var(--line);
  box-shadow:
    8px 8px 0 #000,
    0 0 60px rgba(62, 230, 176, 0.08);
  overflow: hidden;
}

.mock-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 3px solid var(--line);
  background: var(--bg-3);
}

.dot { width: 10px; height: 10px; }
.dot-red { background: var(--coral); }
.dot-yellow { background: var(--amber); }
.dot-green { background: var(--cyan); }

.mock-title {
  margin-left: 14px;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--dim-2);
  letter-spacing: 0.08em;
}

.mock-body { padding: 22px 24px 26px; }

.mock-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.mock-search {
  font-family: var(--font-term);
  font-size: 19px;
  color: var(--dim);
  background: var(--bg);
  border: 2px solid var(--line);
  padding: 7px 16px;
  min-width: 190px;
}

.mock-dots { display: flex; gap: 8px; }

.mock-dots i {
  width: 8px;
  height: 8px;
  background: var(--line);
}

.mock-dots i.on { background: var(--cyan); }

.mock-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.tile {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.3),
    inset 0 0 0 4px rgba(255, 255, 255, 0.08),
    4px 4px 0 rgba(0, 0, 0, 0.45);
  will-change: transform;
}

.tile-label {
  position: absolute;
  left: 8px;
  bottom: 7px;
  z-index: 1;
  font-family: var(--font-pixel);
  font-size: 7px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
  letter-spacing: 0.04em;
}

.tile-play {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 26px;
  height: 24px;
  background: rgba(11, 11, 22, 0.85);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--cyan);
  will-change: transform, opacity;
}

.mock-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 40px;
  margin-top: 20px;
  opacity: 0;
  will-change: opacity, transform;
}

.chip {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--cyan);
  background: var(--bg);
  border: 2px solid var(--line);
  padding: 7px 10px;
  letter-spacing: 0.05em;
}

/* static fallback when JS/tour driver absent */
html:not(.anim) .tour { height: auto; padding: 80px 22px; }
html:not(.anim) .tour-stage { position: static; height: auto; display: block; text-align: center; }
html:not(.anim) .tour-word { display: none; }
html:not(.anim) .tour-mock { margin: 0 auto; opacity: 1; }
html:not(.anim) .mock-chips { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html.anim .reveal { opacity: 1; transform: none; transition: none; }
  html.anim .hero-copy > * { animation: none; }
  html.anim .scroll-cue { animation: none; }
  .marquee-track { animation: none; }
  .blink { animation: none; }
  .tour { height: auto; padding: 80px 22px; }
  .tour-stage { position: static; height: auto; display: block; text-align: center; }
  .tour-word { display: none; }
  .tour-mock { margin: 0 auto; opacity: 1; transform: none !important; }
  .mock-chips { opacity: 1; }
}

/* ---------- statement ---------- */

.statement {
  padding: 150px 22px;
  text-align: center;
}

.statement-inner {
  max-width: 720px;
  margin: 0 auto;
  background: rgba(11, 11, 22, 0.82);
  border: 3px solid var(--line);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.55);
  padding: 56px 36px;
}

.statement h2 {
  font-family: var(--font-pixel);
  font-size: clamp(24px, 4.6vw, 46px);
  line-height: 1.6;
  color: var(--ink);
  text-shadow: 4px 4px 0 #000;
  letter-spacing: 0.02em;
}

.statement p {
  margin-top: 32px;
  font-size: clamp(21px, 2.4vw, 26px);
  color: var(--dim);
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- footer ---------- */

.footer { background: var(--bg); border-top: 3px solid var(--line); }

.footer-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 40px 22px 48px;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--dim);
}

.footer-links a { transition: color 0.15s; }
.footer-links a:hover { color: var(--mint); }

.footer-status {
  margin-top: 24px;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--amber);
  letter-spacing: 0.05em;
}

.footer-note {
  margin-top: 10px;
  font-size: 18px;
  line-height: 1.5;
  color: var(--dim-2);
  max-width: 640px;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .mock-grid { grid-template-columns: repeat(3, 1fr); }
  .tour { height: 280vh; }
}

@media (max-width: 640px) {
  .hero { padding-top: 70px; }
  .mock-body { padding: 16px 16px 20px; }
  .mock-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tour { height: 250vh; }
  .tour-word { -webkit-text-stroke: 1px var(--cyan); font-size: 20px; }
  .tour-mock { margin-top: 16vh; }
  .statement { padding: 100px 20px; }
}
