:root {
  --bg: #070c16;
  --bg-2: #0b2545;
  --panel: rgba(255, 255, 255, 0.045);
  --border: rgba(201, 162, 39, 0.28);
  --text: #f3eede;
  --text-dim: #a79c80;
  --accent: #c9a227;
  --accent-2: #e4572e;
  --parchment: #f5e6c8;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1.15, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, 'Segoe UI', Georgia, serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  background: rgba(7, 12, 22, 0.6);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.nav-brand img { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 26px; font-size: 13px; color: var(--text-dim); }
.nav-links a:hover { color: var(--accent); }
.nav-cta {
  background: var(--accent); color: #1a1305; font-weight: 700; font-size: 13px;
  padding: 9px 18px; border-radius: 999px; transition: transform 150ms var(--ease);
}
.nav-cta:hover { transform: translateY(-1px); }
@media (max-width: 720px) { .nav-links { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 0%, rgba(228, 87, 46, 0.1), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(201, 162, 39, 0.12), transparent 40%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 130%);
}
.hero-waves {
  position: absolute; bottom: 0; left: 0; right: 0; height: 220px;
  background: repeating-linear-gradient(
    100deg, rgba(201, 162, 39, 0.06) 0 2px, transparent 2px 40px
  );
  -webkit-mask-image: linear-gradient(180deg, transparent, black 60%);
  mask-image: linear-gradient(180deg, transparent, black 60%);
}
.hero-ship {
  width: 210px;
  position: relative;
  animation: gl-sail-in 1.6s var(--ease) both, gl-bob-slow 4.5s ease-in-out infinite 1.6s;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5));
  margin-bottom: 18px;
}
@keyframes gl-sail-in {
  0% { transform: translateX(-40vw) rotate(-6deg); opacity: 0; }
  100% { transform: translateX(0) rotate(0deg); opacity: 1; }
}
@keyframes gl-bob-slow {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}
.hero h1 {
  font-size: clamp(32px, 5.5vw, 58px);
  font-weight: 700; letter-spacing: -0.01em;
  max-width: 780px;
  background: linear-gradient(135deg, var(--parchment), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--text-dim); font-size: 16px; max-width: 520px; margin: 18px auto 30px; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-size: 14px; font-weight: 700;
  cursor: pointer; border: 1px solid var(--border); transition: transform 150ms var(--ease);
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #1a1305; border: none; }
.btn-ghost { background: rgba(255, 255, 255, 0.04); color: var(--text); }

.scroll-cue {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim);
  animation: gl-cue-bob 2s ease-in-out infinite;
}
@keyframes gl-cue-bob { 0%, 100% { opacity: 0.4; transform: translate(-50%, 0); } 50% { opacity: 1; transform: translate(-50%, 6px); } }

/* ---------- Section shell ---------- */
section { padding: 100px 0; position: relative; }
.eyebrow {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 10px;
}
.section-title { font-size: clamp(24px, 3.5vw, 36px); font-weight: 700; max-width: 640px; }
.section-sub { color: var(--text-dim); margin-top: 12px; max-width: 560px; font-size: 15px; }
.section-head { margin-bottom: 46px; }

/* ---------- Live demo ---------- */
.demo-stage {
  position: relative;
  height: 340px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 30% 20%, rgba(228, 87, 46, 0.08), transparent 50%),
    rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  overflow: hidden;
  margin-bottom: 22px;
}
.demo-hint {
  position: absolute; top: 18px; left: 20px; font-size: 11px; color: var(--text-dim);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.demo-controls { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.demo-controls .btn { font-size: 13px; padding: 10px 18px; }

/* Demo overlay elements (mirrors the real extension's animation classes) */
.demo-hat-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  background: radial-gradient(circle at center, rgba(10, 14, 24, 0.4), transparent);
  transition: opacity 200ms ease;
}
.demo-hat-overlay.gl-in { opacity: 1; }
.demo-hat-overlay img { width: 110px; transform: scale(0) rotate(-25deg); opacity: 0; }
.demo-hat-overlay.gl-play img { animation: gl-hat-seq 1000ms var(--ease) forwards; }
@keyframes gl-hat-seq {
  0% { transform: scale(0) rotate(-25deg); opacity: 0; }
  55% { transform: scale(1.2) rotate(8deg); opacity: 1; }
  100% { transform: scale(0.95) rotate(0deg); opacity: 1; }
}

.demo-quote-card {
  position: absolute; left: 50%; bottom: 24px; transform: translate(-50%, 14px) scale(0.94);
  max-width: 360px; padding: 14px 18px; border-radius: 14px;
  background: rgba(14, 20, 32, 0.85); border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  opacity: 0; transition: opacity 350ms var(--ease), transform 350ms var(--ease);
  font-style: italic; font-size: 13.5px;
}
.demo-quote-card.gl-in { opacity: 1; transform: translate(-50%, 0) scale(1); }
.demo-quote-card .speaker {
  display: block; margin-top: 6px; font-size: 11px; font-style: normal;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent);
}

.demo-companion {
  position: absolute; right: 22px; bottom: 22px; width: 76px;
  opacity: 0; transform: translateY(14px);
  transition: opacity 400ms var(--ease), transform 400ms var(--ease);
}
.demo-companion.gl-in { opacity: 1; transform: translateY(0); }
.demo-companion img { animation: gl-bob 2.4s ease-in-out infinite; }
@keyframes gl-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- Feature grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }

.feature-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 22px; backdrop-filter: blur(12px);
  transition: transform 200ms var(--ease), border-color 200ms ease;
}
.feature-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.feature-icon {
  width: 42px; height: 42px; border-radius: 12px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 19px;
}
.feature-card h3 { font-size: 15.5px; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--text-dim); line-height: 1.55; }

/* ---------- Character gallery ---------- */
.char-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 860px) { .char-grid { grid-template-columns: repeat(2, 1fr); } }

.char-card {
  position: relative; aspect-ratio: 1; border-radius: 18px;
  border: 1px solid var(--border); background: var(--panel); backdrop-filter: blur(10px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; overflow: hidden; cursor: default;
  transition: transform 200ms var(--ease);
}
.char-card:hover { transform: translateY(-4px); }
.char-emblem {
  width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 16px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}
.char-name { font-size: 12.5px; color: var(--text-dim); }
.char-quote {
  position: absolute; inset: 0; padding: 18px; display: flex; align-items: center; text-align: center;
  font-size: 12.5px; font-style: italic; background: rgba(7, 12, 22, 0.92);
  opacity: 0; transition: opacity 220ms ease; pointer-events: none;
}
.char-card:hover .char-quote { opacity: 1; }

/* ---------- Map / roadmap ---------- */
.map-section { padding: 0; }
.map-wrap { position: relative; height: 560px; overflow: hidden; }
.map-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.map-content {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 24px;
}
.map-compass {
  position: absolute; top: 60px; right: 6%; width: 90px; opacity: 0.9;
  animation: gl-compass-spin 18s linear infinite;
}
@keyframes gl-compass-spin { to { transform: rotate(360deg); } }

.island-marker {
  position: absolute; display: flex; flex-direction: column; align-items: center; gap: 6px;
  z-index: 3;
}
.island-dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 6px rgba(201, 162, 39, 0.15);
  animation: gl-pulse 2.4s ease-in-out infinite;
}
@keyframes gl-pulse { 0%, 100% { box-shadow: 0 0 0 6px rgba(201,162,39,0.15); } 50% { box-shadow: 0 0 0 10px rgba(201,162,39,0.05); } }
.island-label {
  font-size: 11px; background: rgba(7, 12, 22, 0.85); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 10px; white-space: nowrap; color: var(--text);
}
.island-label .status { color: var(--accent); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; display: block; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 720px; }
.faq-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 18px 0;
}
.faq-item summary {
  cursor: pointer; font-size: 15px; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--accent); font-size: 20px; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p { color: var(--text-dim); font-size: 13.5px; margin-top: 12px; line-height: 1.6; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 40px 0;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.footer-links { display: flex; gap: 20px; font-size: 13px; color: var(--text-dim); }
.footer-links a:hover { color: var(--accent); }
.footer-brand { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-dim); }
.footer-brand img { width: 20px; height: 20px; }

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Policy / prose pages ---------- */
.policy { max-width: 760px; margin: 0 auto; padding: 140px 24px 100px; }
.policy h1 { font-size: 30px; margin-bottom: 6px; }
.policy .updated { color: var(--text-dim); font-size: 12.5px; margin-bottom: 40px; }
.policy h2 { font-size: 18px; color: var(--accent); margin: 34px 0 12px; }
.policy p, .policy li { color: #d8cfb6; font-size: 14.5px; line-height: 1.75; }
.policy ul { padding-left: 20px; margin: 10px 0; }
.policy li { margin-bottom: 6px; }
.policy a { color: var(--accent); text-decoration: underline; }
.policy .back-link { display: inline-block; margin-bottom: 30px; font-size: 13px; color: var(--text-dim); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
