/* Koela website: the app's look on the web. Indigo, violet and warm gradient tokens. */
:root {
  /* Koela is light only (docs/BRAND.md; colours from apps/mobile/src/design/tokens.ts). */
  color-scheme: light;
  --bg: #FAF9FF;
  --bg-deep: #F4F1FF;
  --surface: #FFFFFF;
  --subtle: #F7F5FF;
  --raised: #FFFFFF;
  --inset: #F1EDFF;
  --nav: #F1EDFF;
  --text: #211B35;
  --text-2: #4F4868;
  --muted: #6A6384;
  --line: #E6E0F3;
  --line-strong: #CDC3EE;
  --brand: #6336F5;
  --brand-tint: #F1EDFF;
  --accent: #5020DF; /* brand colour used as text: deep violet */
  --coin: #8A5A00; /* coin text on the pale coin surface */
  --diamond: #A0307F;
  --ok: #197A5A;
  --mark-bg: #F1EDFF;
  --mark-text: #5020DF;
  --max: 1160px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  /* Gradients (tokens.ts `gradients`): brand purple, white cards, no rose. */
  --brand-grad: linear-gradient(135deg, #8461FF 0%, #6F47F8 55%, #6336F5 100%);
  --brand-grad-pressed: linear-gradient(135deg, #7048F7 0%, #5020DF 100%);
  --card-grad: linear-gradient(180deg, #FFFFFF, #FCFBFF);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg-deep); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 12px; z-index: 20; }
.skip:focus { left: 8px; }
.wrap { width: min(var(--max), 100% - 48px); margin-inline: auto; }

h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }
h1 { font-size: clamp(42px, 6.4vw, 80px); line-height: 1.04; }
h2 { font-size: clamp(32px, 4.4vw, 54px); line-height: 1.08; }
h3 { font-size: 20px; line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 6px; }
.accent { color: var(--accent); display: block; }
.tag { display: inline-block; background: var(--brand-tint); color: var(--accent); padding: 5px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; margin-bottom: 18px; }
.lead { color: var(--text-2); font-size: clamp(17px, 1.5vw, 20px); max-width: 48ch; margin: 18px 0 0; }

/* Header: a quiet bar with a hairline, like the app's top edge */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(250, 249, 255, 0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.plain .site-header { position: static; background: var(--nav); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.brand img { width: 34px; height: 34px; }
nav { display: flex; align-items: center; gap: 4px; }
nav a { padding: 8px 14px; color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 500; border-radius: 12px; transition: background-color 150ms var(--ease), color 150ms var(--ease); }
nav a:hover, nav a[aria-current="page"] { background: linear-gradient(180deg, #EDE7FF, #E2D9FF); color: var(--accent); }

/* Buttons: the brand purple gradient on every primary action */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 28px; border-radius: 12px; background: var(--brand-grad); color: #fff; font: 500 16px/1 var(--sans); text-decoration: none; border: 0; transition: transform 120ms var(--ease), filter 120ms var(--ease); }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); background: var(--brand-grad-pressed); }
.btn.alt { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
.btn.alt:hover { background: var(--subtle); filter: none; }
.cta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

/* Hero: the dark canvas with the app's plum wash behind the top */
.hero { background: radial-gradient(ellipse 70% 60% at 18% 0%, rgba(99, 54, 245, 0.14), rgba(250, 249, 255, 0) 70%), linear-gradient(135deg, #FAF9FF, #F4F1FF); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; min-height: min(86svh, 760px); }
.hero-copy { align-self: center; padding: 72px 0; position: relative; z-index: 1; }
.hero h1 span { display: block; }
.hero h1 .gold { color: var(--accent); }
.hero .lead { color: var(--text-2); }
.hero-art { align-self: center; }
.hero-art img { display: block; width: 100%; max-width: 520px; height: auto; margin-inline: auto; filter: drop-shadow(0 24px 40px rgba(99, 54, 245, 0.18)); }

/* Ticker: calm hairline band */
.ticker { background: var(--nav); border-block: 1px solid var(--line); overflow: hidden; padding: 14px 0; }
.ticker div { display: flex; width: max-content; animation: slide 36s linear infinite; }
.ticker span { font: 500 16px/1 var(--sans); white-space: nowrap; padding-right: 22px; color: var(--text-2); }
.ticker span:nth-child(3n+2) { color: var(--coin); }
.ticker span:nth-child(3n) { color: var(--accent); }
.ticker span::after { content: "\2022"; color: var(--line-strong); margin-left: 22px; }
@keyframes slide { to { transform: translateX(-50%); } }

section { padding: clamp(64px, 8vw, 112px) 0; background: var(--bg); color: var(--text); }
.head-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: end; margin-bottom: 48px; }
.head-row .lead { margin: 0; }

/* Cards: plum falling to near-black, a hairline, no shadow */
.cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.card { background: var(--card-grad); color: var(--text); border: 1px solid var(--line); border-radius: 20px; padding: 12px 12px 20px; transition: border-color 160ms var(--ease), transform 160ms var(--ease); }
.card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.card img { width: 100%; height: auto; aspect-ratio: 1.1; object-fit: cover; border-radius: 14px; margin-bottom: 16px; }
.card small { display: block; font-weight: 500; margin: 0 6px 6px; color: var(--accent); font-size: 13px; }
.card h3, .card p { margin-inline: 6px; }
.card p { margin-block: 0; font-size: 15px; line-height: 1.45; color: var(--text-2); }

/* Moments, languages, closing: dark surfaces, never a full burgundy screen */
.moments { background: var(--subtle); }
.langs { background: radial-gradient(ellipse 60% 80% at 85% 20%, rgba(99, 54, 245, 0.12), rgba(250, 249, 255, 0) 70%), var(--bg); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 44px; }
.tile { background: var(--card-grad); color: var(--text); border: 1px solid var(--line); border-radius: 20px; padding: 18px 18px 22px; display: flex; flex-direction: column; }
.tile-art { height: 190px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.tile-art img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; }
.tile h3 { margin: 0; font-size: 18px; }
.noreason { font: 500 clamp(24px, 3vw, 36px)/1.15 var(--sans); letter-spacing: -0.02em; color: var(--accent); margin: 36px 0 0; }

/* Two-column sections with numbered rows */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.center-y { align-items: center; }
.stick { position: sticky; top: 96px; }
.object { margin-top: 36px; }
.object img { display: block; width: 100%; max-width: 440px; height: auto; margin-inline: auto; }
.object.globe { margin-top: 0; }
.object.globe img { max-width: 580px; }
.numbered { list-style: none; margin: 0; padding: 0; counter-reset: n; }
.numbered li { counter-increment: n; padding: 22px 0 22px 64px; border-top: 1px solid var(--line); position: relative; }
.numbered li:last-child { border-bottom: 1px solid var(--line); }
.numbered li::before { content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: 22px; font: 500 22px/1.2 var(--sans); color: var(--accent); font-variant-numeric: tabular-nums; }
.numbered p { margin: 0; color: var(--text-2); }

/* Questions */
.faq { display: grid; grid-template-columns: 1fr 1.5fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; padding: 20px 0; font: 500 19px/1.3 var(--sans); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-size: 26px; line-height: 0.9; }
details[open] summary::after { content: "\2013"; }
details p { margin: 0 0 20px; color: var(--text-2); }

/* Closing */
.closing { background: radial-gradient(ellipse 70% 90% at 50% 0%, rgba(99, 54, 245, 0.14), rgba(250, 249, 255, 0) 75%), var(--bg-deep); padding: clamp(72px, 9vw, 120px) 0; text-align: center; }
.closing h2 { font-size: clamp(38px, 6vw, 72px); }
.closing h2 span { color: var(--accent); display: block; }
.soon { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; justify-content: center; }
.soon span { display: inline-flex; align-items: center; height: 52px; padding: 0 24px; border-radius: 12px; background: transparent; color: var(--text); border: 1px solid var(--line-strong); font-weight: 500; font-size: 15px; }

/* Values still to fill in on legal drafts */
mark { background: var(--mark-bg); color: var(--mark-text); padding: 0 4px; border-radius: 4px; }

.site-footer { background: var(--nav); color: var(--muted); padding: 52px 0; font-size: 15px; border-top: 1px solid var(--line); }
.site-footer .cols { display: grid; gap: 32px; grid-template-columns: 1.6fr 1fr 1fr; }
.site-footer h4 { margin: 0 0 12px; color: var(--text); font: 500 16px/1.2 var(--sans); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin: 8px 0 0; max-width: 36ch; }
.foot-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 600 24px/1 var(--sans); letter-spacing: -0.02em; }
.foot-brand img { width: 30px; height: 30px; }

/* Long-form policy pages */
.doc { padding: clamp(36px, 5vw, 64px) 0; }
.doc .wrap { display: grid; gap: 64px; grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
.toc { position: sticky; top: 32px; font-size: 14px; max-height: calc(100vh - 64px); overflow: auto; }
.toc strong { display: block; margin-bottom: 8px; font-weight: 500; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 6px 0; color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--text); }
article.prose { max-width: 70ch; font-size: 16.5px; }
article.prose h1 { font-size: clamp(36px, 5vw, 56px); margin-bottom: 24px; }
article.prose h2 { font-size: 24px; letter-spacing: -0.015em; line-height: 1.2; margin: 44px 0 12px; scroll-margin-top: 24px; }
article.prose p, article.prose li { color: var(--text-2); }
article.prose strong { color: var(--text); font-weight: 600; }
article.prose ul, article.prose ol { padding-left: 22px; }
article.prose li { margin: 6px 0; }
article.prose blockquote { margin: 0 0 24px; padding: 12px 16px; background: var(--mark-bg); color: var(--mark-text); border-radius: 12px; font-size: 15px; }
article.prose blockquote p, article.prose blockquote strong { color: inherit; margin: 0; }
.tablewrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 520px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text-2); }
th { color: var(--text); font-weight: 500; background: var(--subtle); }
tr:last-child td { border-bottom: 0; }

/* Reveal, applied by site.js only */
.pre { opacity: 0; transform: translateY(20px); }
[data-reveal] { transition: opacity 500ms var(--ease), transform 500ms var(--ease); }

@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .tiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .wrap { width: calc(100% - 32px); }
  body { font-size: 16px; }
  nav a.opt { display: none; }
  nav a { padding: 8px 10px; }
  .hero-grid { grid-template-columns: 1fr; gap: 0; min-height: 0; }
  .hero-copy { padding: 48px 0 24px; }
  .hero-art { padding: 0 0 40px; }
  .hero-art img { max-width: 300px; }
  .btn { min-height: 50px; padding: 0 22px; }
  .head-row, .split, .faq { grid-template-columns: 1fr; }
  .head-row { gap: 16px; margin-bottom: 36px; }
  .stick { position: static; }
  .object img { max-width: 320px; }
  .object.globe img { max-width: 100%; }
  .numbered li { padding-left: 52px; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .doc .wrap { grid-template-columns: 1fr; gap: 16px; }
  .toc { display: none; }
}
@media (max-width: 480px) {
  .tile { padding: 14px 14px 18px; border-radius: 16px; }
  .tile-art { height: 110px; margin-bottom: 12px; }
  .tile h3 { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker div { animation: none; }
  .card, .btn, [data-reveal] { transition: none; }
}

/* Artwork is opaque (not cutouts): round the corners, drop the cutout shadow */
.hero-art img { border-radius: 28px; filter: none; box-shadow: 0 24px 60px rgba(99, 54, 245, 0.16); }
.tile-art img { border-radius: 16px; }
.object img { border-radius: 20px; }
.brand img, .foot-brand img { border-radius: 10px; }
