/* PeakDeck — Sunlit Linen & Terracotta Card Table
 * Surface: #F5EFE6 Linen Canvas · #E8DAC8 Table Mat · #B84323 Terracotta · #1D4E89 Cobalt · #2A6B4F Sage
 * WCAG AA >= 4.5:1 · Tabular Numerals · Zero CLS
 */
:root {
  --canvas: #F5EFE6;
  --table: #E8DAC8;
  --surface: #FFFDF9;
  --surface-alt: #EFE4D5;
  --ink: #261C15;
  --muted: #5C4B3E;
  --terracotta: #B84323;
  --terracotta-hover: #96341A;
  --cobalt: #1D4E89;
  --sage: #2A6B4F;
  --border: rgba(38, 28, 21, 0.14);
  --border-strong: rgba(38, 28, 21, 0.24);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 9999px;
  --container-max: 1080px;
  --font-display: "Bricolage Grotesque", "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: "Figtree", "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}
::selection { background: rgba(184, 67, 35, 0.18); color: var(--ink); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--canvas); color: var(--ink); }
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--terracotta); text-decoration: none; text-underline-offset: 0.2em; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }
.tabular { font-variant-numeric: tabular-nums; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--surface); font-weight: 700; padding: 10px 18px; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { left: 16px; top: 12px; text-decoration: none; }

.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }
.container--prose { max-width: 820px; }
@media (max-width: 640px) { .container { padding: 0 16px; } }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(245, 239, 230, 0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px; padding: 10px 0; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 1.08rem; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand__icon { width: 34px; height: 34px; border-radius: 9px; }
.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-size: 0.92rem; font-weight: 600; padding: 7px 12px; border-radius: var(--radius-pill); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); background: var(--surface-alt); text-decoration: none; }
.lang-switch { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 3px; margin-left: 6px; }
.lang-switch span, .lang-switch a { font-size: 0.8rem; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill); color: var(--muted); }
.lang-switch .is-active { background: var(--terracotta); color: #FFFDF9; }
.lang-switch a:hover { color: var(--ink); background: rgba(38, 28, 21, 0.06); text-decoration: none; }

.breadcrumb { padding: 20px 0 8px; font-size: 0.86rem; color: var(--muted); }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--border-strong); }
.breadcrumb a { color: var(--muted); font-weight: 600; }

/* Hero & Interactive Demo */
.hero { padding: 40px 0 52px; }
.hero__grid { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: start; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: minmax(0, 1fr) 396px; gap: 40px; } }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); letter-spacing: -0.025em; line-height: 1.15; margin-top: 0; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; margin-bottom: 14px; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.95rem); font-weight: 800; margin-bottom: 12px; }
h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 8px; }
.lead { font-size: 1.02rem; color: var(--muted); max-width: 60ch; margin: 0 0 18px; text-wrap: pretty; }
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-pill); font-size: 0.8rem; font-weight: 700; border: 1px solid var(--border); background: var(--surface); color: var(--ink); }
.badge--sage { background: #E2F0E9; color: var(--sage); border-color: rgba(42, 107, 79, 0.25); }
.badge--terra { background: rgba(184, 67, 35, 0.11); color: var(--terracotta); border-color: rgba(184, 67, 35, 0.24); }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.pill-list li { background: var(--surface); border: 1px solid var(--border); padding: 6px 12px; border-radius: var(--radius-pill); font-size: 0.84rem; font-weight: 600; color: var(--ink); }

/* Demo Shell */
.demo-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 12px 30px rgba(38, 28, 21, 0.09);
}
.demo-hud { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 0.84rem; font-weight: 700; }
.streak-bar { display: flex; align-items: center; justify-content: space-between; background: var(--surface-alt); border-radius: 12px; padding: 6px 10px; margin-bottom: 10px; font-size: 0.78rem; font-weight: 700; }
.dots { display: flex; gap: 4px; }
.dot { width: 14px; height: 9px; border-radius: 3px; background: #D9CCB9; }
.dot.on { background: var(--cobalt); }
.table-mat { background: var(--table); border: 1px solid var(--border); border-radius: 16px; padding: 12px 2px; display: flex; justify-content: center; overflow-x: auto; }
#board { position: relative; width: 360px; height: 204px; user-select: none; flex-shrink: 0; }
.card { position: absolute; width: 48px; height: 68px; border-radius: 8px; font-weight: 800; transition: transform 0.12s ease, border-color 0.12s ease; }
.card.face { background: #FFFDF9; border: 1px solid #D9CCB9; border-bottom: 2.5px solid #DFD2BF; padding: 3px 4px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; }
.card.face.playable { border: 2px solid var(--terracotta); border-bottom-width: 3px; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(184, 67, 35, 0.22); }
.card.back { background: var(--terracotta); border: 1px solid #8E2F15; box-shadow: inset 0 0 0 3px rgba(241, 197, 180, 0.45); cursor: default; }
.card-top { display: flex; justify-content: space-between; align-items: center; font-size: 15px; line-height: 1; }
.card-center { display: flex; justify-content: center; align-items: center; padding-bottom: 2px; }
.dock { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; }
.piles { display: flex; gap: 10px; align-items: center; }
.pile-btn { position: relative; width: 50px; height: 70px; border-radius: 8px; border: 1px solid #8E2F15; background: var(--terracotta); color: #FFFDF9; font-weight: 800; cursor: pointer; }
.pile-btn.empty { background: var(--surface-alt); border-color: var(--border); color: var(--muted); }
.stock-badge { position: absolute; bottom: -6px; right: -6px; background: var(--ink); color: #FFFDF9; font-size: 11px; padding: 2px 6px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.waste-slot { width: 50px; height: 70px; border-radius: 8px; background: #FFFDF9; border: 1px solid #D9CCB9; border-bottom: 2.5px solid #DFD2BF; padding: 3px 4px; display: flex; flex-direction: column; justify-content: space-between; font-weight: 800; }
.controls { display: flex; gap: 6px; flex: 1; justify-content: flex-end; }
.ctrl-btn { min-height: 54px; padding: 6px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--ink); font-weight: 700; font-size: 0.78rem; cursor: pointer; line-height: 1.25; }
.ctrl-btn.active { background: var(--cobalt); color: #FFFDF9; border-color: var(--cobalt); }
.demo-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 0.8rem; color: var(--muted); }
.status-msg { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #E2F0E9; color: var(--sage); font-size: 0.84rem; font-weight: 700; display: none; }
.status-msg.show { display: block; }

/* Sections & Buttons */
.btn-group { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border-radius: var(--radius-pill); font-size: 0.94rem; font-weight: 700; border: 1px solid transparent; cursor: pointer; }
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--terracotta); color: #FFFDF9; }
.btn--primary:hover { background: var(--terracotta-hover); color: #FFFDF9; }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-alt); }

.section { padding: 48px 0; border-top: 1px solid var(--border); }
.section--tight { padding: 30px 0; border-top: none; }
.feature-ledger { display: grid; grid-template-columns: 1fr; gap: 26px; margin-top: 24px; }
@media (min-width: 760px) { .feature-ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 40px; } }
.feature-row { padding-top: 16px; border-top: 1px solid var(--border-strong); }
.feature-row p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.callout { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px 22px; margin: 20px 0; color: var(--muted); font-size: 0.95rem; }
.callout strong { color: var(--ink); }
.callout--sage { background: #E2F0E9; border-color: rgba(42, 107, 79, 0.28); color: #1F4E3A; }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 0.86rem; color: var(--muted); margin-bottom: 18px; }
.prose h2 { margin-top: 30px; font-size: 1.28rem; color: var(--terracotta); }
.prose p, .prose li { color: var(--muted); max-width: 68ch; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 8px; }
code { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-alt); padding: 2px 6px; border-radius: 5px; color: var(--ink); }
.faq-list { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px 20px; }
.faq-item p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Footer */
.site-footer { margin-top: auto; background: var(--ink); color: #D9CCB9; padding: 42px 0 30px; font-size: 0.9rem; }
.site-footer__grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 40px; }
.site-footer__brand { font-family: var(--font-display); font-weight: 800; color: #FFFDF9; font-size: 1.08rem; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.site-footer a { color: #F2B59D; font-weight: 600; }
.site-footer__copy { margin-top: 26px; padding-top: 16px; border-top: 1px solid rgba(255,253,249,0.14); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 0.84rem; color: #B8A795; }

/* 6-Language Switcher 390px Responsive Overrides */
body { overflow-x: clip; }
.lang-switch { flex-wrap: wrap; max-width: 100%; }
.lang-switch a, .lang-switch span { font-size: 0.75rem; padding: 4px 8px; white-space: nowrap; line-height: 1.2; }
.lang-switch [aria-current="page"] { background: var(--terracotta); color: #FFFDF9; }
@media (max-width: 640px) {
  .lang-switch { margin-left: 0; padding: 2px; gap: 1px; }
  .lang-switch a, .lang-switch span { font-size: 0.7rem; padding: 4px 6px; }
}
