/* Sleightless — one look for the whole site.
   Card-table baize, bone card stock, pip red, brass for XP.
   Mobile-first: everything here is written for a phone and widened later. */

:root {
  --baize:        #12312A;   /* deep table green — page ground */
  --baize-light:  #1A4438;   /* raised panels */
  --baize-edge:   #0C231E;   /* shadow / hairline */
  --bone:         #F2EDE3;   /* card stock — main text and card faces */
  --bone-dim:     #C8C1B4;   /* quiet text */
  --pip:          #C24338;   /* hearts/diamonds, errors, the "wrong" state */
  --brass:        #C9A227;   /* XP, streaks, anything earned */
  --ink:          #17130F;   /* text on a bone surface */

  --display: 'Bodoni Moda', Georgia, 'Times New Roman', serif;
  --ui:      'Karla', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, Consolas, monospace;

  --r: 10px;                 /* corner radius — playing-card corner */
  --pad: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--baize);
  color: var(--bone);
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  /* faint baize weave so the ground is not flat */
  background-image:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.035), transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(0,0,0,.22), transparent 55%);
  background-attachment: fixed;
  padding-bottom: 48px;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 var(--pad); }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: 2.1rem; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; }
p  { margin: 0 0 1em; }
a  { color: var(--brass); text-decoration-thickness: 1px; text-underline-offset: 3px; }

.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.quiet { color: var(--bone-dim); }
.small { font-size: .88rem; }
.center { text-align: center; }

/* ---------- masthead ---------- */
.masthead {
  padding: 22px 0 10px;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.wordmark {
  font-family: var(--display);
  font-size: 1.5rem; font-weight: 600; letter-spacing: .02em;
  color: var(--bone); text-decoration: none;
}
.wordmark .dot { color: var(--pip); }
.badge {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .06em;
  color: var(--bone-dim); border: 1px solid rgba(242,237,227,.22);
  border-radius: 999px; padding: 2px 9px;
}

/* ---------- panels ---------- */
.panel {
  background: var(--baize-light);
  border: 1px solid rgba(242,237,227,.10);
  border-radius: var(--r);
  padding: var(--pad);
  margin: 0 0 16px;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 6px 18px rgba(0,0,0,.18);
}
.panel.tight { padding: 12px 14px; }

/* ---------- buttons ---------- */
button, .btn {
  font-family: var(--ui); font-size: 1rem; font-weight: 700;
  color: var(--ink); background: var(--bone);
  border: none; border-radius: var(--r);
  padding: 13px 18px; cursor: pointer;
  min-height: 46px;                       /* thumb-sized on a phone */
  transition: transform .06s ease, filter .12s ease;
  text-decoration: none; display: inline-block; text-align: center;
}
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }
button.ghost, .btn.ghost {
  background: transparent; color: var(--bone);
  border: 1px solid rgba(242,237,227,.28); font-weight: 600;
}

/* Hidden from view but still laid out and focusable. Used for the file input
   behind a <label>: display:none stops some browsers opening the picker. */
.vis-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
button.brass { background: var(--brass); color: var(--ink); }
button.wide, .btn.wide { display: block; width: 100%; }

/* ---------- forms ---------- */
input[type=email], input[type=text], textarea {
  font-family: var(--ui); font-size: 1rem;
  width: 100%; padding: 12px 13px; min-height: 46px;
  color: var(--ink); background: var(--bone);
  border: 1px solid rgba(0,0,0,.15); border-radius: var(--r);
}
textarea { font-family: var(--mono); font-size: .9rem; min-height: 200px; line-height: 1.45; }
label { display: block; font-size: .9rem; color: var(--bone-dim); margin-bottom: 5px; }

/* Note: the email-capture banner, form and modal are styled inside
   shared/capture.js under slc- class names, not here. Capture has to drop
   into trainers that were written with their own stylesheets, so it carries
   its own look rather than depending on this file. */

/* ---------- playing cards ----------
   The face itself is drawn as SVG in pao.js — indices in opposite corners and
   a proper pip layout, because that is what the eye actually reads at a table.
   Everything here is the card stock it sits on. */
.card-face {
  background: var(--bone);
  border-radius: var(--r);
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
  overflow: hidden;
  user-select: none;
  display: block;
}
.card-face svg { display: block; width: 100%; height: 100%; }

/* big single card in a drill */
.card-face.big { width: 132px; height: 185px; }

/* small card in a row or picker */
.card-face.sm { width: 48px; height: 67px; }

/* ---------- the 52-cell deck grid (the signature element) ---------- */
.deck-grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 3px;
}
.deck-cell {
  aspect-ratio: 1 / 1.35;
  border-radius: 3px;
  background: rgba(242,237,227,.08);
  border: 1px solid rgba(242,237,227,.10);
  position: relative;
}
/* mastery lights the cell from cold baize up to full bone */
.deck-cell[data-m="1"] { background: rgba(242,237,227,.20); }
.deck-cell[data-m="2"] { background: rgba(242,237,227,.38); }
.deck-cell[data-m="3"] { background: rgba(242,237,227,.60); }
.deck-cell[data-m="4"] { background: var(--bone); border-color: var(--bone); }
.deck-cell[data-m="4"].auto { box-shadow: 0 0 0 1px var(--brass), 0 0 9px rgba(201,162,39,.55); }
.deck-row-label {
  font-family: var(--mono); font-size: .7rem; color: var(--bone-dim);
}

/* ---------- stats ---------- */
.stat-row { display: flex; gap: 18px; flex-wrap: wrap; }
.stat { min-width: 74px; }
.stat .v { font-family: var(--mono); font-size: 1.5rem; line-height: 1.1; }
.stat .v.brass { color: var(--brass); }
.stat .k { font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--bone-dim); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; margin: 4px 0 16px; flex-wrap: wrap; }
.tab {
  font-size: .92rem; font-weight: 700; padding: 9px 14px; min-height: 40px;
  background: transparent; color: var(--bone-dim);
  border: 1px solid rgba(242,237,227,.18); border-radius: 999px;
}
.tab.on { background: var(--bone); color: var(--ink); border-color: var(--bone); }

.hidden { display: none !important; }

/* ---------- the tagline under the wordmark ---------- */
.tagline {
  width: 100%;
  font-family: var(--ui);
  font-size: .82rem;
  letter-spacing: .01em;
  color: var(--bone-dim);
  margin: -4px 0 0;
}

/* ---------- footer ---------- */
.site-foot {
  margin: 34px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(242,237,227,.12);
  font-size: .82rem;
  color: var(--bone-dim);
}
.site-foot a { color: var(--bone-dim); }
.site-foot .ver { font-family: var(--mono); font-size: .74rem; opacity: .75; }

/* ---------- blog ---------- */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { margin: 0 0 18px; padding: 0 0 18px; border-bottom: 1px solid rgba(242,237,227,.1); }
.post-list li:last-child { border-bottom: none; }
.post-list a { color: var(--bone); text-decoration: none; }
.post-list h3 { font-size: 1.2rem; margin: 0 0 4px; }
.post-list .date { font-family: var(--mono); font-size: .74rem; color: var(--bone-dim); letter-spacing: .04em; }
.post-list .summary { font-size: .93rem; color: var(--bone-dim); margin: 5px 0 0; }

article.post { max-width: 640px; }
article.post .date {
  font-family: var(--mono); font-size: .76rem; letter-spacing: .05em;
  text-transform: uppercase; color: var(--bone-dim); margin: 0 0 6px;
}
article.post h1 { font-size: 2rem; margin-bottom: .5em; }
article.post h2 { font-size: 1.3rem; margin-top: 1.5em; }
article.post p { font-size: 1.03rem; line-height: 1.65; }
article.post blockquote {
  margin: 1.2em 0; padding: 2px 0 2px 16px;
  border-left: 3px solid var(--brass);
  font-family: var(--display); font-size: 1.1rem; line-height: 1.45;
}
article.post ul, article.post ol { padding-left: 22px; line-height: 1.65; }
article.post li { margin-bottom: .45em; }
article.post hr { border: none; border-top: 1px solid rgba(242,237,227,.14); margin: 26px 0; }
article.post code {
  font-family: var(--mono); font-size: .88em;
  background: rgba(0,0,0,.25); padding: 1px 5px; border-radius: 4px;
}

/* ---------- feedback colours ---------- */
.ok   { color: #7FC29B; }
.bad  { color: var(--pip); }
.slow { color: var(--brass); }

@media (min-width: 640px) {
  body { font-size: 18px; }
  h1 { font-size: 2.6rem; }
}
