/* CardTable marketing site. One shared stylesheet, no build step. */
:root {
  --bg: #F3EFE2; --text: #16181A; --secondary: #5B5F57; --surface: #FBFAF6; --surface-2: #EAE5D3;
  --accent: #1E6B45; --accent-text: #1E6B45; --on-accent: #F3EFE2; --line: rgba(22,24,26,.12);
  --felt-1: #2A8457; --felt-2: #1E6B45; --felt-3: #144C31; --ink: #F3EFE2;
  --red: #C8102E; --black: #16181A; --face: #FBFAF6; --focus: #0B5FFF;
  --shadow: 0 1px 2px rgba(0,0,0,.12), 0 8px 22px rgba(0,0,0,.18);
  --hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;
  --serif: "New York", "Iowan Old Style", "Palatino", Georgia, serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161C19; --text: #ECEFEA; --secondary: #A3ADA6; --surface: #1E2622; --surface-2: #25302B;
    --accent: #43E0A0; --accent-text: #43E0A0; --on-accent: #0C2A1C; --line: rgba(236,239,234,.12);
    --felt-1: #1F2B25; --felt-2: #1A231F; --felt-3: #121815; --ink: #ECEFEA; --focus: #7FB0FF;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 26px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); overflow-x: hidden;
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif; }
img, svg { max-width: 100%; }
a { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 760px; }
.hand { font-family: var(--hand); font-weight: 600; }

/* header / footer */
header.site { padding: 14px 0; border-bottom: 1px solid var(--line); background: var(--bg); position: relative; z-index: 5; }
header.site .wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
header.site img { width: 38px; height: 38px; border-radius: 9px; }
header.site a.brand { color: var(--text); text-decoration: none; font-weight: 700; font-size: 19px; }
header.site nav { margin-left: auto; display: flex; gap: 6px 18px; font-size: 15px; flex-wrap: wrap; }
header.site nav a { color: var(--secondary); text-decoration: none; padding: 10px 2px; min-height: 44px; display: inline-flex; align-items: center; }
header.site nav a:hover, header.site nav a[aria-current] { color: var(--text); }
footer.site { margin-top: 72px; padding: 36px 0 48px; border-top: 1px solid var(--line); font-size: 15px; color: var(--secondary); }
footer.site .links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
footer.site .links a { color: var(--text); text-decoration: none; padding: 10px 0; min-height: 44px; display: inline-flex; align-items: center; }
footer.site .links a:hover { text-decoration: underline; }
footer.site p { margin: 8px 0 0; }

/* type */
h1 { font-size: clamp(34px, 7vw, 60px); line-height: 1.05; letter-spacing: -.025em; margin: 0 0 14px; }
h2 { font-size: clamp(26px, 4.4vw, 38px); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 10px; }
h3 { font-size: 18px; margin: 0 0 4px; }
.prose h2 { font-size: 22px; margin: 36px 0 8px; letter-spacing: -.01em; }
.prose h3 { margin: 22px 0 4px; }
p.lede { font-size: clamp(18px, 2.6vw, 21px); color: var(--secondary); margin: 0 0 24px; }
.muted { color: var(--secondary); font-size: 15px; }
.eyebrow { font-family: var(--hand); font-size: 26px; color: var(--accent-text); margin: 0 0 4px; line-height: 1.1; }
section.block { padding: 64px 0 0; }
section.block > .wrap > .intro { max-width: 640px; margin-bottom: 28px; }
section.block .intro p { color: var(--secondary); margin: 0; font-size: 18px; }

/* buttons */
.cta, .ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 999px; font-weight: 700; text-decoration: none; }
.cta { background: var(--ink); color: #144C31; }
.ghost { color: var(--ink); border: 1.5px solid rgba(243,239,226,.55); }
.cta.solid { background: var(--accent); color: var(--on-accent); }
.badge { display: inline-flex; align-items: center; gap: 12px; background: #000; color: #fff; text-decoration: none; border-radius: 12px; padding: 8px 20px 8px 16px; min-height: 52px; border: 1px solid rgba(255,255,255,.35); }
.badge svg { width: 26px; height: 26px; flex: none; fill: #fff; }
.badge small { display: block; font-size: 11px; line-height: 1.1; letter-spacing: .02em; }
.badge b { display: block; font-size: 22px; line-height: 1.05; font-weight: 600; letter-spacing: -.01em; }

/* hero */
.hero { color: var(--ink); background: radial-gradient(120% 90% at 50% 0%, var(--felt-1) 0%, var(--felt-2) 55%, var(--felt-3) 100%); overflow: hidden; }
.hero .wrap { display: grid; gap: 28px; padding-top: 48px; padding-bottom: 56px; align-items: center; }
@media (min-width: 880px) { .hero .wrap { grid-template-columns: 1.05fr .95fr; padding-top: 72px; padding-bottom: 80px; } }
.hero .eyebrow { color: #BFF0D6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero .eyebrow { color: var(--accent); } }
.hero p.lede { color: rgba(243,239,226,.86); }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero .note { font-size: 14px; color: rgba(243,239,226,.72); margin: 14px 0 0; }
.hero .code { display: inline-flex; align-items: baseline; gap: 10px; margin-top: 22px; padding: 10px 16px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px solid rgba(243,239,226,.18); }
.hero .code .hand { font-size: 22px; color: rgba(243,239,226,.8); }
.hero .code b { font: 700 24px ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .14em; }

/* playing cards in CSS */
.pc { --w: 120px; --c: var(--black); position: relative; width: var(--w); aspect-ratio: 5/7; background: var(--face); color: var(--c);
  border-radius: calc(var(--w) * .11); box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.18), 0 10px 22px rgba(0,0,0,.28);
  font-family: var(--serif); flex: none; user-select: none; }
.pc.red { --c: var(--red); }
.pc .idx { position: absolute; left: 11%; top: 7%; display: flex; flex-direction: column; align-items: center; line-height: 1; font-weight: 700; font-size: calc(var(--w) * .27); }
.pc .idx i { font-style: normal; font-size: .62em; margin-top: .06em; font-weight: 400; }
.pc .pip { position: absolute; right: 16%; bottom: 12%; font-size: calc(var(--w) * .5); line-height: 1; }
.pc.mini .pip { font-size: calc(var(--w) * .42); }
.pc.joker .idx { font-size: calc(var(--w) * .2); letter-spacing: -.02em; writing-mode: vertical-rl; transform: rotate(180deg); left: 12%; top: 8%; flex-direction: row; }
.pc.joker .pip { right: 18%; bottom: 14%; font-size: calc(var(--w) * .56); }
.pc.back { background: repeating-linear-gradient(45deg, #1E6B45 0 6px, #1a5c3b 6px 12px); box-shadow: 0 0 0 5px var(--face) inset, 0 0 0 1px rgba(0,0,0,.1), 0 8px 20px rgba(0,0,0,.28); }

.fan { position: relative; min-width: 0; padding-top: 20px; height: clamp(250px, 46vw, 380px); display: flex; justify-content: center; align-items: flex-end; }
.fan .pc { --w: clamp(104px, 22vw, 150px); position: absolute; bottom: 14px; transform-origin: 50% 130%; }
.fan .c1 { transform: translateX(-80%) rotate(-14deg); }
.fan .c2 { --w: clamp(120px, 26vw, 176px); transform: translateY(-26px) rotate(2deg); z-index: 2; }
.fan .c3 { transform: translateX(80%) rotate(14deg); }
@media (prefers-reduced-motion: no-preference) {
  .fan .c1 { animation: f1 .9s .15s cubic-bezier(.2,.8,.2,1) backwards; }
  .fan .c2 { animation: f2 .9s .3s cubic-bezier(.2,.8,.2,1) backwards; }
  .fan .c3 { animation: f3 .9s .45s cubic-bezier(.2,.8,.2,1) backwards; }
  @keyframes f1 { from { transform: translateX(0) rotate(0); opacity: 0; } }
  @keyframes f2 { from { transform: translateY(40px) rotate(0); opacity: 0; } }
  @keyframes f3 { from { transform: translateX(0) rotate(0); opacity: 0; } }
}

/* grids and cards */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.card p { margin: 6px 0 0; color: var(--secondary); font-size: 16px; }
.card .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 12px; font-size: 22px;
  background: linear-gradient(160deg, var(--felt-1), var(--felt-3)); color: var(--ink); }
.card .ico.s { font-family: var(--serif); }
.card .tag { font-family: var(--hand); font-size: 20px; color: var(--accent-text); }

.steps { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); counter-reset: s; }
.step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px 20px 20px; }
.step::before { counter-increment: s; content: counter(s); font-family: var(--hand); font-size: 44px; line-height: 1; color: var(--accent-text); display: block; margin-bottom: 4px; }
.step p { margin: 6px 0 0; color: var(--secondary); }
.codebox { display: inline-block; margin-top: 10px; padding: 6px 12px; border-radius: 10px; background: var(--surface-2); font: 700 18px ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .14em; color: var(--text); }

/* felt band sections */
.felt { color: var(--ink); background: radial-gradient(120% 120% at 50% 0%, var(--felt-1), var(--felt-2) 55%, var(--felt-3)); border-radius: 28px; padding: clamp(24px, 5vw, 48px); }
.felt p { color: rgba(243,239,226,.86); }
.felt .eyebrow { color: #BFF0D6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .felt .eyebrow { color: var(--accent); } }
.split { display: grid; gap: 28px; align-items: center; }
@media (min-width: 820px) { .split { grid-template-columns: 1fr 1fr; } }
.checks { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.checks li { padding-left: 30px; position: relative; }
.checks li::before { content: "\2713"; position: absolute; left: 0; top: 0; font-weight: 700; color: var(--accent-text); }
.felt .checks li::before { color: #BFF0D6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .felt .checks li::before { color: var(--accent); } }

/* hidden-card illustration */
.seats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.seat { background: rgba(0,0,0,.22); border: 1px solid rgba(243,239,226,.18); border-radius: 18px; padding: 14px; display: grid; gap: 10px; justify-items: center; text-align: center; font-size: 14px; }
.seat .row { display: flex; }
.seat .row .pc { --w: 54px; margin-left: -18px; }
.seat .row .pc:first-child { margin-left: 0; }
.seat .row .pc .idx { font-size: 15px; } .seat .row .pc .pip { font-size: 24px; }
.seat b { display: block; font-size: 15px; }
.speak { box-shadow: 0 0 0 3px #43E0A0, 0 0 18px rgba(67,224,160,.6); }

/* games */
.games { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.game { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: grid; gap: 8px; text-decoration: none; color: var(--text); }
.game .suit { font: 700 44px/1 var(--serif); }
.game p { margin: 0; color: var(--secondary); font-size: 16px; }
.red { color: var(--red); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .game .suit.black { color: var(--text); } :root:not([data-theme="light"]) .game .suit.red { color: #FF6B80; } }

/* devices */
.devices { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.device { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.device svg { width: 100%; height: 86px; margin-bottom: 8px; }
.device svg * { vector-effect: non-scaling-stroke; }
.device svg .o { fill: none; stroke: var(--text); stroke-width: 2.5; }
.device svg .f { fill: var(--felt-2); }
.device p { margin: 4px 0 0; color: var(--secondary); font-size: 15px; }

/* faq */
details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0 18px; margin: 0 0 10px; }
summary { cursor: pointer; font-weight: 600; padding: 14px 0; min-height: 48px; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 24px; color: var(--accent-text); line-height: 1; }
details[open] summary::after { content: "\2212"; }
details p, details ul { margin: 0 0 14px; color: var(--secondary); }
details ul { padding-left: 20px; }

/* prose pages */
.page { padding-top: 44px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 14px; padding: 14px 18px; margin: 18px 0; }
.callout p { margin: 0; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.toc a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: 15px; }
.cta-band { text-align: center; }
.cta-band .actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.cta-band .ghost { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
.hero .code + .actions { margin-top: 18px; }
