/* Ego website. Colours follow the iOS design tokens (ios/DESIGN.md). */
:root {
  --canvas: #F4F7FC;
  --surface: #FFFFFF;
  --ink: #0F1B3D;
  --secondary: #5B6B86;
  --muted: #8A97AD;
  --border: #E3EAF5;
  --fill: #EAF0F8;
  --brand: #1F7BFF;
  --brand-2: #4AA8FF;
  --brand-deep: #1F6BFF;
  --brand-soft: #EAF3FF;
  --pink: #FF6F91;
  --pink-soft: #FFE8EF;
  --live: #FF2D55;
  --audio: #7B61FF;
  --audio-soft: #F0EDFF;
  --gold: #C77700;
  --gold-soft: #FFF4DB;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 27, 61, .04), 0 8px 24px rgba(15, 27, 61, .06);
  --shadow-lg: 0 24px 60px rgba(31, 107, 255, .18);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; border-radius: 6px; }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font-weight: 700; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-deep));
  box-shadow: 0 8px 20px rgba(31, 107, 255, .28);
  border: 0; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 12px 26px rgba(31, 107, 255, .34); }
.btn-small { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--brand); }

/* ── header ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 247, 252, .86);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(227, 234, 245, .8);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 10px; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { color: var(--secondary); font-weight: 600; font-size: 15px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.site-nav .btn { color: #fff; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; position: relative; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  position: absolute; left: 11px; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; content: "";
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before { top: -7px; left: 0; }
.nav-toggle-bar::after { top: 7px; left: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 20px 20px; background: var(--surface);
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid var(--fill); font-size: 16px; }
  .site-nav .btn { margin-top: 14px; border-bottom: 0; }
}

/* ── hero ── */
.hero { position: relative; overflow: hidden; padding: 72px 0 88px; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 720px; height: 720px;
  background: radial-gradient(closest-side, rgba(74, 168, 255, .32), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; left: -200px; bottom: -260px; width: 560px; height: 560px;
  background: radial-gradient(closest-side, rgba(255, 111, 145, .18), transparent 70%);
  pointer-events: none;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; background: var(--surface);
  box-shadow: var(--shadow); font-weight: 700; font-size: 13px; color: var(--secondary); margin-bottom: 22px;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(255, 45, 85, .5); animation: breathe 1.8s ease-out infinite; }
@keyframes breathe { 0% { box-shadow: 0 0 0 0 rgba(255, 45, 85, .5); } 100% { box-shadow: 0 0 0 10px rgba(255, 45, 85, 0); } }
.hero h1 { font-size: clamp(36px, 5.4vw, 60px); font-weight: 800; letter-spacing: -.035em; margin-bottom: 18px; }
.hero h1 .accent { background: linear-gradient(135deg, var(--brand-2), var(--brand-deep)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 19px; color: var(--secondary); max-width: 520px; margin-bottom: 32px; }
.hero-art { position: relative; justify-self: center; }
.hero-art img { width: min(420px, 80vw); filter: drop-shadow(0 30px 50px rgba(31, 107, 255, .25)); animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.hero-chip {
  position: absolute; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.hero-chip .pill { padding: 2px 8px; border-radius: 999px; color: #fff; font-size: 11px; letter-spacing: .04em; }
.chip-live { top: 14%; left: -8%; }
.chip-live .pill { background: var(--live); }
.chip-audio { bottom: 18%; right: 0; }
.chip-audio .pill { background: var(--audio); }

@media (prefers-reduced-motion: reduce) {
  .hero-art img, .live-dot { animation: none; }
  html { scroll-behavior: auto; }
}

/* ── store buttons ── */
.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 20px 8px 16px; border-radius: 14px;
  background: var(--ink); color: #fff; transition: transform .15s ease;
}
.store-btn:hover { text-decoration: none; transform: translateY(-1px); }
.store-btn svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.store-btn span { display: flex; flex-direction: column; line-height: 1.15; font-weight: 700; font-size: 17px; }
.store-btn small { font-weight: 500; font-size: 11px; opacity: .8; }
.store-btn.is-soon { background: var(--fill); color: var(--secondary); cursor: default; }
.store-btn.is-soon:hover { transform: none; }
.store-buttons.on-dark .store-btn { background: #fff; color: var(--ink); }
.store-buttons.on-dark .store-btn.is-soon { background: rgba(255, 255, 255, .18); color: #fff; }

/* ── sections ── */
.section { padding: 88px 0; }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 800; letter-spacing: -.03em; }
.section-head p { color: var(--secondary); font-size: 18px; }
.kicker { display: block; color: var(--brand); font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  background: var(--surface); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow); border: 1px solid rgba(227, 234, 245, .6);
}
.feature h3 { font-size: 19px; font-weight: 800; margin: 18px 0 8px; }
.feature p { color: var(--secondary); margin: 0; font-size: 15px; }
.icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
}
.icon svg { width: 26px; height: 26px; }
.icon-live { background: #FFE6EB; color: var(--live); }
.icon-audio { background: var(--audio-soft); color: var(--audio); }
.icon-chat { background: var(--brand-soft); color: var(--brand); }
.icon-gift { background: var(--gold-soft); color: var(--gold); }
.icon-game { background: #E5F7EE; color: #1F9D63; }
.icon-heart { background: var(--pink-soft); color: var(--pink); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.panel {
  background: linear-gradient(160deg, var(--brand-soft), var(--surface));
  border-radius: 28px; padding: 36px; box-shadow: var(--shadow);
}
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; color: var(--secondary); }
.checklist li strong { color: var(--ink); display: block; }
.checklist svg { flex: none; width: 24px; height: 24px; color: var(--brand); margin-top: 2px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { background: var(--surface); border-radius: var(--radius-sm); padding: 20px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }

.cta {
  position: relative; overflow: hidden; border-radius: 32px; padding: 56px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-deep)); color: #fff;
  display: grid; grid-template-columns: 1.3fr .7fr; gap: 32px; align-items: center;
  box-shadow: var(--shadow-lg);
}
.cta h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; }
.cta p { color: rgba(255, 255, 255, .86); font-size: 18px; margin-bottom: 28px; }
.cta img { width: 220px; justify-self: center; filter: drop-shadow(0 20px 30px rgba(8, 16, 38, .3)); }

/* ── content pages ── */
.page-hero { padding: 64px 0 28px; }
.page-hero h1 { font-size: clamp(32px, 4.4vw, 48px); font-weight: 800; letter-spacing: -.03em; }
.page-hero p { color: var(--secondary); font-size: 18px; max-width: 680px; }
.updated { display: inline-block; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface); padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow); }

.doc { padding: 0 0 88px; }
.doc-layout { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; }
.toc {
  position: sticky; top: 92px; background: var(--surface); border-radius: var(--radius-sm);
  padding: 18px; box-shadow: var(--shadow); font-size: 14px;
}
.toc strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 18px; color: var(--muted); }
.toc li { margin: 6px 0; }
.toc a { color: var(--secondary); }
.toc a:hover { color: var(--brand); }
.prose {
  background: var(--surface); border-radius: var(--radius); padding: 40px 44px;
  box-shadow: var(--shadow); max-width: 820px;
}
.prose h2 { font-size: 22px; font-weight: 800; margin: 36px 0 12px; scroll-margin-top: 96px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 17px; font-weight: 700; margin: 24px 0 8px; }
.prose p, .prose li { color: #34425E; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 1em; }
.prose li { margin: 6px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--canvas); font-weight: 700; }
.table-wrap { overflow-x: auto; }
.note {
  background: var(--brand-soft); border-radius: var(--radius-sm); padding: 16px 18px; margin: 0 0 20px;
  color: var(--ink); font-size: 15px;
}
.note-warn { background: var(--pink-soft); }

.steps { counter-reset: step; list-style: none; padding: 0 !important; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: flex; gap: 14px; align-items: flex-start; margin: 0 !important; }
.steps li::before {
  content: counter(step); flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-deep));
}

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card h2 { font-size: 20px; font-weight: 800; }
.card p { color: var(--secondary); }

/* ── footer ── */
.site-footer { background: var(--ink); color: #B9C4D9; padding: 64px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.site-footer .brand { color: #fff; margin-bottom: 14px; }
.footer-brand p { max-width: 300px; font-size: 15px; }
.site-footer h2 { color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .02em; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0 0 10px; }
.site-footer a { color: #B9C4D9; font-size: 15px; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 14px;
}
.footer-bottom p { margin: 0; }

/* ── responsive ── */
@media (max-width: 960px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .doc-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
}
@media (max-width: 760px) {
  .hero { padding: 40px 0 64px; }
  .hero-grid, .split, .cta, .cards { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .hero-art img { width: min(300px, 72vw); }
  .chip-live { left: 0; }
  .chip-audio { right: 0; }
  .hero .lead { font-size: 17px; }
  .section { padding: 64px 0; }
  .features { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .cta { padding: 36px 24px; text-align: left; }
  .cta img { width: 160px; order: -1; }
  .prose { padding: 26px 20px; }
  .page-hero { padding: 44px 0 20px; }
}
@media (max-width: 420px) {
  .stat b { font-size: 20px; }
  .store-btn { flex: 1 1 auto; justify-content: center; }
}
