/* ==========================================================================
   io.world — the whole site's styles, in one file. No build step.
   Edit this file directly. Class names describe what a thing IS (see docs/STYLE.md).

   Sections:
     1. Tokens (colors, fonts, sizes)
     2. Base elements
     3. Layout (containers, page wrappers)
     4. Site header & footer
     5. Shared components (eyebrow, buttons, prose, pull-quote, cards, tags, lists)
     6. Home page
     7. Pillars page
     8. About page
     9. Resume page
    10. Essays
    11. 404
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --bg: oklch(16% .018 285);
  --surface: oklch(19% .019 285);
  --card: oklch(20% .02 285);
  --secondary: oklch(26% .022 285);
  --fg: oklch(97% .004 285);
  --fg-85: color-mix(in oklab, var(--fg) 85%, transparent);
  --fg-80: color-mix(in oklab, var(--fg) 80%, transparent);
  --muted: oklch(72% .014 285);
  --muted-90: color-mix(in oklab, var(--muted) 90%, transparent);
  --muted-80: color-mix(in oklab, var(--muted) 80%, transparent);
  --muted-70: color-mix(in oklab, var(--muted) 70%, transparent);
  --primary: oklch(62% .22 292);         /* violet: primary buttons */
  --primary-fg: oklch(99% 0 0);
  --accent: oklch(78% .13 195);          /* teal: links, labels, .WORLD */
  --border: oklch(100% 0 0 / .12);

  --font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: .75rem;
  --shadow-lift: 0 24px 60px -30px oklch(0% 0 0 / .8);
  --gradient-rule: linear-gradient(90deg, var(--accent), var(--primary));

  --header-h: 4rem;
  --gutter: 1.5rem;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid var(--border); }
html { -webkit-text-size-adjust: 100%; line-height: 1.5; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* 3. Layout ---------------------------------------------------------------- */
.container { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter); }
.container--mid { max-width: 56rem; }
.container--narrow { max-width: 48rem; }

.page { min-height: 100vh; background: var(--bg); }
.page--offset { padding-top: 6rem; }           /* pages whose content starts under the fixed header */
.page-main { padding-block: 3rem; }
.page-main--resume { padding-top: 8rem; padding-bottom: 6rem; }

.block { margin-top: 3rem; }
.block-lg { margin-top: 4rem; }

/* 4. Site header & footer -------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.site-header__inner { display: flex; height: var(--header-h); align-items: center; justify-content: space-between; }

.logo { font-family: var(--font-display); font-size: .875rem; line-height: 1.25rem; font-weight: 700; letter-spacing: .14em; color: var(--fg); }
.accent { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 1.75rem; font-size: .875rem; line-height: 1.25rem; color: var(--muted); }
.site-nav a, .link-muted, .contact-row a { transition: color .15s; }
.site-nav a:hover, .link-muted:hover, .contact-row a:hover { color: var(--fg); }
.link-muted { font-size: .875rem; line-height: 1.25rem; color: var(--muted); }
/* "The Brain" pill at the right end of the nav: links to /the_brain (wiki views menu) */
.nav-brain {
  border: 1px solid color-mix(in oklab, var(--accent) 55%, transparent); border-radius: 999px; padding: .3rem .8rem;
  font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
}
.site-nav a.nav-brain:hover, .nav-brain[aria-current="page"] { background: color-mix(in oklab, var(--accent) 14%, transparent); color: var(--accent); }
.nav-brain__the { display: none; }
@media (min-width: 40rem) { .nav-brain__the { display: inline; } }
@media (max-width: 39.99rem) {
  .site-header__inner { gap: .75rem; }
  .site-nav { gap: .6rem; font-size: .78rem; }
  .nav-brain { padding: .2rem .5rem; font-size: .6875rem; letter-spacing: .04em; white-space: nowrap; }
}

.site-footer { border-top: 1px solid var(--border); background: var(--bg); }
.site-footer__inner { padding-block: 3.5rem; }
.site-footer__top { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 2rem; }
.site-footer__brand { max-width: 20rem; text-align: center; }
.site-footer__tagline { margin-top: .5rem; font-size: .875rem; line-height: 1.625; color: var(--muted); }
.site-footer__connect { text-align: center; }
.site-footer__connect .eyebrow { margin-bottom: .75rem; }
.site-footer__links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem 1.25rem; }
.site-footer__bottom { margin-top: 3rem; border-top: 1px solid var(--border); padding-top: 1.5rem; text-align: center; font-size: .75rem; line-height: 1rem; color: var(--muted-70); }
@media (min-width: 40rem) {
  .site-footer__top { flex-direction: row; align-items: flex-start; }
  .site-footer__brand, .site-footer__bottom { text-align: left; }
  .site-footer__connect { text-align: right; }
  .site-footer__links { justify-content: flex-end; }
}

/* 5. Shared components ----------------------------------------------------- */
.eyebrow { font-family: var(--font-mono); font-size: .75rem; line-height: 1rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

.rule { height: 1px; width: 9rem; margin-bottom: 1.5rem; background-image: var(--gradient-rule); }

.page-title { margin-top: 1rem; font-size: 2.25rem; line-height: 1.25; font-weight: 700; }
.page-title--flush { margin-top: 0; }
@media (min-width: 40rem) { .page-title { font-size: 3rem; } }
.page-subtitle { margin-top: .75rem; font-size: 1.25rem; line-height: 1.75rem; font-weight: 500; color: var(--fg-85); }
.subtitle-mono { margin-top: .25rem; font-family: var(--font-mono); font-size: .75rem; line-height: 1rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }

.button-row { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.button-row--end { justify-content: flex-end; }
.button {
  display: inline-block; border: 1px solid var(--border); border-radius: var(--radius);
  padding: .625rem 1.25rem; font-size: .875rem; line-height: 1.25rem; font-weight: 600; color: var(--fg);
  transition: background-color .15s, opacity .15s;
}
.button:hover { background: var(--secondary); }
.button--primary { border-color: transparent; background: var(--primary); color: var(--primary-fg); }
.button--primary:hover { background: var(--primary); opacity: .9; }

/* Running text. .prose = essay body (bright); .prose--muted = softer gray, tighter spacing. */
.prose { font-size: 1rem; line-height: 1.625; color: var(--fg-85); }
.prose > * + * { margin-top: 1.5rem; }
.prose--muted { color: var(--muted); }
.prose--muted > * + * { margin-top: 1rem; }

.body-muted { margin-top: 1rem; font-size: 1rem; line-height: 1.625; color: var(--muted); }
.small-muted { margin-top: .25rem; font-size: .875rem; line-height: 1.25rem; color: var(--muted); }

.pull-quote {
  margin-top: 1.5rem; border-left: 2px solid var(--accent); padding-left: 1.5rem;
  font-family: var(--font-display); font-size: 1.5rem; line-height: 1.375; font-weight: 600;
}
@media (min-width: 40rem) { .pull-quote { font-size: 1.875rem; } }

.back-link-row { margin-top: 5rem; border-top: 1px solid var(--border); padding-top: 2.5rem; }
.back-link, .card__link { font-family: var(--font-mono); font-size: .75rem; line-height: 1rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); transition: opacity .15s; }
.back-link:hover, .card__link:hover { opacity: .8; }

.card-grid { margin-top: 3rem; display: grid; gap: 1.5rem; }
@media (min-width: 48rem) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--card); padding: 1.5rem; box-shadow: var(--shadow-lift); }
.card__title { margin-top: 1rem; font-size: 1.25rem; line-height: 1.375; font-weight: 600; }
.card__text { margin-top: .75rem; flex: 1; font-size: .875rem; line-height: 1.625; color: var(--muted); }
.card__link { margin-top: 1.5rem; }
.card__link--soon, .card__link--soon:hover { color: var(--muted); opacity: 1; }

.tag-list { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.tag { border: 1px solid var(--border); border-radius: 9999px; padding: .25rem .75rem; font-size: .75rem; line-height: 1rem; color: var(--muted); }

.bullets { margin-top: 1rem; list-style: disc; padding-left: 1.25rem; font-size: .875rem; line-height: 1.625; color: var(--muted); }
.bullets > li + li { margin-top: .5rem; }
.bullets--compact { margin-top: .75rem; padding-left: 1rem; color: var(--muted-90); }
.bullets--compact > li + li { margin-top: .375rem; }
.plain-list { margin-top: .5rem; font-size: .875rem; line-height: 1.25rem; color: var(--muted); }
.plain-list > li + li { margin-top: .25rem; }

.minor-heading { font-size: 1rem; line-height: 1.5rem; font-weight: 600; }

/* 6. Home ------------------------------------------------------------------ */
.hero { position: relative; display: flex; min-height: 92vh; align-items: flex-end; overflow: hidden; }
.hero__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__veil { position: absolute; inset: 0; background-image: linear-gradient(180deg, color-mix(in oklab, var(--bg) 35%, transparent) 0%, color-mix(in oklab, var(--bg) 70%, transparent) 55%, var(--bg) 100%); }
.hero__inner { position: relative; padding-top: 8rem; padding-bottom: 6rem; }
.hero__content { margin-left: auto; max-width: 36rem; text-align: right; }
.hero__content .rule { margin-left: auto; }
.hero__title { margin-top: 1rem; font-size: 3.75rem; line-height: .95; font-weight: 700; }
.hero__tagline { margin-top: 1.25rem; font-size: 1.25rem; line-height: 1.75rem; font-weight: 500; color: var(--fg-85); }
@media (min-width: 40rem) {
  .hero__title { font-size: 4.5rem; }
  .hero__tagline { font-size: 1.5rem; line-height: 2rem; }
}

.band { border-block: 1px solid var(--border); background: var(--surface); }
.band__inner { padding-block: 4rem; }
.pillar-grid { margin-top: 2rem; display: grid; gap: 2rem 2.5rem; }
@media (min-width: 40rem) { .pillar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .pillar-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.pillar { border-top: 1px solid var(--border); padding-top: 1rem; }
.pillar__title { font-size: 1rem; line-height: 1.5rem; font-weight: 600; }

.section-pad { padding-block: 6rem; }
.section-pad-bottom { padding-bottom: 6rem; }
.section-title { margin-top: .75rem; max-width: 42rem; font-size: 2.25rem; line-height: 1.25; font-weight: 700; }
@media (min-width: 40rem) { .section-title { font-size: 3rem; } }

/* 7. Pillars page ---------------------------------------------------------- */
.intro { margin-top: 2.5rem; }
.pillar-list { margin-top: 4rem; }
.pillar-list > * + * { margin-top: 4rem; }
.pillar-section { border-top: 1px solid var(--border); padding-top: 2rem; }
.pillar-section .prose { margin-top: 1.25rem; }
.numbered-heading { display: flex; align-items: baseline; gap: 1rem; }
.numbered-heading__num { font-family: var(--font-mono); font-size: .75rem; line-height: 1rem; color: var(--accent); }
.pillar-section__title { font-size: 1.5rem; line-height: 1.375; font-weight: 600; }
@media (min-width: 40rem) { .pillar-section__title { font-size: 1.875rem; } }
.pillar-section__kicker { margin-top: .5rem; font-size: .875rem; line-height: 1.25rem; font-weight: 600; color: var(--fg-80); }
.closing { margin-top: 5rem; border-top: 1px solid var(--border); padding-top: 2.5rem; }
.closing__text { margin-top: 1.5rem; font-size: 1rem; line-height: 1.625; color: var(--muted); }

/* 8. About page ------------------------------------------------------------ */
.about-header { margin-bottom: 2.5rem; }
.about-header__row { margin-top: 1.25rem; display: flex; flex-direction: column; align-items: flex-start; gap: 1.5rem; }
@media (min-width: 40rem) { .about-header__row { flex-direction: row; align-items: center; } }
.avatar { width: 6rem; aspect-ratio: 1; border: 1px solid var(--border); border-radius: 9999px; object-fit: cover; box-shadow: var(--shadow-lift); }

.role-list { margin-top: 1rem; }
.role-list > * + * { margin-top: 2rem; }
.role { border-top: 1px solid var(--border); padding-top: 1rem; }
.role__header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; }
.role__title { font-family: var(--font-display); font-size: .875rem; line-height: 1.25rem; font-weight: 600; color: var(--fg); }
.role__dates { font-family: var(--font-mono); font-size: .75rem; line-height: 1rem; color: var(--muted-80); }
.role__company { font-size: .875rem; line-height: 1.25rem; color: var(--muted); }

/* 9. Resume page ----------------------------------------------------------- */
.contact-row { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-family: var(--font-mono); font-size: .75rem; line-height: 1rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.resume-section { margin-top: 3.5rem; border-top: 1px solid var(--border); padding-top: 2rem; }
.resume-section > .body-muted, .resume-section > .small-muted { margin-top: 1rem; }
.job-list { margin-top: 2rem; }
.job-list > * + * { margin-top: 3rem; }
.job__title { font-size: 1.25rem; line-height: 1.375; font-weight: 600; }
.job__company { margin-top: .25rem; font-size: .875rem; line-height: 1.25rem; color: var(--fg-85); }
.job__dates { margin-top: .25rem; font-family: var(--font-mono); font-size: .75rem; line-height: 1rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.job__dates--muted { color: var(--muted); }
.skill-grid { margin-top: 2rem; display: grid; gap: 2rem; }
@media (min-width: 40rem) { .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.edu-list { margin-top: 2rem; }
.edu-list > * + * { margin-top: 1.5rem; }

/* 10. Essays --------------------------------------------------------------- */
.essay { padding-block: 5rem; }
.essay__title { margin-top: .75rem; font-size: 3rem; line-height: 1.02; font-weight: 700; }
.essay__dek { margin-top: 1rem; font-size: 1.125rem; line-height: 1.75rem; color: var(--muted); }
.essay__intro { margin-top: 3rem; }
.essay__section { margin-top: 3.5rem; }
.essay__section .prose { margin-top: 1.25rem; }
.essay__heading { font-size: 1.5rem; line-height: 2rem; font-weight: 600; }
.essay__closing { margin-top: 4rem; border-top: 1px solid var(--border); padding-top: 2rem; font-size: 1rem; line-height: 1.625; font-style: italic; color: var(--muted); }

/* 11. 404 ------------------------------------------------------------------ */
.not-found { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding-inline: 1rem; text-align: center; }
.not-found__code { font-size: 4.5rem; line-height: 1; font-weight: 700; }
.not-found__title { margin-top: 1rem; font-size: 1.25rem; line-height: 1.75rem; font-weight: 600; }
.not-found .small-muted { margin-top: .5rem; }
.not-found .button-row { justify-content: center; margin-top: 1.5rem; }
.block > .small-muted { margin-top: .75rem; }

/* 12. The Brain (/the_brain): menu of LLM Wiki views ------------------------ */
/* body.theme-light: light palette for The Brain, matching the wiki views' own colours */
.theme-light {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --card: #ffffff;
  --secondary: #f3f1ec;
  --fg: #1d1d1f;
  --muted: #5f5e5a;
  --accent: #2f5fb3;
  --border: #e2dfd8;
  --fg-85: color-mix(in oklab, var(--fg) 85%, transparent);
  --fg-80: color-mix(in oklab, var(--fg) 80%, transparent);
  --muted-90: color-mix(in oklab, var(--muted) 90%, transparent);
  --muted-80: color-mix(in oklab, var(--muted) 80%, transparent);
  --muted-70: color-mix(in oklab, var(--muted) 70%, transparent);
  --shadow-lift: 0 18px 40px -28px rgb(0 0 0 / .25);
  color-scheme: light;
}
html:has(.theme-light) { background: #fbfaf7; }
.brain-group { margin-top: 3.5rem; }
.brain-group__title { display: flex; align-items: baseline; gap: .75rem; font-size: 1.5rem; font-weight: 600; }
.brain-group__count { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .14em; color: var(--muted); }
.brain-group .card-grid { margin-top: 1.5rem; }
.brain-group .card { transition: border-color .15s; }
.brain-group .card:hover { border-color: color-mix(in oklab, var(--accent) 45%, transparent); }
.brain-stamp { margin-top: .75rem; font-family: var(--font-mono); font-size: .6875rem; color: var(--muted-70); }
