:root {
  --bg: #f3efe7;
  --surface: #fffdf8;
  --text: #272b2d;
  --muted: #6d706f;
  --line: rgba(12, 28, 49, 0.16);
  --primary: #0c1c31;
  --primary-dark: #081523;
  --accent: #b08a4a;
  --link: #642b37;
  --link-hover: #4b2029;
  --white: #ffffff;
  --max: 1180px;
  --reading: 760px;
  --gutter: 40px;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: var(--link-hover); }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
img { display: block; max-width: 100%; height: auto; }

.skip-link {
  position: fixed;
  z-index: 999;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: var(--white);
  color: #000;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.header-inner, .hero-inner, .content-section, .footer-inner {
  width: min(calc(100% - var(--gutter)), var(--max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--primary-dark);
  color: var(--white);
}
.header-inner {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}
.brand { color: var(--white); text-decoration: none; }
.brand:hover { color: var(--white); }
.brand-name {
  font-family: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  white-space: nowrap;
}

.desktop-nav > ul, .mobile-menu nav > ul {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.desktop-nav li > ul, .mobile-menu li > ul { display: none; }
.desktop-nav a, .mobile-menu a {
  display: block;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.84);
  text-decoration: none;
}
.desktop-nav a { padding: 10px 13px; font-size: 0.88rem; font-weight: 650; }
.desktop-nav a:hover, .desktop-nav .current > a, .desktop-nav .active > a,
.mobile-menu a:hover, .mobile-menu .current > a, .mobile-menu .active > a {
  background: rgba(255, 255, 255, 0.09);
  color: var(--white);
}

.mobile-menu { position: relative; display: none; }
.mobile-menu summary {
  display: grid;
  width: 46px;
  height: 46px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  place-content: center;
  gap: 5px;
}
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary span { display: block; width: 20px; height: 2px; background: var(--white); }
.mobile-menu nav {
  position: absolute;
  top: 58px;
  right: 0;
  width: min(82vw, 320px);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(21, 24, 27, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}
.mobile-menu ul { align-items: stretch; flex-direction: column; }
.mobile-menu li, .mobile-menu a { width: 100%; }
.mobile-menu a { padding: 12px 14px; color: var(--white); }

.hero {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--primary);
  color: var(--white);
  isolation: isolate;
}
.hero-grid {
  position: absolute;
  z-index: -2;
  inset: 0;
  opacity: 0.28;
  background-image: linear-gradient(rgba(63, 140, 255, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(63, 140, 255, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}
.hero-glow {
  position: absolute;
  z-index: -1;
  top: -18rem;
  right: -10rem;
  width: 55rem;
  height: 55rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(63, 140, 255, 0.2), rgba(63, 140, 255, 0.04) 38%, transparent 68%);
}
.hero-inner { display: flex; min-height: 150px; align-items: flex-end; padding-bottom: 1.75rem; }
h1, h2, h3, h4 { font-family: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif; font-weight: 500; line-height: 1.08; }
.hero h1 { max-width: 920px; margin: 0; color: var(--white); font-size: 3.4rem; letter-spacing: -0.025em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.content-section { padding: 32px 0 56px; }
.content-layout { display: grid; grid-template-columns: minmax(0, var(--reading)); justify-content: center; }
.content-layout.has-sidebar { grid-template-columns: minmax(0, 1fr) minmax(230px, 290px); justify-content: stretch; gap: 4rem; }
.page-content { display: flow-root; max-width: var(--reading); }
.page-content > :first-child { margin-top: 0; }
.page-content p { margin: 0 0 1.15em; }
.page-content h1, .page-content h2, .page-content h3, .page-content h4 { color: var(--primary); }
.page-content h2 { margin: 1.35em 0 0.55em; font-size: 2rem; }
.page-content h3 { margin: 1.4em 0 0.55em; font-size: 1.45rem; }
.page-content img { max-width: 100%; height: auto !important; }
.page-content li { margin-block: 0.45em; }
.page-content blockquote { margin: 2em 0; padding: 1em 1.2em; border-left: 4px solid var(--accent); background: var(--surface); }
.page-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.page-content th, .page-content td { padding: 12px 14px; border: 1px solid var(--line); text-align: left; }

.sidebar { min-width: 0; }
#child_menu { position: sticky; top: 2rem; margin: 0; padding: 1rem 0 0; border-top: 2px solid var(--accent); list-style: none; }
#child_menu > li { margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
#child_menu > li:last-child { border-bottom: 1px solid var(--line); }
#child_menu > li#parent { margin-bottom: 0.8rem; border-top: 0; }
#child_menu > li#parent > a { padding: 0 0 0.25rem; color: var(--primary); font-family: Georgia, serif; font-size: 1.35rem; font-weight: 600; }
#child_menu > li > a { display: block; padding: 0.82rem 0; color: var(--text); font-size: 0.88rem; text-decoration: none; }
#child_menu a:hover, #child_menu .current > a { color: var(--link); }
#child_menu .current > a { font-weight: 650; }

.site-footer { border-top: 1px solid rgba(255, 255, 255, 0.1); background: var(--primary); color: rgba(255, 255, 255, 0.68); }
.footer-inner { display: flex; min-height: 66px; align-items: center; }
.footer-inner p { margin: 0; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }

@media (max-width: 900px) {
  .header-inner { align-items: flex-start; flex-direction: column; gap: 0; padding-top: 1rem; }
  .desktop-nav { display: none; }
  .mobile-menu { display: block; position: absolute; top: 1rem; right: 0; }
  .content-layout.has-sidebar { grid-template-columns: 1fr; gap: 2rem; }
  #child_menu { position: static; }
}
@media (max-width: 700px) {
  :root { --gutter: 28px; }
  body { font-size: 16px; }
  .hero-inner { padding-bottom: 1.25rem; }
  .hero h1 { font-size: 2.4rem; }
  .brand-name { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
