:root {
  --cream: #fff6ec;
  --cream-2: #ffedd9;
  --ink: #2b2118;
  --muted: #7a6a5c;
  --coral: #ff6b4a;
  --coral-dark: #e85433;
  --gold: #ffb627;
  --card: #ffffff;
  --line: #f0ddc8;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI Rounded", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(560px 340px at 85% -60px, #ffe3c2 0%, transparent 70%),
    radial-gradient(480px 300px at -80px 38%, #ffe9d2 0%, transparent 70%),
    var(--cream);
  line-height: 1.55;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 24px 12px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hero {
  flex: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 32px;
  align-items: center;
  padding: 32px 0 32px;
}

.kicker {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(3.4rem, 10vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.pronunciation {
  margin: 10px 0 0;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--coral-dark);
}

.lede {
  margin: 20px 0 28px;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: #4d4036;
  max-width: 34rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:active { transform: scale(0.97); }

.btn svg {
  flex: none;
  fill: currentColor;
}

/* Apple badge style: black rounded rectangle, white logo. */
.btn-testflight {
  background: #000;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.btn-testflight:hover { background: #222; }

.btn-testflight svg { width: 30px; height: 30px; }

.btn-lines {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.btn-lines small {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.btn-lines strong {
  font-size: 1.2rem;
  font-weight: 800;
}

/* GitHub light button style: white, dark mark and border. */
.btn-github {
  background: #fff;
  color: #171515;
  border: 2px solid #d0d7de;
}

.btn-github:hover { border-color: #24292f; }

.btn-github svg { width: 26px; height: 26px; }

.note {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}


/* --- Flame stage --- */

.stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.bubble {
  position: absolute;
  top: 2%;
  right: 0;
  z-index: 3;
  width: max-content;
  max-width: 240px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 8px 20px rgba(43, 33, 24, 0.10);
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transform-origin: bottom left;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.bubble.show { opacity: 1; transform: translateY(0) scale(1); }

.bubble::after {
  content: "";
  position: absolute;
  left: 26px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  background: var(--card);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

.stage {
  position: relative;
  width: clamp(240px, 34vw, 380px);
  aspect-ratio: 4 / 5;
  margin-top: 8px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.stage:active { cursor: grabbing; }

.flame {
  position: absolute;
  inset: 0;
  will-change: transform;
  transform-origin: 50% 100%;
}

.flame .layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* RiggedFlame rotation anchors (UnitPoints in the 720x900 layer frame). */
#legL { transform-origin: 39.6% 65.6%; }
#legR { transform-origin: 57.1% 65.6%; }
#armL { transform-origin: 25.4% 55.9%; }
#armR { transform-origin: 72.8% 55.9%; }

.shadow {
  position: absolute;
  left: 50%;
  bottom: 2%;
  width: 46%;
  height: 22px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(43, 33, 24, 0.22), transparent 70%);
  border-radius: 50%;
}


/* --- Footer --- */

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 12px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}

.footer p { margin: 0; }

.footer nav { display: flex; gap: 18px; }

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover { color: var(--ink); text-decoration: underline; }

/* --- Legal pages --- */

.legal { max-width: 720px; margin: 0 auto; padding: 48px 24px 24px; }
.legal h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.legal h2 { margin-top: 32px; font-size: 1.2rem; }
.legal p, .legal li { color: #4d4036; }
.legal a { color: var(--coral-dark); }
.back { display: inline-block; margin-bottom: 24px; color: var(--muted); text-decoration: none; font-weight: 700; }

/* --- Responsive --- */

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 16px;
    text-align: center;
  }

  .lede { margin: 12px auto 16px; }
  .bubble { max-width: 210px; font-size: 0.9rem; }
  .actions { justify-content: center; }
  .stage-wrap { order: -1; }
  .stage { width: clamp(170px, 42vw, 230px); }
}

@media (max-width: 520px) {
  .page { padding: 16px 16px 8px; }
  .actions { flex-direction: column; }
  .btn { width: 100%; }
  .footer { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .flame.bouncing { animation: none; }
  .btn { transition: none; }
}
