/* Site styles. Dark only, to match the app. Every text color below is at least 4.5:1,
   and every control border at least 3:1, on --bg, --surface and --surface-2 (WCAG 2.2 AA).
   Recheck the ratios if you change a color. */
:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --surface: #141416;
  --surface-2: #1d1d20;
  --border: #3a3a41;
  --control-border: #8a8a93;
  --text: #f5f5f7;
  --muted: #b9b9c0;
  --blue: #5aa9ff;
  --green: #30d158;
  --orange: #ff9f0a;
  --purple: #c98bff;
  --red: #ff7a70;
  --radius: 16px;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
main :is(p, li, dd) a { overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; }
h3 { font-size: 1.3rem; letter-spacing: -0.015em; }
h4 { font-size: 1.1rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.wrap { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.narrow { width: min(100% - 2rem, 740px); margin-inline: auto; }
.muted { color: var(--muted); }
.accent { color: var(--orange); }
.eyebrow { color: var(--orange); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 0.75rem; }
.eyebrow a { color: inherit; display: inline-block; padding-block: 0.85rem; margin-block: -0.85rem; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 36em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip-link { position: absolute; left: 1rem; top: -5rem; background: var(--orange); color: #000; padding: 0.7rem 1rem; border-radius: 10px; font-weight: 700; z-index: 10; }
.skip-link:focus { top: 1rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem; padding-block: 0.7rem; }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--text); text-decoration: none; font-weight: 700; margin-right: auto; min-height: 44px; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0 1.15rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.97rem; display: inline-flex; align-items: center; min-height: 44px; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--text); }
.site-nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 0.45em; }

/* Buttons */
.btn { overflow-wrap: break-word; display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; min-height: 52px; padding: 0.75rem 1.4rem; border-radius: 14px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 2px solid transparent; text-align: center; }
.btn-small { min-height: 44px; padding: 0.5rem 1rem; border-radius: 12px; }
.btn-primary { background: var(--orange); color: #000; }
.btn-primary:hover { background: #ffb840; }
.btn-secondary, .btn-choice { background: transparent; color: var(--text); border-color: var(--control-border); }
.btn-secondary:hover, .btn-choice:hover:not([disabled]) { border-color: var(--text); background: var(--surface-2); }
.btn-choice { background: var(--surface-2); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.6rem; }

/* Sections */
section { padding-block: clamp(3rem, 8vw, 6rem); }
.band { background: var(--surface); border-block: 1px solid var(--border); }

/* Hero */
.hero { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 5vw, 3.5rem); position: relative; }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 34% 62% at 70% 42%, rgba(255, 159, 10, 0.20), transparent 70%), radial-gradient(ellipse 26% 46% at 84% 66%, rgba(90, 169, 255, 0.16), transparent 70%); }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2rem 3rem; align-items: center; }
.hero-copy h1 { margin-bottom: 0.4em; }
.rating { margin: 1.4rem 0 0; color: var(--muted); font-weight: 600; }
.rating .star { color: var(--orange); }
.renamed { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.93rem; }
.hero-art { position: relative; min-height: 520px; }
.hero-art .phone { position: absolute; width: 250px; }
.hero-art .phone-front { right: 12%; top: 0; z-index: 1; }
.hero-art .phone-back { right: 46%; top: 60px; transform: rotate(-7deg); opacity: 0.55; }

/* Phone frame */
.phone { width: 100%; background: #19191c; border: 1px solid #45454d; border-radius: 40px; padding: 9px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px #000; }
.phone img { display: block; width: 100%; aspect-ratio: 660 / 1435; border-radius: 32px; }

/* Stats */
.stats { position: relative; list-style: none; margin: clamp(2rem, 5vw, 3.5rem) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); gap: 1rem; }
.stats li { overflow-wrap: break-word; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.stats strong { display: block; font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1; letter-spacing: -0.03em; }
.stats span { color: var(--muted); font-size: 0.98rem; }

/* Try it */
.try-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 2rem 3rem; align-items: center; }
.try-grid .tool { margin: 0; }

/* Steps */
.steps { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.step .phone { max-width: 250px; margin-inline: auto; }
.step-text { margin-top: 1.4rem; }
.step-number { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--orange); color: #000; font-weight: 800; margin: 0 0 0.7rem; }
.step p:last-child { color: var(--muted); margin: 0; }

/* Feature rows */
.feature-row { display: grid; grid-template-columns: 260px 1fr; gap: 2rem 4rem; align-items: center; margin-top: 3.5rem; }
.feature-row:nth-of-type(even) { grid-template-columns: 1fr 260px; }
.feature-row:nth-of-type(even) .phone { order: 2; }
.feature-text h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.tag { display: inline-block; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 0.7rem; }
.tag.blue { color: var(--blue); } .tag.green { color: var(--green); } .tag.purple { color: var(--purple); }
.ticks { list-style: none; padding: 0; margin: 1.1rem 0 0; display: grid; gap: 0.7rem; color: var(--muted); max-width: 34em; }
.ticks li { padding-left: 1.9rem; position: relative; }
.ticks li::before { content: "♠"; content: "♠" / ""; position: absolute; left: 0; top: 0; color: var(--orange); font-size: 1.1rem; }
.subhead { margin-top: 4rem; }

/* Cards and grids */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); margin: 1.6rem 0 0; padding: 0; list-style: none; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.35rem; height: 100%; }
.band .card { background: var(--bg); }
.card h2, .card h3, .card h4 { font-size: 1.15rem; margin-bottom: 0.4rem; letter-spacing: -0.01em; }
.card p { color: var(--muted); margin: 0; font-size: 0.99rem; }
.link-card { position: relative; }
.link-card:hover { border-color: var(--control-border); }
.link-card :is(h2, h3) a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.link-card :is(h2, h3) a:focus-visible { outline: none; }
.link-card :is(h2, h3) a:focus-visible::after { outline: 3px solid var(--blue); outline-offset: 3px; }
.more { margin: 0.9rem 0 0; font-weight: 700; }
.more a { display: inline-flex; align-items: center; min-height: 44px; }

/* Quote */
.quote { margin: 0 auto; max-width: 46rem; text-align: center; }
.quote blockquote { margin: 0; }
.quote blockquote p { font-size: clamp(1.5rem, 3.6vw, 2.3rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; margin: 0 0 1rem; text-wrap: balance; }
.quote figcaption { color: var(--muted); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; padding: 1.05rem 0; font-weight: 700; font-size: 1.1rem; min-height: 44px; }
.faq details p { color: var(--muted); max-width: 44em; }

/* CTA */
.cta-box { text-align: center; border: 1px solid var(--border); border-radius: 28px; padding: clamp(2rem, 6vw, 4rem) 1.25rem;
  background: radial-gradient(ellipse at top, rgba(255, 159, 10, 0.16), transparent 65%), var(--surface); }
.cta-box .lead { margin-inline: auto; }
.cta-box .btn-row { justify-content: center; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding-block: 2.5rem; color: var(--muted); font-size: 0.95rem; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 1rem 3rem; justify-content: space-between; align-items: center; }
.brand-line { display: inline-flex; align-items: center; gap: 0.6rem; margin: 0; font-weight: 700; color: var(--text); }
.brand-line img { border-radius: 8px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.site-footer a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }
.site-footer .fine { margin: 1.2rem 0 0; max-width: 60em; }

/* Article and prose pages */
.page-head { padding-block: clamp(2.2rem, 6vw, 4rem) 0; }
.page-head h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
.prose { padding-block: 1.5rem clamp(2rem, 6vw, 3.5rem); }
.prose h2 { margin-top: 1.9em; font-size: 1.6rem; }
.prose h3 { margin-top: 1.5em; }
.prose .card h2 { margin-top: 0; font-size: 1.25rem; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.45em; }
.post-meta { color: var(--muted); font-size: 0.95rem; }
.card .post-meta { margin-top: 0.6rem; font-size: 0.9rem; }
.post-list { list-style: none; padding: 0 !important; margin: 1rem 0 0; display: grid; gap: 1rem; }
.post-list li { margin: 0; }
.callout { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--orange); border-radius: var(--radius); padding: 1.25rem 1.35rem; margin-block: 2rem; }
.callout p:last-child { margin-bottom: 0; }

/* Strategy chart */
.table-scroll { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); margin-block: 1rem 2rem; }
table.chart { border-collapse: collapse; width: 100%; min-width: 600px; font-variant-numeric: tabular-nums; }
table.chart caption { text-align: left; padding: 0.9rem 1rem; font-weight: 700; font-size: 1.1rem; background: var(--surface); border-bottom: 1px solid var(--border); }
table.chart th, table.chart td { padding: 0.6rem 0.3rem; text-align: center; border: 1px solid var(--border); }
table.chart thead th { background: var(--surface-2); font-size: 0.9rem; }
table.chart tbody th { background: var(--surface-2); text-align: left; padding-left: 0.9rem; white-space: nowrap; }
table.chart td { font-weight: 800; position: relative; }
.a-H { background: #0f3d1e; color: #8df3aa; }
.a-S { background: #4a1512; color: #ffbdb7; }
.a-D { background: #0d2f57; color: #b3d6ff; }
.a-P { background: #3a1a5c; color: #e6ccff; }
.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; list-style: none; padding: 0 !important; margin: 1rem 0; }
.legend li { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; }
.legend .key { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 6px; font-weight: 800; }

/* Tools */
.tool { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: clamp(1rem, 3vw, 1.75rem); margin-block: 1.5rem; }
.band .tool { background: var(--bg); }
.tool fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; min-width: 0; }
.tool legend { font-weight: 700; padding: 0; margin-bottom: 0.6rem; }
.tool .hint { color: var(--muted); font-size: 0.93rem; font-weight: 400; display: block; }
.tool > p.hint { margin: 0 0 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips label { position: relative; }
.chips input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.chips span { display: inline-grid; place-items: center; min-width: 48px; min-height: 48px; padding: 0.3rem 0.85rem; border: 2px solid var(--control-border); border-radius: 12px; font-weight: 700; background: var(--bg); }
.chips input:checked + span { background: var(--text); color: #000; border-color: var(--text); }
.chips input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 3px; }
.chips input:hover + span { border-color: var(--text); }
.check { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.5rem 0; min-height: 44px; cursor: pointer; }
.check input { width: 1.6rem; height: 1.6rem; margin: 0.05rem 0 0; flex: none; accent-color: var(--orange); }
.result { background: var(--bg); border: 2px solid var(--control-border); border-radius: var(--radius); padding: 1.25rem; min-height: 7.5rem; }
.band .result { background: var(--surface); }
.result .big { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; line-height: 1.1; margin: 0 0 0.4rem; }
.result p:last-child { margin: 0; }
.result.is-H, .result.good { border-color: var(--green); } .result.is-H .big, .result.good .big { color: var(--green); }
.result.is-S, .result.bad { border-color: var(--red); } .result.is-S .big, .result.bad .big { color: var(--red); }
.result.is-D { border-color: var(--blue); } .result.is-D .big { color: var(--blue); }
.result.is-P { border-color: var(--purple); } .result.is-P .big { color: var(--purple); }
.result.ok { border-color: var(--orange); } .result.ok .big { color: var(--orange); }

/* Practice drill */
.table-felt { display: flex; flex-wrap: wrap; gap: 1.25rem 3rem; justify-content: center; text-align: center; margin-bottom: 1.25rem; }
.hand-label { color: var(--muted); font-size: 0.9rem; font-weight: 600; margin: 0 0 0.5rem; letter-spacing: 0; }
.cards { display: flex; gap: 0.6rem; justify-content: center; }
.playing-card { width: 78px; height: 110px; border-radius: 11px; background: linear-gradient(#fff, #dcdcdc); color: #111; display: grid; place-items: center; font-weight: 800; font-size: 1.8rem; line-height: 1; box-shadow: 0 6px 16px -6px #000; }
.playing-card.red { color: #b3141b; }
.playing-card .suit { font-size: 1.6rem; display: block; margin-top: 0.15rem; }
.drill-status { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-weight: 600; margin-bottom: 1.25rem; }
.drill-prompt { text-align: center; font-weight: 700; font-size: 1.1rem; margin: 0 0 1rem; }
.drill-prompt:focus { outline: none; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.actions .btn { flex: 1 1 calc(50% - 0.3rem); }

@media (min-width: 640px) { .actions .btn { flex-basis: calc(25% - 0.45rem); } }
@media (max-width: 900px) {
  .hero-grid, .try-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-art { min-height: 0; display: flex; justify-content: center; }
  .hero-art .phone { position: static; width: min(250px, 70vw); }
  .hero-art .phone-back { display: none; }
  .hero::before { background: radial-gradient(ellipse 85% 34% at 50% 68%, rgba(255, 159, 10, 0.18), transparent 70%), radial-gradient(ellipse 60% 26% at 70% 80%, rgba(90, 169, 255, 0.14), transparent 70%); }
  .steps { grid-template-columns: 1fr; gap: 3rem; }
  .step { display: grid; grid-template-columns: minmax(0, 200px) 1fr; gap: 1.5rem; align-items: center; }
  .step-text { margin-top: 0; }
  .feature-row, .feature-row:nth-of-type(even) { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; margin-top: 3rem; }
  .feature-row .phone, .feature-row:nth-of-type(even) .phone { order: 0; max-width: 240px; margin-inline: auto; }
}
@media (max-width: 520px) {
  .step { grid-template-columns: 1fr; }
  .step .phone { max-width: 220px; }
  .btn-row .btn { flex: 1 1 100%; }
  .site-header .btn-small { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (prefers-contrast: more) {
  :root { --border: #8a8a93; --control-border: #f5f5f7; --muted: #e2e2e7; }
  .hero-art .phone-back { opacity: 1; }
}
@media (forced-colors: active) {
  .chips input:checked + span { outline: 3px solid Highlight; outline-offset: -5px; }
  .btn { border-color: ButtonText; }
  .step-number { border: 1px solid CanvasText; }
  .phone, .card, .tool, .result, .stats li, .cta-box, .playing-card { border: 1px solid CanvasText; }
  .hero::before { display: none; }
}
@media print {
  .site-header, .site-footer, .cta, .btn-row, .hero-art { display: none; }
  body { background: #fff; color: #000; }
  .muted, .lead, .card p { color: #333; }
}
