/* Lab: spec-sheet home page. Builds on brutal.css (tokens, skip link, helpers). */
.spec { --soft: #f4f5f9; font-size: 1rem; }
[data-theme="dark"] .spec { --soft: #1f2129; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .spec { --soft: #1f2129; } }
.spec a { text-decoration-thickness: 1px; }
.spec .pill, .spec header a { background: var(--soft); padding: .35rem .85rem; border-radius: 3px; text-decoration: none; font-size: .875rem; }
.spec header { display: flex; justify-content: space-between; align-items: flex-start; padding: var(--gutter); gap: 1rem; }
.spec header ul { list-style: none; padding: 0; display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.spec header a:hover { background: var(--ink); color: var(--bg); }

/* Hero: headline + live instrument + profile sheet, on the registration grid */
.hero { padding-bottom: 4rem; }
.spec h1 { font: 500 clamp(2.25rem, 1.2rem + 4.6vw, 4.75rem)/1.02 var(--head); letter-spacing: 0; padding: 0 var(--gutter); max-width: 16ch; background: var(--bg); width: fit-content; }
.spec h1 span { color: var(--ink-3); }
.hero-cols { display: grid; gap: 2rem; padding: 2.5rem var(--gutter) 0; }
.scope { background: var(--bg); width: min(100%, 34rem); padding: .75rem; align-self: start; font-family: var(--mono); font-size: .75rem; }
.scope-ch { padding: .6rem 0; border-top: 1px solid var(--ink); }
.scope-ch:first-of-type { border-top: 0; padding-top: 0; }
.scope-head { display: flex; justify-content: space-between; margin-bottom: .35rem; }
.scope-head span:first-child { color: var(--ink-3); }
.scope-val { font-variant-numeric: tabular-nums; }
.scope pre { font: .75rem/1 var(--mono); margin: 0; overflow: hidden; white-space: pre; user-select: none; }
.scope-note { color: var(--ink-3); margin-top: .5rem; }
.sheet { background: var(--bg); font-size: .9375rem; line-height: 1.5; max-width: 26rem; }
.sheet section { margin-bottom: 1.5rem; }
.sheet h2, .band-label { font: 400 .875rem/1.4 var(--sans); color: var(--ink-3); }
.sheet h2 { padding-bottom: .4rem; border-bottom: 1px solid var(--ink); margin-bottom: .6rem; }
.sheet p + p { margin-top: .5rem; }
.sheet ul { list-style: none; padding: 0; }
.sheet li a { display: flex; justify-content: space-between; gap: 1rem; padding: .15rem 0; text-decoration: none; }
.sheet li a:hover span:first-child { text-decoration: underline; }
.sheet li a span:last-child { color: var(--ink-3); white-space: nowrap; }
#work li a span:first-child::before, .work-list li a span:first-child::before { content: "--> "; white-space: pre; display: inline-block; }

/* Bands: label column left, content right, hairline between */
.band { display: grid; gap: 1rem; padding: 2rem var(--gutter) 3rem; border-top: 1px solid var(--ink); }
.band-label { padding-top: .25rem; }
.band h2.big { font: 500 clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem)/1.15 var(--head); letter-spacing: 0; margin-bottom: 1.5rem; max-width: 24ch; }
.steps { list-style: none; padding: 0; display: grid; gap: 1.5rem; counter-reset: s; }
.steps li { border-top: 1px solid var(--ink); padding-top: .6rem; max-width: 26rem; }
.steps h3 { font: 500 1.125rem/1.3 var(--head); margin-bottom: .35rem; }
.steps h3::before { counter-increment: s; content: "0" counter(s); font: 400 .875rem var(--mono); color: var(--ink-3); margin-right: .75rem; }
.steps p { font-size: .9375rem; color: var(--ink-3); }
.about { display: grid; gap: 1.5rem; }
.about img { width: min(100%, 15rem); height: auto; border-radius: 3px; filter: grayscale(1) contrast(1.05); }
.about p { max-width: 58ch; }
.about p + p { margin-top: .85rem; }
.quotes { display: grid; gap: 2rem; }
.quote { border-top: 1px solid var(--ink); padding-top: .75rem; max-width: 30rem; }
.quote p + p { margin-top: .6rem; }
.quote figcaption { margin-top: 1rem; font-size: .875rem; display: grid; }
.quote figcaption span:nth-child(1) { font-weight: 600; }
.quote figcaption span:nth-child(n+2) { color: var(--ink-3); }
.clients { list-style: none; padding: 0; columns: 2; column-gap: 2rem; max-width: 26rem; }
.clients li { padding: .25rem 0; border-top: 1px solid var(--ink); break-inside: avoid; }
.spec footer { padding: 1.5rem var(--gutter) 2rem; border-top: 1px solid var(--ink); display: flex; flex-wrap: wrap; gap: .75rem 2rem; justify-content: space-between; font-size: .875rem; }
.spec footer ul { list-style: none; padding: 0; display: flex; gap: 1.25rem; }

@media (min-width: 44rem) {
  .hero-cols { grid-template-columns: minmax(0, 1fr) 26rem; align-items: start; }
  .band { grid-template-columns: 11rem 1fr; gap: 2rem; }
  .steps { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 2rem; max-width: 52rem; }
  .steps li { max-width: none; }
  .about { grid-template-columns: 15rem 1fr; gap: 2rem; }
  .quotes { grid-template-columns: repeat(2, 1fr); max-width: 52rem; gap: 2rem; }
}
@media (min-width: 60rem) { .steps { grid-template-columns: repeat(4, 1fr); max-width: none; } }

.no-js .scope { display: none; }
/* Settings: ASCII-style bracket buttons, e.g. [ pause animations ] */
.settings ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1.5rem; }
.setting { font: .8125rem/1.4 var(--mono); background: none; border: 0; padding: .1rem 0; cursor: pointer; color: var(--ink); }
.setting::before { content: "[ "; content: "[ " / ""; color: var(--ink-3); }
.setting::after { content: " ]"; content: " ]" / ""; color: var(--ink-3); }
.setting:hover { text-decoration: underline; text-underline-offset: 3px; }
.setting:hover::before, .setting:hover::after { color: var(--ink); }
.setting:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.no-js .settings { display: none; }
.spec header a { padding: .6rem 1rem; }
.spec footer a { display: inline-block; padding: .5rem 0; }
.sheet li a { padding: .35rem 0; }

/* Everything in the sheet column */
.sheet { max-width: 28rem; }
.mini-steps { list-style: none; padding: 0; counter-reset: m; }
.mini-steps li { padding: .5rem 0; border-bottom: 1px solid var(--soft); color: var(--ink-3); }
.mini-steps strong { display: block; color: var(--ink); font: 500 1rem/1.3 var(--head); }
.mini-steps strong::before { counter-increment: m; content: "0" counter(m); font: 400 .8125rem var(--mono); color: var(--ink-3); margin-right: .6rem; }
.portrait { width: 9rem; height: auto; border-radius: 3px; filter: grayscale(1) contrast(1.05); margin-bottom: .75rem; }
.sheet .quote { border-top: 0; padding-top: 0; margin-bottom: 1.25rem; max-width: none; }
.sheet .quote p { color: var(--ink); }
.sheet .quote figcaption { margin-top: .6rem; }
.hero { padding-bottom: 2rem; }

.sheet .clients { max-width: none; }
.sheet .clients li { padding: .35rem 0; }
.sheet .clients li { border-top: 0; padding: .15rem 0; }
.sheet .clients { column-gap: 1.5rem; }

.pin { display: grid; gap: 2rem; align-self: start; }
.hero-cols { padding-top: 0; }
.pin h1 { padding: 0; }
@media (min-width: 44rem) and (min-height: 44rem) {
  .pin { position: sticky; top: var(--gutter); }
}

.hero-cols { padding-top: var(--gutter); }

.contacts ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.contacts li { color: var(--ink-3); }
.contacts li a { color: var(--ink); display: inline-block; padding: .25rem 0; }
.pin { gap: 2rem; }

.contacts ul { flex-direction: column; gap: 0; }
.contacts li a { overflow-wrap: anywhere; }

/* Project preview in the pinned column (hover or focus a project) */
.preview { display: none; margin: 0; background: var(--bg); width: min(100%, 34rem); padding: 0 .75rem .75rem; }
.preview img { display: block; width: 100%; height: 12rem; object-fit: contain; background: var(--soft); border-radius: 3px; }
.preview-cap { margin-top: .4rem; font: .75rem/1.4 var(--mono); color: var(--ink-3); }
@media (min-width: 44rem) and (min-height: 52rem) { .preview { display: block; } }

/* How I work: label / value rows, no rules */
.how { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem 1rem; margin: 0; }
.how dt { font: 500 1rem/1.3 var(--head); }
.how dt span { display: block; font: 400 .75rem/1.6 var(--mono); color: var(--ink-3); }
.how dd { margin: 0; color: var(--ink-3); font-size: .9375rem; padding-top: .1rem; }

/* Testimonials: first paragraph is the pull quote, the rest is smaller and grey */
.sheet .quote { margin: 0 0 2rem; }
.sheet .quote blockquote { margin: 0; }
.sheet .quote blockquote p:first-child { font: 500 1.1875rem/1.4 var(--head); letter-spacing: 0; color: var(--ink); }
.sheet .quote blockquote p + p { font-size: .9375rem; color: var(--ink-3); margin-top: .75rem; }
.sheet .quote figcaption { margin-top: 1rem; display: grid; font: .75rem/1.6 var(--mono); }
.sheet .quote figcaption span { color: var(--ink-3); font-weight: 400; }
.sheet .quote figcaption .who { color: var(--ink); font: 500 .9375rem/1.4 var(--sans); margin-bottom: .1rem; }
.sheet .quote figcaption .who::before { content: "— "; color: var(--ink-3); }
.sheet .quote:last-of-type { margin-bottom: 0; }

/* Big left column: no headline, instrument + preview fill the pinned height */
.scope, .preview { width: min(100%, 48rem); }
.scope pre { font-size: .8125rem; line-height: 1.05; }
.scope { font-size: .8125rem; }
.preview { padding-bottom: .75rem; }
@media (min-width: 44rem) and (min-height: 50rem) {
  .pin { height: calc(100vh - 2 * var(--gutter)); display: flex; flex-direction: column; gap: 1rem; }
  .scope { flex: none; }
  .preview { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .preview img { flex: 1; min-height: 0; height: auto; }
}

/* Compact right column so it fits a laptop window without scrolling */
.sheet { font-size: .875rem; line-height: 1.4; max-width: 36rem; }
.sheet section { margin-bottom: 1.1rem; }
.sheet h2 { font-size: .8125rem; padding-bottom: .3rem; margin-bottom: .4rem; }
.sheet li a { padding: .2rem 0; }
.sheet p + p { margin-top: .4rem; }
.sheet .clients li { padding: .1rem 0; }
.contacts li a { padding: .1rem 0; }
.hero { padding-bottom: 0; }
.hero-cols { padding-bottom: var(--gutter); }
@media (min-width: 44rem) { .hero-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 36rem); } }

/* Desktop: the left column is exactly one viewport tall and pinned; the right column scrolls with the page. */
@media (min-width: 44rem) {
  .hero, .hero-cols { height: auto; }
  .hero-cols { padding: 0 var(--gutter); align-items: start; }
  .pin { position: sticky; top: 0; height: 100vh; height: 100dvh; box-sizing: border-box; padding: var(--gutter) 0; min-height: 0; display: flex; flex-direction: column; gap: 1rem; overflow: hidden; }
  .sheet { padding: var(--gutter) 0; }
}

/* ASCII screen: replaces the scope + image preview. Fills the pinned column on desktop. */
.ascii { margin: 0; width: min(100%, 48rem); padding: .75rem; background: var(--bg); display: flex; flex-direction: column; gap: .5rem; font: .8125rem/1.4 var(--mono); }
.ascii pre { font: .75rem/1.1 var(--mono); margin: 0; height: 22rem; overflow: hidden; white-space: pre; user-select: none; }
.ascii .scope-note { margin: 0; }
.ascii-cap { color: var(--ink); }
/* Clicking the screen sends a ripple through it (spec.js); the hint sits right of the caption */
.ascii pre { cursor: crosshair; }
.ascii .scope-note { display: flex; justify-content: space-between; gap: 1rem; }
.ascii-hint { color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .ascii-hint { display: none; } .ascii pre { cursor: auto; } }
.no-js .ascii { display: none; }
@media (min-width: 44rem) {
  .ascii { flex: 1; min-height: 0; }
  .ascii pre { flex: 1; min-height: 0; height: auto; }
}

/* ASCII screen fills the whole left column; tighter gutter to the sheet */
.ascii { width: 100%; padding-right: 0; }
@media (min-width: 44rem) { .hero-cols { column-gap: 1.5rem; } }

/* ---- Case study pages (lab/work/*.html) ----------------------------------
   Same two columns as the home page: the pinned ASCII screen shows this project's
   scene, the sheet on the right is the write-up. Wider, larger text for reading. */
@media (min-width: 44rem) { .case .hero-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 36rem); } }
.case .sheet { font-size: .9375rem; line-height: 1.55; max-width: 36rem; }
.case .sheet section { margin-bottom: 2rem; }
.case .sheet h2 { margin-bottom: .75rem; }
.case .sheet p + p { margin-top: .65rem; }
.case .sheet p + ul, .case .sheet ul + p { margin-top: .5rem; }
/* Back link: same box as the home page's first h2 ("Profile") so text and rule don't shift between pages.
   The link's extra hit area is cancelled by a negative margin so it doesn't push the line down. */
.crumb { font: 400 .8125rem/1.4 var(--sans); padding-bottom: .3rem; border-bottom: 1px solid var(--ink); margin-bottom: .75rem; }
.crumb a { display: inline-block; padding-top: .25rem; margin-top: -.25rem; text-decoration: none; color: var(--ink-3); }
.crumb a:hover { color: var(--ink); text-decoration: underline; }
.spec .case-head { display: block; padding: 0; margin-bottom: 2rem; }
.case h1 { font: 600 1em/1.4 var(--sans); letter-spacing: 0; max-width: none; padding: 0; width: auto; }
.case .lead { margin-top: .15rem; color: var(--ink-3); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1.5rem; margin-top: 1.25rem; padding-top: .6rem; border-top: 1px solid var(--ink); font: 1em/1.5 var(--mono); }
.facts div { display: grid; align-content: start; }
.facts dt { color: var(--ink-3); font-size: .8125rem; }
.facts dd { margin: 0; color: var(--ink); }
@media (min-width: 44rem) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.walkthrough { margin-bottom: 2rem; }

/* Body lists: plain dashes, not the sheet's bare lists */
.case .sheet section:not(.contacts):not(.settings) > ul:not(.work-list):not(.legend) li { padding-left: 1.1rem; position: relative; }
.case .sheet section:not(.contacts):not(.settings) > ul:not(.work-list):not(.legend) li::before { content: "–"; position: absolute; left: 0; color: var(--ink-3); }
.case .sheet section:not(.contacts):not(.settings) > ul:not(.work-list):not(.legend) li + li { margin-top: .2rem; }

/* Key design decisions: unnumbered, separated by space */
.decisions { list-style: none; padding: 0; }
.decisions > li { padding: .9rem 0; }
.decisions > li:first-child { padding-top: 0; }
.decisions h3 { font: 600 .875rem/1.4 var(--sans); margin-bottom: .3rem; }
.decisions p { color: var(--ink); }

/* Heatmap legend (project 2): the real UI colours, kept small */
.legend { list-style: none; padding: 0; display: grid; gap: .35rem; margin: .65rem 0; color: var(--ink-3); }
.legend li { display: flex; align-items: center; gap: .65rem; }
.swatch { flex: none; width: 1.75rem; height: .75rem; border-radius: 2px; }
.swatch--empty { background: #e4e6ee; }
.swatch--blue { background: linear-gradient(90deg, #d4dcfc, #4f6bed); }
.swatch--severity { background: linear-gradient(90deg, #f0a33a 50%, #e5484d 50%); }
.swatch--marker { background: var(--soft); position: relative; }
.swatch--marker::after { content: ""; position: absolute; top: 50%; left: 50%; width: .45rem; height: .45rem; margin: -.225rem 0 0 -.225rem; border-radius: 50%; background: #e5484d; }

/* More work: same rows as Selected work on the home page */
.case .work-list li a { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; text-decoration: none; }
.case .contacts ul { font-size: .875rem; }

/* Clients & employers: plain names that link out; hover plays the logo on the ASCII screen */
.sheet .clients li a { display: inline; padding: 0; }
.sheet .clients li a:hover { text-decoration: underline; }
