/* PipRelic — Indigo-Slate Tabletop Atelier
 * Surface: #101526 Deep Indigo Canvas · #F8F4EA Ivory Dice · #FF6B4A Coral × #22D3EE Cyan -> #FBBF24 Amber
 * WCAG AA >= 4.5:1 · Tabular Numerals · Zero CLS
 */
:root {
  --bg-canvas: #101526;
  --bg-tray: #171F36;
  --bg-surface: #1D2742;
  --bg-elevated: #263356;
  --border-subtle: rgba(218, 228, 255, 0.12);
  --border-control: rgba(218, 228, 255, 0.24);
  --text-primary: #F6F8FF;
  --text-secondary: #B2BEDB;
  --text-muted: #8B9AC0;
  --points: #FF6B4A;
  --points-fill: #D94A2B;
  --points-soft: rgba(255, 107, 74, 0.16);
  --mult: #22D3EE;
  --mult-fill: #0891B2;
  --mult-soft: rgba(34, 211, 238, 0.15);
  --total: #FBBF24;
  --success: #34D399;
  --boss: #FB7185;
  --ivory: #F8F4EA;
  --ivory-edge: #D8CFC0;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 9999px;
  --container-max: 1120px;
  --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;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.64;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}
::selection { background: rgba(34, 211, 238, 0.26); color: var(--text-primary); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-canvas); color: var(--text-primary); }
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--mult); text-decoration: none; text-underline-offset: 0.2em; transition: color 0.16s var(--ease-out), background-color 0.16s var(--ease-out), border-color 0.16s var(--ease-out); }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--mult); outline-offset: 3px; border-radius: 6px; }
.tabular { font-variant-numeric: tabular-nums; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ivory); color: #101526; 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 18px; } }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(16, 21, 38, 0.90);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
.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(--text-primary); 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(--text-secondary); 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(--text-primary); background: var(--bg-elevated); text-decoration: none; }
.lang-switch { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-tray); border: 1px solid var(--border-subtle); 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(--text-secondary); }
.lang-switch .is-active { background: var(--points-fill); color: #FFFFFF; }
.lang-switch a:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); text-decoration: none; }

/* Breadcrumb */
.breadcrumb { padding: 20px 0 8px; font-size: 0.86rem; color: var(--text-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-control); }
.breadcrumb a { color: var(--text-secondary); font-weight: 600; }

/* Hero */
.hero { padding: 52px 0 56px; }
.hero__grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; }
@media (min-width: 920px) { .hero__grid { grid-template-columns: minmax(0, 1.12fr) minmax(350px, 0.88fr); gap: 52px; } }
h1, h2, h3 { font-family: var(--font-display); color: var(--text-primary); letter-spacing: -0.025em; line-height: 1.15; margin-top: 0; text-wrap: balance; }
h1 { font-size: clamp(2.15rem, 4.4vw, 3.35rem); font-weight: 800; margin-bottom: 18px; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.05rem); font-weight: 800; margin-bottom: 12px; }
h3 { font-size: 1.14rem; font-weight: 700; margin-bottom: 8px; }
.lead { font-size: clamp(1.02rem, 1.4vw, 1.14rem); color: var(--text-secondary); max-width: 62ch; margin: 0 0 22px; text-wrap: pretty; }
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 24px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-pill); font-size: 0.82rem; font-weight: 700; border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-primary); }
.badge--points { background: var(--points-soft); color: var(--points); border-color: rgba(255, 107, 74, 0.32); }
.badge--mult { background: var(--mult-soft); color: var(--mult); border-color: rgba(34, 211, 238, 0.30); }
.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: 48px; padding: 11px 22px; border-radius: var(--radius-pill); font-size: 0.95rem; font-weight: 700; border: 1px solid transparent; cursor: pointer; }
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--points-fill); color: #FFFFFF; }
.btn--primary:hover { background: #C23E21; color: #FFFFFF; }
.btn--secondary { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-control); }
.btn--secondary:hover { background: var(--bg-elevated); border-color: var(--mult); }

/* Tabletop Board Specimen */
.tabletop-board {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.relic-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.relic-chip { background: var(--bg-tray); border: 1px solid var(--border-control); border-radius: 12px; padding: 10px 6px; text-align: center; }
.relic-chip__math { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700; color: var(--mult); }
.relic-chip__name { font-size: 0.72rem; color: var(--text-secondary); margin-top: 3px; }
.eqn-bar { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px; }
.eqn-box { flex: 1; text-align: center; border-radius: 12px; padding: 10px 8px; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; }
.eqn-box--pts { background: var(--points-soft); color: var(--points); border: 1px solid rgba(255, 107, 74, 0.34); }
.eqn-box--mult { background: var(--mult-soft); color: var(--mult); border: 1px solid rgba(34, 211, 238, 0.34); }
.eqn-total { text-align: center; font-family: var(--font-display); font-size: 1.55rem; font-weight: 800; color: var(--total); margin-bottom: 16px; }
.dice-tray { background: var(--bg-tray); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 16px 12px; display: flex; justify-content: space-between; gap: 8px; }
.die {
  width: 54px; height: 54px; border-radius: 12px;
  background: var(--ivory); border-bottom: 3px solid var(--ivory-edge);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.die--held { box-shadow: 0 0 0 2px var(--mult); }
@media (max-width: 420px) { .die { width: 46px; height: 46px; } }

/* Sections */
.section { padding: 56px 0; border-top: 1px solid var(--border-subtle); }
.section--tight { padding: 32px 0; border-top: none; }
.feature-ledger { display: grid; grid-template-columns: 1fr; gap: 28px; margin-top: 28px; }
@media (min-width: 760px) { .feature-ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; } }
.feature-row { padding-top: 18px; border-top: 1px solid var(--border-control); }
.feature-row p { margin: 0; color: var(--text-secondary); font-size: 0.96rem; }

.callout { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 20px 22px; margin: 20px 0; color: var(--text-secondary); font-size: 0.95rem; }
.callout strong { color: var(--text-primary); }
.callout--mult { background: var(--mult-soft); border-color: rgba(34, 211, 238, 0.30); }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 0.86rem; color: var(--text-muted); margin-bottom: 20px; }
.prose h2 { margin-top: 34px; font-size: 1.32rem; }
.prose p, .prose li { color: var(--text-secondary); 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(--bg-elevated); padding: 2px 6px; border-radius: 5px; color: var(--text-primary); }

.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
thead th { background: var(--bg-tray); font-weight: 700; color: var(--text-primary); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: none; }

.faq-list { display: flex; flex-direction: column; gap: 16px; margin-top: 22px; }
.faq-item { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 20px 22px; }
.faq-item h3 { margin-bottom: 8px; }
.faq-item p { margin: 0; color: var(--text-secondary); font-size: 0.95rem; }

/* Footer */
.site-footer { margin-top: auto; background: #0A0E1B; color: var(--text-secondary); padding: 44px 0 32px; font-size: 0.9rem; border-top: 1px solid var(--border-subtle); }
.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: var(--text-primary); font-size: 1.08rem; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.site-footer a { color: var(--mult); font-weight: 600; }
.site-footer__copy { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border-subtle); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 0.84rem; color: var(--text-muted); }

/* 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(--points); color: #FFFFFF; }
@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; }
}
