/* CocoForge — coming soon
   Palette sampled from the wordmark (#c4a058) and packaging (#cda746). */
:root {
  --bg: #0a0a08;
  --bg-raise: #14120e;
  --gold: #cda746;
  --gold-logo: #c4a058;
  --gold-hi: #f3d78f;
  --gold-deep: #94722b;
  --ember: #ff6a1a;
  --ember-hot: #ffb04a;
  --text: #f5f0e6;
  --muted: #b9ad98;
  --faint: #7d7364;
  --line: rgba(205, 167, 70, 0.32);

  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gutter: clamp(16px, 4.2vw, 64px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: rgba(205, 167, 70, 0.35); color: #fff; }

/* ---------- Background layers ---------- */
#forge {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.8s ease;
  touch-action: pan-y;
}
#forge.ready { opacity: 1; }

.fallback {
  position: fixed;
  inset: 0;
  display: none;
  background:
    radial-gradient(ellipse 40% 45% at 72% 55%, rgba(255, 106, 26, 0.28), transparent 70%),
    url("/assets/fallback-fire.jpg") no-repeat 80% 52% / min(42vw, 640px) auto,
    var(--bg);
}
.no-webgl .fallback { display: block; }
.no-webgl #forge { display: none; }
.no-webgl .hint { display: none; }

/* Darkens the side the copy sits on so text stays readable over the fire. */
.shade {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10, 10, 8, 0.92) 0%, rgba(10, 10, 8, 0.72) 30%, rgba(10, 10, 8, 0) 58%),
    radial-gradient(ellipse 120% 90% at 65% 50%, transparent 45%, rgba(0, 0, 0, 0.6) 100%);
}

.grain {
  position: fixed;
  inset: -50%;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* ---------- Layout ---------- */
.page {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding:
    max(env(safe-area-inset-top), clamp(18px, 3vw, 36px))
    max(env(safe-area-inset-right), var(--gutter))
    max(env(safe-area-inset-bottom), clamp(18px, 3vw, 32px))
    max(env(safe-area-inset-left), var(--gutter));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: block; width: clamp(150px, 17vw, 250px); }
.brand img { width: 100%; height: auto; filter: drop-shadow(0 2px 18px rgba(205, 167, 70, 0.18)); }

.lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--faint);
}
.lang button {
  padding: 8px 6px;
  min-width: 36px;
  min-height: 36px;
  letter-spacing: inherit;
  color: var(--faint);
  border-radius: 6px;
  transition: color 0.25s ease;
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { color: var(--gold); }
.lang button:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- Hero copy ---------- */
.hero {
  align-self: center;
  max-width: min(600px, 48vw);
  padding: clamp(28px, 5vh, 64px) 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(20, 18, 14, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.ember-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ember-hot);
  box-shadow: 0 0 0 0 rgba(255, 140, 40, 0.6), 0 0 12px 2px rgba(255, 106, 26, 0.75);
  animation: ember-pulse 2.2s ease-in-out infinite;
}
@keyframes ember-pulse {
  0%, 100% { transform: scale(0.85); background: #ff7a22; }
  50% { transform: scale(1.15); background: #ffc266; }
}

.eyebrow {
  margin-top: clamp(22px, 3.4vh, 34px);
  font-size: clamp(0.84rem, 1.05vw, 0.98rem);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

h1 {
  margin-top: 10px;
  font-weight: 600;
  font-size: clamp(3.2rem, 7.4vw, 7rem);
  line-height: 0.9;
  letter-spacing: -0.035em;
}
h1 span { display: block; }
.h1a { color: var(--text); }
.h1b {
  padding-bottom: 0.08em; /* keeps descenders inside the clipped gradient */
  background: linear-gradient(100deg, var(--gold-deep) 0%, var(--gold) 22%, var(--gold-hi) 42%, var(--gold) 58%, #b48633 80%, var(--gold-deep) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.tagline {
  margin-top: clamp(16px, 2.6vh, 26px);
  font-size: clamp(1.2rem, 1.9vw, 1.6rem);
  font-weight: 300;
  letter-spacing: -0.005em;
  color: var(--text);
}
.lead {
  margin-top: 12px;
  max-width: 50ch;
  font-size: clamp(0.98rem, 1.15vw, 1.08rem);
  font-weight: 300;
  line-height: 1.65;
  color: var(--muted);
}

.features {
  list-style: none;
  margin-top: clamp(26px, 4.4vh, 44px);
  padding-top: clamp(22px, 3.4vh, 32px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 14px;
  max-width: 560px;
}
.features li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.25;
  text-transform: uppercase;
  color: var(--text);
}
.ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  background: radial-gradient(circle at 50% 65%, rgba(255, 120, 30, 0.14), transparent 70%);
  transition: box-shadow 0.4s ease, transform 0.4s var(--ease-out);
}
.ico svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.features li:hover .ico {
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(255, 140, 40, 0.35);
}

/* ---------- Footer ---------- */
.bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.natural { color: var(--gold); }
.hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.hint.show { opacity: 1; }
.hint-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 10px var(--ember);
  animation: ember-pulse 1.6s ease-in-out infinite;
}

/* ---------- Entrance ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: reveal 1.1s var(--ease-out) forwards;
  animation-delay: calc(0.25s + var(--d, 0) * 0.11s);
}
@keyframes reveal {
  to { opacity: 1; transform: none; }
}

/* ---------- Stacked layout (phones, tablets, portrait) ----------
   Keep this query in sync with STACKED_QUERY in js/forge-scene.js. */
@media (max-width: 899px), (max-aspect-ratio: 23/20) {
  .shade {
    background:
      linear-gradient(180deg, rgba(10, 10, 8, 0.3) 0%, rgba(10, 10, 8, 0) 12%, rgba(10, 10, 8, 0) 44%, rgba(10, 10, 8, 0.85) 60%, rgba(10, 10, 8, 0.95) 100%);
  }
  h1 { font-size: clamp(3.2rem, 11vw, 6.2rem); }
  .hero {
    align-self: start;
    max-width: 640px;
    margin: clamp(230px, 40svh, 460px) auto 0;
    text-align: center;
    padding-bottom: 40px;
  }
  .lead { margin-inline: auto; }
  .features {
    margin-inline: auto;
    text-align: left;
  }
  .bottom {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 10px;
  }
  .hint { order: -1; }
  .fallback {
    background:
      radial-gradient(ellipse 60% 30% at 50% 24%, rgba(255, 106, 26, 0.28), transparent 70%),
      url("/assets/fallback-fire.jpg") no-repeat 50% 9% / min(86vw, 520px) auto,
      var(--bg);
  }
}

/* Short landscape screens (e.g. 1280x720 laptops): keep the footer above the fold. */
@media (min-width: 900px) and (max-height: 800px) {
  .hero { padding: 10px 0; }
  .eyebrow { margin-top: 16px; }
  h1 { font-size: clamp(3rem, 11.5vh, 6rem); }
  .tagline { margin-top: 12px; }
  .features { margin-top: 20px; padding-top: 18px; gap: 14px 14px; }
}

@media (max-width: 560px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; max-width: 380px; }
  .features li { font-size: 0.7rem; letter-spacing: 0.08em; }
  .ico { width: 36px; height: 36px; }
  .ico svg { width: 19px; height: 19px; }
  .badge { font-size: 0.68rem; letter-spacing: 0.12em; }
  .eyebrow { letter-spacing: 0.14em; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .grain, .h1b, .ember-dot, .hint-dot { animation: none; }
  #forge { transition: none; }
}
