@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Unbounded:wght@500;600;700;800&display=swap");

:root {
  --void: #050506;
  --bg-deep: #0c0c0e;
  --surface: rgba(18, 18, 22, 0.72);
  --surface-2: rgba(26, 26, 32, 0.85);
  --surface-solid: #141418;
  --ink: #f4f4f5;
  --ink-muted: #9b9ba8;
  --ink-dim: #6e6e7a;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.12);
  --glow: rgba(255, 255, 255, 0.06);
  --focus-ring: #c8c8d4;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --header-h: 76px;
  --shadow-elev: 0 28px 80px rgba(0, 0, 0, 0.55);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.72;
  font-weight: 450;
  background-color: var(--void);
  background-image:
    radial-gradient(ellipse 140% 90% at 50% -30%, rgba(255, 255, 255, 0.07), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 20%, rgba(255, 255, 255, 0.03), transparent 45%),
    linear-gradient(165deg, var(--void) 0%, var(--bg-deep) 42%, #060607 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 85% 70% at 50% 30%, black 15%, transparent 70%);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--accent);
  color: var(--void);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 700;
  font-size: 13px;
  z-index: 10000;
  text-decoration: none;
}

.skip-link:focus {
  left: 12px;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 10, 0.78);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: opacity 0.2s var(--ease-out);
}

.brand:hover {
  opacity: 0.92;
}

.brand-logo {
  width: clamp(140px, 22vw, 200px);
  height: auto;
  display: block;
  /* Source asset is black-on-white; invert for dark UI */
  filter: invert(1) brightness(1.08) drop-shadow(0 2px 20px rgba(255, 255, 255, 0.08));
}

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

.nav-toggle-label {
  display: none;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

.nav-toggle-label:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(34, 34, 42, 0.95);
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 999px;
  position: relative;
}

.nav-toggle-label span::before {
  position: absolute;
  left: 0;
  top: -7px;
}

.nav-toggle-label span::after {
  position: absolute;
  left: 0;
  top: 7px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(16px, 3vw, 28px);
  max-width: min(920px, 72vw);
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-muted);
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  border: 0;
  border-radius: 0;
  padding: 6px 0;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.site-nav a:hover {
  color: var(--ink);
  border-bottom-color: rgba(255, 255, 255, 0.35);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 700;
}

.age-banner {
  margin: 0;
  text-align: center;
  font-family: "Manrope", sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  border-bottom: 1px solid var(--line);
  padding: 11px 16px;
  position: relative;
  z-index: 1;
}

/* —— Layout —— */
.layout {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 96px;
}

/* New top-first structure: headline block always first row */
.hero-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 20px;
  align-items: stretch;
}

.page-hero,
.prose,
.content-aside,
.site-footer,
.meta-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-elev);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.page-hero {
  border-radius: var(--radius-xl);
  padding: clamp(32px, 5vw, 56px) clamp(24px, 4vw, 56px) clamp(28px, 4vw, 44px);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  width: min(420px, 90vw);
  height: min(420px, 90vw);
  right: -18%;
  top: -35%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.07), transparent 68%);
  pointer-events: none;
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 88%, rgba(255, 255, 255, 0.04) 0%, transparent 42%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='4' cy='4' r='1.2' fill='%23ffffff' fill-opacity='0.09'/%3E%3C/svg%3E");
  opacity: 0.45;
  pointer-events: none;
}

.eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--ink-muted);
  font-family: "Manrope", sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.page-hero h1 {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  max-width: 24ch;
  color: var(--ink);
  font-family: "Unbounded", sans-serif;
  font-size: clamp(2.05rem, 5.2vw, 4rem);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lead {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--ink-muted);
  max-width: 60ch;
  font-size: 1.06rem;
  font-weight: 500;
  line-height: 1.65;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.meta-card {
  border-radius: var(--radius-lg);
  padding: 16px 16px 15px;
  background: var(--surface-2);
}

.meta-card span {
  display: block;
  margin-bottom: 8px;
  font-family: "Manrope", sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  font-weight: 800;
}

.meta-card strong {
  font-family: "Unbounded", sans-serif;
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
  grid-template-areas: "main aside";
  gap: 18px;
  align-items: start;
}

.content-aside {
  grid-area: aside;
  position: sticky;
  top: calc(var(--header-h) + 28px);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
}

.content-aside h2 {
  margin: 0 0 16px;
  font-family: "Unbounded", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.2;
}

.aside-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.aside-nav a {
  text-decoration: none;
  color: var(--ink-muted);
  border: 0;
  border-radius: 0;
  padding: 6px 0;
  background: transparent;
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.aside-nav a:hover {
  color: var(--ink);
  border-bottom-color: rgba(255, 255, 255, 0.28);
}

.aside-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 700;
}

.aside-note {
  margin: 16px 0 0;
  color: var(--ink-dim);
  font-size: 12px;
  line-height: 1.6;
  font-weight: 500;
}

.content-main {
  grid-area: main;
  min-width: 0;
}

.prose {
  border-radius: var(--radius-xl);
  padding: clamp(26px, 3.5vw, 48px);
}

.prose p,
.prose li {
  color: #c8c8d0;
  font-size: 0.995rem;
}

.prose h2 {
  margin: 2.4rem 0 0.85rem;
  color: var(--ink);
  font-family: "Unbounded", sans-serif;
  font-size: clamp(1.25rem, 1.9vw, 1.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  border-top: 1px solid var(--line);
  padding-top: 1.35rem;
}

.prose h2:first-of-type {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.prose h3 {
  margin: 1.5rem 0 0.5rem;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 3px;
  font-weight: 700;
  transition: text-decoration-color 0.2s var(--ease-out);
}

.prose a:hover {
  text-decoration-color: var(--accent);
}

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

.prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 28px 0;
  font-size: 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

.prose tr:last-child td {
  border-bottom: 0;
}

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

.prose th {
  color: var(--void);
  font-family: "Manrope", sans-serif;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--accent);
}

.prose td {
  color: #b8b8c2;
}

.callout {
  margin: 28px 0;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.callout p {
  margin: 0;
  color: #d4d4dc;
}

.site-footer {
  margin-top: 18px;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--surface-2);
}

.site-footer p {
  margin: 0;
  color: var(--ink-dim);
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(14px, 3vw, 24px);
}

.site-footer nav a {
  text-decoration: none;
  color: var(--ink-muted);
  border: 0;
  border-radius: 0;
  padding: 4px 0;
  background: transparent;
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.03em;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.site-footer nav a:hover {
  color: var(--ink);
  border-bottom-color: rgba(255, 255, 255, 0.3);
}

.site-footer nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 700;
}

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

/* —— Mobile —— */
@media (max-width: 1060px) {
  .nav-toggle-label {
    display: inline-flex;
  }

  .site-nav {
    position: fixed;
    left: 16px;
    right: 16px;
    top: calc(var(--header-h) + 10px);
    max-width: none;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    padding: 14px;
    background: rgba(14, 14, 18, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow-elev);
    flex-direction: column;
    align-items: stretch;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition:
      opacity 0.25s var(--ease-out),
      transform 0.25s var(--ease-out),
      visibility 0.25s;
    z-index: 150;
  }

  .site-nav a {
    text-align: left;
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .site-nav a:last-child {
    border-bottom: 0;
  }

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

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

  .nav-toggle-input:checked ~ .site-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .hero-meta {
    grid-template-columns: 1fr;
  }

  .content-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "aside"
      "main";
  }

  .content-aside {
    position: static;
    order: 1;
  }

  .content-main {
    order: 2;
  }
}

@media (max-width: 760px) {
  .layout {
    padding: 22px 14px 72px;
  }

  .page-hero,
  .prose,
  .content-aside,
  .site-footer,
  .meta-card {
    border-radius: var(--radius-md);
  }

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

  .header-inner {
    padding: 0 14px;
  }
}

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