@import url("/fonts.css");

:root {
  color-scheme: dark;
  --bg-void: #020618;
  --bg-base: #0b0614;
  --bg-base-alt: #110d1b;
  --bg-surface: #29243d;
  --surface-800: #1d293d;
  --text: #f8fafc;
  --muted: #90a1b9;
  --subtle: #7f8fa7;
  --violet: #755ad9;
  --violet-deep: #4726bb;
  --violet-light: #a390e8;
  --pink: #e770ff;
  --cyan: #14a8f5;
  --orange: #f5a93c;
  --line: rgb(255 255 255 / 0.12);
  --display: Jost, Poppins, "Century Gothic", "Segoe UI", sans-serif;
  --body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

}
/* ---------------------------------------------------------------------------
   Light palette (MAI-1652).

   Values are taken from site.css's own light theme so the blog reads as the
   same site rather than a second design: its --surface/--raised/--soft/--sunken
   become the blog's background ramp, and --fg/--dim/--faint its text ramp.

   The violet/pink/cyan accents are deliberately unchanged -- they are the brand
   spectrum and carry across both themes -- except where an accent was chosen
   for legibility ON a dark field and would fail on a light one. Those are
   listed individually below rather than swapped wholesale.
   --------------------------------------------------------------------------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg-void: #ece6f8;
  --bg-base: #f6f4fc;
  --bg-base-alt: #f1ebfb;
  --bg-surface: #ffffff;
  --surface-800: #ffffff;
  --text: #0b0614;
  --muted: #574f6b;
  --subtle: #6b6280;
  --violet-light: #6d28d9;
  --line: rgb(11 6 20 / 0.12);
}


* { box-sizing: border-box; }

html {
  background: var(--bg-base);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 10%, rgb(113 77 255 / 0.13), transparent 30rem),
    radial-gradient(circle at 8% 34%, rgb(20 168 245 / 0.055), transparent 26rem),
    linear-gradient(180deg, var(--bg-base-alt) 0%, var(--bg-base) 42%, var(--bg-void) 100%);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid #a78bfa;
  outline-offset: 4px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--text);
  background: var(--surface-800);
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgb(11 6 20 / 0.78);
  backdrop-filter: blur(24px);
}

.nav-shell {
  width: min(1240px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.brand-link img {
  display: block;
  width: 132px;
  height: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 32px);
  font-size: 14px;
  color: var(--muted);
}

.site-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--text); }

.mobile-nav { display: none; position: relative; }
.mobile-nav summary {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font: 600 13px/1 var(--body);
  cursor: pointer;
  list-style: none;
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav > div {
  position: absolute;
  top: 52px;
  right: 0;
  width: min(270px, calc(100vw - 32px));
  padding: 8px;
  display: grid;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #1d293d;
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.5);
}
.mobile-nav a {
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.mobile-nav a:hover,
.mobile-nav a[aria-current="page"] { color: var(--text); background: rgb(255 255 255 / 0.06); }

.nav-cta {
  padding: 0 18px;
  border: 1px solid rgb(163 144 232 / 0.42);
  border-radius: 999px;
  background: linear-gradient(180deg, rgb(117 90 217 / 0.28), rgb(71 38 187 / 0.18));
}

.signal-rule {
  height: 1px;
  background: linear-gradient(99deg, transparent, #714dff 22%, #9c83ff 48%, #e770ff 76%, transparent);
  box-shadow: 0 0 20px rgb(156 131 255 / 0.58);
}

.container {
  width: min(1240px, calc(100% - 40px));
  margin-inline: auto;
}

.index-hero {
  min-height: 68vh;
  padding: clamp(72px, 11vw, 150px) 0 90px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: end;
  gap: clamp(44px, 7vw, 110px);
}

.eyebrow,
.kicker {
  margin: 0 0 18px;
  color: var(--violet-light);
  font: 700 11px/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.index-hero h1,
.article-hero h1 {
  margin: 0;
  max-width: 980px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.index-hero h1 {
  font-size: clamp(3.4rem, 8.6vw, 7.7rem);
  line-height: 0.94;
}

.gradient-word {
  color: transparent;
  background: linear-gradient(266deg, #7959ef 10%, #a390e8 56%, #e770ff 94%);
  background-clip: text;
  -webkit-background-clip: text;
}

.hero-dek {
  max-width: 760px;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 1.55vw, 1.35rem);
  line-height: 1.55;
}

.brain-orbit {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 1;
  margin-left: auto;
  display: grid;
  place-items: center;
}

.brain-orbit::before,
.brain-orbit::after {
  position: absolute;
  inset: 11%;
  border: 1px solid rgb(163 144 232 / 0.3);
  border-radius: 50%;
  content: "";
  box-shadow: inset 0 0 56px rgb(113 77 255 / 0.08), 0 0 50px rgb(20 168 245 / 0.08);
}

.brain-orbit::after {
  inset: 2%;
  border-color: rgb(255 255 255 / 0.08);
  border-style: dashed;
  animation: orbit 32s linear infinite;
}

.brain-orbit img {
  width: 42%;
  height: 42%;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 0 30px rgb(113 77 255 / 0.35));
}

.orbit-note {
  position: absolute;
  max-width: 125px;
  color: var(--muted);
  font: 600 10px/1.55 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.orbit-note.one { top: 2%; right: 3%; }
.orbit-note.two { bottom: 9%; left: 0; }

.featured-section { padding: 0 0 120px; }

.section-header {
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 600 11px/1.4 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.featured-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.45fr);
  gap: clamp(36px, 6vw, 90px);
  padding: clamp(32px, 5vw, 72px);
  border-radius: 24px;
  color: var(--text);
  background:
    linear-gradient(130deg, rgb(41 36 61 / 0.94), rgb(15 23 43 / 0.9)),
    var(--bg-surface);
  text-decoration: none;
  box-shadow: 0 30px 90px rgb(2 6 24 / 0.34);
}

.featured-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, #714dff, #9c83ff 45%, #e770ff 82%, transparent);
  content: "";
  box-shadow: 0 0 22px rgb(156 131 255 / 0.75);
}

.featured-card:hover { transform: translateY(-3px); }

.featured-card h2 {
  margin: 0;
  max-width: 820px;
  font: 700 clamp(2.25rem, 5vw, 5rem)/1.02 var(--display);
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.featured-card p {
  max-width: 690px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.card-side {
  align-self: end;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.card-side dl { margin: 0; }
.card-side div { margin-top: 22px; }
.card-side div:first-child { margin-top: 0; }
.card-side dt {
  color: var(--subtle);
  font: 600 10px/1.3 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.card-side dd { margin: 5px 0 0; font-size: 14px; }

.arrow-link {
  margin-top: 30px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.arrow-link span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgb(163 144 232 / 0.4);
  border-radius: 50%;
}

.article-hero {
  padding: clamp(70px, 10vw, 136px) 0 64px;
}

.breadcrumbs {
  margin-bottom: 46px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumbs ol {
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.breadcrumbs li:not(:last-child)::after {
  margin-left: 8px;
  color: var(--subtle);
  content: "/";
}

.breadcrumbs a { text-underline-offset: 4px; }

.article-hero h1 {
  max-width: 1080px;
  font-size: clamp(2.8rem, 7vw, 6.2rem);
  line-height: 0.99;
}

.article-meta {
  margin-top: 44px;
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 500 12px/1.5 var(--mono);
  letter-spacing: 0.04em;
}

.article-layout {
  padding: 24px 0 120px;
  display: grid;
  grid-template-columns: minmax(180px, 0.38fr) minmax(0, 0.92fr) minmax(120px, 0.22fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.contents {
  position: sticky;
  top: 28px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.contents h2 {
  margin: 0 0 16px;
  color: var(--subtle);
  font: 700 10px/1.4 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.contents ol { margin: 0; padding: 0; list-style: none; }
.contents li + li { margin-top: 10px; }
.contents a {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-decoration: none;
}
.contents a:hover { color: var(--text); }

.article-body {
  min-width: 0;
  max-width: 70ch;
  font-size: 18px;
  line-height: 1.72;
}

.article-body .lede {
  margin-top: 0;
  color: var(--text);
  font: 500 clamp(1.25rem, 2vw, 1.55rem)/1.55 var(--display);
  letter-spacing: -0.01em;
}

.article-body p { margin: 0 0 1.45em; }

.article-body h2 {
  margin: 3.2em 0 0.75em;
  font: 700 clamp(1.85rem, 3.6vw, 2.65rem)/1.13 var(--display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.article-body h3 {
  margin: 2.25em 0 0.55em;
  font: 600 clamp(1.28rem, 2.2vw, 1.62rem)/1.25 var(--display);
  letter-spacing: -0.018em;
}

.article-body ol,
.article-body ul { margin: 0 0 1.65em; padding-left: 1.3em; }
.article-body li { margin-bottom: 0.62em; padding-left: 0.3em; }
.article-body a { text-decoration-thickness: 1px; text-underline-offset: 4px; }
.article-body a:hover { color: #d8ccff; }

.pull-quote {
  margin: 3em 0;
  padding: 0 0 0 28px;
  border-left: 1px solid rgb(231 112 255 / 0.55);
  color: var(--text);
  font: 500 clamp(1.45rem, 3vw, 2.25rem)/1.35 var(--display);
  letter-spacing: -0.025em;
}

.article-body .sources {
  margin-top: 4em;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.cta-panel {
  margin-top: 4em;
  padding: clamp(30px, 5vw, 54px);
  border-radius: 24px;
  background:
    linear-gradient(130deg, rgb(117 90 217 / 0.24), rgb(71 38 187 / 0.08)),
    var(--bg-surface);
  box-shadow: 0 28px 80px rgb(2 6 24 / 0.3);
}
.cta-panel h2 { margin-top: 0; }
.cta-panel a {
  min-height: 48px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #755ad9, #4726bb);
  color: white;
  font-weight: 700;
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-void);
}
.footer-shell {
  width: min(1240px, calc(100% - 40px));
  min-height: 150px;
  margin: 0 auto;
  padding: 42px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  color: var(--muted);
  font-size: 13px;
}
.footer-shell img { width: 112px; height: auto; }
.footer-shell p { max-width: 520px; margin: 0; }

@keyframes orbit { to { transform: rotate(360deg); } 
}

@media (max-width: 960px) {
  .site-nav .wide-nav { display: none; }
  .index-hero { grid-template-columns: 1fr; min-height: auto; }
  .brain-orbit { width: 280px; margin: 0; }
  .featured-card { grid-template-columns: 1fr; }
  .card-side { max-width: 520px; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-body { margin-inline: auto; }
  .contents { position: static; max-width: 70ch; margin-inline: auto; }
  .contents ol { columns: 2; column-gap: 28px; }

}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .nav-shell { width: min(100% - 32px, 1240px); min-height: 68px; }
  .brand-link img { width: 112px; }
  .site-nav { display: none; }
  .mobile-nav { display: block; }
  .container { width: min(100% - 40px, 1240px); }
  .index-hero { padding-top: 68px; }
  .index-hero h1 {
    font-size: clamp(3rem, 14vw, 4rem);
    text-wrap: wrap;
  }
  .brain-orbit { width: 230px; }
  .featured-section { padding-bottom: 80px; }
  .featured-card { padding: 30px 25px 34px; }
  .featured-card h2 { font-size: clamp(2rem, 11vw, 3.1rem); }
  .article-hero { padding-top: 64px; }
  .article-hero h1 {
    font-size: clamp(2.7rem, 11.5vw, 3.4rem);
    letter-spacing: -0.035em;
    text-wrap: wrap;
  }
  .article-meta { font-size: 11px; }
  .article-layout { padding-bottom: 84px; }
  .article-body { font-size: 17px; line-height: 1.72; }
  .contents { width: 100%; }
  .contents ol { columns: 1; }
  .footer-shell { align-items: flex-start; flex-direction: column; }

}

@media (max-width: 360px) {
  .container { width: calc(100% - 40px); }
  .nav-shell { width: calc(100% - 28px); }
  .brand-link img { width: 102px; }

}

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

}

.signature {
  margin-top: 3em;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font: 500 1.05rem/1.7 var(--display);
  letter-spacing: -0.01em;
}

/* ---------------------------------------------------------------------------
   Light-theme corrections for rules that hardcode a dark value (MAI-1652).

   Each of these was written against the dark field and cannot follow the token
   swap above: a scrim, a card gradient, a shadow tuned for near-black, or a
   white overlay used as a highlight. Listed individually so it stays obvious
   what was chosen deliberately rather than inherited.
   --------------------------------------------------------------------------- */

/* Page glows: same hues, dialled back so they read on a light ground. */
:root[data-theme="light"] body {
  background:
    radial-gradient(circle at 82% 10%, rgb(113 77 255 / 0.07), transparent 30rem),
    radial-gradient(circle at 8% 34%, rgb(20 168 245 / 0.05), transparent 26rem),
    var(--bg-base);
}

/* The old .site-header and .mobile-nav rules that would have needed light
   variants are gone: MAI-1652 replaced the blog's own header with the shared
   nav.top, and site.css already carries that component's light treatment. */

/* White-on-dark overlays used as hairlines. */
:root[data-theme="light"] .brain-orbit img { border-color: rgb(11 6 20 / 0.08); }

/* Cards were a dark gradient with a heavy near-black shadow. */
:root[data-theme="light"] .featured-card {
  background: linear-gradient(130deg, #ffffff, #faf8ff);
  box-shadow: 0 30px 90px rgb(80 60 140 / 0.12);
}
:root[data-theme="light"] .cta-panel {
  background: linear-gradient(130deg, rgb(117 90 217 / 0.10), rgb(71 38 187 / 0.05)), #ffffff;
  box-shadow: 0 28px 80px rgb(80 60 140 / 0.12);
}

/* Link hover was a pale violet chosen to glow on black. */
:root[data-theme="light"] .article-body a:hover { color: #5b21b6; }
