/* StudyBlock — Warm Study Paper & Editorial Desk
 * Surface: #FAF7F0 Paper Canvas · #1E40AF Academic Cobalt · #B45309 Brass Amber
 * WCAG AA >= 4.5:1 · Tabular Numerals · Zero CLS
 */
:root {
  --bg-canvas: #FAF7F0;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F2EDE3;
  --bg-ink: #151B2C;
  --border-paper: rgba(30, 41, 59, 0.11);
  --border-control: rgba(30, 41, 59, 0.22);
  --text-primary: #151B2C;
  --text-secondary: #47526A;
  --text-muted: #5F6B82;
  --brand: #1E40AF;
  --brand-hover: #17338C;
  --brand-soft: rgba(30, 64, 175, 0.10);
  --brass: #B45309;
  --brass-soft: rgba(180, 83, 9, 0.11);
  --success: #0F766E;
  --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-serif: Georgia, "Times New Roman", 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(30, 64, 175, 0.18); 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(--brand); 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(--brand); outline-offset: 3px; border-radius: 6px; }
.tabular { font-variant-numeric: tabular-nums; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--bg-ink); color: #FAF7F0; 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(250, 247, 240, 0.90);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-paper);
}
.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(--brand); background: var(--brand-soft); text-decoration: none; }
.lang-switch { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-subtle); border: 1px solid var(--border-paper); 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(--brand); color: #FFFFFF; }
.lang-switch a:hover { color: var(--text-primary); background: rgba(30, 41, 59, 0.06); 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.15fr) minmax(340px, 0.85fr); gap: 52px; } }
h1, h2, h3 { font-family: var(--font-display); color: var(--text-primary); letter-spacing: -0.025em; line-height: 1.16; 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-paper); background: var(--bg-surface); color: var(--text-primary); }
.badge--brand { background: var(--brand-soft); color: var(--brand); border-color: rgba(30, 64, 175, 0.22); }
.badge--brass { background: var(--brass-soft); color: var(--brass); border-color: rgba(180, 83, 9, 0.24); }
.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(--brand); color: #FFFFFF; }
.btn--primary:hover { background: var(--brand-hover); color: #FFFFFF; }
.btn--secondary { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-control); }
.btn--secondary:hover { background: var(--bg-subtle); border-color: var(--text-primary); }

/* Paper Planner Specimen */
.planner-sheet {
  background: var(--bg-surface);
  border: 1px solid var(--border-paper);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.planner-sheet__head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--border-paper); }
.planner-sheet__title { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.planner-sheet__total { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--brand); }
.timetable { display: grid; grid-template-columns: 34px repeat(6, 1fr); gap: 5px; align-items: center; }
.tt-hr { font-size: 0.74rem; font-weight: 700; color: var(--text-muted); text-align: right; padding-right: 4px; }
.tt-cell { height: 22px; border-radius: 4px; background: var(--bg-subtle); }
.tt-c1 { background: #2563EB; }
.tt-c2 { background: #DC5B42; }
.tt-c3 { background: #0F766E; }
.tt-c4 { background: #7C3AED; }
.tt-c5 { background: #CA8A04; }
.planner-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-paper); font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.planner-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Sections & Lists */
.section { padding: 56px 0; border-top: 1px solid var(--border-paper); }
.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; }

/* Shelf visual strip */
.shelf-card { background: var(--bg-surface); border: 1px solid var(--border-paper); border-radius: var(--radius-md); padding: 24px; margin-top: 28px; }
.shelf-books { display: flex; align-items: flex-end; gap: 6px; padding: 12px 16px 0; border-bottom: 10px solid #D8C3A5; border-radius: 2px; min-height: 102px; overflow-x: auto; }
.book { border-radius: 3px 3px 0 0; position: relative; flex-shrink: 0; }
.book::after { content: ""; position: absolute; left: 3px; right: 3px; top: 10px; height: 2px; background: rgba(255,255,255,0.65); }

/* Callout & Prose */
.callout { background: var(--bg-surface); border: 1px solid var(--border-paper); 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--brand { background: var(--brand-soft); border-color: rgba(30, 64, 175, 0.22); }
.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-subtle); padding: 2px 6px; border-radius: 5px; color: var(--text-primary); }

.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--border-paper); 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-paper); vertical-align: top; }
thead th { background: var(--bg-subtle); 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-paper); 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: var(--bg-ink); color: #CBD5E1; padding: 44px 0 32px; 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: #FAF7F0; font-size: 1.08rem; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.site-footer a { color: #93C5FD; font-weight: 600; }
.site-footer__copy { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.12); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 0.84rem; color: #94A3B8; }

/* 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(--brand); 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; }
}
