/* Cellula landing — palette mirrors the app theme (teal primary, editor gold-on-navy) */
:root {
  --teal-900: #0e3f40;
  --teal-700: #0f6f73;
  --teal-500: #14b8b5;
  --teal-300: #4fd1cc;
  --teal-100: #9ae8e3;
  --gold: #ffd700;
  --navy: #000080;
  --ink: #0b1b1c;
  --ink-2: #3d5556;
  --line: #b7d0d2;
  --surface: rgba(11, 63, 64, 0.08);
  --bg: #d6e6e6;
  --bg-end: #c4cbe3;
  --card: #f5fafa;
  --glow-teal: rgba(20, 184, 181, 0.32);
  --glow-navy: rgba(0, 0, 128, 0.16);
  --glow-gold: rgba(255, 215, 0, 0.22);
  --radius: 16px;
  --section-pad: clamp(16px, 4vw, 48px);
  --shadow: 0 1px 2px rgba(11, 27, 28, 0.08), 0 8px 24px rgba(11, 27, 28, 0.1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8f4f4;
    --ink-2: #a9c4c4;
    --line: #1d3448;
    --surface: rgba(255, 255, 255, 0.035);
    --bg: #041a22;
    --bg-end: #07092c;
    --card: #0c2135;
    --glow-teal: rgba(20, 184, 181, 0.26);
    --glow-navy: rgba(40, 40, 200, 0.36);
    --glow-gold: rgba(255, 215, 0, 0.13);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  /* Teal-tinted top to navy-tinted bottom, with colour glows spread down the document (sized in % of the body); tinted bands let them show through */
  background:
    radial-gradient(45% 14% at 8% 22%, var(--glow-teal), transparent 70%),
    radial-gradient(50% 12% at 92% 40%, var(--glow-navy), transparent 70%),
    radial-gradient(40% 12% at 15% 62%, var(--glow-gold), transparent 70%),
    radial-gradient(45% 12% at 85% 82%, var(--glow-teal), transparent 70%),
    linear-gradient(180deg, var(--bg), var(--bg-end));
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.25rem); font-weight: 800; }
h3 { font-size: 1.125rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--teal-700); text-underline-offset: 0.15em; }
@media (prefers-color-scheme: dark) { a { color: var(--teal-300); } }
img, canvas { display: block; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 8px 12px; background: var(--teal-500); color: #fff; border-radius: 8px;
}
.skip:focus { top: 16px; }

/* Buttons */
.button {
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; text-decoration: none;
  border: 1.5px solid transparent; transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .icon-button:focus-visible, a:focus-visible { outline: 3px solid var(--teal-300); outline-offset: 2px; }
.button-primary { background: var(--teal-500); color: var(--teal-900); box-shadow: 0 6px 18px rgba(20, 184, 181, 0.35); }
.button-primary:hover { background: var(--teal-300); }
.button-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.55); background: rgba(0, 0, 0, 0.18); }
.button-ghost:hover { background: rgba(255, 255, 255, 0.12); }
.button-small { padding: 8px 16px; font-size: 0.95rem; background: var(--teal-500); color: var(--teal-900); }
.button-small:hover { background: var(--teal-300); }
.button-large { padding: 16px 32px; font-size: 1.1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 12px clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.25rem; }
.site-nav { display: flex; gap: 20px; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.site-nav a:hover { color: var(--teal-700); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.lang { display: flex; gap: 2px; }
.lang a {
  padding: 6px 8px; border-radius: 8px; text-decoration: none; text-transform: uppercase;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-2);
}
.lang a:hover { background: var(--line); }
.lang a[aria-current="page"] { color: var(--teal-900); background: var(--teal-100); }
@media (max-width: 720px) {
  .site-nav { display: none; }
  .header-actions { gap: 8px; }
}
/* Phones: the hero carries the call to action, the header keeps brand + languages on one row */
@media (max-width: 600px) {
  .header-actions .button { display: none; }
}

/* Hero: the editor's default look — gold cells on a navy map — as a live, clickable world */
.hero {
  position: relative; min-height: min(88vh, 760px); display: grid; place-items: center;
  background: var(--navy); color: #fff; overflow: hidden; isolation: isolate;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; touch-action: manipulation; }
/* Soft shade behind the copy so it stays legible over a dense soup; clicks pass through to the canvas */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 60% 70% at 50% 45%, rgba(0, 0, 60, 0.7), rgba(0, 0, 60, 0.35) 60%, transparent 100%);
}
.hero-content {
  position: relative; z-index: 2; text-align: center; padding: 96px 20px 120px; max-width: 760px; pointer-events: none;
}
.hero-content a { pointer-events: auto; }
.hero h1 {
  font-size: clamp(3.5rem, 2.5rem + 6vw, 7rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.15em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}
.hero-subtitle {
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.5rem); max-width: 34em; margin: 0 auto 1.6em; color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-controls {
  position: absolute; z-index: 2; right: 16px; bottom: 16px; left: 16px;
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
}
.hero-hint {
  margin-right: auto; font-size: 0.9rem; color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.35); padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(6px);
}
.icon-button {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.35); color: #fff; display: inline-grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px);
}
.icon-button:hover { background: rgba(255, 255, 255, 0.18); }
.icon-button svg { width: 22px; height: 22px; fill: currentColor; }
.icon-button[data-running="false"] .icon-pause, .icon-button:not([data-running="false"]) .icon-play { display: none; }
@media (max-width: 600px) { .hero-hint { display: none; } }

/* Sections */
.section { padding: clamp(56px, 8vw, 112px) var(--section-pad); max-width: 1120px; margin: 0 auto; }
/* Full-width band whose content still lines up with the other sections' content box */
.section-tinted { max-width: none; background: var(--surface); }
.section-tinted > * { max-width: calc(1120px - 2 * var(--section-pad)); margin-left: auto; margin-right: auto; }
.two-columns { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.two-columns p { color: var(--ink-2); font-size: 1.05rem; }
@media (max-width: 760px) { .two-columns { grid-template-columns: 1fr; } }

.glider { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.glider canvas { width: 192px; height: 192px; border-radius: 12px; box-shadow: var(--shadow); }
.glider figcaption { font-size: 0.9rem; color: var(--ink-2); text-align: center; max-width: 28em; }

/* Rules */
.rules { list-style: none; padding: 0; margin: 32px auto 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 860px) { .rules { grid-template-columns: 1fr; } }
.rule { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.rule-figure { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 0 18px; }
.rule-figure figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.rule-figure svg { width: 96px; height: 96px; }
.rule-arrow { width: 28px; height: 28px; color: var(--ink-2); flex: none; }
.rule-number { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--teal-100); color: var(--teal-900); font-weight: 700; font-size: 0.9rem; margin-right: 10px; }
.rule p { margin: 0; color: var(--ink-2); }
.rules-note { color: var(--ink-2); text-align: center; margin: 0 auto; }

/* Features */
.features { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-100); color: var(--teal-900); }
.feature-icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin: 6px 0 0; }
/* Seven cards on three columns: the last one spans the row instead of standing alone */
@media (min-width: 900px) {
  .feature:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; column-gap: 20px; row-gap: 4px; align-items: center; }
  .feature:last-child .feature-icon { grid-row: 1 / span 2; }
  .feature:last-child h3 { margin: 0; align-self: end; }
  .feature:last-child p { align-self: start; }
}
.feature p { margin: 0; color: var(--ink-2); font-size: 0.98rem; }

/* CTA */
.cta {
  margin: 0 clamp(16px, 4vw, 48px) clamp(56px, 8vw, 112px); padding: clamp(40px, 6vw, 72px) 24px; text-align: center;
  border-radius: 24px; color: #fff;
  background: radial-gradient(120% 140% at 10% 0%, var(--teal-300), var(--teal-700) 55%, var(--teal-900));
}
.cta h2 { color: #fff; }
.cta p { color: rgba(255, 255, 255, 0.9); max-width: 36em; margin: 0 auto 1.6em; }
.cta .button-primary { background: #fff; color: var(--teal-900); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.cta .button-primary:hover { background: var(--teal-100); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px clamp(16px, 4vw, 48px) 40px; display: grid; gap: 16px; color: var(--ink-2); font-size: 0.95rem; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { color: var(--ink-2); }
.footer-links a:hover { color: var(--teal-700); }
.footer-made { margin: 0; font-size: 0.875rem; }
