@view-transition {
  navigation: auto;
}

@font-face {
  font-family: "Barbara Serif";
  src: url("/assets/fonts/source-han-serif-sc.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: "Barbara Mono";
  src: url("/assets/fonts/ibm-plex-mono-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

::view-transition-old(root) {
  animation: page-out 420ms cubic-bezier(.55, 0, .8, .2) both;
}

::view-transition-new(root) {
  animation: page-in 620ms cubic-bezier(.16, .7, .2, 1) both;
}

@keyframes page-out {
  to { opacity: 0; transform: perspective(1400px) rotateY(-5deg) translateX(-3%); filter: blur(6px); }
}

@keyframes page-in {
  from { opacity: 0; transform: perspective(1400px) rotateY(6deg) translateX(4%); filter: blur(8px); }
}

:root {
  color-scheme: dark;
  --night: #100918;
  --night-soft: #1a1027;
  --paper: rgba(250, 245, 233, 0.94);
  --paper-soft: rgba(244, 236, 221, 0.88);
  --ink: #191421;
  --ink-soft: #625968;
  --white: #fffaf2;
  --muted: rgba(255, 250, 242, 0.64);
  --line: rgba(255, 250, 242, 0.17);
  --accent: #ff6f45;
  --accent-2: #f13b96;
  --accent-3: #52e5d0;
  --reading-progress: 0;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--night);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--white);
  background: var(--night);
  font-family: "Barbara Serif", ui-serif, "Songti SC", serif;
}

body[data-palette="violet"] { --accent: #b969ff; --accent-2: #ff4d9b; --accent-3: #57cfff; }
body[data-palette="azure"] { --accent: #4f9cff; --accent-2: #7756ff; --accent-3: #52e5d0; }
body[data-palette="cyan"] { --accent: #2dded0; --accent-2: #3a86ff; --accent-3: #c073ff; }
body[data-palette="amber"] { --accent: #ffab35; --accent-2: #ff4e58; --accent-3: #a46cff; }
body[data-palette="lime"] { --accent: #9ce64e; --accent-2: #30d5a5; --accent-3: #4b82ff; }

a { color: inherit; }
button { font: inherit; }

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

#ink-field,
.fallback-ink {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
}

#ink-field { pointer-events: none; }

.fallback-ink {
  z-index: -1;
  background:
    radial-gradient(circle at 18% 28%, rgba(255, 92, 48, 0.9), transparent 33%),
    radial-gradient(circle at 76% 22%, rgba(235, 50, 152, 0.75), transparent 36%),
    radial-gradient(circle at 68% 76%, rgba(49, 97, 255, 0.8), transparent 35%),
    radial-gradient(circle at 26% 82%, rgba(31, 222, 192, 0.6), transparent 31%),
    var(--night);
  animation: fallback-breathe 14s ease-in-out infinite alternate;
}

.no-webgl #ink-field { display: none; }

@keyframes fallback-breathe {
  to { filter: hue-rotate(18deg) saturate(1.2); transform: scale(1.06); }
}

.paper-grain {
  position: fixed;
  z-index: 20;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: 0.7rem 1rem;
  color: var(--ink);
  background: var(--white);
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }

.book-spine {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  width: 72px;
  padding: 1.2rem 0.8rem;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(17, 9, 25, 0.63);
  backdrop-filter: blur(18px);
}

.spine-brand {
  display: block;
  justify-self: center;
  padding: .45rem .25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.32);
  text-decoration: none;
  font: 400 0.5rem/1 "Barbara Mono", ui-monospace, monospace;
  letter-spacing: .08em;
  writing-mode: vertical-rl;
}

.spine-title {
  align-self: center;
  justify-self: center;
  color: rgba(255, 255, 255, 0.76);
  font: 0.58rem/1 ui-monospace, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.spine-progress {
  position: relative;
  width: 1px;
  height: 78px;
  margin: 0 auto 1rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}

.spine-progress i {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: calc(var(--reading-progress) * 100%);
  background: var(--accent);
}

.spine-folio {
  justify-self: center;
  color: rgba(255, 255, 255, 0.5);
  font: 0.52rem/1.5 ui-monospace, monospace;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
}

.edge-tabs {
  position: fixed;
  z-index: 28;
  top: 28%;
  right: 0;
  display: grid;
  gap: 0.45rem;
}

.edge-tabs a {
  display: grid;
  grid-template-columns: auto 0fr;
  gap: 0.55rem;
  align-items: center;
  min-height: 52px;
  padding: 0.7rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-right: 0;
  border-radius: 0.5rem 0 0 0.5rem;
  background: rgba(20, 10, 30, 0.66);
  text-decoration: none;
  backdrop-filter: blur(14px);
  transition: grid-template-columns 260ms ease, background 260ms ease;
}

.edge-tabs span { color: var(--accent); font: 0.62rem/1 ui-monospace, monospace; }
.edge-tabs b { overflow: hidden; white-space: nowrap; font-size: 0.72rem; font-weight: 580; }
.edge-tabs a:hover { grid-template-columns: auto 5rem; background: rgba(37, 18, 53, 0.9); }

.book-stage,
.project-book {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 8rem), 1320px);
  margin-left: max(6rem, calc((100% - 1320px) / 2 + 4.5rem));
  padding: 4rem 1rem 5rem;
}

.page-surface {
  position: relative;
  min-height: calc(100vh - 8rem);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 1.15rem;
  background: rgba(19, 10, 28, 0.9);
  box-shadow: 0 2.5rem 9rem rgba(5, 2, 10, 0.42);
}

.page-surface::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  content: "";
  pointer-events: none;
}

.page-turn-sheet {
  position: fixed;
  z-index: 80;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 50vw;
  opacity: 0;
  pointer-events: none;
  transform-style: preserve-3d;
  perspective: 1800px;
}

.page-turn-front,
.page-turn-back {
  position: absolute;
  inset: 0;
  border-left: 1px solid rgba(49, 38, 50, 0.18);
  backface-visibility: hidden;
  background:
    linear-gradient(90deg, rgba(20, 12, 25, 0.18), transparent 8%),
    #f7f0e3;
  box-shadow: -28px 0 55px rgba(8, 3, 12, 0.28);
}

.page-turn-back {
  transform: rotateY(180deg);
  background:
    linear-gradient(-90deg, rgba(20, 12, 25, 0.16), transparent 9%),
    #eee4d3;
}

.is-page-turning.turn-forward .page-turn-sheet {
  opacity: 1;
  transform-origin: left center;
  animation: sheet-forward 340ms cubic-bezier(.62, .02, .28, 1) forwards;
}

.is-page-turning.turn-backward .page-turn-sheet {
  left: 0;
  opacity: 1;
  transform-origin: right center;
  animation: sheet-backward 340ms cubic-bezier(.62, .02, .28, 1) forwards;
}

@keyframes sheet-forward {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(-180deg); }
}

@keyframes sheet-backward {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(180deg); }
}

.cover {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.75fr);
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
  padding: clamp(1.2rem, 3vw, 3rem);
  overflow: hidden;
}

.cover-frame {
  position: absolute;
  inset: clamp(1rem, 2.3vw, 2rem);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 1.3rem;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.018);
  pointer-events: none;
}

.cover-meta {
  position: relative;
  z-index: 3;
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.7);
  font: 0.62rem/1 ui-monospace, monospace;
  letter-spacing: 0.16em;
}
.cover-meta-top { padding: 1rem 1.2rem; }
.cover-meta-bottom { align-self: end; gap: 2rem; justify-content: flex-start; padding: 1rem 1.2rem; }

.cover-title {
  position: relative;
  z-index: 4;
  align-self: center;
  max-width: 64rem;
  padding-left: clamp(1rem, 4vw, 4rem);
}
.cover-title > p:first-child { margin-bottom: 1.4rem; color: rgba(255,255,255,.72); font: 0.68rem/1 ui-monospace, monospace; letter-spacing: .18em; }
.cover-title h1 { margin: 0; font-size: clamp(4.5rem, 10vw, 10rem); line-height: .82; letter-spacing: -.085em; }
.cover-title h1 span { display: block; color: rgba(255,255,255,.5); font-size: .38em; letter-spacing: .02em; }
.cover-title h2 { margin: 1.6rem 0 1rem; font-size: clamp(1.2rem, 2.7vw, 2.4rem); font-weight: 420; letter-spacing: -.03em; }
.cover-description { max-width: 36rem; margin: 0; color: rgba(255,255,255,.74); line-height: 1.75; }

.cover-wordmark {
  display: block;
  width: min(56vw, 46rem);
  height: auto;
  color: var(--white);
  filter: drop-shadow(0 16px 38px rgba(5, 2, 10, .22));
}

.cover-bookplate {
  position: relative;
  z-index: 4;
  align-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(8rem, 1fr));
  gap: 1px;
  width: min(35vw, 30rem);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 1rem;
  background: rgba(14, 8, 24, .42);
  backdrop-filter: blur(12px);
}

.cover-bookplate > p {
  grid-column: 1 / -1;
  margin: 0;
  padding: .9rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.68);
  font: .55rem/1 "Barbara Mono", ui-monospace, monospace;
  letter-spacing: .12em;
}

.cover-bookplate figure {
  min-height: 8rem;
  margin: 0;
  padding: 1rem;
  border-right: 1px solid rgba(255,255,255,.14);
  border-bottom: 1px solid rgba(255,255,255,.14);
  transition: background 180ms ease, color 180ms ease;
}

.cover-bookplate figure:nth-of-type(2n) { border-right: 0; }
.cover-bookplate figure:nth-last-of-type(-n+2) { border-bottom: 0; }
.cover-bookplate figure:hover { color: var(--accent-3); background: rgba(255,255,255,.08); }
.cover-bookplate svg { display: block; width: 100%; height: 3.6rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cover-bookplate figcaption { margin-top: .55rem; color: rgba(255,255,255,.72); font-size: .65rem; }

.open-book {
  position: relative;
  z-index: 5;
  align-self: end;
  justify-self: end;
  display: grid;
  min-width: 15rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: .7rem;
  background: rgba(255,255,255,.12);
  text-decoration: none;
  backdrop-filter: blur(14px);
  transition: color 200ms ease, background 200ms ease, transform 200ms ease;
}
.open-book span { font-weight: 680; }
.open-book i { margin-top: .45rem; color: rgba(255,255,255,.58); font: normal .58rem/1 ui-monospace, monospace; }
.open-book:hover { color: var(--ink); background: var(--white); transform: translateY(-4px); }

.page-leaf { position: absolute; z-index: 40; top: 0; bottom: 0; width: 51%; background: var(--paper); pointer-events: none; transform: scaleX(0); transition: transform 680ms cubic-bezier(.66,0,.22,1); }
.page-leaf-left { left: 0; transform-origin: left; }
.page-leaf-right { right: 0; transform-origin: right; }
.is-page-turning .page-leaf { transform: scaleX(1); }
.is-page-turning .cover-title,
.is-page-turning .open-book { opacity: 0; transform: scale(.96); transition: opacity 360ms ease, transform 500ms ease; }

.editorial-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: clamp(2rem, 5vw, 5rem);
  border-bottom: 1px solid var(--line);
}
.editorial-header p { grid-column: 1 / -1; margin: 0 0 1rem; color: var(--accent); font: .64rem/1 ui-monospace, monospace; letter-spacing: .16em; }
.editorial-header h1 { margin: 0; font-size: clamp(3.3rem,7vw,7rem); line-height: .9; letter-spacing: -.07em; }
.editorial-header span { align-self: end; color: var(--muted); font: .62rem/1 ui-monospace, monospace; }

.chapter-index { display: grid; grid-template-columns: 1fr 1fr; }
.chapter-entry { position: relative; min-height: 23rem; padding: clamp(2rem,4vw,4rem); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; transition: background 250ms ease, transform 250ms ease; }
.chapter-entry:nth-child(2n) { border-right: 0; }
.chapter-entry:hover { background: rgba(255,255,255,.08); }
.chapter-number { color: var(--accent); font: .62rem/1 ui-monospace, monospace; letter-spacing: .14em; }
.chapter-entry h2 { margin: 3.5rem 0 .4rem; font-size: clamp(2.5rem,5vw,5rem); letter-spacing: -.06em; }
.chapter-entry div p { margin: 0; color: var(--muted); font: .68rem/1 ui-monospace, monospace; letter-spacing: .08em; }
.chapter-entry > p { max-width: 28rem; margin: 2rem 0; color: var(--muted); line-height: 1.75; }
.chapter-entry b { position: absolute; right: 2rem; bottom: 2rem; color: var(--accent-3); font: .62rem/1 ui-monospace, monospace; }
.chapter-entry.is-preparing { background: repeating-linear-gradient(-45deg, transparent, transparent 9px, rgba(255,255,255,.018) 10px); }

.contents-projects { padding: clamp(2rem,4vw,4rem); }
.contents-projects > p { color: var(--accent); font: .62rem/1 ui-monospace, monospace; letter-spacing: .15em; }
.contents-projects ol { display: grid; grid-template-columns: repeat(3,1fr); gap: 0; margin: 2rem 0 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.contents-projects li { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contents-projects li:nth-child(3n) { border-right: 0; }
.contents-projects a { display: grid; grid-template-columns: auto 1fr; gap: .7rem; padding: 1.2rem; text-decoration: none; }
.contents-projects span { color: var(--accent); font: .58rem/1 ui-monospace, monospace; }
.contents-projects small { display: block; margin-top: .25rem; color: var(--muted); font-size: .58rem; }
.page-footer { display: flex; justify-content: space-between; padding: 1.3rem 2rem; color: var(--muted); font: .55rem/1 ui-monospace, monospace; }

.kicker { margin: 0 0 1.5rem; color: var(--accent); font: .65rem/1 ui-monospace, monospace; letter-spacing: .16em; }

.folio-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 4rem; }
.folio-nav a { padding: .9rem 1.1rem; border: 1px solid currentColor; border-radius: .4rem; text-decoration: none; font-size: .76rem; }


.project-book { padding-top: 0; }
.project-cover { position: relative; display: grid; grid-template-columns: auto 1fr; min-height: 100dvh; padding: 6rem clamp(2rem,6vw,6rem) 4rem; overflow: hidden; align-items: center; border-radius: 1.2rem; }
.project-cover::after { position: absolute; inset: 6% 0; border: 1px solid rgba(255,255,255,.24); border-radius: 1.2rem; background: linear-gradient(135deg,rgba(22,12,31,.94),rgba(12,7,20,.86)); content: ""; z-index: -1; }
.project-cover-visual { position: absolute; z-index: 0; top: 14%; right: 2%; bottom: 14%; width: 49%; opacity: .44; color: var(--accent); mask-image: linear-gradient(90deg,transparent,#000 22%); }
.project-cover-visual svg { width: 100%; height: 100%; }
.project-cover-visual svg path,.project-cover-visual svg rect,.project-cover-visual svg circle,.project-cover-visual svg ellipse { fill: none; stroke: currentColor; stroke-width: 1.5; }
.project-cover-visual text { fill: currentColor; font: 12px "Barbara Mono",ui-monospace,monospace; }
.project-cover-index { position: relative; z-index: 1; align-self: start; display: grid; gap: .7rem; color: var(--muted); font: .58rem/1 ui-monospace, monospace; }
.project-cover-index b { color: var(--accent); font-size: 2.7rem; }
.project-cover-title { position: relative; z-index: 1; max-width: 44rem; padding-left: clamp(2rem,5vw,6rem); }
.project-cover-title > p { margin: 0 0 1.2rem; color: var(--accent-3); font: .68rem/1 ui-monospace, monospace; letter-spacing: .15em; }
.project-cover-title h1 { margin: 0; font-size: clamp(5rem,13vw,13rem); line-height: .8; letter-spacing: -.09em; }
.project-cover-title blockquote { max-width: 46rem; margin: 2.5rem 0; color: rgba(255,255,255,.8); font-size: clamp(1.05rem,2vw,1.35rem); line-height: 1.8; }
.project-cover-title ul { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.project-cover-title li { padding: .5rem .7rem; border: 1px solid rgba(255,255,255,.24); border-radius: 99px; color: var(--muted); font: .6rem/1 ui-monospace, monospace; }
.read-deeper { position: absolute; z-index: 1; right: 2rem; bottom: 3rem; display: flex; gap: 1rem; color: var(--muted); text-decoration: none; font-size: .72rem; }
.read-deeper span { color: var(--accent); }

.paper-spread {
  position: relative;
  min-height: min(82vh, 58rem);
  margin-bottom: 2rem;
  padding: clamp(2rem,6vw,6rem);
  overflow: hidden;
  border-radius: 1rem;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 2rem 7rem rgba(5,2,9,.36);
}
.paper-spread::after { position: absolute; inset: 0 50% 0 auto; width: 1px; background: rgba(25,20,33,.1); box-shadow: 0 0 35px rgba(25,20,33,.15); content: ""; }
.paper-spread > header { display: flex; justify-content: space-between; padding-bottom: 1rem; border-bottom: 1px solid rgba(25,20,33,.18); font: .62rem/1 ui-monospace, monospace; letter-spacing: .12em; }
.paper-spread > header span { color: color-mix(in srgb, var(--accent) 72%, var(--ink)); }
.paper-spread > header b { font-weight: 600; }

.project-local-contents ol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 2.5rem 0 0;
  padding: 0;
  border-top: 1px solid rgba(25,20,33,.16);
  list-style: none;
}

.project-page-entry {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  align-items: center;
  min-height: 5.8rem;
  padding: 1rem 1.2rem;
  border-right: 1px solid rgba(25,20,33,.16);
  border-bottom: 1px solid rgba(25,20,33,.16);
}
.project-page-entry:nth-child(2n) { border-right: 0; }
.project-page-entry span { color: color-mix(in srgb,var(--accent) 78%,var(--ink)); font: .58rem/1 "Barbara Mono",ui-monospace,monospace; }
.project-page-entry b { font-size: 1rem; font-weight: 560; }

.proposition-spread { display: grid; grid-template-columns: 1.35fr .65fr; grid-template-rows: auto 1fr; gap: 3rem; }
.proposition-spread > header { grid-column: 1 / -1; }
.proposition-spread > div { align-self: center; padding-right: clamp(1rem,5vw,5rem); }
.drop-cap { margin: 0; font-family: ui-serif, Georgia, serif; font-size: clamp(1.45rem,3vw,2.45rem); line-height: 1.6; letter-spacing: -.02em; }
.drop-cap::first-letter { float: left; margin: .1em .16em 0 0; color: var(--accent); font-size: 4em; line-height: .7; }
.proposition-spread aside { align-self: end; padding-left: 2rem; }
.proposition-spread aside span { color: var(--accent); font: .58rem/1 ui-monospace, monospace; }
.proposition-spread aside p { color: var(--ink-soft); }

.system-sequence { display: grid; grid-template-columns: 1fr 1fr; min-height: 36rem; }
.system-sequence article { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; gap: 1rem; padding: 2.5rem; border-right: 1px solid rgba(25,20,33,.14); border-bottom: 1px solid rgba(25,20,33,.14); }
.system-sequence article:nth-child(2n) { border-right: 0; }
.system-sequence article:nth-last-child(-n+2) { border-bottom: 0; }
.system-sequence span { grid-row: 1 / 3; color: var(--accent); font: .62rem/1 ui-monospace, monospace; }
.system-sequence h3 { margin: 0; font-size: 1.45rem; }
.system-sequence p { margin: 0; color: var(--ink-soft); line-height: 1.7; }

.decision-grid { display: grid; grid-template-columns: 1fr 1fr; min-height: 36rem; }
.decision-grid article { display: flex; padding: clamp(2rem,5vw,5rem); flex-direction: column; justify-content: flex-end; border-right: 1px solid rgba(25,20,33,.14); }
.decision-grid article:last-child { border-right: 0; }
.decision-grid span { color: var(--accent); font: .58rem/1 ui-monospace, monospace; }
.decision-grid h3 { margin: 1.2rem 0; font-family: ui-serif, Georgia, serif; font-size: clamp(2rem,4vw,3.8rem); line-height: 1.08; letter-spacing: -.05em; }
.decision-grid p { color: var(--ink-soft); line-height: 1.85; }

.evidence-grid { display: grid; grid-template-columns: repeat(4,1fr); min-height: 35rem; align-items: stretch; }
.evidence-grid article { display: flex; padding: 2rem; flex-direction: column; justify-content: center; border-right: 1px solid rgba(25,20,33,.14); text-align: center; }
.evidence-grid article:last-child { border-right: 0; }
.evidence-grid strong { color: color-mix(in srgb, var(--accent) 76%, var(--ink)); font-size: clamp(2.2rem,5vw,5rem); letter-spacing: -.07em; }
.evidence-grid span { margin-top: .7rem; color: var(--ink-soft); font: .65rem/1 ui-monospace, monospace; }

.project-figure {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: min(82vh, 56rem);
  margin: 0 0 2rem;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 1rem;
  box-shadow: 0 2rem 7rem rgba(5,2,9,.34);
}

.project-figure.figure-tone-dark {
  color: color-mix(in srgb, var(--accent) 82%, white);
  background: rgba(10, 7, 18, .83);
}

.project-figure.figure-tone-light {
  color: color-mix(in srgb, var(--accent) 82%, var(--ink));
  background: var(--paper);
}

.project-figure-art {
  display: grid;
  min-height: 36rem;
  padding: clamp(1.5rem,5vw,5rem);
  place-items: center;
}

.project-figure-art svg {
  width: min(100%, 68rem);
  height: auto;
  overflow: visible;
}

.project-figure-art svg path,
.project-figure-art svg rect,
.project-figure-art svg circle,
.project-figure-art svg ellipse {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.project-figure-art .figure-labels text {
  fill: currentColor;
  stroke: none;
  font: 12px "Barbara Mono", ui-monospace, monospace;
  letter-spacing: .05em;
}

.project-figure-art .figure-nodes circle,
.project-figure-art .state-points circle,
.project-figure-art .branch-nodes rect,
.project-figure-art .loop-nodes circle,
.project-figure-art .trace-points circle,
.project-figure-art .evolution-nodes circle {
  fill: color-mix(in srgb, currentColor 14%, transparent);
  stroke-width: 2;
}

.project-figure-art .pipeline-boxes rect,
.project-figure-art .stage-blocks rect,
.project-figure-art .budget-row rect,
.project-figure-art .mode-columns rect,
.project-figure-art .waterfall rect,
.project-figure-art .bandwidth-bars rect,
.project-figure-art .contact-frames rect,
.project-figure-art .outbox-nodes rect,
.project-figure-art .trace-cards rect,
.project-figure-art .copy-before rect,
.project-figure-art .copy-after rect {
  fill: color-mix(in srgb, currentColor 8%, transparent);
}

.project-figure-art .source-rays,
.project-figure-art .refracted,
.project-figure-art .laser-beam,
.project-figure-art .flow-line,
.project-figure-art .event-links,
.project-figure-art .citation-links {
  stroke-width: 2.2;
  stroke-dasharray: 10 9;
}

.project-figure.is-visible .source-rays,
.project-figure.is-visible .refracted,
.project-figure.is-visible .laser-beam,
.project-figure.is-visible .flow-line,
.project-figure.is-visible .event-links,
.project-figure.is-visible .citation-links {
  animation: figure-flow 1.8s linear infinite;
}

@keyframes figure-flow { to { stroke-dashoffset: -38; } }

.project-figure-art .point-cloud circle {
  fill: currentColor;
  stroke: none;
  opacity: .75;
}

.project-figure.is-visible .point-cloud circle,
.project-figure.is-visible .figure-nodes circle,
.project-figure.is-visible .event-clients circle {
  animation: figure-pulse 2.4s ease-in-out infinite alternate;
  animation-delay: calc(var(--node-index, 0) * 40ms);
}

@keyframes figure-pulse { to { opacity: .35; transform: translateY(-2px); } }

.buffer-cells .consumed { fill: color-mix(in srgb, currentColor 5%, transparent); opacity: .35; }
.buffer-cells .readable { fill: color-mix(in srgb, currentColor 22%, transparent); }
.buffer-cells .writable { fill: transparent; stroke-dasharray: 4 4; }
.mode-dots circle,.answer-core,.event-core { fill: color-mix(in srgb, currentColor 12%, transparent) !important; }
.knowledge-layers path:nth-child(1) { fill: color-mix(in srgb,currentColor 8%,transparent); }
.knowledge-layers path:nth-child(2) { fill: color-mix(in srgb,currentColor 12%,transparent); }
.knowledge-layers path:nth-child(3) { fill: color-mix(in srgb,currentColor 16%,transparent); }
.knowledge-layers path:nth-child(4) { fill: color-mix(in srgb,currentColor 20%,transparent); }

.project-figure figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.5rem;
  border-top: 1px solid currentColor;
  font-family: "Barbara Mono", ui-monospace, monospace;
}
.project-figure figcaption span { opacity: .62; font-size: .58rem; }
.project-figure figcaption b { font-size: .68rem; font-weight: 400; }

.project-book[data-visual="network-weave"] .project-figure { --figure-signature: "RELATION"; }
.project-book[data-visual="dialogue-forge"] .project-figure { --figure-signature: "DIALOGUE"; }
.project-book[data-visual="evidence-prism"] .project-figure { --figure-signature: "EVIDENCE"; }
.project-book[data-visual="laser-protocol"] .project-figure { --figure-signature: "PROTOCOL"; }
.project-book[data-visual="capture-notebook"] .project-figure { --figure-signature: "CAPTURE"; }
.project-book[data-visual="event-tide"] .project-figure { --figure-signature: "EVENT"; }

.project-epilogue { min-height: 75vh; padding: clamp(3rem,8vw,8rem); }
.project-epilogue > p { color: var(--accent); font: .62rem/1 ui-monospace, monospace; letter-spacing: .15em; }
.project-epilogue blockquote { max-width: 62rem; margin: 8vh 0 3rem; font-family: ui-serif, Georgia, serif; font-size: clamp(2.2rem,5vw,5rem); line-height: 1.25; letter-spacing: -.05em; }
.source-link { display: inline-block; padding: .8rem 1rem; border: 1px solid currentColor; border-radius: .4rem; text-decoration: none; }

.front-stage {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100dvh;
  padding: clamp(1rem, 4vw, 4rem);
  place-items: center;
}

.front-page {
  position: relative;
  display: flex;
  width: min(92vw, 76rem);
  min-height: min(88vh, 54rem);
  padding: clamp(2rem, 6vw, 6rem);
  overflow: hidden;
  border-radius: 1rem;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 2.5rem 8rem rgba(6,2,10,.42);
  flex-direction: column;
}

.front-page > p:first-child {
  margin: 0;
  color: color-mix(in srgb, var(--accent) 75%, var(--ink));
  font: .62rem/1 "Barbara Mono", ui-monospace, monospace;
  letter-spacing: .14em;
}

.front-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(25,20,33,.18);
}
.front-nav a { text-decoration: none; font-size: .72rem; }

.half-title-page { align-items: center; justify-content: center; }
.half-title-page > p { position: absolute; top: 2rem; left: 2rem; }
.half-title-page img { width: min(78%, 48rem); color: var(--ink); }
.half-title-page > span { margin-top: 2rem; color: var(--ink-soft); font: .62rem/1 "Barbara Mono", ui-monospace, monospace; }
.half-title-page .front-nav { position: absolute; right: 2rem; bottom: 2rem; left: 2rem; }

.title-page { justify-content: space-between; }
.title-page > div { align-self: center; width: min(100%, 52rem); }
.title-page > div > span { color: var(--accent); font: .62rem/1 "Barbara Mono", ui-monospace, monospace; letter-spacing: .15em; }
.title-page h1 { margin: 1rem 0 0; font-size: clamp(5rem,12vw,11rem); line-height: .85; letter-spacing: -.08em; }
.title-page h2 { margin: 1.5rem 0; font-size: clamp(1.3rem,3vw,2.4rem); font-weight: 400; }
.title-page > footer { display: flex; justify-content: space-between; color: var(--ink-soft); font: .58rem/1 "Barbara Mono", ui-monospace, monospace; }

.epigraph-page { justify-content: center; }
.epigraph-page blockquote { margin: 0; font-size: clamp(3rem,8vw,7.5rem); line-height: 1.18; letter-spacing: -.06em; }
.epigraph-page > span { margin-top: 2rem; color: var(--ink-soft); }

.colophon-page header { margin: 5vh 0 3rem; }
.colophon-page header h1 { margin: 0 0 1rem; font-size: clamp(3rem,6vw,6rem); letter-spacing: -.06em; }
.colophon-page header p { max-width: 42rem; color: var(--ink-soft); line-height: 1.75; }
.colophon-page dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-top: 1px solid rgba(25,20,33,.18); }
.colophon-page dl div { padding: 1.5rem; border-right: 1px solid rgba(25,20,33,.18); border-bottom: 1px solid rgba(25,20,33,.18); }
.colophon-page dl div:nth-child(2n) { border-right: 0; }
.colophon-page dt { margin-bottom: .7rem; color: color-mix(in srgb, var(--accent) 75%, var(--ink)); font-weight: 700; }
.colophon-page dd { margin: 0; color: var(--ink-soft); line-height: 1.7; }

.part-opener { padding: clamp(2rem, 5vw, 5rem); }
.part-heading > p { color: var(--accent); font: .62rem/1 "Barbara Mono", ui-monospace, monospace; letter-spacing: .15em; }
.part-heading h1 { margin: 0; font-size: clamp(4rem,9vw,9rem); line-height: .86; letter-spacing: -.08em; }
.part-heading blockquote { max-width: 44rem; margin: 2rem 0 5rem; color: var(--muted); font-size: 1.1rem; line-height: 1.8; }
.part-entries { border-top: 1px solid var(--line); }
.part-entries > a { display: grid; grid-template-columns: 3rem .65fr 1.35fr auto; gap: 1.2rem; align-items: center; min-height: 9rem; padding: 1.2rem 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.part-entries > a > span { color: var(--accent); font: .62rem/1 "Barbara Mono", ui-monospace, monospace; }
.part-entries h2 { margin: 0 0 .3rem; font-size: 2rem; }
.part-entries div p { margin: 0; color: var(--muted); font: .58rem/1 "Barbara Mono", ui-monospace, monospace; }
.part-entries > a > p { margin: 0; color: var(--muted); line-height: 1.6; }
.part-entries i { color: var(--accent-3); font-style: normal; }
.unpublished-part { min-height: 24rem; padding: 4rem 0; border-block: 1px solid var(--line); }
.unpublished-part span { color: var(--accent); font: .62rem/1 "Barbara Mono", ui-monospace, monospace; }
.unpublished-part h2 { max-width: 48rem; margin: 5rem 0 1rem; font-size: clamp(2.5rem,6vw,5.5rem); letter-spacing: -.06em; }
.unpublished-part p { max-width: 42rem; color: var(--muted); line-height: 1.8; }

.cover-meta,
.cover-title > p:first-child,
.open-book i,
.spine-title,
.spine-folio,
.edge-tabs,
.editorial-header > p,
.chapter-number,
.contents-projects,
.page-footer,
.project-cover-index,
.project-cover-title > p,
.project-cover-title li,
.paper-spread > header,
.system-sequence span,
.decision-grid span,
.evidence-grid span,
.project-epilogue > p,
.kicker {
  font-family: "Barbara Mono", ui-monospace, monospace;
}

[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 720ms ease, transform 720ms cubic-bezier(.16,.75,.22,1); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

.is-page-turning .page-surface,
.is-page-turning .project-book { transform: perspective(1400px) rotateY(-7deg) translateX(-4%); opacity: 0; filter: blur(7px); transition: transform 700ms cubic-bezier(.6,0,.3,1), opacity 520ms ease, filter 500ms ease; transform-origin: left center; }

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

@media (max-width: 900px) {
  .book-spine { width: 54px; }
  .spine-title { display: none; }
  .edge-tabs { display: none; }
  .book-stage,.project-book { width: calc(100% - 4.5rem); margin-left: 3.7rem; padding-inline: .6rem; }
  .cover { grid-template-columns: 1fr; }
  .cover-bookplate { position: absolute; right: 2rem; bottom: 10%; width: min(42vw, 24rem); opacity: .82; }
  .open-book { justify-self: start; margin-left: 1rem; }
  .contents-projects ol { grid-template-columns: 1fr 1fr; }
  .project-cover { grid-template-columns: 1fr; }
  .project-cover-index { grid-auto-flow: column; justify-content: start; align-items: center; }
  .project-cover-title { padding-left: 0; }
  .evidence-grid { grid-template-columns: 1fr 1fr; }
  .evidence-grid article { min-height: 14rem; border-bottom: 1px solid rgba(25,20,33,.14); }
  .evidence-grid article:nth-child(2n) { border-right: 0; }
}

@media (max-width: 640px) {
  .book-spine { top: auto; right: 0; bottom: 0; display: flex; width: auto; height: 52px; padding: .35rem .7rem; align-items: center; justify-content: space-between; border-top: 1px solid rgba(255,255,255,.18); border-right: 0; }
  .spine-brand { padding: .55rem .3rem; border: 0; writing-mode: initial; }
  .spine-progress { position: absolute; top: 0; right: 0; left: 0; width: auto; height: 2px; margin: 0; }
  .spine-progress i { width: calc(var(--reading-progress) * 100%); height: 100%; }
  .spine-folio { writing-mode: initial; }
  .book-stage,.project-book { width: calc(100% - 1rem); margin-left: .5rem; padding: .5rem 0 4.5rem; }
  .page-surface { min-height: calc(100vh - 1rem); border-radius: .8rem; }
  .cover { padding: 1rem; }
  .cover-frame { inset: .55rem; border-radius: .8rem; }
  .cover-meta-top { padding: .5rem .3rem; }
  .cover-meta-top span:first-child { display: none; }
  .cover-title { align-self: end; padding: 0 .3rem 10rem; }
  .cover-wordmark { width: 100%; }
  .cover-title h2 { margin-block: 1rem .65rem; font-size: 1.25rem; }
  .cover-description { max-width: 19rem; font-size: .8rem; line-height: 1.5; }
  .cover-bookplate { top: 8%; right: 1rem; bottom: auto; left: 1rem; grid-template-columns: repeat(3,1fr); width: auto; opacity: .78; }
  .cover-bookplate > p { display: none; }
  .cover-bookplate figure { min-height: 4.6rem; padding: .55rem; border-right: 1px solid rgba(255,255,255,.14); border-bottom: 1px solid rgba(255,255,255,.14); }
  .cover-bookplate figure:nth-of-type(2n) { border-right: 1px solid rgba(255,255,255,.14); }
  .cover-bookplate figure:nth-of-type(3n) { border-right: 0; }
  .cover-bookplate figure:nth-last-of-type(-n+3) { border-bottom: 0; }
  .cover-bookplate svg { height: 2.5rem; }
  .cover-bookplate figcaption { display: none; }
  .open-book { position: absolute; bottom: 5rem; left: 1.3rem; min-width: 13rem; margin: 0; }
  .cover-meta-bottom { display: none; }
  .editorial-header { grid-template-columns: 1fr; padding: 2rem 1.2rem; }
  .editorial-header h1 { font-size: 3.4rem; }
  .chapter-index { grid-template-columns: 1fr; }
  .chapter-entry { min-height: 19rem; border-right: 0; }
  .chapter-entry h2 { margin-top: 2.5rem; }
  .contents-projects { padding: 2rem 1.2rem; }
  .contents-projects ol { grid-template-columns: 1fr; }
  .contents-projects li { border-right: 0; }
  .chapter-opener { padding: 2rem 1.2rem 5rem; }
  .project-cover { min-height: 100svh; padding: 4rem 1.5rem 6rem; }
  .project-cover::after { inset: 1rem 0; }
  .project-cover-visual { top: 8%; right: -24%; width: 92%; opacity: .18; }
  .project-cover-title h1 { font-size: clamp(5rem,25vw,7rem); }
  .project-cover-title blockquote { font-size: 1rem; }
  .read-deeper { right: 1.5rem; bottom: 2rem; }
  .paper-spread { min-height: auto; margin-bottom: .75rem; padding: 2rem 1.2rem 3rem; border-radius: .65rem; }
  .paper-spread::after { display: none; }
  .proposition-spread { grid-template-columns: 1fr; }
  .project-local-contents ol { grid-template-columns: 1fr; }
  .project-page-entry { grid-template-columns: 3.8rem 1fr; min-height: 4.8rem; padding-inline: 0; border-right: 0; }
  .proposition-spread > div { padding-right: 0; }
  .drop-cap { font-size: 1.35rem; }
  .system-sequence,.decision-grid { grid-template-columns: 1fr; min-height: auto; }
  .system-sequence article,.decision-grid article { min-height: 15rem; padding: 2rem 0; border-right: 0; border-bottom: 1px solid rgba(25,20,33,.14); }
  .decision-grid h3 { font-size: 2.4rem; }
  .evidence-grid { grid-template-columns: 1fr 1fr; min-height: auto; }
  .evidence-grid article { min-height: 11rem; padding: 1rem; }
  .project-figure { min-height: auto; margin-bottom: .75rem; border-radius: .65rem; }
  .project-figure-art { min-height: 20rem; padding: 1rem .65rem; }
  .project-figure figcaption { align-items: flex-start; flex-direction: column; padding: .9rem 1rem; }
  .project-epilogue { min-height: 70vh; padding: 4rem 1rem 6rem; }
  .project-epilogue blockquote { margin-top: 4rem; font-size: 2.5rem; }
  .folio-nav { align-items: stretch; flex-direction: column; }
  .front-stage { padding: .5rem; }
  .front-page { width: 100%; min-height: calc(100svh - 1rem); padding: 2rem 1.2rem 5rem; border-radius: .75rem; }
  .half-title-page img { width: 100%; }
  .half-title-page .front-nav { right: 1.2rem; bottom: 1.2rem; left: 1.2rem; }
  .title-page h1 { font-size: 5rem; }
  .title-page > footer { gap: 1rem; flex-direction: column; }
  .epigraph-page blockquote { font-size: 3.2rem; }
  .colophon-page dl { grid-template-columns: 1fr; }
  .colophon-page dl div { padding-inline: 0; border-right: 0; }
  .part-opener { padding: 2rem 1.2rem 5rem; }
  .part-heading h1 { font-size: 4.3rem; }
  .part-entries > a { grid-template-columns: 2rem 1fr auto; min-height: 10rem; }
  .part-entries > a > p { grid-column: 2 / -1; }
  .part-entries i { grid-column: 3; grid-row: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  #ink-field { opacity: .72; }
}
