@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Manrope:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #FFF8F4;
  --ink: #1C1418;
  --ink-soft: #4A3D42;
  --muted: #6E5F64;
  --wine: #A43D5E;
  --wine-dark: #87314D;
  --line: #EADFD8;
  --line-strong: #DDCBC2;
  --soft: #FDF1EA;
  --accent-soft: #F7E4D9;
  --nav: rgba(12, 17, 25, 0.88);
  --radius: 14px;
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding-top: 64px;
  padding-bottom: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--wine); }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.15;
}

:focus-visible { outline: 2px solid #C98BA0; outline-offset: 2px; }

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

/* ---------- navigation ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 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.1);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .site-nav { background: #0C1119; }
}

.nav-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  font-size: 15px;
}

.brand-text { font-family: var(--font-heading); font-size: 22px; letter-spacing: -0.02em; }

.nav-links { display: flex; align-items: center; gap: 2px; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  white-space: nowrap;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.nav-link:hover, .nav-link:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.1); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 6px;
  background: var(--wine);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.nav-cta:hover { background: var(--wine-dark); }

.nav-dropdown { position: relative; }

.drop-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 320px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0E131B;
  display: none;
}

.drop-panel[data-open="true"] { display: block; }

.drop-title {
  margin: 4px 8px 6px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.drop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }

.drop-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.drop-link:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.drop-note { margin: 6px 8px 2px; font-size: 10.5px; line-height: 1.5; color: rgba(255, 255, 255, 0.4); }

.nav-burger {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

/* ---------- page head ---------- */
.page-head { padding: 20px 0 6px; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  margin: 0 0 10px;
}

.crumbs a { color: var(--wine); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span[aria-hidden] { color: var(--line-strong); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--wine);
  margin: 0 0 8px;
}

.page-head h1 {
  font-size: clamp(27px, 3.6vw, 40px);
  margin: 0 0 12px;
  max-width: 900px;
}

.lead {
  max-width: 760px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 0 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}

.meta-row strong { color: var(--ink-soft); font-weight: 600; }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding: 22px 0 8px;
}

.prose { min-width: 0; font-size: 15px; }

.prose h2 {
  font-size: clamp(21px, 2.4vw, 26px);
  margin: 30px 0 10px;
  scroll-margin-top: 88px;
}

.prose h3 { font-size: 17px; margin: 20px 0 8px; }

.prose p { margin: 0 0 12px; color: var(--ink-soft); }

.prose ul, .prose ol { margin: 0 0 14px; padding-left: 20px; color: var(--ink-soft); }

.prose li { margin-bottom: 6px; }

.prose strong { color: var(--ink); font-weight: 600; }

.prose a { color: var(--wine); text-decoration-thickness: 1px; }

.toc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px 16px;
  margin: 0 0 18px;
}

.toc p { margin: 0 0 8px; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

.toc ol { margin: 0; padding-left: 18px; font-size: 12.5px; }

.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--wine); text-decoration: underline; }

.note {
  border-left: 3px solid var(--wine);
  background: var(--soft);
  border-radius: 0 10px 10px 0;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.note strong { color: var(--wine); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 0 0 16px;
  background: #fff;
}

table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 480px; }

th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }

thead th {
  background: #FAF0EA;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}

tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }

td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.checklist { list-style: none; padding: 0; margin: 0 0 16px; }

.checklist li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 6px;
  font-size: 12.5px;
  line-height: 1.6;
}

.checklist input { margin-top: 3px; accent-color: var(--wine); width: 15px; height: 15px; flex-shrink: 0; }

.related {
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.related h2 { font-size: 20px; margin: 0 0 10px; }

.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }

.related a {
  display: block;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.related a:hover { border-color: #D9B7C2; background: #FFFAF7; }

.related span { display: block; margin-top: 3px; font-size: 11px; font-weight: 400; color: var(--muted); }

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.back-home:hover { border-color: var(--wine); color: var(--wine); }

/* ---------- sidebar ---------- */
.aside { position: sticky; top: 88px; display: grid; gap: 12px; }

.aside-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.aside-card h2 { font-size: 16px; margin: 0 0 6px; }

.aside-card p { margin: 0 0 10px; font-size: 11.5px; line-height: 1.65; color: var(--muted); }

.aside-card .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--wine);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.aside-card .btn:hover { background: var(--wine-dark); }

.aside-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }

.aside-list a { font-size: 12px; color: var(--ink-soft); text-decoration: none; line-height: 1.45; display: block; }
.aside-list a:hover { color: var(--wine); }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 34px;
  background: #2A1018;
  color: #F6E9E4;
  padding: 30px 0 26px;
}

.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 26px; }

.site-footer h2 { color: #fff; font-size: 15px; margin: 0 0 8px; }

.site-footer p { margin: 0 0 8px; font-size: 11.5px; line-height: 1.7; color: rgba(246, 233, 228, 0.78); max-width: 320px; }

.site-footer a { color: rgba(246, 233, 228, 0.82); text-decoration: none; font-size: 11.5px; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

.footer-bottom {
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  font-size: 10.5px;
  color: rgba(246, 233, 228, 0.6);
}

/* ---------- mobile dock + sheet ---------- */
.dock {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 55;
  background: rgba(12, 17, 25, 0.94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: env(safe-area-inset-bottom);
}

.dock-inner { display: flex; gap: 4px; padding: 6px 8px; }

.dock-item {
  flex: 1;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.dock-item i { font-size: 19px; }
.dock-item:hover { color: #fff; }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(12, 17, 25, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sheet-backdrop[data-open="true"] { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 80;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  background: #0E131B;
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: env(safe-area-inset-bottom);
}

.sheet[data-open="true"] { transform: translateY(0); }

.sheet-grip { display: flex; justify-content: center; padding: 10px 0 4px; }
.sheet-grip span { width: 40px; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.25); }

.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 20px 10px; }

.sheet-head h2 { color: #fff; font-size: 20px; margin: 0; }

.sheet-close {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 20px;
  cursor: pointer;
}

.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 20px 22px; }

.sheet-cats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.sheet-cats a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  text-decoration: none;
  overflow: hidden;
}

.sheet-cats a:hover { background: rgba(255, 255, 255, 0.1); }
.sheet-cats span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sheet-arts { list-style: none; margin: 0; padding: 0; }

.sheet-arts a {
  display: flex;
  gap: 10px;
  padding: 10px 6px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12.5px;
  line-height: 1.45;
  text-decoration: none;
}

.sheet-arts a:hover { background: rgba(255, 255, 255, 0.1); }
.sheet-arts b { font-weight: 500; }
.sheet-arts em { font-style: normal; color: rgba(255, 255, 255, 0.38); font-size: 11px; flex-shrink: 0; }

.sheet-note {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.5);
}

body.is-locked { overflow: hidden; }

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .aside { position: static; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  body { padding-bottom: 92px; }
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
  .dock { display: block; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .wrap { padding: 0 18px; }
  .nav-inner { padding: 0 18px; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; padding-bottom: 96px; }
  .dock { display: block; }
  .lead { font-size: 14.5px; }
  .aside { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 18px; }
  .nav-cta { display: none; }
  .sheet-head h2 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}