@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk-400.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk-700.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/JetBrainsMono-400.ttf") format("truetype");
  font-display: swap;
}

:root {
  --sc-canvas: #0e1726;
  --sc-surface: #172539;
  --sc-ink: #f6f8f7;
  --sc-ink-soft: #b4c3d6;
  --sc-accent: #38d9b4;
  --sc-accent-ink: #0e1726;
  --sc-font-display: "Space Grotesk", system-ui, sans-serif;
  --sc-font-text: var(--sc-font-display);
  --sc-font-mono: "JetBrains Mono", ui-monospace, monospace;
  --sc-gutter: clamp(1.25rem, 5.2vw, 5rem);
  --sc-maxw: 84rem;
  --rule: #304156;
  --ink-on-paper: #131f2c;
  --soft-on-paper: #425867;
  --paper-accent: #006852;
  --paper-line: #d0dbd5;
}

html { scroll-behavior: auto; }
body { line-height: 1.55; }
a { color: inherit; text-underline-offset: .22em; }
a:focus-visible, [tabindex="-1"]:focus-visible {
  outline: 2px solid var(--sc-accent);
  outline-offset: 4px;
}
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--sc-font-display); text-wrap: balance; }
p { text-wrap: pretty; }
.wrap { width: min(var(--sc-maxw), calc(100% - 2 * var(--sc-gutter))); margin-inline: auto; }
.sr-only, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus { position: fixed; z-index: 10; top: 1rem; left: 1rem; padding: .65rem 1rem; background: var(--sc-accent); color: var(--sc-accent-ink); }

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sc-4);
  min-height: 4.65rem;
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--sc-ink);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.15;
  letter-spacing: -.025em;
  font-weight: 700;
  text-decoration: none;
}
.wordmark i {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  background: var(--sc-accent);
  clip-path: polygon(0 64%, 33% 64%, 33% 32%, 65% 32%, 65% 0, 100% 0, 100% 34%, 68% 34%, 68% 67%, 35% 67%, 35% 100%, 0 100%);
}
.mast-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--sc-ink-soft);
  font-weight: 700;
  font-size: .95rem;
  text-decoration-color: transparent;
  white-space: nowrap;
}
.mast-link:hover, .mast-link[aria-current] { color: var(--sc-accent); text-decoration-color: currentColor; }

.front {
  display: grid;
  grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr);
  align-items: center;
  gap: clamp(2rem, 4.5vw, 5rem);
  padding-block: clamp(2.4rem, 5vw, 5rem);
}
.front-copy h1 {
  font-size: clamp(4rem, 9vw, 8.7rem);
  font-weight: 700;
  line-height: .91;
  letter-spacing: -.072em;
}
.subtitle {
  max-width: 42ch;
  margin-top: clamp(1.1rem, 2.2vw, 2.2rem);
  color: var(--sc-ink-soft);
  font-size: clamp(1rem, 1.53vw, 1.25rem);
  line-height: 1.5;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  margin-top: var(--sc-5);
  padding: .65rem 1.3rem;
  border: 1px solid transparent;
  border-radius: 5px;
  background: var(--sc-accent);
  color: var(--sc-accent-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
}
.button:hover { background: #91f1d8; }
.button:focus-visible { outline-color: #a9f9e6; }

.scene {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
  height: clamp(25rem, 42vw, 39rem);
  border: 1px solid #44596a;
  border-radius: 8px;
  background: #1d333c;
  box-shadow: var(--sc-e3);
}
.scene-plate { position: absolute; inset: -3.5% -1%; }
.scene-plate img { width: 100%; height: 100%; object-fit: cover; object-position: 54% center; }
.scene-light {
  position: absolute;
  inset: -12%;
  background: linear-gradient(134deg, transparent 34%, #f3f7ce18 48%, transparent 61%);
  mix-blend-mode: screen;
}
.scene-folder { position: absolute; left: 13%; top: 10%; width: 70%; }
.scene-folder picture { display: block; rotate: -7deg; filter: drop-shadow(20px 28px 24px #07151bd1); }
.scene-folder img { width: 100%; height: auto; }
.folder-print {
  position: absolute;
  top: 24%;
  left: 23%;
  display: grid;
  gap: clamp(.45rem, 1vw, 1rem);
  rotate: -12deg;
  transform-origin: top left;
  color: #132631;
}
.folder-imprint, .folder-types {
  color: #365754;
  font: 400 clamp(.57rem, 1vw, .87rem)/1.15 var(--sc-font-mono);
  letter-spacing: .05em;
}
.folder-title {
  font: 700 clamp(2.8rem, 6.8vw, 7rem)/.86 var(--sc-font-display);
  letter-spacing: -.08em;
}
.scene-label { position: absolute; right: 6%; bottom: 9%; }
.scene-label-paper {
  display: grid;
  gap: .32rem;
  rotate: 6deg;
  border: 1px solid #92ae9e;
  border-radius: 2px;
  padding: .78rem 1.05rem;
  background: #d8ebe1;
  color: #12362d;
  box-shadow: 4px 12px 24px #0613178f;
  font: 400 clamp(.68rem, 1vw, .84rem)/1.2 var(--sc-font-mono);
}

.paper {
  --sc-accent: var(--paper-accent);
  background: #f2f6f1;
  color: var(--ink-on-paper);
}
.kicker {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--sc-accent);
  font: 400 .85rem/1.2 var(--sc-font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.kicker span { width: .75rem; height: 1px; background: currentColor; }
.home-archive { border-top: 4px solid #38d9b4; }
.archive-callout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--sc-7);
  padding-block: clamp(2.3rem, 5vw, 4.5rem);
}
.archive-callout h2 {
  margin-block: .65rem .45rem;
  font-size: var(--sc-t-2xl);
  line-height: 1.02;
  letter-spacing: -.065em;
}
.archive-callout p:not(.kicker) { color: var(--soft-on-paper); }
.archive-callout .button { background: #12372f; color: #effcf6; }
.archive-callout .button:hover { background: #205647; }
.archive-callout .button:focus-visible { outline-color: var(--paper-accent); }
.archive-edge {
  justify-self: end;
  width: min(100%, 22rem);
  padding: .6rem;
  border: 1px solid var(--paper-line);
  border-radius: 5px;
  background: #e9f0e9;
}
.archive-edge-inner {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  column-gap: .9rem;
  padding: clamp(.65rem, 2.5vw, 1.75rem);
  border: 1px solid #b7ccc0;
  background: #daeae1;
  color: #12362d;
}
.archive-edge-reveal {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #c8e1d7;
}
.archive-count { font-size: clamp(3.2rem, 7vw, 6rem); line-height: .75; letter-spacing: -.09em; }
.archive-count-label { align-self: end; font-size: .92rem; line-height: 1.28; }
html:not(.sc-ready) .archive-count { opacity: 1; transform: none; }

.library-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: clamp(1.65rem, 4.5vw, 4.2rem) clamp(1.9rem, 4vw, 3.7rem);
}
.library-hero h1 {
  margin-block: .55rem .65rem;
  font-size: clamp(3.25rem, 7vw, 7.25rem);
  line-height: 1.02;
  letter-spacing: -.065em;
}
.book-note { color: var(--sc-ink-soft); font-size: var(--sc-t-base); }
.library-meta {
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  gap: clamp(1rem, 4vw, 3.3rem);
  padding: 0 0 .2rem .9rem;
  border-left: 1px solid var(--sc-accent);
}
.library-meta > div { display: grid; gap: .25rem; }
.library-meta strong { font-size: var(--sc-t-2xl); line-height: 1; letter-spacing: -.07em; }
.library-meta span { color: var(--sc-ink-soft); font-size: .9rem; }

.library-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(14rem, .65fr) minmax(0, 1.9fr);
  gap: clamp(1.8rem, 5.5vw, 6rem);
  padding-block: clamp(1.7rem, 4vw, 3.8rem) clamp(2.5rem, 6vw, 6rem);
}
.chapter-nav {
  position: sticky;
  top: 1rem;
  padding: var(--sc-5);
  border: 1px solid var(--paper-line);
  border-radius: 7px;
  background: #e7eee8;
}
.chapter-nav h2 { margin-bottom: .85rem; font-size: 1.15rem; letter-spacing: -.025em; }
.chapter-nav ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .375rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chapter-nav a {
  display: grid;
  place-items: center;
  min-height: 2.75rem;
  border: 1px solid #c5d3cb;
  border-radius: 4px;
  background: #f5f8f4;
  color: #1c4337;
  font: 400 .875rem/1 var(--sc-font-mono);
  text-decoration: none;
}
.chapter-nav a:hover { border-color: #0d725c; background: #dbefe6; }
.chapter-nav a[aria-current="location"] { background: #163d32; color: #f0fff6; border-color: #163d32; }
.folio-current {
  margin-top: .95rem;
  padding-top: .85rem;
  border-top: 1px solid #c5d3cb;
  color: #244b3e;
  font-size: .89rem;
  min-height: 3.5rem;
}
.case-files { min-width: 0; }
.chapter + .chapter { margin-top: clamp(1.8rem, 4vw, 3.5rem); }
.chapter h2 {
  display: grid;
  grid-template-columns: minmax(2.75rem, auto) 1fr;
  align-items: baseline;
  gap: .8rem;
  margin-bottom: .9rem;
  scroll-margin-top: 1.25rem;
  font-size: clamp(1.35rem, 3.1vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -.038em;
}
.chapter-number {
  align-self: start;
  padding-block: .32rem;
  border-top: 1px solid #4c8a78;
  color: var(--paper-accent);
  font: 400 clamp(.9rem, 1.4vw, 1.08rem)/1.2 var(--sc-font-mono);
  letter-spacing: 0;
}
.files {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--paper-line);
  list-style: none;
}
.files li { border-bottom: 1px solid var(--paper-line); }
.file {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto 1.05rem;
  align-items: center;
  gap: clamp(.6rem, 1.5vw, 1rem);
  min-height: 3.45rem;
  padding: .65rem .6rem;
  text-decoration: none;
}
.file:hover, .file:focus-visible { background: #e3eee7; }
.file:hover .filename, .file:focus-visible .filename { text-decoration: underline; }
.file-type {
  justify-self: start;
  width: 2.8rem;
  padding-block: .2rem;
  border-radius: 3px;
  background: #dceae3;
  color: #1b4939;
  text-align: center;
  font: 400 .74rem/1.4 var(--sc-font-mono);
}
.filename {
  overflow-wrap: anywhere;
  color: #1a302d;
  font: 400 clamp(.82rem, 1.3vw, .98rem)/1.35 var(--sc-font-mono);
}
.size { color: var(--soft-on-paper); font-size: .875rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.download-icon {
  display: block;
  position: relative;
  width: 1rem;
  height: 1rem;
  align-self: center;
  border-bottom: 1px solid currentColor;
  color: var(--paper-accent);
}
.download-icon::before {
  position: absolute;
  inset: 0 0 auto;
  height: .6rem;
  width: 1px;
  margin-inline: auto;
  background: currentColor;
  content: "";
}
.download-icon::after {
  position: absolute;
  top: .3rem;
  left: .29rem;
  width: .42rem;
  height: .42rem;
  rotate: 45deg;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  content: "";
}
.library-end { margin-top: var(--sc-7); color: var(--paper-accent); font-weight: 700; }

.footer {
  display: flex;
  align-items: center;
  min-height: 4.6rem;
  padding-block: 1rem;
  color: var(--sc-ink-soft);
  font-size: .9rem;
}

@media (max-width: 900px) {
  .front { gap: 1.7rem; }
  .scene { height: clamp(20rem, 50vw, 27rem); }
  .scene-folder { left: 11%; top: 18%; width: 76%; }
  .file { grid-template-columns: 2.6rem minmax(0, 1fr) auto 1.05rem; }
  .file-type { width: 2.4rem; }
}
@media (max-width: 700px) {
  .masthead { min-height: 3.6rem; }
  .front { grid-template-columns: minmax(0, 1fr); gap: 1.85rem; padding-block: 1.9rem 1.9rem; }
  .front-copy h1 { font-size: clamp(3.55rem, 12vw, 5.4rem); max-width: none; line-height: .98; }
  .front-copy h1 br { display: none; }
  .subtitle { margin-top: .7rem; }
  .front .button { margin-top: 1.05rem; }
  .scene { height: clamp(15rem, 68vw, 27rem); }
  .scene-plate img { object-position: 64% center; }
  .scene-folder { left: 14%; top: 8%; width: 67%; }
  .scene-label { right: 7%; bottom: 8%; }
  .scene-label-paper { padding: .55rem .7rem; }
  .folder-title { font-size: clamp(2.9rem, 11vw, 5.25rem); }
  .archive-callout { grid-template-columns: minmax(0, 1fr); gap: 1.35rem; }
  .archive-edge { justify-self: start; width: min(100%, 15rem); }

  .library-hero { display: block; }
  .library-hero h1 { font-size: clamp(3.4rem, 12vw, 5.25rem); }
  .library-meta { display: flex; gap: 1.3rem; margin-top: 1.1rem; }
  .library-meta > div { display: flex; align-items: baseline; gap: .35rem; }
  .library-meta strong { font-size: 1.2rem; }
  .library-layout { grid-template-columns: minmax(0, 1fr); gap: var(--sc-5); }
  .chapter-nav { position: static; padding: .75rem; }
  .chapter-nav h2 { margin-bottom: .6rem; font-size: 1rem; }
  .chapter-nav ol { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem; }
  .folio-current { min-height: 0; margin-top: .6rem; padding-top: .55rem; }
  .chapter h2 { grid-template-columns: 2.1rem minmax(0, 1fr); gap: .65rem; }
  .file {
    grid-template-columns: minmax(0, 1fr) auto 1rem;
    row-gap: .15rem;
    padding: .65rem .25rem;
  }
  .filename { grid-column: 1 / 3; grid-row: 1; }
  .file-type { grid-column: 1; grid-row: 2; }
  .size { grid-column: 2; grid-row: 2; }
  .download-icon { grid-column: 3; grid-row: 1 / 3; }
}
@media (prefers-reduced-motion: reduce) {
  .scene [data-sc-parallax] { transform: none !important; }
  .archive-edge-reveal { clip-path: none !important; }
  .archive-count, .archive-count .sc-split__i { opacity: 1 !important; transform: none !important; }
}
@media (forced-colors: active) {
  .wordmark i { background: LinkText; }
  .chapter-nav a[aria-current="location"] { border: 2px solid Highlight; }
}
