/* Tokens: colours match the app (pad3l apps/web/public/app.css); orange is the logo's. */
:root {
  --bg: #f3f5fa;
  --panel: #ffffff;
  --line: #d5dbea;
  --text: #0b1020;
  --muted: #5b6682;
  --accent: #ee742c;
  --accent-text: #0b1020;
  --ball: #d9f24f;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --fs-h1: clamp(2.25rem, 6vw, 4rem);
  --fs-h2: clamp(1.75rem, 4vw, 2.5rem);
  --fs-h3: 1.25rem;
  --fs-lead: clamp(1.125rem, 2vw, 1.3rem);
  --fs-body: 1rem;

  --wrap: 1120px;
  --gutter: 16px;
  --radius: 16px;
  --section-spacing: clamp(56px, 9vw, 112px);
  --gap: calc(var(--section-spacing) / 4);
  --gap-s: calc(var(--section-spacing) / 8);
  --btn-transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1e;
    --panel: #141a2e;
    --line: #2b3454;
    --text: #f5f7fb;
    --muted: #9aa4bd;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1e;
  --panel: #141a2e;
  --line: #2b3454;
  --text: #f5f7fb;
  --muted: #9aa4bd;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 var(--gap-s); letter-spacing: -0.01em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 var(--gap-s); }
p:last-child { margin-bottom: 0; }
a { color: inherit; transition: color .2s ease; }
a:hover { color: var(--accent); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section-spacing) 0; }
.section.alt { background: var(--panel); }
.lead { font-size: var(--fs-lead); color: var(--muted); max-width: 40em; }

/* Header, nav and footer */
.site-header { position: relative; }
.site-nav { display: flex; align-items: center; gap: var(--gap); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--gap); }
.site-nav ul a { text-decoration: none; font-weight: 600; }
.site-nav a[aria-current="page"] { color: var(--accent); }
.nav-toggle {
  display: none; font: inherit; font-weight: 600; color: var(--text); background: transparent;
  border: 2px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer;
  transition: var(--btn-transition);
}
.nav-toggle:hover { border-color: var(--accent); }
@media (max-width: 1079px) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 10;
    flex-direction: column; align-items: flex-start; gap: var(--gap-s);
    background: var(--bg); border-bottom: 1px solid var(--line); padding: var(--gap-s) var(--gutter) var(--gap);
  }
  .js .nav-open .site-nav { display: flex; }
  .site-nav ul { flex-direction: column; gap: var(--gap-s); }
  .site-header .header-inner { flex-wrap: wrap; }
}

.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--gap-s);
  padding-top: var(--gap-s); padding-bottom: var(--gap-s);
}
.logo { width: 120px; }
.logo-on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-on-dark { display: block; }
  :root:not([data-theme="light"]) .logo-on-light { display: none; }
}
:root[data-theme="dark"] .logo-on-dark { display: block; }
:root[data-theme="dark"] .logo-on-light { display: none; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.site-footer p { margin: 0; }

/* Buttons: one look everywhere */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 999px; border: 2px solid var(--accent);
  font-weight: 600; text-decoration: none; line-height: 1.2;
  transition: var(--btn-transition);
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: transparent; color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--accent); color: var(--accent-text); }
.btn[aria-disabled="true"] { cursor: default; }
.btn[aria-disabled="true"]:hover { background: var(--accent); color: var(--accent-text); }
.actions { display: flex; flex-wrap: wrap; gap: var(--gap-s); margin-top: var(--gap); }

/* Content blocks */
.hero h1 { max-width: 14em; }
.steps { list-style: none; padding: 0; margin: var(--gap) 0 0; display: grid; gap: var(--gap); counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step); display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%; margin-bottom: var(--gap-s);
  background: var(--ball); color: #0b1020; font-weight: 700;
}
.cards { display: grid; gap: var(--gap); margin-top: var(--gap); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--gap); }
.steps p, .card p { color: var(--muted); }

/* Hero with the phone mock-up */
.hero-grid { display: grid; gap: var(--gap); align-items: center; }
.note { color: var(--muted); font-size: .95rem; margin-top: var(--gap-s); }
.hero-visual { display: flex; justify-content: center; }

/* Lists and page parts */
.page-intro h1 { margin-bottom: var(--gap-s); }
.more { margin-top: var(--gap); font-weight: 600; }
.more a { text-decoration-color: var(--accent); text-underline-offset: 3px; }
.tag {
  display: inline-block; vertical-align: middle; margin-left: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: .875rem; font-weight: 600; background: var(--ball); color: #0b1020;
}
.format-list, .ticks { list-style: none; padding: 0; margin: var(--gap) 0 0; display: grid; gap: var(--gap-s); }
.format-list li { padding-bottom: var(--gap-s); border-bottom: 1px solid var(--line); color: var(--muted); }
.format-list strong { display: block; color: var(--text); font-size: var(--fs-h3); }
.ticks li { padding-left: 32px; position: relative; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .3em; width: 18px; height: 18px; border-radius: 50%; background: var(--ball);
}
.timeline { list-style: none; padding: 0; margin: 0; counter-reset: step; max-width: 760px; }
.timeline li { counter-increment: step; position: relative; padding: 0 0 var(--gap) 64px; }
.timeline li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ball); color: #0b1020; font-weight: 700;
}
.timeline li:not(:last-child)::after {
  content: ""; position: absolute; left: 19px; top: 48px; bottom: 8px; width: 2px; background: var(--line);
}
.timeline h3 { padding-top: 8px; }
.timeline p { color: var(--muted); }
.toc { display: flex; flex-wrap: wrap; gap: var(--gap-s); margin-top: var(--gap); }
.toc a {
  text-decoration: none; font-weight: 600; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  transition: color .2s ease, border-color .2s ease;
}
.toc a:hover { border-color: var(--accent); }
.defs { display: grid; grid-template-columns: max-content 1fr; gap: var(--gap-s) var(--gap); margin: 0 0 var(--gap-s); }
.defs dt { font-weight: 600; }
.defs dd { margin: 0; color: var(--muted); }
@media (max-width: 599px) {
  .defs { grid-template-columns: 1fr; gap: 4px; }
  .defs dd { margin-bottom: var(--gap-s); }
}
.faq > * { max-width: 760px; }
.faq h2 { margin-bottom: var(--gap-s); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; font-weight: 600; font-size: 1.05rem; padding: var(--gap-s) 40px var(--gap-s) 0; position: relative;
  transition: color .2s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--accent); }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { color: var(--accent); }
.faq details p { color: var(--muted); padding-bottom: var(--gap-s); }
.lead a, .faq a, .card a { text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* Text pages: privacy, support, 404 */
.prose > * { max-width: 720px; }
.prose h2 { margin-top: var(--gap); }
.prose ul, .prose ol { margin: 0 0 var(--gap-s); padding-left: 1.25em; }
.prose h3 { margin-top: var(--gap-s); }
.prose li + li { margin-top: calc(var(--gap-s) / 2); }
.prose .updated { color: var(--muted); font-size: .9rem; }
.prose a:not(.btn) { text-decoration-color: var(--accent); text-underline-offset: 3px; }

.footer-nav { display: flex; flex-wrap: wrap; gap: var(--gap-s); }
.footer-nav a { text-decoration: none; }

@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1.2fr 1fr; }
}
@media (min-width: 1024px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .cards-4 { grid-template-columns: repeat(4, 1fr); }
}
.alt .card { background: var(--bg); }

/* Social: trophies, titles, league table, recap card */
:root {
  --tier-common: #9aa4bd;
  --tier-uncommon: #22c55e;
  --tier-rare: #4f8cff;
  --tier-legendary: #ee742c;
  --tier-mythic: #b46cff;
}
.trophy { border-top: 4px solid var(--tier); }
.trophy .tier { font-size: .875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tier); margin-bottom: calc(var(--gap-s) / 2); }
.tier-common { --tier: var(--tier-common); }
.tier-uncommon { --tier: var(--tier-uncommon); }
.tier-rare { --tier: var(--tier-rare); }
.tier-legendary { --tier: var(--tier-legendary); }
.tier-mythic { --tier: var(--tier-mythic); }

.split { display: grid; gap: var(--gap); align-items: center; }
.split-top { margin-top: var(--gap); }
.split h3 { margin-top: var(--gap); }

.title-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap-s); }
.title-list li {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--gap-s) var(--gap); font-weight: 700; font-size: var(--fs-h3);
}
.title-list span:not(.title-icon) { color: var(--accent); font-weight: 600; }

  width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; font-variant-numeric: tabular-nums;
}

.mock-recap {
  justify-self: center; width: 100%; max-width: 340px; padding: 28px; border-radius: 24px;
  background: #0a0f1e; color: #f5f7fb; border: 1px solid #2b3454; box-shadow: 0 24px 60px rgba(10, 15, 30, .25);
}
.mock-recap p { margin: 0; }
.mock-recap-meta, .mock-recap-foot { color: #9aa4bd; font-size: .875rem; }
.mock-recap .mock-recap-win { font-size: 1.75rem; font-weight: 700; margin: 8px 0 16px; color: var(--ball); }
.mock-recap ol { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; font-weight: 600; }
.mock-recap li { display: flex; justify-content: space-between; border-bottom: 1px solid #2b3454; padding-bottom: 8px; }
.mock-recap .mock-recap-trophies { color: var(--accent); font-weight: 600; margin-bottom: 12px; }

@media (min-width: 768px) {
  .split { grid-template-columns: 1fr 1fr; gap: calc(var(--gap) * 2); }
}
@media (min-width: 1024px) {
  .cards.trophies { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 767px) {
  .cards.trophies, .cards-4:has(.trophy) { grid-template-columns: repeat(2, 1fr); gap: var(--gap-s); }
  .trophy { padding: var(--gap-s); }
}

.trophy-icon { font-size: 3.5rem; line-height: 1; margin-bottom: var(--gap-s); }
.title-icon { margin-right: 4px; }

/* Screenshots in a device frame */
.device { margin: 0; overflow: hidden; background: #0a0f1e; border: 8px solid #2b3454; box-shadow: 0 24px 60px rgba(10, 15, 30, .25); }
.device img { display: block; width: 100%; height: auto; }
.device-phone { width: 100%; max-width: 300px; border-radius: 40px; justify-self: center; margin-inline: auto; }
.device-tablet { border-radius: 24px; }
.figure-wide { max-width: 960px; margin: var(--gap) auto 0; }
@media (min-width: 768px) {
  .media-end { order: 2; }
}
@media (max-width: 767px) {
  .hero .device-phone { max-width: 200px; border-width: 6px; border-radius: 30px; }
}

/* Screenshots beside the How it works steps and guide sections.
   Phone: heading, screenshot, text. Desktop: text left, screenshot right. */
.shot { margin: 0; }
.shot.device-phone { max-width: 260px; border-width: 6px; border-radius: 32px; }
.shot.device-tablet { border-width: 6px; border-radius: 18px; }
.shot-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: var(--gap-s); }

.timeline { max-width: none; }
.step-media { display: grid; grid-template-areas: "head" "fig" "text"; row-gap: var(--gap-s); }
.step-media > h3 { grid-area: head; margin-bottom: 0; }
.step-media > .shot { grid-area: fig; }
.step-media > p { grid-area: text; }

.guide-row { display: grid; grid-template-areas: "head" "fig" "text"; row-gap: var(--gap); }
.guide-row > h2 { grid-area: head; margin-bottom: 0; }
.guide-fig { grid-area: fig; }
.guide-text { grid-area: text; }

@media (min-width: 900px) {
  .step-media {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr;
    grid-template-areas: "head fig" "text fig"; column-gap: calc(var(--gap) * 2); align-items: start;
  }
  .step-media > .device-phone { justify-self: center; }
  .timeline li.step-media { padding-bottom: calc(var(--gap) * 2); }

  .guide-row {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-areas: "head fig" "text fig";
    grid-template-rows: auto 1fr; column-gap: calc(var(--gap) * 2); align-items: start;
  }
  .guide-fig { position: sticky; top: var(--gap); display: flex; justify-content: center; }
  .guide-fig > .device-tablet { width: 100%; }
}
