@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --paper: #f7f3eb;
  --paper-deep: #ebe4d4;
  --ink: #141109;
  --ink-soft: #3d3830;
  --muted: #6b655a;
  --line: rgba(20, 17, 9, 0.12);
  --line-strong: rgba(20, 17, 9, 0.22);
  --accent: #c13d1a;
  --accent-hover: #9e2f12;
  --accent-soft: rgba(193, 61, 26, 0.12);
  --highlight: #0f4c5c;
  --radius: 4px;
  --radius-lg: 8px;
  --header-rail: 17.5rem;
  --max: 42rem;
  --max-wide: 50rem;
  --font-sans: "Outfit", system-ui, sans-serif;
  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --shadow-soft: 0 2px 24px rgba(20, 17, 9, 0.06);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-soft);
  background-color: var(--paper);
  background-image:
    linear-gradient(165deg, var(--paper) 0%, var(--paper-deep) 55%, #e8dfd0 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-blend-mode: normal, multiply;
  min-height: 100vh;
}

@media (min-width: 1100px) {
  body {
    display: grid;
    grid-template-columns: var(--header-rail) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "rail strip"
      "rail main";
    min-height: 100vh;
  }

  .site-header {
    grid-area: rail;
  }

  .age-banner {
    grid-area: strip;
  }

  main.page {
    grid-area: main;
  }
}

a {
  color: var(--highlight);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
  transition: color 0.15s var(--ease-out);
}

a:hover {
  color: var(--accent);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  padding: 0.65rem 1.1rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 1000;
  border-radius: var(--radius);
  text-decoration: none;
}

.skip-link:focus {
  left: 0.75rem;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 235, 0.92);
  backdrop-filter: blur(16px);
}

@media (min-width: 1100px) {
  .site-header {
    position: sticky;
    top: 0;
    align-self: stretch;
    height: 100vh;
    border-bottom: none;
    border-right: 1px solid var(--line-strong);
    background:
      linear-gradient(180deg, var(--paper) 0%, #efe8dc 72%, var(--paper-deep) 100%);
  }
}

.header-inner {
  max-width: none;
  margin: 0;
  padding: 1rem 1.25rem;
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 1100px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2.5rem;
    padding: 2.25rem 1.75rem 2rem;
    min-height: 100%;
  }
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}

.brand:hover {
  color: var(--accent);
}

.brand-wordmark {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 700;
  font-optical-sizing: auto;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand-accent {
  color: var(--accent);
  font-style: italic;
  font-weight: 600;
}

.nav-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.nav-toggle-label {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  cursor: pointer;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 0;
  transition: background 0.2s, transform 0.2s var(--ease-out);
}

.nav-toggle-label:hover {
  background: var(--paper-deep);
}

.nav-toggle-label span:nth-child(n + 2) {
  display: none;
}

.nav-toggle-label span:first-child {
  display: block;
  width: 1rem;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  position: relative;
  transition: transform 0.25s var(--ease-out), opacity 0.2s;
}

.nav-toggle-label span::before,
.nav-toggle-label span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 1rem;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.25s var(--ease-out);
}

.nav-toggle-label span::before {
  top: -6px;
}

.nav-toggle-label span::after {
  top: 6px;
}

.nav-toggle-input:checked ~ .nav-toggle-label span:first-child {
  background: transparent;
}

.nav-toggle-input:checked ~ .nav-toggle-label span:first-child::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle-input:checked ~ .nav-toggle-label span:first-child::after {
  transform: translateY(-6px) rotate(-45deg);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 1100px) {
  .site-nav {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.35rem;
  }
}

.site-nav a {
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s,
    transform 0.2s var(--ease-out);
}

@media (min-width: 1100px) {
  .site-nav a {
    text-align: left;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.35);
  }

  .site-nav a:hover {
    transform: translateX(4px);
    border-color: var(--ink);
  }
}

.site-nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.65);
  border-color: var(--line-strong);
}

.site-nav a[aria-current="page"] {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
}

@media (max-width: 1099px) {
  .nav-toggle-label {
    display: flex;
  }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    padding: 0.75rem 1.25rem 1.25rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line-strong);
    box-shadow: var(--shadow-soft);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition:
      max-height 0.4s var(--ease-out),
      opacity 0.25s,
      visibility 0.25s;
  }

  .nav-toggle-input:checked ~ .site-nav {
    max-height: 20rem;
    opacity: 1;
    visibility: visible;
  }

  .site-header {
    position: relative;
  }

  .header-inner {
    flex-wrap: nowrap;
  }

  .site-nav a {
    text-align: center;
    width: 100%;
    border: 1px solid var(--line);
  }
}

/* ——— Age strip ——— */
.age-banner {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper);
  padding: 0.65rem 1.25rem;
  background: var(--ink);
  border-bottom: 3px solid var(--accent);
}

@media (min-width: 1100px) {
  .age-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-left: clamp(1.25rem, 4vw, 3rem);
    padding-right: clamp(1.25rem, 4vw, 3rem);
  }

  .age-banner::after {
    content: "";
    flex: 0 0 4rem;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0.7;
  }
}

/* ——— Main column ——— */
.page {
  max-width: var(--max-wide);
  margin: 0;
  padding: clamp(1.75rem, 5vw, 3.25rem) clamp(1.25rem, 4vw, 3.5rem) 4rem;
}

@media (min-width: 1100px) {
  .page {
    padding-top: clamp(2.5rem, 5vh, 4rem);
    max-width: min(var(--max-wide), calc(100vw - var(--header-rail) - 4rem));
  }
}

/* Legacy home layout blocks (unused but kept) */
.home-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 960px) {
  .home-layout {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

.home-hero-panel {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.mesh-deco {
  display: none;
}

/* ——— Hero ——— */
.page-hero {
  margin-bottom: clamp(2rem, 5vw, 3rem);
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.page-hero::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: min(40%, 12rem);
  height: 3px;
  background: var(--accent);
}

.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 5.5vw, 3.35rem);
  font-optical-sizing: auto;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 1rem;
  color: var(--ink);
  max-width: 18ch;
}

@media (min-width: 700px) {
  .page-hero h1 {
    max-width: 14ch;
  }
}

.home-hero-panel .page-hero h1 {
  max-width: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: currentColor;
}

.lead {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--muted);
  max-width: 44ch;
  line-height: 1.65;
}

/* ——— Prose ——— */
.prose {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  backdrop-filter: none;
  box-shadow: none;
  max-width: var(--max);
}

.prose > *:first-child {
  margin-top: 0;
}

.prose > *:last-child {
  margin-bottom: 0;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 600;
  font-optical-sizing: auto;
  margin: 2.75rem 0 0.85rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
  position: relative;
  padding-left: 1rem;
  border-left: 4px solid var(--accent);
}

.prose h2:first-of-type {
  margin-top: 1.5rem;
}

.prose h3 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.prose p,
.prose li {
  color: var(--ink-soft);
}

.prose ul,
.prose ol {
  padding-left: 1.35rem;
}

.prose li {
  margin: 0.35rem 0;
}

.prose li::marker {
  color: var(--accent);
}

.callout {
  margin: 2rem 0;
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  border-left: 5px solid var(--accent);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.7), var(--accent-soft));
  box-shadow: var(--shadow-soft);
}

.callout p {
  margin: 0;
  color: var(--ink-soft);
}

.hub-intro {
  margin-bottom: 1.75rem;
}

.hub-intro p {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 52ch;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 1rem;
}

.hub-card {
  display: flex;
  flex-direction: column;
  padding: 1.35rem 1.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.2s,
    transform 0.25s var(--ease-out),
    box-shadow 0.25s;
  min-height: 8.5rem;
  box-shadow: var(--shadow-soft);
}

.hub-card:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(20, 17, 9, 0.1);
}

.hub-card h2 {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  margin: 0 0 0.45rem;
  border: none;
  padding: 0;
}

.hub-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  flex-grow: 1;
}

.hub-card .hub-arrow {
  margin-top: 1.1rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

/* ——— Tables ——— */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: 0.88rem;
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
}

.prose tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.45);
}

.prose tbody tr:nth-child(odd) {
  background: rgba(247, 243, 235, 0.6);
}

.prose th {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ——— Footer ——— */
.site-footer {
  margin-top: clamp(3rem, 8vw, 4.5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line-strong);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-footer p {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
}

.site-footer nav a {
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
}

.site-footer nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.code-inline {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.86em;
  background: rgba(20, 17, 9, 0.06);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

