@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,800;1,600&display=swap');

:root {
  --cream: #fff5e9;
  --cream-2: #fbebda;
  --cream-3: #f6dfc9;
  --ink: #241715;
  --ink-soft: #5b453f;
  --accent: #974032;
  --accent-dark: #7a3227;
  --denim: #3a5a78;
  --wine: #5a1f1f;
  --line: #e6d3bd;
  --nav: rgba(12, 17, 25, 0.88);
  --font-head: 'Playfair Display', Georgia, serif;
  --font-label: 'Bebas Neue', 'Inter', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --shadow-card: 0 1px 0 rgba(36, 23, 21, 0.06), 0 10px 24px -18px rgba(36, 23, 21, 0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  padding-bottom: calc(74px + env(safe-area-inset-bottom));
}

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: var(--accent-dark); }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- fixed dark glass navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: var(--nav);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 30px -18px rgba(0, 0, 0, 0.9);
}
@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .nav { background: #0e131b; }
}
.nav-in {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav .brand {
  font-family: var(--font-head); font-weight: 800; font-size: 22px; letter-spacing: -0.02em;
  color: #fff5e9; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.nav .brand span { font-family: var(--font-label); font-size: 12px; letter-spacing: .14em; color: #e6c9a8; }
.nav .brand:hover, .nav .brand:focus-visible { color: #ffd9b0; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a, .nav-links button {
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  color: #efe3d4; background: transparent; border: 0; cursor: pointer;
  padding: 9px 12px; border-radius: 6px; text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; line-height: 1;
}
.nav-links a:hover, .nav-links button:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav-links a:focus-visible, .nav-links button:focus-visible { outline: 2px solid #ffd9b0; outline-offset: 2px; }
.nav-cat i { font-size: 15px; }

/* ---------- breadcrumbs ---------- */
.crumbs { padding: 22px 0 0; font-size: 13px; color: var(--ink-soft); }
.crumbs a { color: var(--accent-dark); text-decoration: none; border-bottom: 1px solid rgba(151, 64, 50, .3); }
.crumbs a:hover { border-bottom-color: var(--accent); }
.crumbs span { opacity: .6; padding: 0 6px; }

/* ---------- article ---------- */
.article-head { padding: 16px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.article-head .kicker {
  font-family: var(--font-label); letter-spacing: .18em; font-size: 13px;
  color: var(--accent); text-transform: uppercase; display: block; margin-bottom: 10px;
}
.article-head h1 { font-size: clamp(28px, 4vw, 42px); max-width: 860px; }
.article-head .lead { max-width: 720px; font-size: 17px; color: var(--ink-soft); margin-bottom: 0; }
.article-body { max-width: 760px; }
.article-body h2 {
  font-size: clamp(21px, 2.4vw, 26px); margin-top: 38px; scroll-margin-top: 88px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.article-body h3 { font-size: 18px; margin-top: 24px; }
.article-body ul, .article-body ol { padding-left: 20px; margin: 0 0 1.1em; }
.article-body li { margin-bottom: .45em; }
.article-body strong { color: #1a100f; }

.callout {
  background: var(--cream-2); border-left: 3px solid var(--accent);
  padding: 16px 18px; border-radius: 0 8px 8px 0; margin: 22px 0; font-size: 15px;
}
.callout p:last-child { margin-bottom: 0; }
.callout .tag {
  font-family: var(--font-label); letter-spacing: .14em; font-size: 12px;
  color: var(--denim); display: block; margin-bottom: 4px;
}

.table-scroll { overflow-x: auto; margin: 22px 0 26px; border: 1px solid var(--line); border-radius: 8px; background: #fffaf3; }
table.data { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14px; }
table.data caption {
  text-align: left; padding: 12px 14px; font-size: 12.5px; color: var(--ink-soft);
  font-family: var(--font-label); letter-spacing: .12em; border-bottom: 1px solid var(--line);
}
table.data th, table.data td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: var(--cream-3); font-weight: 600; font-size: 13px; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.check { list-style: none; padding: 0; margin: 18px 0 24px; }
.check li {
  display: flex; gap: 10px; align-items: flex-start; padding: 9px 0;
  border-bottom: 1px dashed var(--line); font-size: 15px;
}
.check li::before {
  content: ""; flex: 0 0 auto; width: 15px; height: 15px; margin-top: 4px;
  border: 1.5px solid var(--accent); border-radius: 3px; background: #fffaf3;
}

.related { margin: 44px 0 0; padding: 22px; background: var(--cream-2); border-radius: 8px; border: 1px solid var(--line); }
.related h2 { font-size: 18px; border: 0; margin: 0 0 12px; padding: 0; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.related a { color: var(--accent-dark); font-size: 15px; text-decoration: none; border-bottom: 1px solid rgba(151, 64, 50, .35); }
.related a:hover { border-bottom-color: var(--accent-dark); }

.back-home {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  margin: 30px 0 10px; padding: 12px 20px; border-radius: 6px;
  background: var(--accent); color: #fff5e9; text-decoration: none;
  font-family: var(--font-label); letter-spacing: .1em; font-size: 15px;
}
.back-home:hover { background: var(--accent-dark); }

.site-foot {
  margin-top: 56px; background: var(--accent); color: #fdeee2; padding: 34px 0 28px;
}
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: flex-start; }
.site-foot a { color: #ffe6d3; }
.site-foot p { margin: 0; font-size: 13.5px; max-width: 560px; }
.site-foot .flogo { font-family: var(--font-head); font-weight: 800; font-size: 20px; display: block; margin-bottom: 6px; color: #fff; text-decoration: none; }

/* ---------- bottom sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(12, 17, 25, .62); border: 0; padding: 0; cursor: pointer; }
.sheet-panel {
  position: relative; width: 100%; max-width: 720px; max-height: 85dvh;
  background: #121a24; color: #f2e7d8; border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column; border: 1px solid rgba(255, 255, 255, .14);
  animation: sheetUp .26s ease-out; padding-bottom: env(safe-area-inset-bottom);
}
@keyframes sheetUp { from { transform: translateY(18px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet-panel { animation: none; } html { scroll-behavior: auto; } }
.sheet-grip { width: 44px; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .32); margin: 10px auto 0; }
.sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px 12px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.sheet-bar h2 { font-family: var(--font-head); font-size: 19px; margin: 0; color: #fff5e9; }
.sheet-close {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .1); color: #fff5e9; font-size: 18px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.sheet-close:hover { background: rgba(255, 255, 255, .2); }
.sheet-body { overflow-y: auto; padding: 14px 18px 26px; -webkit-overflow-scrolling: touch; }
.sheet-body h3 { font-family: var(--font-label); letter-spacing: .16em; font-size: 13px; color: #c8a98d; margin: 0 0 10px; }
.sheet-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 22px; }
.sheet-cats a, .sheet-arts a {
  display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-radius: 6px;
  background: rgba(255, 255, 255, .07); color: #f6ead9; text-decoration: none; font-size: 13.5px;
  border: 1px solid rgba(255, 255, 255, .08); line-height: 1.3;
}
.sheet-cats a:hover, .sheet-arts a:hover { background: rgba(255, 255, 255, .14); }
.sheet-arts { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; counter-reset: a; }
.sheet-arts a::before {
  counter-increment: a; content: counter(a, decimal-leading-zero);
  font-family: var(--font-label); font-size: 11px; color: #e0a878; flex: 0 0 auto;
}

/* ---------- fixed bottom tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(12, 17, 25, .96);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, .14);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a, .tabbar button {
  min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #e8dccb; background: transparent; border: 0; text-decoration: none; cursor: pointer;
  font-size: 11px; font-family: var(--font-body); letter-spacing: .02em; padding: 6px 2px;
}
.tabbar i { font-size: 19px; }
.tabbar a:hover, .tabbar button:hover, .tabbar a:focus-visible, .tabbar button:focus-visible { color: #ffd9b0; background: rgba(255, 255, 255, .07); }

@media (max-width: 720px) {
  .wrap, .nav-in { padding: 0 16px; }
  .nav-in { height: 58px; }
  .nav-links a, .nav-links button { padding: 9px 8px; font-size: 13px; }
  .nav-links a.hide-sm { display: none; }
  .article-head h1 { font-size: 27px; }
  .article-body h2 { margin-top: 30px; }
  .site-foot .wrap { flex-direction: column; }
  .sheet-cats { grid-template-columns: 1fr; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .sheet-panel { max-height: 92dvh; }
  .sheet-bar { position: sticky; top: 0; background: #121a24; z-index: 2; }
}