/* Storylang website — shared styles */

:root {
  --bg: #ffffff;
  --bg-soft: #f4f7fb;
  --surface: #ffffff;
  --text: #0f1b2d;
  --text-muted: #51607a;
  --border: #e2e8f0;
  --brand: #1f6fe5;
  --brand-2: #10a5c4;
  --brand-ink: #ffffff;
  --highlight: rgba(31, 111, 229, 0.14);
  --shadow: 0 24px 60px -24px rgba(15, 27, 45, 0.28);
  --radius: 18px;
  --max: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --bg-soft: #111a2c;
    --surface: #152036;
    --text: #e8eef8;
    --text-muted: #9aa8c0;
    --border: #23314b;
    --brand: #5b9bff;
    --brand-2: #2cc4de;
    --highlight: rgba(91, 155, 255, 0.2);
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --bg-soft: #111a2c;
  --surface: #152036;
  --text: #e8eef8;
  --text-muted: #9aa8c0;
  --border: #23314b;
  --brand: #5b9bff;
  --brand-2: #2cc4de;
  --highlight: rgba(91, 155, 255, 0.2);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 720px) {
  .wrap { padding: 0 32px; }
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }

.nav { display: flex; gap: 20px; font-size: 15px; }
.nav a { color: var(--text-muted); }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav .hide-sm { display: none; }
@media (min-width: 640px) { .nav .hide-sm { display: inline; } }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-ink);
  box-shadow: 0 10px 24px -10px var(--brand);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn svg { width: 20px; height: 20px; fill: currentColor; }

/* Hero */

.hero {
  padding: 56px 0 40px;
  background:
    radial-gradient(900px 400px at 85% -10%, var(--highlight), transparent 70%),
    radial-gradient(700px 360px at -10% 10%, color-mix(in srgb, var(--brand-2) 14%, transparent), transparent 70%);
}

.hero .wrap {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 900px) {
  .hero { padding: 88px 0 72px; }
  .hero .wrap { grid-template-columns: 1.1fr 0.9fr; }
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--highlight);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

h1 {
  font-size: clamp(36px, 6vw, 58px);
  line-height: 1.07;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
}

h1 .grad {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--text-muted);
  max-width: 34em;
  margin: 0 0 28px;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.fine { font-size: 14px; color: var(--text-muted); margin-top: 14px; }

/* Phone mockup */

.phone {
  position: relative;
  width: 100%;
  max-width: 330px;
  margin: 0 auto;
  aspect-ratio: 9 / 18.5;
  border-radius: 44px;
  padding: 12px;
  background: #0d1424;
  box-shadow: var(--shadow), inset 0 0 0 2px #2a3550;
}

.screen {
  position: relative;
  height: 100%;
  border-radius: 34px;
  overflow: hidden;
  background: #fbf8f2;
  color: #2a2620;
  padding: 54px 22px 22px;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.7;
}

.screen::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 92px;
  height: 26px;
  margin-left: -46px;
  background: #0d1424;
  border-radius: 999px;
}

.screen .chapter {
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a8f7c;
  margin-bottom: 10px;
}

.screen p { margin: 0 0 12px; }

.screen .word {
  background: rgba(31, 111, 229, 0.18);
  border-radius: 4px;
  padding: 0 2px;
  box-shadow: 0 0 0 1px rgba(31, 111, 229, 0.35);
}

.popover {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 47%;
  background: #ffffff;
  color: #0f1b2d;
  border-radius: 16px;
  padding: 14px 16px;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 18px 40px -12px rgba(15, 27, 45, 0.45), 0 0 0 1px rgba(15, 27, 45, 0.06);
  animation: pop 0.5s 0.6s both cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.popover .head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.popover .term { font-weight: 700; font-size: 17px; }
.popover .pos { font-size: 12px; color: #6b7891; }
.popover .tr { font-size: 16px; color: #1f6fe5; font-weight: 600; margin: 2px 0 6px; }
.popover .ctx { color: #51607a; font-size: 13px; }
.popover .saved {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #0f8a5f;
}

.screen .player {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 6px 18px -8px rgba(15, 27, 45, 0.3);
  font-family: var(--font);
  font-size: 12px;
  color: #6b7891;
}
.screen .player .play {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1f6fe5;
  color: #fff;
  font-size: 11px;
}
.screen .player .bar { flex: 1; height: 4px; border-radius: 4px; background: #e6ebf2; overflow: hidden; }
.screen .player .bar i { display: block; width: 32%; height: 100%; background: linear-gradient(90deg, #1f6fe5, #10a5c4); }

@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .popover { animation: none; }
  html { scroll-behavior: auto; }
}

/* Sections */

section { padding: 64px 0; }
@media (min-width: 900px) { section { padding: 96px 0; } }

.soft { background: var(--bg-soft); }

.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.section-head p { color: var(--text-muted); margin: 0; font-size: 18px; }

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid.three { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card h3 { font-size: 19px; margin: 14px 0 6px; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--text-muted); font-size: 16px; }

.icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--highlight);
  color: var(--brand);
}
.icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Steps */

.steps { counter-reset: step; display: grid; gap: 16px; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.step { position: relative; padding-top: 8px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 700;
  margin-bottom: 14px;
}
.step h3 { margin: 0 0 6px; font-size: 19px; }
.step p { margin: 0; color: var(--text-muted); }

/* Levels strip */

.levels { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.levels span {
  font-weight: 700;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* Pricing */

.plans { display: grid; gap: 16px; }
@media (min-width: 760px) { .plans { grid-template-columns: 1fr 1fr; } }

.plan { padding: 28px; }
.plan.featured {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--brand), var(--brand-2)) border-box;
}
.plan h3 { margin: 0 0 4px; font-size: 22px; }
.plan .sub { color: var(--text-muted); margin: 0 0 18px; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li svg { flex: none; width: 20px; height: 20px; margin-top: 3px; stroke: var(--brand); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* Privacy band */

.privacy-band {
  display: grid;
  gap: 24px;
  align-items: center;
}
@media (min-width: 900px) { .privacy-band { grid-template-columns: 1fr 1fr; } }

.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pills span {
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
}

/* Final CTA */

.final {
  text-align: center;
  border-radius: 28px;
  padding: 56px 24px;
  background: linear-gradient(135deg, #1f6fe5, #10a5c4);
  color: #fff;
}
.final h2 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 10px; letter-spacing: -0.02em; }
.final p { margin: 0 auto 26px; max-width: 32em; opacity: 0.92; }
.final .btn-primary { background: #fff; color: #0f1b2d; box-shadow: none; }

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  font-size: 14px;
  color: var(--text-muted);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  justify-content: space-between;
  align-items: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* Long-form pages (privacy, support) */

.doc { padding: 48px 0 72px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(32px, 5vw, 44px); }
.doc h2 { font-size: 24px; margin: 40px 0 10px; letter-spacing: -0.01em; }
.doc h3 { font-size: 19px; margin: 28px 0 6px; }
.doc p, .doc li { color: var(--text); }
.doc .updated { color: var(--text-muted); margin-top: -6px; }
.doc .callout {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 24px 0;
}
.doc .callout p { margin: 0; }
.doc ul { padding-left: 22px; }
.doc li { margin: 6px 0; }
