/* ==========================================================
   Athlorun website — shared styles
   Brand colours mirror lib/config/styles/app_colors.dart
   ========================================================== */

:root {
  --blue: #0f67fe;
  --blue-100: #357efb;
  --blue-soft: #f0f6fe;
  --purple: #7b61ff;
  --green: #33d68b;
  --pink: #ff4d61;
  --yellow: #fbbf24;

  --bg: #ffffff;
  --bg-alt: #f6f8fc;
  --surface: #ffffff;
  --border: #e6e9f0;
  --text: #0e1525;
  --text-muted: #5b6475;
  --shadow: 0 20px 50px -20px rgba(15, 40, 90, 0.25);
  --shadow-sm: 0 6px 20px -10px rgba(15, 40, 90, 0.25);

  --radius: 20px;
  --radius-sm: 12px;
  --max: 1160px;
  --gutter: 24px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1c;
    --bg-alt: #0f1626;
    --surface: #131b2e;
    --border: #222c44;
    --text: #eef2fb;
    --text-muted: #a0abc3;
    --blue-soft: #14223f;
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
    --shadow-sm: 0 6px 20px -10px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1c;
  --bg-alt: #0f1626;
  --surface: #131b2e;
  --border: #222c44;
  --text: #eef2fb;
  --text-muted: #a0abc3;
  --blue-soft: #14223f;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --shadow-sm: 0 6px 20px -10px rgba(0, 0, 0, 0.7);
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
@media (max-width: 600px) { :root { --gutter: 16px; } }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--blue); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--blue-100); outline-offset: 2px; border-radius: 6px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 12px; border-radius: 10px;
  color: var(--text-muted); font-weight: 600; font-size: .95rem;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: var(--bg-alt); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }
.menu-toggle { display: none; }

@media (max-width: 880px) {
  .menu-toggle { display: grid; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 68px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px var(--gutter) 16px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
  .nav-actions .btn { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 22px; border-radius: 14px; font-weight: 700; font-size: 1rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s;
  font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 10px 24px -10px rgba(15, 103, 254, .7); }
.btn-primary:hover { background: #0a58e0; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-danger { background: #e5354b; color: #fff; }
.btn-sm { padding: 8px 16px; font-size: .9rem; border-radius: 12px; }

.play-badge {
  display: inline-flex; align-items: center; gap: 12px;
  background: #000; color: #fff; padding: 10px 20px 10px 16px; border-radius: 14px;
  border: 1px solid #333; transition: transform .15s ease;
}
.play-badge:hover { text-decoration: none; transform: translateY(-2px); }
.play-badge svg { width: 28px; height: 28px; }
.play-badge small { display: block; font-size: .7rem; letter-spacing: .04em; opacity: .85; line-height: 1.1; }
.play-badge strong { display: block; font-size: 1.15rem; line-height: 1.2; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 72px 0 96px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto auto; width: 900px; height: 900px;
  background: radial-gradient(closest-side, rgba(15, 103, 254, .18), transparent 70%);
  z-index: -1;
}
.hero::after {
  content: ""; position: absolute; left: -300px; bottom: -300px; width: 700px; height: 700px;
  background: radial-gradient(closest-side, rgba(123, 97, 255, .14), transparent 70%);
  z-index: -1;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blue-soft); color: var(--blue); font-weight: 700; font-size: .85rem;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(51, 214, 139, .25); }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); font-weight: 800; letter-spacing: -0.035em; }
.gradient-text {
  background: linear-gradient(100deg, var(--blue) 0%, var(--purple) 60%, var(--pink) 110%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { font-size: 1.2rem; color: var(--text-muted); max-width: 540px; margin-bottom: 32px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 36px; color: var(--text-muted); font-size: .9rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta svg { width: 18px; height: 18px; color: var(--green); }

@media (max-width: 900px) {
  .hero { padding: 48px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
}

/* ---------- Phone mockup ---------- */
.phone-wrap { position: relative; display: flex; justify-content: center; }
.phone {
  position: relative; width: 300px; max-width: 100%; aspect-ratio: 9 / 19;
  background: #0b1220; border-radius: 44px; padding: 12px;
  box-shadow: 0 50px 80px -30px rgba(15, 40, 90, .55), inset 0 0 0 2px #1d2740;
  transform: rotate(-3deg);
}
.phone-screen {
  position: relative; height: 100%; border-radius: 34px; overflow: hidden;
  background: linear-gradient(180deg, #f5f9fe 0%, #ffffff 60%);
  color: #0e1525; padding: 40px 18px 18px; display: flex; flex-direction: column; gap: 14px;
  font-size: 12px;
}
.phone-notch { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 90px; height: 22px; background: #0b1220; border-radius: 20px; }
.ps-head { display: flex; justify-content: space-between; align-items: center; }
.ps-head b { font-size: 15px; }
.ps-head .avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--purple), var(--blue)); }
.ps-ring { position: relative; width: 150px; height: 150px; margin: 4px auto 0; }
.ps-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ps-ring .val { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ps-ring .val strong { font-size: 26px; font-weight: 800; line-height: 1; }
.ps-ring .val small { color: #6b7280; font-size: 11px; }
.ps-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ps-stat { background: #fff; border: 1px solid #e8edf6; border-radius: 14px; padding: 8px; text-align: center; }
.ps-stat b { display: block; font-size: 14px; }
.ps-stat span { color: #6b7280; font-size: 10px; }
.ps-card { background: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff; border-radius: 16px; padding: 12px 14px; }
.ps-card b { font-size: 13px; display: block; }
.ps-card .bar { height: 6px; background: rgba(255,255,255,.3); border-radius: 6px; margin-top: 8px; overflow: hidden; }
.ps-card .bar i { display: block; height: 100%; width: 68%; background: #fff; border-radius: 6px; }
.ps-chart { display: flex; align-items: flex-end; gap: 6px; height: 54px; padding: 0 4px; }
.ps-chart i { flex: 1; border-radius: 6px 6px 3px 3px; background: #dce9fe; }
.ps-chart i.on { background: var(--blue); }

.float-card {
  position: absolute; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px; font-size: .9rem; animation: bob 5s ease-in-out infinite;
}
.float-card .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 18px; }
.float-card b { display: block; font-size: .95rem; }
.float-card small { color: var(--text-muted); }
.fc-1 { top: 34%; left: -6%; }
.fc-2 { bottom: 14%; right: -6%; animation-delay: -2.5s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (max-width: 560px) {
  .fc-1 { left: 0; top: 30%; }
  .fc-2 { right: 0; bottom: 6%; }
}
@media (prefers-reduced-motion: reduce) {
  .float-card { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Sections ---------- */
section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.section-head .kicker { color: var(--blue); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); font-weight: 800; margin-top: 8px; }
.section-head p { color: var(--text-muted); font-size: 1.1rem; }
@media (max-width: 600px) { section { padding: 64px 0; } }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card h3 { font-size: 1.2rem; margin-top: 18px; }
.card p { color: var(--text-muted); margin: 0; }
.feature-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff;
}
.feature-icon svg { width: 26px; height: 26px; }
.bg-blue { background: linear-gradient(135deg, #357efb, #0f67fe); }
.bg-purple { background: linear-gradient(135deg, #9480ff, #7b61ff); }
.bg-green { background: linear-gradient(135deg, #51d9c9, #33d68b); }
.bg-pink { background: linear-gradient(135deg, #ff8a9a, #ff4d61); }
.bg-yellow { background: linear-gradient(135deg, #fcd34d, #f59e0b); }
.bg-dark { background: linear-gradient(135deg, #3b4a6b, #1b2438); }

/* Steps */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { position: relative; padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--blue-soft); color: var(--blue); font-weight: 800; margin-bottom: 16px;
}
.step h3 { font-size: 1.1rem; }
.step p { color: var(--text-muted); margin: 0; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

/* Stats band */
.stats-band {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  background: linear-gradient(120deg, var(--blue) 0%, var(--purple) 100%);
  color: #fff; border-radius: 28px; padding: 40px; text-align: center;
}
.stats-band strong { display: block; font-size: 2.2rem; font-weight: 800; }
.stats-band span { opacity: .85; }
@media (max-width: 720px) { .stats-band { grid-template-columns: repeat(2, 1fr); padding: 28px 16px; } }

/* Privacy highlight */
.privacy-split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.check-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 14px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; }
.check-list svg { flex: none; width: 22px; height: 22px; color: var(--green); margin-top: 2px; }
.shield-card {
  border-radius: 28px; padding: 36px; color: #fff;
  background: radial-gradient(circle at 20% 0%, #2b3d68 0%, #0b1220 70%);
  box-shadow: var(--shadow);
}
.shield-card .row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.shield-card .row:last-child { border-bottom: 0; }
.pill { font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(51,214,139,.18); color: #6ff0b5; }
@media (max-width: 860px) { .privacy-split { grid-template-columns: 1fr; } }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 20px; }
.faq summary {
  cursor: pointer; list-style: none; font-weight: 700; padding: 16px 0;
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--blue); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-muted); }

/* CTA */
.cta {
  position: relative; overflow: hidden; text-align: center; color: #fff;
  border-radius: 32px; padding: 64px 24px;
  background: linear-gradient(135deg, #0b1220 0%, #12245a 60%, #0f67fe 140%);
}
.cta h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.cta p { opacity: .85; max-width: 560px; margin: 0 auto 28px; }
.cta .play-badge { border-color: rgba(255,255,255,.3); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 56px 0 32px; background: var(--bg-alt); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-grid a { color: var(--text); }
.footer-about p { color: var(--text-muted); max-width: 320px; margin-top: 12px; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: .9rem;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }

/* ---------- Legal / document pages ---------- */
.page-hero { padding: 64px 0 40px; background: linear-gradient(180deg, var(--blue-soft), transparent); }
.page-hero h1 { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 800; }
.page-hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 720px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.meta-chip { font-size: .85rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); }

.doc-layout { display: grid; grid-template-columns: 260px 1fr; gap: 48px; padding-top: 32px; padding-bottom: 96px; align-items: start; }
.toc { position: sticky; top: 92px; font-size: .92rem; }
.toc h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 2px solid var(--border); }
.toc a { display: block; padding: 6px 14px; color: var(--text-muted); margin-left: -2px; border-left: 2px solid transparent; }
.toc a:hover, .toc a.active { color: var(--blue); border-left-color: var(--blue); text-decoration: none; }
@media (max-width: 900px) { .doc-layout { grid-template-columns: 1fr; } .toc { position: static; } }

.prose { max-width: 780px; min-width: 0; }
.prose h2 { font-size: 1.5rem; margin-top: 2.4em; padding-top: 8px; scroll-margin-top: 90px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.15rem; margin-top: 1.6em; }
.prose p, .prose li { color: var(--text-muted); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.callout {
  border-radius: var(--radius-sm); padding: 18px 20px; margin: 24px 0;
  background: var(--blue-soft); border: 1px solid color-mix(in srgb, var(--blue) 25%, transparent);
}
.callout p:last-child { margin: 0; }
.callout.warn { background: color-mix(in srgb, #f59e0b 12%, var(--bg)); border-color: color-mix(in srgb, #f59e0b 40%, transparent); }

.table-wrap { overflow-x: auto; margin: 20px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg-alt); color: var(--text); font-weight: 700; }
td { color: var(--text-muted); }
tr:last-child td { border-bottom: 0; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: .92rem; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; width: 100%;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid color-mix(in srgb, var(--blue) 35%, transparent); border-color: var(--blue); }
.field .hint { font-size: .82rem; color: var(--text-muted); }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--text-muted); }
.checkbox input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--blue); }
.form-note { font-size: .9rem; color: var(--text-muted); }
.form-success { display: none; }
.form-success.show { display: block; }

.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; padding-top: 32px; padding-bottom: 96px; align-items: start; }
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card { display: flex; gap: 16px; align-items: flex-start; }
.contact-card + .contact-card { margin-top: 16px; }
.contact-card .feature-icon { flex: none; width: 46px; height: 46px; border-radius: 14px; }
.contact-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.contact-card p { margin: 0; color: var(--text-muted); }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 24px 40px; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .num {
  position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue); color: #fff; font-weight: 800; font-size: .85rem; display: grid; place-items: center;
}
.timeline h3 { font-size: 1.05rem; margin: 2px 0 4px; }
.timeline p { color: var(--text-muted); margin: 0; }

/* 404 */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 80px 0; }
.notfound .big { font-size: clamp(5rem, 18vw, 10rem); font-weight: 800; line-height: 1; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
.no-js .reveal { opacity: 1; transform: none; }
