/* SPDX-License-Identifier: AGPL-3.0-only */

:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #000;
  color: #fff;
  --ink: #fff;
  --paper: #000;
  --muted: #c9c9c9;
  --san: #8bd7ff;
  --padprobe: #ff9b7b;
  --hime: #ffb4f4;
  --tend: #ffd36a;
  --eql: #8fffc1;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { min-width: 18rem; min-height: 100vh; margin: 0; background: var(--paper); color: var(--ink); }
header, main, section, article, nav, aside, footer, div { min-width: 0; }
p, li, dt, dd { overflow-wrap: break-word; }
code, pre { font-family: "Courier New", monospace; }
a { color: inherit; text-decoration-thickness: .14em; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .22em; }
a:focus-visible { outline: .25rem solid var(--ink); outline-offset: .3rem; }

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  padding: .8rem 1rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-120%);
}
.skip-link:focus { transform: translateY(0); }
.page { width: min(100%, 100rem); min-height: 100vh; margin: 0 auto; padding: clamp(1rem, 4vw, 4rem); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem 2rem;
  padding-bottom: clamp(1.25rem, 3vw, 2rem);
  border-bottom: .12rem solid var(--ink);
}
.brand { font: 900 1rem/1.2 "Courier New", monospace; letter-spacing: .15em; text-decoration: none; text-transform: uppercase; }
.nav-links { display: flex; flex-wrap: wrap; gap: .65rem 1.4rem; margin: 0; padding: 0; list-style: none; font: 700 .92rem/1.4 "Courier New", monospace; }
[aria-current="page"] { text-decoration-thickness: .25em; }

.hero, .page-hero, .project-hero {
  padding: clamp(3.5rem, 10vw, 8rem) 0 clamp(3rem, 7vw, 6rem);
  border-bottom: .2rem solid var(--ink);
}
.hero h1 { max-width: 10ch; font-size: clamp(4rem, 15vw, 12rem); line-height: .8; }
.page-hero h1, .project-hero h1, .news-article > h1 { max-width: 13ch; font-size: clamp(3.25rem, 10vw, 8rem); line-height: .86; }
h1, h2, h3 { margin: 0; }
h1 { font-weight: 900; letter-spacing: -.075em; overflow-wrap: anywhere; }
h2 { font-size: clamp(2rem, 5.5vw, 4.75rem); line-height: .98; letter-spacing: -.045em; overflow-wrap: anywhere; }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.8rem); line-height: 1.15; }
.label { margin: 0 0 1rem; font: 800 clamp(.78rem, 1.3vw, .98rem)/1.35 "Courier New", monospace; letter-spacing: .14em; text-transform: uppercase; }
.intro { max-width: 52rem; margin: clamp(1.75rem, 4vw, 3.5rem) 0 0; font-size: clamp(1.2rem, 2.6vw, 1.9rem); font-weight: 700; line-height: 1.45; }
.tagline { display: inline-block; max-width: 100%; margin: clamp(2rem, 5vw, 4rem) 0 0; padding: .8rem 1rem; background: var(--ink); color: var(--paper); font: 900 clamp(.95rem, 1.8vw, 1.2rem)/1.35 "Courier New", monospace; transform: rotate(-1deg); }

.focus, .section-intro, .approach-heading, .section-heading-row {
  display: grid;
  grid-template-columns: minmax(12rem, .65fr) minmax(0, 1.6fr);
  gap: clamp(1.5rem, 5vw, 5rem);
}
.focus, .section-intro { padding: clamp(3rem, 7vw, 6rem) 0; border-bottom: .12rem solid var(--ink); }
.focus { --accent: var(--san); }
.focus .label { color: var(--accent); }
.prose, .section-copy { max-width: 52rem; font-size: clamp(1.08rem, 2vw, 1.4rem); line-height: 1.62; }
.prose p:first-child, .section-copy { margin-top: 0; }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 1px 0 0; background: var(--ink); border-bottom: .2rem solid var(--ink); }
.project-grid--index { margin-top: clamp(2rem, 5vw, 4rem); border: .12rem solid var(--ink); }
.project-card { --accent: var(--ink); padding: clamp(1.5rem, 3.5vw, 3rem); background: var(--paper); }
.project-card--san { --accent: var(--san); grid-column: 1 / -1; }
.project-card--padprobe { --accent: var(--padprobe); }
.project-card--hime { --accent: var(--hime); }
.project-card--tend { --accent: var(--tend); }
.project-card--eql { --accent: var(--eql); }
.project-card .label, .project-card .project-kicker { color: var(--accent); }
.project-card h3 { font-size: clamp(1.8rem, 3.5vw, 3.2rem); }
.project-card p { line-height: 1.6; }
.project-kicker { font-weight: 900; }
.text-link { font-weight: 800; }

.case-study-preview, .news-preview, .approach { padding: clamp(3rem, 7vw, 6rem) 0; border-bottom: .2rem solid var(--ink); }
.section-heading-row { align-items: end; }
.section-heading-row > .action { justify-self: start; }
.case-study-home-list { margin-top: clamp(2rem, 5vw, 4rem); }
.case-study-home-list article { max-width: 72rem; padding: clamp(1.75rem, 4vw, 3rem) 0; border-block: .12rem solid var(--ink); }
.case-study-home-list h3 { max-width: 30ch; font-size: clamp(1.8rem, 4vw, 3.4rem); }
.case-study-home-list p { max-width: 58rem; line-height: 1.7; }
.news-list { margin-top: clamp(2rem, 5vw, 4rem); }
.news-list article { max-width: 64rem; padding: clamp(1.5rem, 3vw, 2.5rem) 0; border-top: .12rem solid var(--ink); }
.news-list article:last-child { border-bottom: .12rem solid var(--ink); }
.news-list h2, .news-list h3 { max-width: 24ch; }
.news-list p { max-width: 54rem; line-height: 1.65; }

.approach-heading p { max-width: 50rem; margin: 0; font-size: clamp(1.08rem, 1.8vw, 1.35rem); line-height: 1.65; }
.approach-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: clamp(2.5rem, 5vw, 4rem); border-block: .12rem solid var(--ink); }
.approach-grid > div { padding: 1.5rem; border-right: .12rem solid var(--ink); }
.approach-grid > div:first-child { padding-left: 0; }
.approach-grid > div:last-child { padding-right: 0; border-right: 0; }
.approach-grid p { margin: .75rem 0 0; line-height: 1.55; }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: .5rem; padding: 1.25rem 0; font: 700 .9rem/1.4 "Courier New", monospace; }
.project-hero { --accent: var(--ink); border-color: var(--accent); }
.project-hero--san { --accent: var(--san); }
.project-hero--padprobe { --accent: var(--padprobe); }
.project-hero--hime { --accent: var(--hime); }
.project-hero--tend { --accent: var(--tend); }
.project-hero--eql { --accent: var(--eql); }
.project-hero .label { color: var(--accent); }
.detail-layout { display: grid; grid-template-columns: minmax(14rem, .55fr) minmax(0, 1.6fr); gap: clamp(2rem, 6vw, 6rem); padding: clamp(3rem, 7vw, 6rem) 0; border-bottom: .2rem solid var(--ink); }
.detail-aside { align-self: start; padding: 1.25rem; border: .12rem solid var(--ink); }
.detail-aside p { line-height: 1.55; }
.detail-prose { max-width: 58rem; }
.detail-prose section { padding: 0 0 clamp(2.75rem, 6vw, 5rem); }
.detail-prose section + section { padding-top: clamp(2.75rem, 6vw, 5rem); border-top: .12rem solid var(--ink); }
.detail-prose p, .detail-prose li { font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.7; }
.fact-list { padding-left: 1.4rem; }
.fact-list li + li { margin-top: .8rem; }
pre { max-width: 100%; padding: 1rem; overflow-x: auto; border: .12rem solid var(--ink); font-size: clamp(.78rem, 1.7vw, .98rem); line-height: 1.6; }
.code-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }

.news-article { max-width: 66rem; margin: 0 auto; padding: clamp(3rem, 7vw, 6rem) 0; border-bottom: .2rem solid var(--ink); }
.news-article > .intro { margin-bottom: clamp(3rem, 7vw, 6rem); }
.news-article section { padding: clamp(2.5rem, 6vw, 5rem) 0; border-top: .12rem solid var(--ink); }
.news-article section p, .news-article section li { font-size: clamp(1rem, 1.7vw, 1.2rem); line-height: 1.75; }
.notice { margin: 1.75rem 0; padding: 1.25rem; border: .12rem solid var(--ink); font: 700 1rem/1.6 "Courier New", monospace; }

.case-study-list { padding: clamp(3rem, 7vw, 6rem) 0; border-bottom: .2rem solid var(--ink); }
.case-study-list > h2 { max-width: 12ch; }
.case-study-list article { max-width: 72rem; padding: clamp(2rem, 5vw, 4rem) 0; border-top: .12rem solid var(--ink); }
.case-study-list article:first-of-type { margin-top: clamp(2rem, 5vw, 4rem); }
.case-study-list article:last-child { border-bottom: .12rem solid var(--ink); }
.case-study-list h3 { max-width: 30ch; font-size: clamp(1.8rem, 4vw, 3.4rem); }
.case-study-list p { max-width: 58rem; line-height: 1.7; }

.case-study { max-width: 78rem; margin: 0 auto; padding-bottom: clamp(3rem, 7vw, 6rem); border-bottom: .2rem solid var(--ink); }
.case-study-hero { padding: clamp(3rem, 8vw, 7rem) 0 clamp(3rem, 7vw, 6rem); }
.case-study-hero > h1 { max-width: 15ch; font-size: clamp(2.8rem, 7.5vw, 6.5rem); line-height: .94; }
.case-study-deck { max-width: 58rem; margin: 1.5rem 0 0; font-size: clamp(1.08rem, 2vw, 1.4rem); line-height: 1.65; }
.personal-note { max-width: 62rem; margin-top: clamp(2.5rem, 6vw, 5rem); padding: clamp(1.25rem, 3vw, 2.25rem); border: .12rem solid var(--ink); }
.personal-note h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); letter-spacing: -.03em; }
.personal-note p { font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.7; }
.case-study > section { padding: clamp(3rem, 7vw, 6rem) 0; border-top: .12rem solid var(--ink); scroll-margin-top: 1rem; }
.case-study > section > h2 { max-width: 18ch; }
.case-study > section > p, .case-study > section > ul, .case-study > section > blockquote { max-width: 64rem; }
.case-study > section p, .case-study > section li, .case-study > section dd { font-size: clamp(1rem, 1.55vw, 1.18rem); line-height: 1.72; }
.case-study-summary { display: grid; grid-template-columns: minmax(14rem, .65fr) minmax(0, 1.5fr); gap: clamp(2rem, 6vw, 6rem); }
.case-study-summary h2 { font-size: clamp(2rem, 4.5vw, 4rem); line-height: 1; letter-spacing: -.04em; overflow-wrap: break-word; }
.case-study-summary > div:last-child p:first-child { margin-top: 0; }
.editor-letter { padding-inline: clamp(1.25rem, 4vw, 3rem) !important; border-inline: .12rem solid var(--ink); background: color-mix(in srgb, var(--paper) 88%, var(--hime)); }
.editor-letter > h2 { max-width: 14ch !important; }
.editor-signature { margin-top: 2rem; }
.editor-boundary { padding-top: 1.25rem; border-top: .12rem solid var(--ink); color: var(--muted); font: 700 .9rem/1.6 "Courier New", monospace !important; }

.contents-nav { margin: 0 0 clamp(3rem, 7vw, 6rem); padding: clamp(1.25rem, 3vw, 2rem); border: .12rem solid var(--ink); }
.contents-nav ol { columns: 2; column-gap: 3rem; margin: 0; padding-left: 1.4rem; }
.contents-nav li { break-inside: avoid; margin: .55rem 0; line-height: 1.5; }

.allocation-list, .evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: clamp(2rem, 5vw, 4rem) 0; border: .12rem solid var(--ink); }
.allocation-list > div, .evidence-grid > div { min-width: 0; padding: clamp(1.25rem, 3vw, 2rem); border-bottom: .12rem solid var(--ink); }
.allocation-list > div:nth-child(odd), .evidence-grid > div:nth-child(odd) { border-right: .12rem solid var(--ink); }
.allocation-list > div:nth-last-child(-n+2), .evidence-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
.allocation-list > div:last-child:nth-child(odd), .evidence-grid > div:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
.allocation-list dt, .evidence-grid dt { font-weight: 900; line-height: 1.35; }
.allocation-list dd, .evidence-grid dd { margin: .8rem 0 0; color: var(--muted); }
.allocation-percent, .evidence-value { display: block; margin-bottom: .4rem; color: var(--san); font: 900 clamp(1.5rem, 4vw, 3rem)/1 "Courier New", monospace; }

.case-timeline { margin: clamp(2rem, 5vw, 4rem) 0 0; padding: 0; list-style: none; border-top: .12rem solid var(--ink); }
.case-timeline > li { display: grid; grid-template-columns: minmax(11rem, .45fr) minmax(0, 1.55fr); column-gap: clamp(1.5rem, 5vw, 5rem); padding: clamp(1.75rem, 4vw, 3rem) 0; border-bottom: .12rem solid var(--ink); }
.case-timeline > li > .label { grid-row: 1 / span 3; }
.case-timeline h3 { font-size: clamp(1.3rem, 2.5vw, 2rem); }
.case-timeline p { margin: .8rem 0 0; }
.evidence-class { color: var(--muted); font: 700 .92rem/1.55 "Courier New", monospace !important; }

.evidence-boundaries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: clamp(2rem, 5vw, 4rem) 0; border-block: .12rem solid var(--ink); }
.evidence-boundaries > div { padding: 1.5rem; border-right: .12rem solid var(--ink); }
.evidence-boundaries > div:first-child { padding-left: 0; }
.evidence-boundaries > div:last-child { padding-right: 0; border-right: 0; }
.evidence-boundaries p { margin-bottom: 0; }
.resume-summary { max-width: 64rem; margin: clamp(2rem, 5vw, 4rem) 0; padding: .5rem 0 .5rem clamp(1.25rem, 3vw, 2rem); border-left: .35rem solid var(--san); }
.resume-summary p { margin: 0; font-size: clamp(1.15rem, 2.2vw, 1.55rem) !important; font-weight: 700; line-height: 1.6 !important; }

.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: clamp(2rem, 4vw, 3rem); }
.action { --accent: var(--ink); display: inline-block; max-width: 100%; padding: .9rem 1.05rem; border: .2rem solid var(--accent); color: var(--accent); font-weight: 900; }
.action--san { --accent: var(--san); }
.action--padprobe { --accent: var(--padprobe); }
.action--hime { --accent: var(--hime); }
.action--tend { --accent: var(--tend); }
.action--eql { --accent: var(--eql); }
.action:hover, .action:focus-visible { background: var(--accent); color: var(--paper); }

.site-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 3rem; padding: 2rem 0 0; font: 700 .92rem/1.55 "Courier New", monospace; }
.site-footer p { margin: 0; }
.site-footer p:last-child:nth-child(3) { grid-column: 1 / -1; padding-top: 1rem; border-top: .12rem solid var(--ink); }

.project { display: grid; grid-template-columns: minmax(12rem, .65fr) minmax(0, 1.6fr) auto; gap: clamp(1.5rem, 5vw, 5rem); padding: clamp(3rem, 7vw, 6rem) 0; }
.description { max-width: 48rem; margin: 0; font-size: clamp(1.08rem, 1.8vw, 1.35rem); line-height: 1.65; }

@media (max-width: 80rem) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-card { border-top: 1px solid var(--ink); }
  .project-card:first-child { border-top: 0; }
}

@media (max-width: 64rem) {
  .approach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .approach-grid > div:nth-child(2) { border-right: 0; }
  .approach-grid > div:nth-child(n+3) { border-top: .12rem solid var(--ink); }
  .case-study-summary { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 48rem) {
  h1 { letter-spacing: -.045em; }
  h2 { letter-spacing: -.035em; }
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .site-nav { align-items: flex-start; }
  .focus, .section-intro, .approach-heading, .section-heading-row, .detail-layout, .site-footer, .project { grid-template-columns: minmax(0, 1fr); }
  .section-heading-row > .action { margin-top: 1rem; }
  .detail-aside { position: static; }
  .approach-grid { grid-template-columns: minmax(0, 1fr); }
  .approach-grid > div, .approach-grid > div:first-child, .approach-grid > div:last-child { padding: 1.35rem 0; border-right: 0; border-top: .12rem solid var(--ink); }
  .approach-grid > div:first-child { border-top: 0; }
  .actions { align-items: stretch; flex-direction: column; }
  .action { width: 100%; }
  .tagline { transform: none; }
  .case-timeline > li { grid-template-columns: minmax(0, 1fr); }
  .case-timeline > li > .label { grid-row: auto; }
  .contents-nav ol { columns: 1; }
  .allocation-list, .evidence-grid, .evidence-boundaries { grid-template-columns: minmax(0, 1fr); }
  .allocation-list > div, .allocation-list > div:nth-child(odd), .allocation-list > div:nth-last-child(-n+2), .evidence-grid > div, .evidence-grid > div:nth-child(odd), .evidence-grid > div:nth-last-child(-n+2) { grid-column: auto; border-right: 0; border-bottom: .12rem solid var(--ink); }
  .allocation-list > div:last-child, .evidence-grid > div:last-child { border-bottom: 0; }
  .evidence-boundaries > div, .evidence-boundaries > div:first-child, .evidence-boundaries > div:last-child { padding: 1.5rem 0; border-right: 0; border-bottom: .12rem solid var(--ink); }
  .evidence-boundaries > div:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media (forced-colors: active) {
  .label, .project-kicker, .action, .allocation-percent, .evidence-value { color: LinkText; }
  .action:hover, .action:focus-visible { background: Canvas; color: LinkText; }
}

@media print {
  :root { color-scheme: light; background: #fff; color: #000; --ink: #000; --paper: #fff; --muted: #333; --san: #000; }
  body { min-width: 0; background: #fff; color: #000; font-size: 10.5pt; }
  .page { width: 100%; max-width: none; padding: 0; }
  .site-header, .site-footer { display: none; }
  .breadcrumbs { padding-top: 0; }
  .case-study { max-width: none; border: 0; }
  .case-study-hero { padding: 1.5rem 0 2rem; }
  .case-study-hero > h1 { max-width: none; font-size: 34pt; line-height: 1; }
  .case-study .intro { font-size: 16pt; }
  .case-study > section, .case-study-summary { padding: 1.5rem 0; }
  .contents-nav { display: none; }
  .personal-note, .notice, .allocation-list, .evidence-grid, .resume-summary, .editor-signature, .editor-boundary { break-inside: avoid; }
  .case-timeline > li, .evidence-boundaries > div { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
  a { color: #000; }
  .case-study a[href^="http"]::after { content: " (" attr(href) ")"; font: 8pt/1.3 "Courier New", monospace; overflow-wrap: anywhere; }
}
