:root {
  color-scheme: light dark;
  --paper: #e7e9e5;
  --paper-raised: #eff0ed;
  --ink: #1d2525;
  --muted: #53605e;
  --line: #b4bcb7;
  --line-strong: #75817c;
  --accent: #b54027;
  --hero-surface: #747b79;
  --hero-wordmark: #f0f1ee;
  --hero-nav: #1d2525;
  --content: 1280px;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --hero-gutter: clamp(1.25rem, 3.2vw, 3rem);
  --font-sans: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b2020;
    --paper-raised: #222928;
    --ink: #e7eae6;
    --muted: #b6bfbb;
    --line: #48524e;
    --line-strong: #75817c;
    --accent: #ef7e5e;
    --hero-surface: #747b79;
    --hero-wordmark: #f0f1ee;
    --hero-nav: #1d2525;
  }
}

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

html { background: var(--paper); color: var(--ink); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.35vw + 0.93rem, 1.12rem);
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.22em; }
a:hover { color: var(--accent); }
button { color: inherit; font: inherit; }
h1, h2, h3, p, figure { margin-top: 0; }
h1, h2, h3 { color: var(--ink); }
p { max-width: 68ch; color: var(--muted); }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.container { width: min(100% - (2 * var(--gutter)), var(--content)); margin-inline: auto; }

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9rem;
  font-weight: 700;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site-header { position: relative; z-index: 20; border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header--home { position: absolute; inset: 0 0 auto; border-bottom: 0; background: transparent; color: var(--hero-nav); }
.site-header__inner {
  width: calc(100% - (2 * var(--hero-gutter)));
  max-width: none;
  display: flex;
  min-height: 4.6rem;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding-top: clamp(1rem, 2.4vw, 1.8rem);
  padding-bottom: clamp(0.5rem, 1vw, 0.9rem);
}
.site-brand { color: inherit; font-size: 1rem; font-weight: 650; letter-spacing: -0.025em; text-decoration: none; white-space: nowrap; }
.site-brand:hover { color: var(--accent); }
.site-header--home .site-brand,
.site-header--home .site-nav a {
  color: #f0f1ee;
  mix-blend-mode: difference;
}
.site-header--home .site-brand:hover,
.site-header--home .site-nav a:hover { color: #f0f1ee; text-decoration: underline; text-underline-offset: 0.25em; }
.site-nav { margin-left: auto; }
.site-nav__groups { display: grid; grid-template-columns: max-content max-content; gap: clamp(1.5rem, 5vw, 4.5rem); align-items: center; }
.site-nav__list { display: grid; margin: 0; padding: 0; gap: 0.16rem; list-style: none; }
.site-nav__list[aria-label="Pages"] { align-self: start; }
.site-nav a {
  display: block;
  padding: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.7rem 0.55rem;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 100%; height: 1px; background: currentColor; transition: transform 160ms ease; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3px) rotate(-45deg); }

.hero-cover {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
  background: var(--hero-surface);
  isolation: isolate;
}
.hero-cover::before {
  position: absolute;
  z-index: -3;
  inset: 0;
  background: url("/static/media/technical-paper.webp") center / cover no-repeat;
  content: "";
  mix-blend-mode: multiply;
  opacity: 0.50;
}
.hero-cover__collage {
  position: absolute;
  z-index: -2;
  inset: 0;
  background: url("/static/media/hacker-paper-collage-blend.svg?v=vertical-flip-2") center / cover no-repeat;
  opacity: 0.78;
  transform: scaleY(-1);
  -webkit-mask-image: linear-gradient(90deg, transparent 16%, #000 68%);
  -webkit-mask-repeat: no-repeat;
  mask-image: linear-gradient(90deg, transparent 16%, #000 68%);
  mask-repeat: no-repeat;
}
.hero-cover::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("/static/media/hacker-paper-ascii.svg?v=blue-lift-1") center / cover no-repeat;
  -webkit-mask-image:
    linear-gradient(90deg, #000 0%, #000 23%, transparent 74%),
    radial-gradient(ellipse 34% 32% at 0% 0%, transparent 0%, transparent 58%, #000 100%),
    radial-gradient(ellipse 34% 32% at 0% 100%, transparent 0%, transparent 58%, #000 100%);
  -webkit-mask-composite: source-in, source-in;
  -webkit-mask-repeat: no-repeat;
  mask-image:
    linear-gradient(90deg, #000 0%, #000 23%, transparent 74%),
    radial-gradient(ellipse 34% 32% at 0% 0%, transparent 0%, transparent 58%, #000 100%),
    radial-gradient(ellipse 34% 32% at 0% 100%, transparent 0%, transparent 58%, #000 100%);
  mask-composite: intersect, intersect;
  mask-repeat: no-repeat;
  content: "";
}
.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;
}
.hero-marquee {
  position: absolute;
  z-index: 0;
  top: 47%;
  left: 0;
  width: 100%;
  overflow: hidden;
  margin: 0;
  color: var(--hero-wordmark);
  font-size: clamp(7.5rem, 17.25vw, 17.25rem);
  font-weight: 680;
  letter-spacing: -0.11em;
  line-height: 0.82;
  transform: translateY(-50%);
}
.hero-marquee__track { display: flex; width: max-content; animation: hero-marquee-scroll 100s linear infinite; }
.hero-marquee__track span { display: block; flex: 0 0 auto; padding-right: 0.8em; white-space: nowrap; }
@keyframes hero-marquee-scroll { to { transform: translateX(-50%); } }
.hero-cover__footer {
  position: absolute;
  z-index: auto;
  right: var(--hero-gutter);
  bottom: clamp(1.5rem, 5vh, 3.5rem);
  left: var(--hero-gutter);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  color: #f0f1ee;
  font-size: clamp(0.9rem, 1vw, 1.1rem);
  line-height: 1.5;
}
.hero-cover__footer::before { position: absolute; z-index: 0; top: 0; right: 0; left: 0; border-top: 1px solid rgb(240 241 238 / 78%); content: ""; }
.hero-cover__caption, .hero-private-trigger { position: relative; z-index: 2; padding-top: 1.1rem; }
.hero-cover__caption { display: grid; margin: 0; color: inherit; }
.hero-private-trigger {
  display: grid;
  padding: 1.1rem 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: right;
  cursor: pointer;
}
.hero-private-trigger:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.work-dialog {
  width: min(36rem, calc(100% - 2rem));
  max-width: none;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid rgb(240 241 238 / 42%);
  background: var(--hero-surface);
  color: var(--hero-wordmark);
  box-shadow: 0 1.5rem 4.5rem rgb(10 14 14 / 32%);
}
.work-dialog::backdrop { background: rgb(10 14 14 / 72%); backdrop-filter: blur(3px); }
.work-dialog form { display: flex; justify-content: flex-end; }
.work-dialog__close { padding: 0.25rem 0; border: 0; background: transparent; color: #f8f9f7; font: inherit; cursor: pointer; }
.work-dialog__eyebrow, .page-heading__index { color: var(--accent); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.06em; }
.work-dialog__eyebrow { color: rgb(240 241 238 / 72%); letter-spacing: 0.11em; }
.work-dialog h2 { margin: 1.5rem 0 0.75rem; color: var(--hero-wordmark); font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -0.06em; line-height: 0.98; }
.work-dialog p { color: #f8f9f7; }
.work-dialog a { color: #f8f9f7; text-decoration-thickness: 1px; }
.work-dialog p:last-child { margin-bottom: 0; }
.empty-state { max-width: none; padding-top: 1.25rem; border-top: 1px solid var(--line-strong); color: var(--muted); }
.page-heading p.page-heading__index { margin-bottom: 1rem; font-size: 0.75rem; }
.hero-cover__portrait {
  position: absolute;
  z-index: 1;
  bottom: -1%;
  left: 50%;
  width: min(52.5vw, 750px);
  height: 98dvh;
  max-width: none;
  object-fit: cover;
  object-position: center top;
  transform: translateX(-50%);
}

.text-page { min-height: calc(100dvh - 8.5rem); padding-block: clamp(4.5rem, 10vw, 9rem) clamp(5rem, 11vw, 10rem); }
.text-page--soul { padding-top: clamp(3rem, 5vw, 5rem); }
.page-heading { max-width: 61rem; margin-bottom: clamp(3rem, 7vw, 6.5rem); }
.page-heading h1 { margin-bottom: 1rem; font-size: clamp(3.5rem, 9vw, 7.25rem); font-weight: 700; letter-spacing: -0.08em; line-height: 0.92; }
.page-heading p { margin-bottom: 0; font-size: clamp(1.08rem, 1.8vw, 1.35rem); }
.soul-document {
  max-width: 64rem;
  padding-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: clamp(0.86rem, 1vw, 0.98rem);
  line-height: 1.85;
}
.soul-document__frontmatter {
  margin: 0 0 2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  color: var(--muted);
  font: inherit;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.soul-document h1 { margin: 0 0 1.5rem; color: var(--ink); font: inherit; font-size: clamp(1.2rem, 2vw, 1.55rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.4; }
.soul-document h1 a { color: inherit; text-decoration-color: var(--line-strong); text-decoration-thickness: 1px; text-underline-offset: 0.14em; }
.soul-document h1 a:hover { color: var(--accent); }
.soul-document h2 { margin: 2.25rem 0 0.9rem; color: var(--ink); font: inherit; font-size: clamp(1rem, 1.3vw, 1.15rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.5; }
.soul-document__syntax { color: var(--accent); }
.soul-document p { max-width: 76ch; margin-bottom: 1.35rem; color: var(--ink); font: inherit; }
.soul-document code { padding: 0.08em 0.25em; background: var(--paper-raised); color: var(--ink); font: inherit; }
.soul-document__list { margin: 0 0 1.35rem; padding: 0 0 0 1rem; list-style: none; }
.soul-document__list li { color: var(--ink); }
.soul-document__quote { margin: 0 0 1.35rem; padding-left: 1rem; border-left: 1px solid var(--line-strong); color: var(--muted); }
.soul-document__quote p { margin-bottom: 0; color: inherit; }
.soul-document__thematic-break { margin: 2rem 0; color: var(--accent); }
.soul-document strong { color: var(--ink); font-weight: 750; }
.soul-document > p:last-child { margin-bottom: 0; }
.soul-document > p:last-child::after {
  display: inline-block;
  width: 0.12em;
  height: 1.85em;
  margin-left: 0.14em;
  background: currentColor;
  content: "";
  vertical-align: -0.42em;
  animation: soul-cursor-blink 1.05s steps(2, end) infinite;
}
@keyframes soul-cursor-blink { 50% { opacity: 0; } }

.discipline-list, .background-list { margin: 0; border-top: 1px solid var(--line-strong); }
.discipline-row, .background-list > div {
  display: grid;
  padding-block: 1.55rem;
  grid-template-columns: minmax(12rem, 0.7fr) minmax(0, 1.3fr);
  align-items: baseline;
  gap: clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
}
.discipline-row dt { font-size: clamp(1.45rem, 2.6vw, 2.2rem); font-weight: 660; letter-spacing: -0.045em; }
.discipline-row dd, .background-list dd { max-width: 58ch; margin: 0; color: var(--muted); }
.background-list dt { color: var(--accent); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; }

.process-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-strong); }
.process-list li {
  display: grid;
  padding-block: 1.4rem;
  grid-template-columns: 3.5rem minmax(11rem, 0.62fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.process-step { color: var(--accent); font-family: var(--font-mono); font-size: 0.75rem; }
.process-list h2 { margin: 0; font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 650; letter-spacing: -0.04em; }
.process-list p { margin: 0; }
.method-note, .leadership-note { max-width: 48rem; margin: 3rem 0 0; padding-left: 1rem; border-left: 2px solid var(--accent); font-size: 1.04rem; }

.vector-list { max-width: 58rem; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-strong); }
.vector-list li { padding: 1rem 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: clamp(1.15rem, 2vw, 1.55rem); }
.direction-callout { max-width: 51rem; margin-top: clamp(4rem, 8vw, 7rem); padding-top: 1.5rem; border-top: 1px solid var(--line-strong); }
.direction-callout h2 { margin-bottom: 0.8rem; font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -0.055em; }
.direction-callout p { font-size: clamp(1.05rem, 1.7vw, 1.25rem); }

.site-footer { border-top: 1px solid var(--line); }
.site-footer__inner { display: flex; min-height: 4rem; align-items: center; justify-content: space-between; gap: 1rem; color: var(--muted); font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

.not-found { display: grid; min-height: 100dvh; align-content: center; justify-items: start; }
.not-found__code { color: var(--accent); font-family: var(--font-mono); font-size: 0.75rem; }
.not-found h1 { max-width: 12ch; font-size: clamp(3rem, 8vw, 6rem); letter-spacing: -0.07em; line-height: 0.96; }

@media (max-width: 950px) {
  .site-header__inner { gap: 1rem; }
  .site-nav a { font-size: 0.79rem; }
}

@media (max-width: 800px) {
  :root { --gutter: 1.25rem; }
  .site-header--home { background: transparent; }
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    padding: 0.6rem var(--gutter) 1rem;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
  }
  .site-nav.is-open { display: block; }
  .site-nav__groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .site-nav__list { gap: 0.5rem; }
  .site-nav a, .site-header--home .site-nav a { width: 100%; min-height: 2rem; padding: 0.2rem 0.15rem; color: var(--ink); font-size: 0.92rem; white-space: normal; }
  .site-nav a[aria-current="page"] { color: var(--accent); }
  .hero-marquee { top: 43%; font-size: clamp(6rem, 24vw, 10rem); }
  .hero-cover__portrait { bottom: 0; width: min(96vw, 720px); height: 48dvh; }
  .hero-cover__footer { bottom: 1.5rem; gap: 1rem; font-size: 0.82rem; }
  .hero-cover__caption, .hero-private-trigger { padding-top: 0.8rem; }
  .text-page { min-height: calc(100dvh - 8rem); }
}

@media (max-width: 600px) {
  .discipline-row, .background-list > div { grid-template-columns: 1fr; gap: 0.35rem; }
  .discipline-row { padding-block: 1.25rem; }
  .process-list li { grid-template-columns: 2.25rem minmax(0, 1fr); gap: 0.45rem 0.75rem; }
  .process-step { grid-row: 1 / span 2; }
  .process-list h2 { grid-column: 2; }
  .process-list p { grid-column: 2; }
  .site-footer__inner { min-height: 3.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .hero-marquee__track { animation: none; transform: translateX(-25%); }
  .soul-document > p:last-child::after { animation: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .site-header--home { background: var(--hero-surface); }
  .hero-cover::before { opacity: 0.12; }
  .hero-cover__collage { opacity: 0.68; }
}
