/* Double Skunk learn pages (/learn/*). Chrome is in chrome.css (linked first).
   Tokens come from colors_and_type.css. No Tailwind, no dark: variants;
   these pages are dark by construction. */

/* ---- page ---- */
.learn-head { padding: 56px 0 8px; }
.learn-head .kicker, .kicker { font-family: var(--font-sign); font-weight: 800; font-size: 12px;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--pop-ruby); }
.learn-head h1 { font-family: var(--font-display); font-weight: 400;
  font-size: clamp(34px, 5vw, 52px); line-height: 1.02; color: var(--chalk); margin: 10px 0 0; }
.learn-head .lede, .lede { font-family: var(--font-body); font-size: 18px; line-height: 1.55;
  color: var(--fg-2); max-width: 680px; margin: 16px 0 0; }
.lesson { padding: 40px 0 8px; max-width: 760px; scroll-margin-top: 76px; }
.lesson h2 { font-family: var(--font-display); font-weight: 400; font-size: 30px; color: var(--chalk); margin: 0 0 14px; }
.lesson h3 { font-family: var(--font-body); font-weight: 700; font-size: 20px; color: var(--chalk); margin: 24px 0 8px; }
.lesson p { font-size: 17px; line-height: 1.6; color: var(--fg-2); margin: 0 0 14px; }
.lesson ul { margin: 0 0 14px; padding-left: 22px; color: var(--fg-2); line-height: 1.6; }
.lesson b, .lesson strong { color: var(--chalk); font-weight: 600; }
.next-stop { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center;
  margin: 40px 0 64px; padding: 20px 24px; border-radius: 14px; background: var(--surface-base); border: 1px solid var(--border-hair); }
.next-stop .kicker { color: var(--fg-4); }
.next-stop a.cta { margin-left: auto; }

/* ---- callouts and terms ---- */
.callout.in-ds { margin: 22px 0; padding: 16px 20px; border-radius: 12px; max-width: 760px;
  background: color-mix(in srgb, var(--brass) 8%, var(--surface-base)); border-left: 3px solid var(--brass); }
.callout-kicker { display: block; font-family: var(--font-sign); font-weight: 800; font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass-glow); margin-bottom: 6px; }
.callout.in-ds p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--fg-2); }
.term { color: var(--chalk); border-bottom: 1px dotted var(--brass); text-decoration: none; position: relative; }
.term:hover, .term:focus-visible { color: var(--brass-glow); }
/* The popover is absolutely positioned inside a short inline <a>, so
   shrink-to-fit sizes it to the anchor (about 77px) and the max-width
   clamp never gets a say. max-content lets the clamp do its job. */
.term-pop { position: absolute; z-index: 40; width: max-content; max-width: min(300px, calc(100vw - 16px)); padding: 10px 12px; border-radius: 10px;
  background: var(--skunk-ink-4); color: var(--chalk); border: 1px solid var(--border-hair); box-shadow: var(--shadow-card);
  font-size: 14px; line-height: 1.45; font-family: var(--font-body); }
.term-pop b { display: block; font-family: var(--font-sign); letter-spacing: 0.12em; text-transform: uppercase; font-size: 11px; color: var(--brass-glow); margin-bottom: 4px; }

/* ---- cards ---- */
.card-wrap { display: inline-block; width: 74px; line-height: 0; vertical-align: middle;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.45)); transition: transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1), filter 180ms; }
.card-wrap.lg { width: 106px; }
.card-wrap.sm { width: 52px; }
.card-wrap .pc { width: 100%; height: auto; display: block; }
.card-wrap.pc-back-wrap { border-radius: 8px; background-image: var(--cribbage-holes); background-size: 20px 20px; }
.card-wrap[data-selected="true"] { transform: translateY(-10px); filter: drop-shadow(0 0 3px var(--card-select)) drop-shadow(0 8px 14px rgba(0,0,0,0.5)); }
.card-wrap[data-lit="true"] { transform: translateY(-8px) scale(1.04); filter: drop-shadow(0 0 12px var(--brass-glow)); }
.card-wrap[data-dim="true"] { opacity: 0.45; }
button.card-btn { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 8px; }
button.card-btn:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }
.hand { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.hand .cut { margin-left: 18px; position: relative; }
.hand .cut::before { content: "cut"; position: absolute; top: -18px; left: 0; font-family: var(--font-sign); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-4); }

/* ---- widgets ---- */
.widget { margin: 26px 0; padding: 22px 24px; border-radius: 16px; background: var(--surface-base);
  border: 1px solid var(--border-hair); box-shadow: var(--shadow-card); max-width: 760px; }
.widget-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.widget-head .kicker { color: var(--brass); }
.widget-panel { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--surface-raised); }
.widget-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; cursor: pointer;
  font-family: var(--font-sign); font-weight: 800; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--chalk); border: 0; background: linear-gradient(180deg, var(--brass-bright), var(--brass) 65%, var(--brass-deep));
  box-shadow: var(--shadow-button); transition: transform 80ms, box-shadow 160ms; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--border-hair); color: var(--fg-2); }
.btn:focus-visible { outline: 3px solid var(--brass-glow); outline-offset: 2px; }
.toggle { display: inline-flex; border-radius: 999px; background: var(--surface-raised); padding: 3px; }
.toggle button { border: 0; background: transparent; color: var(--fg-3); padding: 6px 14px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-sign); font-weight: 800; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
.toggle button[aria-pressed="true"] { background: var(--brass); color: var(--chalk); }
.stat { display: inline-flex; flex-direction: column; gap: 2px; min-width: 96px; }
.stat .lbl { font-family: var(--font-sign); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-4); }
.stat-num { font-family: var(--font-mono); font-size: 26px; font-weight: 700; color: var(--brass); font-variant-numeric: tabular-nums; }
.stat-num.pop { animation: pop 320ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.35); color: var(--chalk); } 100% { transform: scale(1); } }
.hint { font-family: var(--font-body); font-size: 14px; color: var(--fg-3); margin-top: 10px; min-height: 1.4em; }
.srs { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- worked discards (deal-and-crib) ---- */
.trainer-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 16px; }
.trainer-row { padding: 18px 20px; border-radius: 14px; background: var(--surface-base); border: 1px solid var(--border-hair); scroll-margin-top: 90px; }
.trainer-row .kicker { display: block; margin-bottom: 10px; }
.trainer-row .hand { margin: 0 0 10px; }
.trainer-row p { margin: 0 0 6px; font-size: 15px; }
.trainer-row:target { border-color: var(--brass); }

/* ---- count meter ---- */
.meter { display: grid; grid-template-columns: repeat(31, 1fr); gap: 3px; margin: 12px 0 6px; }
.meter-hole { aspect-ratio: 1; border-radius: 50%; background: var(--skunk-ink-5); box-shadow: var(--shadow-engrave); transition: background 160ms; }
.meter-hole.filled { background: var(--brass); }
.meter-hole.mark { box-shadow: inset 0 0 0 2px var(--gold); }
.meter-labels { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; color: var(--fg-4); }
.badge-score { display: inline-block; padding: 3px 10px; border-radius: 999px; font-family: var(--font-mono); font-size: 12px;
  color: var(--chalk); background: var(--brass-deep); box-shadow: inset 0 0 0 1px var(--brass); margin-left: 8px; }
.play-steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.play-steps li { display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); }
.play-steps li.future { opacity: 0.25; }
.play-steps li .by { font-family: var(--font-sign); letter-spacing: 0.14em; text-transform: uppercase; font-size: 10px; color: var(--fg-4); }
.play-steps li.go .card-wrap { visibility: hidden; }

/* ---- breakdown (count it) ---- */
.breakdown { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.breakdown li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 8px;
  font-family: var(--font-body); font-size: 15px; color: var(--fg-3); background: var(--surface-raised); transition: background 160ms, color 160ms; }
.breakdown li.lit { background: color-mix(in srgb, var(--brass) 22%, var(--surface-raised)); color: var(--chalk); }
.breakdown li .pts { font-family: var(--font-mono); color: var(--brass-glow); }
.breakdown li.total { font-weight: 700; color: var(--chalk); background: transparent; border-top: 1px solid var(--border-hair); border-radius: 0; }
/* Quiz mode. Blurring the rows is not enough on its own: the total sits
   right above the guess box, so its value is taken out of the flow too. */
.breakdown.hidden li { filter: blur(6px); pointer-events: none; }
.breakdown.hidden li.total .pts { visibility: hidden; }
/* The worked-example paragraph under each widget states the answer in
   prose, so quiz mode has to cover it too. */
body[data-quiz="on"] .score-line { filter: blur(6px); user-select: none; }
.quiz input { width: 80px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-hair); background: var(--skunk-ink); color: var(--chalk);
  font-family: var(--font-mono); font-size: 18px; }

/* ---- board ---- */
.board-svg { width: 100%; height: auto; display: block; }
.board-svg .hole { fill: var(--skunk-ink-5); }
.board-svg .street { fill: var(--surface-board); stroke: var(--border-hair); }
.board-svg .mark { stroke: var(--brass); stroke-width: 2; }
.board-svg .mark-label { font-family: var(--font-sign); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; fill: var(--brass-glow); }
.board-svg .peg-you { fill: var(--brass-bright); stroke: var(--chalk); stroke-width: 1.5; transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1); }
.board-svg .peg-rival { fill: var(--seal-blue); stroke: var(--chalk); stroke-width: 1.5; transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1); }
.sliders { display: grid; gap: 10px; margin-top: 14px; }
.sliders label { display: grid; grid-template-columns: 70px 1fr 40px; align-items: center; gap: 12px; font-family: var(--font-sign);
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-3); }
.sliders input[type="range"] { accent-color: var(--brass); width: 100%; }
.verdict { margin-top: 12px; font-family: var(--font-display); font-size: 22px; color: var(--chalk); }

/* ---- picker (calculator) ---- */
.picker { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; margin-top: 12px; }
.picker button { padding: 6px 0; border-radius: 6px; border: 1px solid var(--border-hair); background: var(--surface-raised); cursor: pointer;
  font-family: var(--font-mono); font-size: 13px; color: var(--fg-2); }
.picker button.red { color: var(--card-red); }
.picker button[aria-pressed="true"] { background: var(--brass); color: var(--chalk); border-color: var(--brass); }
.picker button:disabled { opacity: 0.3; cursor: default; }
.best-cuts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.best-cuts .card-wrap { width: 44px; }
.best-cuts .n { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); text-align: center; display: block; }
.share { font-family: var(--font-mono); font-size: 12px; color: var(--fg-4); margin-top: 12px; word-break: break-all; }

/* ---- hub ---- */
.hero-deal { position: relative; height: 170px; margin: 26px 0 8px; }
.hero-deal .card-wrap[data-code] { position: absolute; left: 0; top: 0; width: 88px; transition: transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 300ms; }
.hero-deal.dealt .card-wrap[data-code] { opacity: 1; }
.hero-deal button.deck { position: absolute; right: 0; top: 10px; background: none; border: 0; padding: 0; cursor: pointer; }
.stops { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; counter-reset: stop; }
.stop { counter-increment: stop; position: relative; padding: 20px 22px 20px 62px; border-radius: 16px; background: var(--surface-base);
  border: 1px solid var(--border-hair); box-shadow: var(--shadow-card); transition: border-color 180ms, transform 120ms; }
.stop::before { content: counter(stop); position: absolute; left: 18px; top: 18px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-display); font-size: 15px; color: var(--chalk); background: var(--brass-deep); box-shadow: inset 0 0 0 1px var(--brass); }
.stop:hover { border-color: var(--brass); transform: translateY(-2px); }
.stop a { color: var(--chalk); text-decoration: none; border: 0; font-family: var(--font-display); font-size: 19px; }
.stop a::after { content: ""; position: absolute; inset: 0; }
.stop p { margin: 6px 0 0; font-size: 14px; color: var(--fg-3); }
.stop.done::before { content: "✓"; background: var(--ok); box-shadow: none; }
.stop.soon { opacity: 0.55; }
.stop.soon .soon-tag { font-family: var(--font-sign); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-left: 8px; }
.quick-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* ---- glossary ---- */
.glossary dt { font-family: var(--font-display); font-size: 20px; color: var(--chalk); margin-top: 26px; scroll-margin-top: 90px; }
.glossary dt:target { color: var(--brass-glow); }
.glossary dd { margin: 6px 0 0; color: var(--fg-2); line-height: 1.6; max-width: 720px; }
.glossary dd b { color: var(--chalk); font-weight: 600; }

/* ---- motion + responsive ---- */
@media (prefers-reduced-motion: reduce) {
  .card-wrap, .board-svg .peg-you, .board-svg .peg-rival, .hero-deal .card-wrap, .stat-num.pop { transition: none; animation: none; }
}
@media (max-width: 720px) {
  .stops { grid-template-columns: 1fr; }
  .card-wrap { width: 58px; }
  .card-wrap.lg { width: 84px; }
  .meter { gap: 2px; }
  .picker { grid-template-columns: repeat(7, 1fr); }
}

/* ---- practice table ---- */
.practice .stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.practice .stepper li { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--skunk-ink-5); box-shadow: var(--shadow-engrave); }
.practice .stepper li.current { background: var(--brass); }
.practice .stepper li.done { background: var(--ok); }
.table { display: grid; gap: 14px; padding: 16px; border-radius: 14px; background: var(--surface-table); border: 1px solid var(--border-hair); }
.table-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-height: 60px; }
/* Row gap leaves the cut card's label room on the wrap at narrow widths. */
.table-row.middle { justify-content: space-between; gap: 24px 10px; }
/* The middle row carries the crib, up to five played cards, the cut, and the
   count. At the page's max width that only fits with tighter cards. */
.table .hand { gap: 6px; }
.table .card-wrap.sm { width: 44px; }
.table-row .hand:empty { min-width: 74px; min-height: 40px; border: 1px dashed var(--border-hair); border-radius: 8px; }
.caption { margin-top: 16px; min-height: 4.5em; font-family: var(--font-body); font-size: 18px; line-height: 1.5; color: var(--chalk); }
.caption .cursor { display: inline-block; width: 0.5em; border-bottom: 2px solid var(--brass); margin-left: 2px; animation: blink 900ms steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
