/* Tactile Card Stack — antjanus.com redesign #044
   The page is a tabletop. Every piece of content is a physical card lying on it. */

:root {
  --table: #d6c8ae;
  --table-deep: #c8b894;
  --table-ink: #1e232b;
  --table-muted: #3d4350;
  --paper: #fffdf7;
  --paper-2: #f4eddd;
  --paper-edge: #d9ccb2;
  --ink: #1d232c;
  --ink-muted: #4b5262;
  --line: #e3d9c4;
  --rule-red: #c0392b;
  --rule-blue: #c9d9e8;
  --brand: #364f6a;
  --brand-deep: #2a3f54;
  --on-brand: #f7f3ea;
  --link: #2c4d70;
  --gold: #8a5a06;
  --suit-red: #b3261e;
  --suit-black: #1d232c;
  --sticky: #fbe9a6;
  --sticky-ink: #3b2f07;
  --code-bg: #1f2530;
  --code-ink: #e7e3d9;
  --focus: #1d4ed8;
  --shadow-hue: 30 35% 18%;
  --texture: url("assets/table-linen-light.jpg");
  color-scheme: light;
}

:root[data-theme="dark"] {
  --table: #10171f;
  --table-deep: #0b1117;
  --table-ink: #ece6da;
  --table-muted: #aeb8c4;
  --paper: #1f2833;
  --paper-2: #28323e;
  --paper-edge: #0a0f15;
  --ink: #ede7db;
  --ink-muted: #aab4c0;
  --line: #34404e;
  --rule-red: #e27b69;
  --rule-blue: #2e3d4d;
  --brand: #6f92bd;
  --brand-deep: #2a3f54;
  --on-brand: #f4efe4;
  --link: #9cc0ea;
  --gold: #e0b35c;
  --suit-red: #f08a7c;
  --suit-black: #ede7db;
  --sticky: #4a3f17;
  --sticky-ink: #f7e9b5;
  --code-bg: #0c1117;
  --code-ink: #e7e3d9;
  --focus: #8ab4ff;
  --shadow-hue: 215 40% 3%;
  --texture: url("assets/table-felt-dark.jpg");
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --table: #10171f;
    --table-deep: #0b1117;
    --table-ink: #ece6da;
    --table-muted: #aeb8c4;
    --paper: #1f2833;
    --paper-2: #28323e;
    --paper-edge: #0a0f15;
    --ink: #ede7db;
    --ink-muted: #aab4c0;
    --line: #34404e;
    --rule-red: #e27b69;
    --rule-blue: #2e3d4d;
    --brand: #6f92bd;
    --brand-deep: #2a3f54;
    --on-brand: #f4efe4;
    --link: #9cc0ea;
    --gold: #e0b35c;
    --suit-red: #f08a7c;
    --suit-black: #ede7db;
    --sticky: #4a3f17;
    --sticky-ink: #f7e9b5;
    --code-bg: #0c1117;
    --focus: #8ab4ff;
    --shadow-hue: 215 40% 3%;
    --texture: url("assets/table-felt-dark.jpg");
    color-scheme: dark;
  }
}

/* Shadows: one light source, upper left. Offsets scale with elevation. */
:root {
  --lift-1: 0.5px 1px 1px hsl(var(--shadow-hue) / 0.18), 1px 2px 3px hsl(var(--shadow-hue) / 0.14);
  --lift-2: 0.5px 1px 1px hsl(var(--shadow-hue) / 0.14), 1px 2px 2px hsl(var(--shadow-hue) / 0.14),
    2px 4px 6px hsl(var(--shadow-hue) / 0.14), 4px 8px 14px hsl(var(--shadow-hue) / 0.12);
  --lift-3: 0.5px 1px 1px hsl(var(--shadow-hue) / 0.12), 2px 4px 4px hsl(var(--shadow-hue) / 0.12),
    4px 8px 10px hsl(var(--shadow-hue) / 0.12), 8px 16px 22px hsl(var(--shadow-hue) / 0.14),
    14px 30px 44px hsl(var(--shadow-hue) / 0.14);
  --deck: 3px 3px 0 -1px var(--paper-2), 3px 3px 0 0 var(--paper-edge), 6px 6px 0 -1px var(--paper-2),
    6px 6px 0 0 var(--paper-edge);
  --radius: 14px;
  --font-display: "Young Serif", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --font-type: "Courier Prime", "Courier New", monospace;
  --font-code: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 2rem; overflow-x: clip; }
body {
  margin: 0;
  background-color: var(--table);
  background-image:
    radial-gradient(ellipse at 20% 0%, hsl(0 0% 100% / 0.12), transparent 60%),
    repeating-linear-gradient(90deg, hsl(var(--shadow-hue) / 0.025) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(0deg, hsl(var(--shadow-hue) / 0.025) 0 2px, transparent 2px 6px),
    var(--texture);
  background-size: auto, auto, auto, 900px;
  color: var(--table-ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--paper); color: var(--ink); padding: 0.6rem 1rem; border-radius: 8px; box-shadow: var(--lift-2); }
.skip:focus { top: 1rem; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 1.5rem; }
@media (max-width: 600px) { .wrap { padding: 0 1rem; } }

/* ---------- Header: logo card + card-catalog index tabs ---------- */
.site-head { padding-top: 1.25rem; position: relative; z-index: 20; }
.head-row { display: flex; align-items: flex-end; gap: 1.25rem; }
.logo {
  display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--table-ink);
  padding-bottom: 0.6rem; flex-shrink: 0;
}
.logo-card {
  width: 44px; height: 60px; border-radius: 7px; background: #fffdf7; box-shadow: var(--lift-2), var(--deck);
  transform: rotate(-6deg); display: grid; place-items: center; position: relative; transition: transform 200ms var(--ease);
}
.logo:hover .logo-card, .logo:focus-visible .logo-card { transform: rotate(0deg) translateY(-3px); }
.logo-card svg { width: 30px; height: 30px; }
.logo-words { display: flex; flex-direction: column; line-height: 1.05; }
.logo-words small { font-family: var(--font-type); font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--table-muted); }
.logo-words strong { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; letter-spacing: 0.02em; }

.tabs { display: flex; align-items: flex-end; gap: 0.25rem; margin: 0 0 0 auto; padding: 0; list-style: none; }
.tabs a {
  display: block; padding: 0.55rem 1.05rem 0.7rem; min-height: 44px;
  font-family: var(--font-type); font-size: 1rem; font-weight: 700; letter-spacing: 0.02em;
  text-decoration: none; color: var(--ink); background: var(--paper-2);
  border-radius: 12px 12px 0 0; box-shadow: var(--lift-1);
  transform: translateY(6px); transition: transform 150ms var(--ease), background 150ms;
  position: relative;
}
.tabs a:hover { transform: translateY(0); background: var(--paper); }
.tabs a[aria-current="page"] { background: var(--paper); transform: translateY(0); padding-bottom: 0.95rem; box-shadow: none; }
.tabs a[aria-current="page"]::before {
  content: ""; position: absolute; left: 0.9rem; right: 0.9rem; top: 0.35rem; height: 3px; background: var(--rule-red); border-radius: 2px;
}
.tabs a.tab-ai { background: var(--brand-deep); color: #f7f3ea; }
.tabs a.tab-ai[aria-current="page"], .tabs a.tab-ai:hover { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .tabs a.tab-ai[aria-current="page"], :root[data-theme="dark"] .tabs a.tab-ai:hover { color: #0b1117; }
.tabs .ext::after { content: " ↗"; font-weight: 400; }
.tab-rail { height: 12px; background: var(--paper); border-radius: 0 0 10px 10px; box-shadow: var(--lift-2); }

.tools { display: flex; align-items: center; gap: 0.5rem; padding-bottom: 0.55rem; }
.search { display: flex; align-items: center; background: var(--paper); border-radius: 10px; box-shadow: var(--lift-1); padding: 0 0.25rem 0 0.7rem; }
.search input {
  border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1rem; width: 9.5rem; min-height: 44px; padding: 0;
}
.search input::placeholder { color: var(--ink-muted); }
.search button, .icon-btn {
  border: 0; font: inherit; cursor: pointer; min-width: 44px; min-height: 44px; border-radius: 8px;
  background: transparent; color: var(--ink); display: inline-grid; place-items: center;
}
.icon-btn { background: var(--paper); box-shadow: var(--lift-1); }
.icon-btn:hover, .search button:hover { background: var(--paper-2); }
.icon-btn svg, .search svg { width: 20px; height: 20px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
.menu-btn { display: none; }

@media (max-width: 1080px) {
  .search input { width: 6.5rem; }
  .tabs a { padding-left: 0.75rem; padding-right: 0.75rem; }
}
@media (max-width: 920px) {
  .head-row { flex-wrap: wrap; align-items: center; }
  .tools { margin-left: auto; padding-bottom: 0; }
  .search { display: none; }
  .menu-btn { display: inline-grid; }
  .tabs {
    display: none; order: 3; width: 100%; flex-direction: column; align-items: stretch; gap: 0; margin: 0.9rem 0 0;
  }
  .tabs.is-open { display: flex; }
  .tabs li { margin-top: -6px; }
  .tabs li:nth-child(odd) a { transform: rotate(-0.6deg); }
  .tabs li:nth-child(even) a { transform: rotate(0.5deg); }
  .tabs a, .tabs a:hover, .tabs a[aria-current="page"] { border-radius: 10px; padding: 0.85rem 1rem; box-shadow: var(--lift-2); }
  .tabs a[aria-current="page"]::before { left: 0; top: 0.8rem; bottom: 0.8rem; width: 4px; height: auto; right: auto; }
  .tabs .mobile-search { display: flex; margin-top: 0.5rem; }
  .tab-rail { display: none; }
  .site-head { padding-bottom: 0.5rem; }
}
.mobile-search { display: none; }
.mobile-search form { display: flex; width: 100%; background: var(--paper); border-radius: 10px; box-shadow: var(--lift-2); padding: 0 0.3rem 0 0.9rem; }
.mobile-search input { flex: 1; border: 0; background: transparent; color: var(--ink); font: inherit; min-height: 48px; }

/* ---------- Generic card ---------- */
.card {
  --rx: 0deg; --ry: 0deg; --rest: 0deg; --lift: 0px;
  position: relative; display: block; background: var(--paper); color: var(--ink);
  border-radius: var(--radius); box-shadow: var(--lift-2);
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) rotate(var(--rest)) translateY(var(--lift));
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
  text-decoration: none; isolation: isolate;
}
.card.deck { box-shadow: var(--deck), var(--lift-2); }
a.card:hover, a.card:focus-visible, .card[data-tilt]:hover { --lift: -6px; --rest: 0deg; box-shadow: var(--lift-3); }
a.card.deck:hover, a.card.deck:focus-visible { box-shadow: var(--deck), var(--lift-3); }
a.card:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: var(--radius); }
.card.is-tilting { transition: box-shadow 200ms var(--ease); }
.card[data-tilt]::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), hsl(0 0% 100% / 0.28), transparent 55%);
  opacity: 0; transition: opacity 200ms;
}
.card.is-tilting::after { opacity: 1; }
:root[data-theme="dark"] .card[data-tilt]::after { background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), hsl(0 0% 100% / 0.1), transparent 55%); }

.scatter > :nth-child(4n+1) { --rest: -0.9deg; }
.scatter > :nth-child(4n+2) { --rest: 0.6deg; }
.scatter > :nth-child(4n+3) { --rest: -0.4deg; }
.scatter > :nth-child(4n+4) { --rest: 1deg; }

/* Typewriter meta and labels */
.type { font-family: var(--font-type); font-size: 0.9375rem; letter-spacing: 0.02em; }
.eyebrow { font-family: var(--font-type); font-size: 0.9375rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.muted { color: var(--ink-muted); }

/* Index card: red header rule, blue ruled lines */
.index-card { padding: 1.4rem 1.5rem 1.5rem; background:
  linear-gradient(var(--paper), var(--paper)) top / 100% 3.1rem no-repeat,
  repeating-linear-gradient(to bottom, transparent 0 calc(1.8rem - 1px), var(--rule-blue) calc(1.8rem - 1px) 1.8rem) 0 3.1rem / 100% 100%,
  var(--paper);
}
.index-card::before { content: ""; position: absolute; left: 0; right: 0; top: 3.05rem; height: 2px; background: var(--rule-red); opacity: 0.75; }
.index-card .meta-row { height: 1.9rem; display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; color: var(--ink-muted); }
.index-card .meta-row > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.index-card .meta-row > :last-child { flex-shrink: 0; }
.index-card .meta-row > :first-child { flex-shrink: 1; }
.index-card h3 { font-size: 1.4rem; margin-top: 0.3rem; }
.index-card p { color: var(--ink-muted); }

/* Photo cards */
.photo-card { overflow: hidden; }
.photo-card .photo { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--brand-deep), var(--brand)); overflow: hidden; border-radius: calc(var(--radius) - 4px) calc(var(--radius) - 4px) 0 0; margin: 0.45rem 0.45rem 0; }
.photo-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-card .body { padding: 1rem 1.25rem 1.3rem; }
.photo-card h3 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.photo-card p { color: var(--ink-muted); margin-bottom: 0.7rem; }
.photo-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; color: var(--ink-muted); }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Playing-card corner indices */
.pips { position: absolute; font-family: var(--font-display); line-height: 1; text-align: center; font-size: 1.35rem; color: var(--suit-black); }
.pips small { display: block; font-size: 1rem; margin-top: 0.1rem; }
.pips.tl { top: 0.7rem; left: 0.75rem; }
.pips.br { bottom: 0.7rem; right: 0.75rem; transform: rotate(180deg); }
.red, .red .pips { color: var(--suit-red); }

/* Card back */
.card-back {
  background-color: var(--brand-deep); color: var(--on-brand);
  background-image:
    repeating-linear-gradient(45deg, hsl(0 0% 100% / 0.07) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(-45deg, hsl(0 0% 100% / 0.07) 0 2px, transparent 2px 14px);
  border: 8px solid var(--paper);
}
.card-back a { color: #fff; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 46px; padding: 0.6rem 1.2rem;
  font: 700 1rem/1.2 var(--font-body); border-radius: 10px; text-decoration: none; cursor: pointer; border: 0;
  background: var(--brand-deep); color: #f7f3ea;
  box-shadow: 0 4px 0 #17222e, var(--lift-1); transition: transform 120ms var(--ease), box-shadow 120ms var(--ease);
}
.btn:hover { background: #22364a; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #17222e; }
.btn.ghost { background: var(--paper); color: var(--ink); box-shadow: 0 4px 0 var(--paper-edge), var(--lift-1); }
.btn.ghost:hover { background: var(--paper-2); }
.btn.on-back { background: var(--paper); color: var(--ink); box-shadow: 0 4px 0 #0e1822; }
.text-link { font-weight: 700; }

/* Chips shaped like ticket stubs */
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; padding: 0; margin: 0; list-style: none; }
.chip {
  display: inline-block; font-family: var(--font-type); font-size: 0.875rem; padding: 0.2rem 0.65rem;
  background: var(--paper-2); color: var(--ink); border-radius: 4px; border: 1px dashed var(--paper-edge);
  text-decoration: none;
}
:root[data-theme="dark"] .chip { border-color: var(--line); }
a.chip:hover { background: var(--paper); }
.badge { display: inline-block; font-family: var(--font-type); font-weight: 700; font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.15rem 0.5rem; border-radius: 4px; background: var(--rule-red); color: #fff; }
:root[data-theme="dark"] .badge { color: #1a0d0a; }
.badge.updated { background: var(--gold); }
:root[data-theme="dark"] .badge.updated { color: #1a1204; }

/* ---------- Section headings sit on the table ---------- */
main { display: block; padding-bottom: 4rem; }
.section { margin-top: 4.5rem; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; color: var(--table-ink); }
.sec-head h2 { font-size: clamp(1.9rem, 3.2vw, 2.4rem); margin: 0; }
.sec-head p { margin: 0.25rem 0 0; color: var(--table-muted); }
.sec-head .count { font-family: var(--font-type); color: var(--table-muted); }
.sec-head a { color: var(--table-ink); }
.label-slip {
  display: inline-block; font-family: var(--font-type); font-weight: 700; font-size: 0.875rem; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--paper); color: var(--ink); padding: 0.25rem 0.7rem; border-radius: 3px; box-shadow: var(--lift-1); transform: rotate(-2deg); margin-bottom: 0.7rem;
}

.grid { display: grid; gap: 1.75rem; }
.g2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

/* ---------- Page heroes ---------- */
.page-hero { margin-top: 2.5rem; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.page-hero h1 { font-size: clamp(2.5rem, 5.5vw, 4.2rem); color: var(--table-ink); }
.page-hero .lede { font-size: 1.3rem; color: var(--table-muted); max-width: 38ch; }
.page-hero .eyebrow { color: var(--table-muted); }
.hero-photo { padding: 0.6rem 0.6rem 2.6rem; --rest: 2deg; }
.hero-photo img { border-radius: 6px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: var(--brand-deep); }
.hero-photo figcaption { font-family: var(--font-type); color: var(--ink-muted); text-align: center; margin-top: 0.7rem; }
@media (max-width: 820px) { .page-hero { grid-template-columns: 1fr; gap: 1.5rem; } .hero-photo { max-width: 480px; } }

/* ---------- Home: hero with a fanned hand ---------- */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 3rem; align-items: center; margin-top: 3rem; }
.title-card { padding: 2.2rem 2.4rem 2.3rem; --rest: -1deg; }
.title-card h1 { font-size: clamp(2.4rem, 4.6vw, 3.8rem); line-height: 1.05; margin-top: 0.6rem; }
.title-card .lede { font-size: 1.25rem; color: var(--ink-muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; margin-top: 1.6rem; }
.cta-row .secondary { color: var(--ink); font-weight: 700; text-decoration-thickness: 2px; }
.cta-row .tertiary { color: var(--ink-muted); }

.hand { position: relative; height: 470px; --card-w: 230px; --card-h: 320px; --step: 72px; }
.hand > * { position: absolute; left: 50%; top: 50%; width: var(--card-w); height: var(--card-h); margin: calc(var(--card-h) / -2) 0 0 calc(var(--card-w) / -2); transform-origin: 50% 100%; }
.hand .stat-card { padding: 1rem; display: grid; place-items: center; text-align: center; }
.stat-card .big { font-family: var(--font-display); font-size: 3.2rem; line-height: 1; }
.stat-card .what { font-family: var(--font-type); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); margin-top: 0.5rem; }
.hand .h1 { --rest: -15deg; transform: translateX(calc(var(--step) * -1.5)) rotate(var(--rest)); }
.hand .h2 { --rest: -5deg; transform: translateX(calc(var(--step) * -0.5)) translateY(-10px) rotate(var(--rest)); }
.hand .h3 { --rest: 5deg; transform: translateX(calc(var(--step) * 0.5)) translateY(-10px) rotate(var(--rest)); }
.hand .h4 { --rest: 15deg; transform: translateX(calc(var(--step) * 1.5)) rotate(var(--rest)); padding: 0.5rem 0.5rem 0; overflow: hidden; }
.hand .h4 img { width: 100%; height: calc(var(--card-h) - 62px); object-fit: cover; object-position: 20% 30%; border-radius: 8px; background: var(--brand-deep); }
.hand .h4 figcaption { font-family: var(--font-type); text-align: center; padding: 0.6rem 0; color: var(--ink-muted); }
.hand > * { transition: transform 300ms var(--ease); box-shadow: var(--lift-3); }
.hand:hover .h1, .hand:focus-within .h1 { transform: translateX(calc(var(--step) * -1.9)) rotate(-19deg); }
.hand:hover .h2, .hand:focus-within .h2 { transform: translateX(calc(var(--step) * -0.65)) translateY(-22px) rotate(-6deg); }
.hand:hover .h3, .hand:focus-within .h3 { transform: translateX(calc(var(--step) * 0.65)) translateY(-22px) rotate(6deg); }
.hand:hover .h4, .hand:focus-within .h4 { transform: translateX(calc(var(--step) * 1.9)) rotate(19deg); }
@media (max-width: 1200px) and (min-width: 901px) { .hand { --card-w: 200px; --card-h: 280px; --step: 58px; } .stat-card .big { font-size: 2.7rem; } }
@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr; gap: 1rem; }
  .hand { height: 400px; --card-w: 190px; --card-h: 266px; --step: 60px; }
  .stat-card .big { font-size: 2.6rem; }
}
@media (max-width: 480px) {
  .hand { height: 330px; --card-w: 146px; --card-h: 208px; --step: 38px; }
  .stat-card .big { font-size: 2rem; }
  .stat-card .what { font-size: 0.8125rem; letter-spacing: 0.04em; }
  .title-card { padding: 1.6rem 1.3rem; }
}

/* Spread hand: cards overlap and fan apart on hover (desktop), plain grid on narrow */
.spread { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
@media (min-width: 1000px) {
  .spread { display: flex; justify-content: center; gap: 0; padding: 1rem 0 2rem; }
  .spread > * { width: 290px; flex-shrink: 0; margin-left: -46px; transform-origin: 50% 140%; }
  .spread > :first-child { margin-left: 0; }
  .spread > :nth-child(1) { --rest: -7deg; }
  .spread > :nth-child(2) { --rest: -2.5deg; --lift: -12px; }
  .spread > :nth-child(3) { --rest: 2.5deg; --lift: -12px; }
  .spread > :nth-child(4) { --rest: 7deg; }
  .spread > *:hover, .spread > *:focus-visible { z-index: 5; --rest: 0deg; --lift: -28px; }
}
@media (max-width: 999px) and (min-width: 600px) { .spread { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) { .spread { grid-template-columns: 1fr; } }
.exp-card { padding: 1.6rem 1.5rem 3rem; min-height: 300px; }
.exp-card .suit-big { font-size: 2.6rem; line-height: 1; margin: 1.6rem 0 0.8rem; }
.exp-card h3 { font-size: 1.35rem; }
.exp-card p { color: var(--ink-muted); }

/* ---------- Footer: the card box ---------- */
.site-foot { margin-top: 3rem; padding: 3rem 0 2rem; background: var(--brand-deep); color: #ece6da; position: relative; }
.site-foot::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; background: linear-gradient(to bottom, transparent, hsl(0 0% 0% / 0.18)); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.4fr; gap: 2rem; }
.site-foot h2 { font-family: var(--font-type); font-size: 0.9375rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #c9d6e4; margin-bottom: 0.9rem; }
.site-foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.3rem; }
.site-foot a { color: #f4efe4; }
.site-foot p { color: #cdd6e0; }
.foot-news { background: var(--paper); color: var(--ink); border-radius: 12px; padding: 1.2rem; box-shadow: var(--lift-3); transform: rotate(1deg); }
.foot-news h2 { color: var(--ink-muted); }
.foot-news p { color: var(--ink-muted); }
.news-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.news-form input[type="email"] {
  flex: 1 1 12rem; min-height: 46px; border-radius: 8px; border: 1.5px solid var(--paper-edge); background: var(--paper); color: var(--ink);
  padding: 0 0.8rem; font: inherit; font-size: 1rem;
}
:root[data-theme="dark"] .news-form input[type="email"] { border-color: var(--line); }
.form-status { width: 100%; margin: 0.3rem 0 0; font-size: 1rem; min-height: 1.4em; }
.foot-bottom { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px dashed hsl(0 0% 100% / 0.25); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; font-family: var(--font-type); color: #cdd6e0; }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- Bottom trio (home) ---------- */
.trio { display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 1.75rem; align-items: start; }
@media (max-width: 900px) { .trio { grid-template-columns: 1fr; } }
.list-card { padding: 1.5rem; }
.list-card h3 { font-size: 1.35rem; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li + li { border-top: 1px dashed var(--line); }
.link-list a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; text-decoration: none; color: var(--ink); font-weight: 600; }
.link-list a span { font-family: var(--font-type); font-weight: 400; color: var(--ink-muted); }
.link-list a:hover { color: var(--link); }
.back-card { padding: 2rem 1.8rem; border-radius: var(--radius); box-shadow: var(--lift-3); --rest: 1.5deg; transform: rotate(var(--rest)); }
.back-card h3 { font-size: 1.7rem; color: #fff; }
.back-card p { color: #e3e8ef; }

/* ---------- Trading cards (projects) ---------- */
.trade { padding: 0.7rem; display: flex; flex-direction: column; }
.trade .frame { border: 2px solid var(--ink); border-radius: 9px; padding: 0.6rem; display: flex; flex-direction: column; flex: 1; }
:root[data-theme="dark"] .trade .frame { border-color: var(--line); }
.trade .nameplate { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.5rem; }
.trade .nameplate h3 { font-size: 1.3rem; margin: 0; }
.trade .power { font-family: var(--font-type); font-weight: 700; color: var(--suit-red); white-space: nowrap; }
.trade .window { aspect-ratio: 16 / 10; border-radius: 5px; overflow: hidden; background: linear-gradient(135deg, #1f2d3c, #364f6a); border: 1px solid var(--line); }
.trade .window img { width: 100%; height: 100%; object-fit: cover; }
.trade .window.empty { display: grid; place-items: center; color: #d7e0ea; font-family: var(--font-display); font-size: 2.4rem; }
.trade .type-line { font-family: var(--font-type); font-size: 0.9375rem; background: var(--paper-2); border-radius: 4px; padding: 0.2rem 0.5rem; margin: 0.55rem 0; color: var(--ink); }
.trade p { color: var(--ink-muted); font-size: 1.0625rem; margin-bottom: 0.6rem; flex: 1; }
.trade .statbar { display: flex; gap: 0.4rem; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 0.55rem; font-family: var(--font-type); font-size: 0.9375rem; color: var(--ink-muted); }
.trade .statbar b { color: var(--ink); }

.featured-proj { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; overflow: hidden; }
.featured-proj .art { background: #0e2036; min-height: 320px; }
.featured-proj .art img { width: 100%; height: 100%; object-fit: cover; }
.featured-proj .txt { padding: 2rem 2.2rem; }
.featured-proj h3 { font-size: 2rem; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; margin: 1.3rem 0; }
.mini-stats div { background: var(--paper-2); border-radius: 8px; padding: 0.6rem 0.8rem; box-shadow: 2px 2px 0 var(--paper-edge); }
.mini-stats b { display: block; font-family: var(--font-display); font-size: 1.9rem; font-weight: 400; }
.mini-stats span { font-family: var(--font-type); font-size: 0.8125rem; overflow-wrap: anywhere; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.08em; }
@media (max-width: 820px) { .featured-proj { grid-template-columns: minmax(0, 1fr); } .featured-proj .art { min-height: 200px; } .featured-proj .txt { padding: 1.5rem; } }

.jump { position: sticky; top: 0; z-index: 10; padding: 0.7rem 0; margin-top: 2rem; }
.jump .inner { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; background: var(--paper); border-radius: 12px; box-shadow: var(--lift-2); padding: 0.5rem 0.7rem; }
.jump .inner > span { font-family: var(--font-type); color: var(--ink-muted); margin-right: 0.3rem; }
.jump a { font-family: var(--font-type); font-weight: 700; font-size: 0.9375rem; color: var(--ink); text-decoration: none; padding: 0.45rem 0.75rem; border-radius: 6px; background: var(--paper-2); min-height: 40px; display: inline-flex; align-items: center; }
.jump a:hover { background: var(--rule-blue); }
@media (max-width: 600px) { .jump { position: static; } }

.postcard { padding: 1.4rem 1.5rem; display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1rem; min-height: 190px; }
.postcard .stamp { width: 64px; height: 76px; border: 2px dashed var(--rule-red); border-radius: 4px; display: grid; place-items: center; font-size: 1.8rem; color: var(--rule-red); transform: rotate(4deg); }
.postcard h3 { font-size: 1.4rem; margin: 0; }
.postcard p { grid-column: 1 / -1; color: var(--ink-muted); margin: 0; border-top: 1px solid var(--line); padding-top: 0.6rem; }

/* ---------- Writing ---------- */
.two-decks { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 820px) { .two-decks { grid-template-columns: 1fr; } }
.deck-panel { padding: 1.5rem 1.6rem; }
.deck-panel h2 { font-size: 1.6rem; margin: 0; }
.deck-panel > p { color: var(--ink-muted); }
.deck-panel ol { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.deck-panel li { counter-increment: rank; border-top: 1px dashed var(--line); }
.deck-panel li a { display: grid; grid-template-columns: 2.4rem 1fr; gap: 0.8rem; padding: 0.9rem 0; color: var(--ink); text-decoration: none; }
.deck-panel li a::before { content: counter(rank); font-family: var(--font-display); font-size: 1.7rem; color: var(--suit-red); line-height: 1; }
.deck-panel li a strong { display: block; font-size: 1.15rem; }
.deck-panel li a:hover strong { color: var(--link); text-decoration: underline; }
.deck-panel li span { color: var(--ink-muted); font-size: 1rem; }

.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 1.6rem; }
.call-no { font-family: var(--font-type); font-weight: 700; color: var(--rule-red); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tag-cloud a { font-family: var(--font-type); background: var(--paper); color: var(--ink); text-decoration: none; padding: 0.4rem 0.8rem 0.4rem 1.3rem; border-radius: 4px 10px 10px 4px; box-shadow: var(--lift-1); position: relative; min-height: 40px; display: inline-flex; align-items: center; }
.tag-cloud a::before { content: ""; position: absolute; left: 0.5rem; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--table); box-shadow: inset 1px 1px 1px hsl(var(--shadow-hue) / 0.4); }
.tag-cloud a:hover { background: var(--paper-2); }
.tag-cloud a span { color: var(--ink-muted); margin-left: 0.4rem; }

/* ---------- AI: stories as tarot ---------- */
.consult { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; padding: 1.4rem 1.8rem; border-radius: var(--radius); box-shadow: var(--lift-2); }
.consult p { margin: 0; font-size: 1.2rem; color: #fff; }
.tarot-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.3rem; align-items: start; }
@media (max-width: 1100px) { .tarot-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .tarot-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tarot-row { grid-template-columns: 1fr; } }
.tarot { padding: 0.55rem; display: flex; flex-direction: column; min-height: 100%; }
.tarot .numeral { font-family: var(--font-display); text-align: center; font-size: 1.3rem; padding: 0.2rem 0 0.4rem; letter-spacing: 0.1em; }
.tarot .art { aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden; border: 3px double var(--gold); background: var(--brand-deep); }
.tarot .art img { width: 100%; height: 100%; object-fit: cover; }
.tarot h3 { font-size: 1.15rem; text-align: center; margin: 0.7rem 0.3rem 0.3rem; }
.tarot p { font-size: 1rem; color: var(--ink-muted); padding: 0 0.4rem; }
.tarot .read { text-align: center; font-family: var(--font-type); font-weight: 700; color: var(--link); padding-bottom: 0.4rem; margin-top: auto; }
.tarot.facedown { min-height: 380px; display: grid; place-items: center; text-align: center; padding: 1.2rem; }
.tarot.facedown .inner { background: var(--paper); color: var(--ink); border-radius: 8px; padding: 0.9rem; box-shadow: var(--lift-1); }
.tarot.facedown h3 { margin-top: 0.3rem; }
.tarot.facedown p { margin: 0; }
.notice { display: flex; gap: 1rem; align-items: flex-start; background: var(--sticky); color: var(--sticky-ink); padding: 1.1rem 1.3rem; border-radius: 4px; box-shadow: var(--lift-2); transform: rotate(-0.6deg); max-width: 760px; }
.notice p { margin: 0; }

/* ---------- About ---------- */
.id-card { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; padding: 1.6rem; --rest: -1deg; align-items: center; }
.id-card img { border-radius: 10px; aspect-ratio: 3 / 4; object-fit: cover; width: 100%; background: var(--brand-deep); }
.id-card h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); margin: 0.4rem 0 0.6rem; }
.id-card .lede { font-size: 1.25rem; color: var(--ink-muted); }
.id-strip { display: flex; justify-content: space-between; font-family: var(--font-type); color: var(--ink-muted); border-bottom: 2px solid var(--rule-red); padding-bottom: 0.4rem; flex-wrap: wrap; gap: 0.5rem; }
@media (max-width: 700px) { .id-card { grid-template-columns: 1fr; } .id-card img { max-width: 260px; } }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.stat-row .stat-card { position: relative; aspect-ratio: 5 / 3.4; display: grid; place-items: center; text-align: center; padding: 1rem; }
@media (max-width: 640px) { .stat-row { grid-template-columns: 1fr; } .stat-row .stat-card { aspect-ratio: auto; min-height: 170px; } }
.summary-card { padding: 2rem 2.2rem; max-width: 880px; }
.summary-card p { font-size: 1.2rem; }

.career-bar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0 1.5rem; padding: 0; list-style: none; }
.career-bar li { background: var(--paper); color: var(--ink); box-shadow: var(--lift-1); border-radius: 6px; padding: 0.35rem 0.75rem; font-size: 1rem; }
.career-bar li span { font-family: var(--font-type); color: var(--ink-muted); margin-left: 0.4rem; }
details.history > summary { list-style: none; cursor: pointer; display: inline-flex; }
details.history > summary::-webkit-details-marker { display: none; }
details.history[open] .show-label { display: none; }
details.history:not([open]) .hide-label { display: none; }
.phase-stack { display: grid; gap: 1.4rem; margin-top: 1.5rem; }
.phase { padding: 1.5rem 1.6rem 1.5rem 2rem; border-left: 6px solid var(--brand); }
.phase:nth-child(2) { border-left-color: var(--rule-red); }
.phase:nth-child(3) { border-left-color: var(--gold); }
.phase:nth-child(4) { border-left-color: var(--ink-muted); }
.phase h3 { font-size: 1.5rem; margin-bottom: 0.2rem; }
.phase .period { font-family: var(--font-type); color: var(--ink-muted); }
.phase ul { margin: 0.6rem 0 0; padding-left: 1.2rem; }
.phase li { margin-bottom: 0.3rem; }
.phase blockquote { margin: 0.8rem 0 0; padding: 0.8rem 1rem; background: var(--paper-2); border-radius: 8px; font-size: 1.05rem; }

.proverb-deck { overflow-x: clip; padding: 0 12px; position: relative; min-height: 330px; max-width: 620px; margin: 0 auto; }
.proverb-deck .proverb { padding: 2.2rem 2.4rem 2.6rem; min-height: 260px; display: flex; flex-direction: column; justify-content: center; }
.proverb blockquote { margin: 0; font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.3; }
.proverb .no { font-family: var(--font-type); color: var(--ink-muted); margin-bottom: 0.8rem; }
.js .proverb-deck .proverb { position: absolute; inset: 0 0 auto 0; transition: transform 350ms var(--ease), opacity 350ms; }
.js .proverb-deck .proverb[data-pos="0"] { z-index: 5; transform: rotate(-1deg); }
.js .proverb-deck .proverb[data-pos="1"] { z-index: 4; transform: rotate(3deg) translate(10px, 8px); }
.js .proverb-deck .proverb[data-pos="2"] { z-index: 3; transform: rotate(-4deg) translate(-10px, 14px); }
.js .proverb-deck .proverb[data-pos="3"] { z-index: 2; transform: rotate(5deg) translate(14px, 18px); }
.js .proverb-deck .proverb[data-pos="4"] { z-index: 1; transform: rotate(-2deg) translate(0, 22px); }
.js .proverb-deck .proverb:not([data-pos="0"]) blockquote, .js .proverb-deck .proverb:not([data-pos="0"]) .no { visibility: hidden; }
.proverb-list { display: grid; gap: 1rem; }
.js .proverb-list { display: block; }
.deck-controls { display: none; justify-content: center; gap: 1rem; margin-top: 2.5rem; align-items: center; }
.js .deck-controls { display: flex; }
.deck-controls .type { color: var(--table-muted); }

.beyond { display: grid; grid-template-columns: 360px 1fr; gap: 2.5rem; align-items: center; }
.polaroid { background: #fbf9f3; padding: 0.8rem 0.8rem 3rem; --rest: -3deg; color: #1d232c; }
.polaroid img { aspect-ratio: 1; object-fit: cover; width: 100%; background: var(--brand-deep); }
.polaroid figcaption { font-family: var(--font-type); text-align: center; margin-top: 0.8rem; }
@media (max-width: 820px) { .beyond { grid-template-columns: 1fr; } .polaroid { max-width: 340px; } }
.cap-card { padding: 1.5rem; }
.cap-card h3 { font-size: 1.35rem; }
.cap-card p { color: var(--ink-muted); }

/* ---------- Article ---------- */
.progress { position: fixed; top: 0; left: 0; height: 5px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--rule-red); z-index: 50; }
.progress-pct { position: fixed; top: 10px; right: 12px; z-index: 50; font-family: var(--font-type); font-size: 0.875rem; background: var(--paper); color: var(--ink); padding: 0.1rem 0.5rem; border-radius: 4px; box-shadow: var(--lift-1); opacity: 0; transition: opacity 200ms; }
.progress-pct.show { opacity: 1; }
.art-hero { position: relative; margin-top: 2.5rem; display: grid; grid-template-columns: 1fr; }
.art-hero .pinned { padding: 0.6rem; --rest: 1.2deg; width: min(100%, 900px); margin-left: auto; }
.art-hero .pinned img { border-radius: 8px; width: 100%; aspect-ratio: 21 / 9; object-fit: cover; background: var(--brand-deep); }
.art-hero .title-card { width: min(100%, 720px); margin-top: -7rem; --rest: -1.2deg; z-index: 2; }
.art-hero .title-card h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); }
.crumb { font-family: var(--font-type); font-weight: 700; }
.meta-line { font-family: var(--font-type); color: var(--ink-muted); display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin-top: 1rem; }
@media (max-width: 700px) { .art-hero .title-card { margin-top: -2.5rem; } .art-hero .pinned img { aspect-ratio: 16 / 9; } }

.art-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 3rem; margin-top: 3rem; align-items: start; }
.toc { position: sticky; top: 1.5rem; }
.toc-stack { list-style: none; margin: 0; padding: 0; }
.toc-stack li { margin-top: -4px; }
.toc-stack a {
  display: block; background: var(--paper-2); color: var(--ink); text-decoration: none; padding: 0.6rem 0.9rem;
  border-radius: 8px 8px 4px 4px; box-shadow: var(--lift-1); font-size: 1rem; line-height: 1.35; transition: transform 150ms var(--ease);
  border-top: 3px solid transparent;
}
.toc-stack a:hover { transform: translateX(5px); background: var(--paper); }
.toc-stack a[aria-current="true"] { background: var(--paper); border-top-color: var(--rule-red); transform: translateX(10px); font-weight: 700; }
.toc h2 { font-family: var(--font-type); font-size: 0.9375rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--table-muted); }
.toc-mobile { display: none; }
@media (max-width: 1100px) {
  .art-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .toc-mobile { display: block; margin-bottom: 1.5rem; }
}
.toc-mobile summary { cursor: pointer; font-family: var(--font-type); font-weight: 700; padding: 0.9rem 1.1rem; list-style-position: inside; }
.toc-mobile ol { margin: 0; padding: 0 1.2rem 1rem 2.4rem; }
.toc-mobile li { padding: 0.25rem 0; }

.sheet { padding: 3rem clamp(1.2rem, 5vw, 4rem); border-radius: 6px; box-shadow: var(--deck), var(--lift-2); }
.prose { max-width: 70ch; margin: 0 auto; font-size: 1.1875rem; line-height: 1.7; color: var(--ink); }
.prose h2 { font-size: 2rem; margin: 2.4em 0 0.7em; padding-top: 0.6em; border-top: 2px solid var(--rule-red); }
.prose code { font-family: var(--font-code); font-size: 0.88em; background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 4px; }
.prose ol, .prose ul { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.35rem; }
.prose blockquote { margin: 1.8rem 0; padding: 1rem 1.3rem; border-radius: 4px; box-shadow: var(--lift-2); background: var(--paper-2); }
.prose blockquote p:last-child { margin: 0; }
.prose blockquote.why { background: var(--sticky); color: var(--sticky-ink); transform: rotate(-0.7deg); }
.prose blockquote.why a, .prose blockquote.why code { color: inherit; }
.prose blockquote.ask { background: var(--paper); border: 2px dashed var(--brand); transform: rotate(0.5deg); }
.prose blockquote.skill { background: var(--brand-deep); color: #f1ece2; }
.prose blockquote.skill a { color: #cfe3ff; }
.prose blockquote.skill code { background: hsl(0 0% 100% / 0.12); color: #fff; }
.prose blockquote .tag { display: block; font-family: var(--font-type); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.875rem; margin-bottom: 0.3rem; }

.code-card { margin: 1.8rem -1.5rem; background: var(--code-bg); color: var(--code-ink); border-radius: 12px; box-shadow: var(--lift-3); overflow: hidden; }
@media (max-width: 700px) { .code-card { margin: 1.5rem -0.5rem; } }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 0.35rem 0.5rem 0.35rem 1rem; background: hsl(0 0% 100% / 0.06); font-family: var(--font-type); font-size: 0.9375rem; color: #c9d1dc; }
.code-head button { background: hsl(0 0% 100% / 0.1); color: #f1ece2; border: 0; border-radius: 6px; font: inherit; min-height: 38px; padding: 0 0.9rem; cursor: pointer; }
.code-head button:hover { background: hsl(0 0% 100% / 0.2); }
.code-card pre { margin: 0; padding: 1.1rem 1.2rem 1.3rem; overflow-x: auto; font-family: var(--font-code); font-size: 0.9375rem; line-height: 1.6; tab-size: 2; }
.code-card code { background: none; padding: 0; font-size: inherit; color: inherit; }
.tk-k { color: #f0a58f; } .tk-s { color: #b5d88a; } .tk-c { color: #9aa6b5; font-style: italic; } .tk-t { color: #8fc4f2; }

.share-zone { display: grid; grid-template-columns: 1fr 1.2fr; gap: 2rem; margin-top: 3rem; }
@media (max-width: 820px) { .share-zone { grid-template-columns: 1fr; } }
.share-card, .news-card { padding: 1.6rem 1.8rem; }
.share-card h2, .news-card h2 { font-size: 1.6rem; }
.share-btns { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.series-slip { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: space-between; }

/* ---------- Patterns ---------- */
.suit-dd { --suit-color: var(--suit-red); }
.suit-lay { --suit-color: var(--suit-black); }
.suit-int { --suit-color: var(--suit-red); }
.suit-frm { --suit-color: var(--suit-black); }
.suit-col { --suit-color: var(--gold); }
.three-ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 820px) { .three-ways { grid-template-columns: 1fr; } }
.way { padding: 1.5rem 1.5rem 1.6rem 1.5rem; }
.way h3 { font-size: 1.5rem; display: flex; align-items: center; gap: 0.6rem; }
.way h3 span { font-family: var(--font-type); font-size: 1rem; color: var(--rule-red); }
.way p { color: var(--ink-muted); margin: 0; }
.point-note { margin-top: 1.5rem; max-width: 900px; }

.filter-bar { display: grid; gap: 1rem; padding: 1.2rem 1.3rem; margin-top: 2.5rem; }
.filter-bar label { font-family: var(--font-type); font-weight: 700; display: block; margin-bottom: 0.3rem; }
.filter-bar input[type="search"], .filter-bar select {
  width: 100%; min-height: 48px; border-radius: 8px; border: 1.5px solid var(--paper-edge); background: var(--paper); color: var(--ink); padding: 0 0.9rem; font: inherit; font-size: 1.05rem;
}
:root[data-theme="dark"] .filter-bar input[type="search"], :root[data-theme="dark"] .filter-bar select { border-color: var(--line); }
.filter-row { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; justify-content: space-between; }
.suit-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.suit-pills button {
  font: 700 1rem var(--font-type); min-height: 44px; padding: 0 0.9rem; border-radius: 8px; cursor: pointer;
  background: var(--paper-2); color: var(--ink); border: 1.5px solid transparent; box-shadow: 0 3px 0 var(--paper-edge);
}
.suit-pills button span { color: var(--suit-color, var(--ink)); margin-right: 0.3rem; }
.suit-pills button[aria-pressed="true"] { background: var(--paper); border-color: var(--ink); transform: translateY(2px); box-shadow: 0 1px 0 var(--paper-edge); }
.result-line { font-family: var(--font-type); color: var(--table-muted); margin: 1.5rem 0 1rem; display: flex; gap: 1rem; align-items: center; }
.result-line button { font: inherit; background: none; border: 0; color: var(--table-ink); text-decoration: underline; cursor: pointer; min-height: 44px; }

.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 1.8rem 1.5rem; }
.pcard { padding: 3rem 1.3rem 3.2rem; min-height: 390px; display: flex; flex-direction: column; }
.pcard .pips { color: var(--suit-color); }
.pcard .center-suit { font-size: 3rem; line-height: 1; color: var(--suit-color); text-align: center; margin-bottom: 0.8rem; opacity: 0.9; }
.pcard .cat { font-family: var(--font-type); color: var(--ink-muted); display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; justify-content: center; text-align: center; }
.pcard h3 { font-size: 1.35rem; text-align: center; margin: 0.5rem 0 0.6rem; }
.pcard p { color: var(--ink-muted); font-size: 1.0625rem; flex: 1; }
.pcard .chips { justify-content: center; }
.empty-state { display: none; text-align: center; padding: 2.5rem 1.5rem; max-width: 560px; margin: 1rem auto; }
.empty-state.show { display: block; }
.empty-state h2 { font-size: 1.7rem; }

.pat-head { max-width: 1024px; margin: 2.5rem auto 0; }
.back-link { font-family: var(--font-type); font-weight: 700; color: var(--table-ink); display: inline-flex; min-height: 44px; align-items: center; }
.pat-title { padding: 2rem 2.2rem; margin-top: 0.8rem; }
.pat-title h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); margin: 0.4rem 0 0.7rem; }
.pat-title .lede { font-size: 1.2rem; color: var(--ink-muted); }
.reach { columns: 2; column-gap: 2rem; padding-left: 1.2rem; }
@media (max-width: 640px) { .reach { columns: 1; } .pat-title { padding: 1.5rem 1.3rem; } }

.divider-tabs { display: flex; gap: 0.3rem; align-items: flex-end; flex-wrap: wrap; margin-top: 2.5rem; }
.divider-tabs [role="tab"] {
  font: 700 1rem var(--font-type); min-height: 46px; padding: 0.55rem 1.1rem; border: 0; cursor: pointer;
  border-radius: 12px 12px 0 0; background: var(--paper-2); color: var(--ink); transform: translateY(5px); box-shadow: var(--lift-1);
}
.divider-tabs [role="tab"]:hover { transform: translateY(0); }
.divider-tabs [role="tab"][aria-selected="true"] { background: var(--paper); transform: translateY(0); box-shadow: none; padding-bottom: 0.8rem; border-top: 3px solid var(--rule-red); }
.tab-actions { margin-left: auto; display: flex; gap: 0.5rem; padding-bottom: 0.5rem; }
.tab-actions .btn { min-height: 42px; padding: 0.4rem 0.9rem; }
.pane-card { border-radius: 0 var(--radius) var(--radius) var(--radius); padding: 1.8rem; box-shadow: var(--lift-2); background: var(--paper); color: var(--ink); }
.pane-card pre { margin: 0; overflow-x: auto; font-family: var(--font-code); font-size: 0.9375rem; line-height: 1.6; background: var(--code-bg); color: var(--code-ink); padding: 1.2rem; border-radius: 10px; }
.pane-note { background: var(--paper-2); padding: 0.8rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.prompt-text { max-width: 70ch; }
@media (max-width: 640px) { .tab-actions { margin-left: 0; width: 100%; order: -1; } .pane-card { padding: 1.1rem; } }

/* The demo pattern itself, rendered inline with the pattern token names */
.hss-demo { --ground: var(--paper-2); --surface: var(--paper); --border: var(--line); --dim: var(--ink-muted); --accent: var(--brand); display: grid; gap: 1rem; }
.hss-cap { color: var(--ink-muted); margin: 0; }
.hss-strip { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; grid-template-columns: 1fr; }
@media (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 52rem) { .hss-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hss-strip.five { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.hss-tile { background: var(--surface); padding: 0.9rem 1rem; text-align: left; font: inherit; color: var(--ink); border: 0; min-width: 0; }
.hss-tile .l { font-family: var(--font-code); text-transform: uppercase; font-size: 0.8125rem; letter-spacing: 0.06em; color: var(--dim); display: block; }
.hss-tile .v { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; display: block; }
.hss-tile .v.none { color: var(--dim); font-weight: 400; }
.hss-tile .u { color: var(--dim); font-size: 0.9375rem; }
button.hss-tile { cursor: pointer; min-height: 44px; }
button.hss-tile:hover { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); box-shadow: inset 0 -3px 0 var(--accent); }
button.hss-tile:focus-visible { outline-offset: -4px; }
.hss-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.hss-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 1rem; background: var(--surface); }
.hss-list li + li { border-top: 1px solid var(--border); }
.hss-list li span { font-family: var(--font-code); font-size: 0.875rem; color: var(--dim); }
.hss-status { font-family: var(--font-type); color: var(--ink-muted); margin: 0; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .hand:hover > *, .hand:focus-within > * { transform: rotate(var(--rest)); }
}
