/* Reset, typography, sea-glass surfaces, controls. */

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

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Decorative overhang must never scroll the page sideways. */
  overflow-x: clip;
}

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

body {
  /* Repeated taps on the game were triggering double-tap-to-zoom. manipulation
     keeps panning and pinch-zoom but drops the double-tap gesture. */
  touch-action: manipulation;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--sand);
  background: var(--abyss);
  overflow-x: clip;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
canvas,
svg,
video {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* ── the scene sits behind everything ───────────────────────────────────── */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-scene);
  pointer-events: none;
}

main {
  position: relative;
  z-index: var(--z-content);
}

/* ── type ───────────────────────────────────────────────────────────────── */

h1,
h2,
h3 {
  line-height: 1.1;
  font-weight: 400;
  overflow-wrap: break-word;
}

/* The meme's own voice: a quiet italic serif, always in quotes. */
.serif {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.005em;
}

.section-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-2xl);
  color: var(--sand);
  letter-spacing: 0.01em;
}

/* Eyebrow: a small spaced label, the only all-caps on the page. */
/* Section headings sit directly on the moving sky, so the small text needs a
   shadow to stay legible over whatever colour is behind it at that scroll
   position. */
.eyebrow {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--sand-dim);
  text-shadow: 0 1px 12px rgba(7, 10, 28, 0.9);
  margin-bottom: var(--space-4);
}

.section-title,
.section-head p,
.hero h1,
.hero-sub {
  text-shadow: 0 2px 26px rgba(7, 10, 28, 0.65);
}

p {
  max-width: var(--prose);
  color: var(--sand-dim);
}

.lede {
  font-size: var(--text-lg);
  color: var(--sand);
  max-width: 40rem;
}

a {
  color: var(--sand);
  text-decoration-color: var(--glass-edge-lit);
  text-underline-offset: 4px;
}

a:hover {
  text-decoration-color: var(--green);
}

strong {
  font-weight: 600;
  color: var(--sand);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
}

/* The one accent. */
.green {
  color: var(--green);
}

/* ── sea glass: the only surface treatment ──────────────────────────────── */

/* Every .glass on this page carries words, and the ground behind it is a live
   sunset — at 0.55 the sun read straight through and body copy fell to ~2:1.
   The blur keeps it feeling like glass rather than a panel. */
.glass {
  background: var(--glass-read);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
}

.glass-tight {
  background: var(--glass-strong);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
}

/* ── buttons: quiet, wide, no shadows ───────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  padding: 0.95em 1.7em;
  border-radius: 999px;
  border: 1px solid var(--glass-edge-lit);
  background: rgba(243, 233, 220, 0.06);
  color: var(--sand);
  transition: background var(--dur-quick) var(--ease-tide), border-color var(--dur-quick) var(--ease-tide), transform var(--dur-quick) var(--ease-tide);
  user-select: none;
}

.btn:hover {
  background: rgba(243, 233, 220, 0.12);
  border-color: var(--sand-dim);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* The buy button is the only green thing that is not a candle. */
.btn--green {
  background: rgba(61, 220, 132, 0.14);
  border-color: rgba(61, 220, 132, 0.5);
  color: #d6ffe8;
}

.btn--green:hover {
  background: rgba(61, 220, 132, 0.22);
  border-color: var(--green);
}

.btn--sm {
  font-size: var(--text-xs);
  padding: 0.7em 1.2em;
}

.btn[aria-disabled='true'] {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.btn[aria-disabled='true']:hover {
  background: rgba(243, 233, 220, 0.06);
  border-color: var(--glass-edge-lit);
  transform: none;
}

/* ── focus ──────────────────────────────────────────────────────────────── */

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

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 100;
  background: var(--green);
  color: #05130b;
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ── helpers ────────────────────────────────────────────────────────────── */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

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

[hidden] {
  display: none !important;
}

/* ── scroll reveal: content surfaces like something coming into focus ───── */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-slow) var(--ease-drift), transform var(--dur-slow) var(--ease-drift);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}
