/* Durendal: one stylesheet, no build step. */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2");
  font-weight: 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Pirata One";
  src: url("assets/fonts/pirata-one-wordmark.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
/* Georgia shrunk to Cormorant's proportions, so the swap barely moves the page. */
@font-face { font-family: "Durendal Fallback"; src: local("Georgia"); size-adjust: 84%; }

:root {
  --parch: #F2EEE5;
  --ink: #151613;
  --ox: #7A302C;
  --steel: #969C9C;
  --stone: #C6BFB2;

  --bg: var(--parch);
  --fg: var(--ink);
  --muted: #55564F;
  --rule: rgba(21, 22, 19, .22);
  --accent: var(--ox);
  --focus: var(--ox);

  --serif: "Cormorant Garamond", "Durendal Fallback", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --space: clamp(3.5rem, 7vw, 6.5rem);
  --px: 2; /* how many CSS pixels one dithered pixel covers */
  --dot: 2; /* the live hero and footer landscapes, at every width: CSS pixels per dot (script.js reads it) */
}
@media (max-width: 559px) { :root { --px: 1; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 4rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg); color: var(--fg);
  font: 400 1rem/1.6 var(--sans);
  -webkit-tap-highlight-color: transparent;
  /* The footer sits at the foot of the window on pages shorter than it: main takes the spare height. */
  display: flex; flex-direction: column; min-height: 100svh;
}
/* ...and main's last section stretches into it, so the space carries that section's colour, not a blank band. */
main { flex: 1 0 auto; display: flex; flex-direction: column; }
main > :last-child { flex: 1 0 auto; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--ox); color: var(--parch); }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; text-wrap: balance; }
h1 { font-size: clamp(4.5rem, 11vw, 9.5rem); line-height: .82; letter-spacing: -.035em; }
h2 { font-size: clamp(2.25rem, 4.2vw, 3.75rem); line-height: .95; letter-spacing: -.025em; }
h3 { font-size: clamp(1.5rem, 2vw, 1.875rem); line-height: 1.05; letter-spacing: -.01em; }
h2 em, .mock em { font-style: italic; }
p { text-wrap: pretty; }

.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter); }
.mono, .label { font: 400 .75rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.label { display: flex; align-items: center; gap: .9rem; color: var(--muted); }
.label::before { content: ""; width: 2.25rem; height: 1px; background: var(--accent); }
.lede { font-size: clamp(1.125rem, 1.5vw, 1.25rem); line-height: 1.5; max-width: 34ch; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; left: var(--gutter); top: -4rem; z-index: 10; padding: .75rem 1rem; background: var(--ink); color: var(--parch); }
.skip:focus { top: 1rem; }

/* Dithered images are stored small and enlarged by a whole number, so every dot stays square. */
.px { width: calc(var(--w) * var(--px) * 1px); max-width: none; image-rendering: pixelated; }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; min-height: 3.25rem; padding: .5rem 1.6rem;
  border: 1px solid var(--fg); border-radius: 0; background: var(--fg); color: var(--bg);
  font: 500 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  position: relative; isolation: isolate; transition: border-color .3s, color .25s;
}
/* Hover: the new colour is cut across the button on a diagonal, like a blade stroke. */
.btn::before, .bar__cta::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; background: var(--wipe, var(--ox));
  clip-path: polygon(0 0, 0 0, -35% 100%, 0 100%); transition: clip-path .38s cubic-bezier(.2, .7, .2, 1);
}
:is(.btn, .bar__cta):is(:hover, :focus-visible, :active)::before { clip-path: polygon(0 0, 135% 0, 100% 100%, 0 100%); }
.btn:is(:hover, :focus-visible, :active) { border-color: var(--wipe, var(--ox)); color: var(--parch); }
.btn[aria-disabled="true"] { opacity: .6; cursor: progress; }

.arrow-link { display: inline-block; padding-block: .6rem; font-weight: 500; text-decoration: underline; text-decoration-color: var(--rule); transition: color .18s, text-decoration-color .18s; }
.arrow-link::after { content: "\2192"; display: inline-block; margin-left: .5em; transition: transform .18s; }
.arrow-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.arrow-link:hover::after { transform: translateX(.25em); }

/* ---------- Header: one slim bar that stays at the top of the page ---------- */
.site-header { position: sticky; top: 0; z-index: 5; background: var(--ink); color: var(--parch); border-bottom: 1px solid rgba(242, 238, 229, .24); --focus: var(--parch); }
.bar { display: flex; align-items: center; gap: 1rem clamp(1rem, 2.5vw, 2rem); height: 3.5rem; }
/* The mark: Pirata One, lowercase, then Roland's sword planted point down, a word space away so it reads as an emblem,
   not a "t". The sword stands ~.05em above the ascender (.77em) and ~.06em below the baseline, in the link's colour. */
.wordmark { display: inline-flex; align-items: center; font: 400 1.75rem/1 "Pirata One", var(--serif); letter-spacing: .01em; text-transform: lowercase; text-decoration: none; }
.sword { width: .294em; height: .882em; margin-left: .4em; vertical-align: -.0588em; fill: currentColor; } /* 10 x 30 grid at 34px */
.sword__sm { display: none; }
/* Bar: 34px type (ink 26px). Whole-pixel sword grids: 10 x 30 here, 9 x 26 at the 29px phone size.
   The ink box (ascender top to baseline) is centred in the full-height link: line-height 1 alone leaves it .02em high,
   so the top padding moves it down onto whole pixels (2px pad = 1px down: baseline 41, ink gaps 14.7 / 15). */
.bar__mark { align-self: stretch; padding-top: 2px; font-size: 2.125rem; }
.bar__mark .sword { width: 10px; height: 30px; margin-left: 14px; vertical-align: -2px; }
.bar nav { min-width: 0; margin-left: auto; }
.nav { display: flex; gap: clamp(1rem, 2.5vw, 2.25rem); overflow-x: auto; scrollbar-width: none; font-size: 1rem; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: inline-flex; align-items: center; height: 3.5rem; color: var(--stone); text-decoration: none; white-space: nowrap; }
/* Hover: the word rolls up and a brighter copy takes its place. The copy is decoration, hidden from screen readers. */
.roll { display: block; height: 1.4em; line-height: 1.4; overflow: hidden; }
.roll span { display: block; transition: transform .34s cubic-bezier(.2, .7, .2, 1); }
.roll span::after { content: attr(data-t); content: attr(data-t) / ""; display: block; color: var(--parch); }
:is(.nav, .menu) a:is(:hover, :focus-visible) .roll span { transform: translateY(-50%); }
.nav a[aria-current] { color: var(--parch); }
.nav a[aria-current] { box-shadow: inset 0 -2px 0 var(--parch); }
.bar__cta {
  flex: none; display: inline-flex; align-items: center; height: 2.25rem; padding-inline: 1rem;
  position: relative; isolation: isolate; border: 1px solid var(--parch); color: var(--parch);
  font-size: 1rem; font-weight: 500; text-decoration: none; transition: border-color .3s, color .25s;
}
.bar__cta:is(:hover, :focus-visible, :active) { border-color: var(--ox); color: var(--parch); }
/* Touch screens: the visible box stays the site's 36px; the tap area reaches 46px, inside the 56px bar. */
@media (pointer: coarse) { .bar__cta::after { content: ""; position: absolute; inset: -5px -1px; } }
/* Phones. The script adds .js-menu to <html>: the name, the button and a Menu control share one row, and the links
   drop in a panel. Without script the Menu control could not work, so the bar keeps its sideways-scrolling links. */
.menu-toggle { display: none; }
@media (max-width: 639px) {
  html:not(.js-menu) .bar__mark { display: none; }
  html:not(.js-menu) .bar nav { margin-left: 0; flex: 1; }
  .js-menu .bar { gap: .75rem; }
  .js-menu .bar nav { display: none; }
  .js-menu .bar__mark { flex: none; align-self: stretch; margin-right: auto; white-space: nowrap; padding-top: 1px; font-size: 1.8125rem; } /* 29px: 1px pad = .5px down, baseline 39 */
  .bar__mark .sword { width: 9px; height: 26px; margin-left: 12px; }
  .bar__mark .sword__lg { display: none; }
  .bar__mark .sword__sm { display: inline; }
  /* The hero has its own Start a project button: while it is on screen the bar's steps aside (script.js). */
  .bar__cta { white-space: nowrap; transition: border-color .3s, color .25s, opacity .3s cubic-bezier(.2, .7, .2, 1), visibility .3s; }
  .is-hero-cta .bar__cta { opacity: 0; visibility: hidden; }
  .js-menu .menu-toggle {
    flex: none; display: inline-flex; align-items: center; justify-content: flex-end; gap: .5rem; min-width: 3.75rem; height: 3.5rem; margin: 0; padding: 0 .25rem;
    border: 0; background: none; color: var(--parch); cursor: pointer; touch-action: manipulation;
    font: 400 .75rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  }
  .menu-toggle::before { content: ""; width: 1px; height: 1.25rem; margin-right: .75rem; background: rgba(242, 238, 229, .24); }
  .menu {
    position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100svh - 3.5rem); overflow-y: auto; overscroll-behavior: contain;
    background: var(--ink); border-bottom: 1px solid rgba(242, 238, 229, .24); padding: .5rem var(--gutter) 1.75rem;
  }
  .menu li + li { border-top: 1px solid rgba(242, 238, 229, .24); }
  .menu ol a { display: flex; align-items: baseline; gap: 1rem; min-height: 4.25rem; padding-block: .9rem .6rem; color: var(--stone); text-decoration: none; }
  .menu ol .mono { flex: none; width: 1.5rem; }
  .menu .roll { font: 500 2.25rem/1.4 var(--serif); letter-spacing: -.02em; }
  .menu a[aria-current] { color: var(--parch); }
  .menu .btn { margin-top: 1.25rem; width: 100%; justify-content: center; --fg: var(--parch); --bg: var(--ink); }
  /* The page behind dims and holds still while the menu is open. */
  .scrim { position: fixed; inset: 0; z-index: 4; background: rgba(21, 22, 19, .55); }
  html.is-locked { overflow: hidden; }
}
@media (max-width: 389px) { .js-menu .bar__cta { display: none; } }
@media (prefers-reduced-motion: no-preference) {
  .menu:not([hidden]) { animation: drop .22s cubic-bezier(.2, .7, .2, 1); }
  .scrim:not([hidden]) { animation: fade .22s cubic-bezier(.2, .7, .2, 1); }
  @keyframes drop { from { opacity: 0; transform: translateY(-.5rem); } }
  @keyframes fade { from { opacity: 0; } }
}

/* ---------- Hero ---------- */
/* The hero is never taller than 60% of the window's width, and the picture's box never wider than the picture is at that
   height (its frame is 900 x 509, so 1.768 wide for 1 high). Together they pin where the picture sits against the words at
   every desktop width: it always fits by height, so the place where its ink thins to nothing always falls just right of
   the text. That thinning is in the picture's own tone (dot by dot, no transparency), so the box needs no mask. */
.hero { --hero-h: clamp(38rem, min(92svh, 60vw), 52rem); position: relative; display: flex; flex-direction: column; min-height: var(--hero-h); overflow: hidden; }
.hero__art { position: absolute; inset: 0 0 0 auto; width: min(100%, calc(var(--hero-h) * 1.768)); overflow: hidden; }
/* One-bit dither. The image is the still version; the canvas is the same picture redrawn live, and hides the image once it runs. */
.hero__art img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: right center; image-rendering: pixelated; }
.hero__art canvas { position: absolute; right: 0; top: 0; image-rendering: pixelated; }
.hero__art.is-live img { opacity: 0; }
.hero__text { position: relative; margin-block: auto; padding-block: clamp(3rem, 6vw, 5rem) 4rem; }
.hero__text .lede { margin-top: clamp(1.75rem, 3vw, 2.75rem); }
.hero__foot { margin-top: clamp(2.5rem, 5vw, 4rem); color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; margin-top: 2.25rem; }

@media (max-width: 1023px) {
  .hero { min-height: 0; }
  /* Under the words: a square, never wider than 32rem and kept to the right edge, so the scene still runs off the side
     and the foot of the screen as it does on a desktop. It shows the picture's right-hand square. */
  .hero__art { position: relative; order: 2; inset: auto; width: min(100%, 32rem); height: auto; margin-left: auto; aspect-ratio: 1 / 1; }
  .hero__text { padding-block: 2rem 1rem; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--space); }
.section--tint { --bg: #E4DFD4; background: var(--bg); }
.section--dark {
  --bg: var(--ink); --fg: var(--parch); --muted: var(--stone); --rule: rgba(242, 238, 229, .24); --accent: var(--stone); --focus: var(--parch);
  background: var(--bg); color: var(--fg);
}

.section-head { display: grid; gap: 1.25rem; margin-bottom: clamp(2.25rem, 4vw, 3.5rem); }
.section-head__note { max-width: 40ch; color: var(--muted); }
@media (min-width: 900px) {
  .section-head { grid-template-columns: repeat(12, 1fr); column-gap: 2rem; align-items: end; }
  .section-head .label { grid-column: 1 / -1; }
  .section-head h2 { grid-column: 1 / 9; }
  .section-head__note { grid-column: 9 / -1; padding-bottom: .6rem; }
}

/* ---------- Plates (image blocks) ---------- */
.plate { position: relative; overflow: hidden; background: var(--plate, var(--stone)); }
.plate > img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.plate--stone { --plate: var(--stone); }
.plate--steel { --plate: var(--steel); }
.plate--oxblood { --plate: var(--ox); }
.plate--ink { --plate: var(--ink); }
.plate--portrait { aspect-ratio: 4 / 5; }

/* A small screen set into each plate, at a slight tilt, showing a fragment of the concept. */
.mock {
  position: relative; z-index: 1; overflow: hidden; border: 6px solid var(--ink); padding: 9% 8% 0;
  font-size: clamp(.5625rem, 3.3cqw, .875rem); line-height: 1.4;
}
.mock--paper { background: var(--parch); color: var(--ink); --rule: rgba(21, 22, 19, .22); }
.mock--ink { background: var(--ink); color: var(--parch); --rule: rgba(242, 238, 229, .24); border-color: var(--parch); }
.mock .mono { font-size: .72em; opacity: .8; }
.mock__title { margin-block: .35em .6em; font: 500 2em/1 var(--serif); }
.mock dl div { display: flex; justify-content: space-between; gap: 1em; padding-block: .45em; border-top: 1px solid var(--rule); }
.mock__quote { padding-top: .6em; border-top: 1px solid var(--rule); font: italic 500 1.35em/1.3 var(--serif); }

/* The section head of Selected work: the label is the heading, and the disclosure sits under it. */
/* The note runs on one line where there is room, and breaks evenly where there is not. */
.section-head--label { gap: .9rem; margin-bottom: clamp(1.5rem, 2.5vw, 2rem); }
.section-head--label .section-head__note { max-width: none; text-wrap: balance; }
@media (min-width: 900px) { .section-head--label .section-head__note { grid-column: 1 / -1; padding-bottom: 0; } }
#work { padding-block: clamp(3rem, 5vw, 4.5rem); }

/* ---------- Work: a grid of cards. Plate, then the title, then the tag, both centred.
   The title is the card's one link, stretched over the whole card; it leads to the project's page. ---------- */
.works { display: grid; gap: 2.25rem 1.5rem; }
.work { position: relative; display: grid; gap: .75rem; align-content: start; justify-items: center; text-align: center; }
.work h3 { font-size: 1.5rem; line-height: 1.1; }
.work__link { text-decoration: none; }
.work .plate { text-align: left; } /* the mock screens keep their own alignment */
.work__link::after { content: ""; position: absolute; inset: 0; }
.work__link:focus-visible { outline: none; }
.work__link:focus-visible::after { outline: 2px solid var(--focus); outline-offset: 4px; }
.work:hover .work__link { text-decoration: underline; }
/* Card and project plates: 4:5, a mock centred in it; a photograph fills it, flush. */
:is(.work, .project__body) .plate { width: 100%; aspect-ratio: 4 / 5; display: grid; place-items: center; container-type: inline-size; }
.plate--photo > img { width: 100%; height: 100%; object-fit: cover; }
.work__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .6rem; color: var(--muted); }
.tag { display: inline-block; padding: .2rem .5rem; border: 1px solid currentColor; color: var(--accent); }
.brief { display: grid; gap: .9rem; padding-bottom: .5rem; }
.brief div { display: grid; gap: .2rem; padding-top: .9rem; border-top: 1px solid var(--rule); }
.brief dt { font: 400 .75rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@media (min-width: 640px) { .works { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .works { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* The plate's layers sit above the title's stretched link: let every click and hover on the plate reach it. */
.work .plate, .work .plate * { pointer-events: none; }
/* Hover and focus: the plate is cut on a diagonal and the halves part, showing "View project" on oxblood. The upper
   half is the photo itself, the lower a copy of it (--shot, set on each card); the cut rises 16.7deg, the 4:5 plate's
   24% fall. In full colour at rest. Touch screens never hover; with reduced motion only the title's underline shows. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .work .plate { --plate: var(--ox); isolation: isolate; }
  .work .plate > img, .work .plate::before { z-index: 1; transition: translate .35s cubic-bezier(.2, .7, .2, 1); }
  .work .plate > img { clip-path: polygon(0 0, 100% 0, 100% 38%, 0 62%); }
  .work .plate::before {
    content: ""; position: absolute; inset: 0; background: var(--shot) center / cover;
    clip-path: polygon(0 calc(62% - 1px), 100% calc(38% - 1px), 100% 100%, 0 100%);
  }
  .work .plate::after {
    content: "View project \2192"; content: "View project \2192" / "";
    position: absolute; inset: 50% auto auto 50%; z-index: 0; translate: -50% -50%; rotate: -16.7deg;
    color: var(--parch); font: 400 .75rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  }
  .work:is(:hover, :focus-within) .plate > img { translate: 0 -1rem; transition-duration: .5s; }
  .work:is(:hover, :focus-within) .plate::before { translate: 0 1rem; transition-duration: .5s; }
  @supports (animation-timeline: view()) {
    .work .plate::before { animation: arrive linear both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
  }
}

/* ---------- Project pages: back link, title block, the plate, the ruled brief below it, then the next project ---------- */
.project__back { display: inline-flex; gap: .6rem; margin-bottom: clamp(2rem, 4vw, 3rem); padding-block: .5rem; color: var(--muted); text-decoration: none; }
.project__back::before { content: "\2190"; }
.project__back:hover { color: var(--fg); }
/* A page that is only its title block (the 404 page): centred in the height the footer rule gives it. */
.project--lone { display: flex; flex-direction: column; justify-content: center; }
.project__head { display: grid; gap: .6rem; justify-items: start; margin-bottom: clamp(2rem, 4vw, 3rem); }
.project__head .work__meta { margin-top: .65rem; }
.project__title { max-width: 22ch; font-size: clamp(2.25rem, 4.5vw, 3.75rem); line-height: .98; letter-spacing: -.025em; }
.project__body { display: grid; gap: 2rem; }
.brief--spec { padding-bottom: 0; }
.brief__note dd { color: var(--muted); }
.brief__links { display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; }
.brief__links a { padding-block: .35rem; }
.brief__links a::after { content: "\00a0\2192"; }
/* A live prototype in a plain phone: ink bezel, rounded device and screen, centred on a parchment plate. */
.project__body .plate--device { aspect-ratio: auto; gap: 1rem; padding: clamp(1.25rem, 4vw, 3rem) clamp(.75rem, 3vw, 3rem); background: var(--parch); box-shadow: inset 0 0 0 1px var(--stone); --muted: #55564F; --focus: var(--ox); }
.device { --bz: 10px; width: min(100%, calc(min(78svh, 760px) * 393 / 852 + 2 * var(--bz))); padding: var(--bz); border-radius: 46px; background: var(--ink); }
.device iframe { display: block; width: 100%; height: auto; aspect-ratio: 393 / 852; border: 0; border-radius: calc(46px - var(--bz)); background: var(--ink); transition: opacity .7s cubic-bezier(.25, .1, .25, 1); }
/* The screen wakes from dark once the app's scene is drawn */
.device iframe.is-loading { opacity: 0; transition: none; }
/* The bezel overlaps the screen's rounded edge by a pixel, so no light fringe shows where the corner is antialiased. */
.device iframe { outline: 2px solid var(--ink); outline-offset: -1px; }
.is-desk .device iframe { outline: 0; }
@media (prefers-reduced-motion: reduce) { .device iframe { transition: none; } }
.device__cap { color: var(--muted); font-size: .875rem; }
@media (max-width: 559px) { .device { --bz: 6px; border-radius: 38px; } .device iframe { border-radius: calc(38px - var(--bz)); } }
/* With script the framed page is always laid out as a real phone, 390 x 844, and scaled to the bezel (--ds), so a small
   frame shows the same phone layout smaller and never a cramped one that pans sideways. */
.device.is-fit { position: relative; }
.device.is-fit::before { content: ""; display: block; aspect-ratio: 390 / 844; }
.device.is-fit iframe {
  position: absolute; top: var(--bz); left: var(--bz); width: 390px; height: 844px; aspect-ratio: auto;
  transform: scale(var(--ds, 1)); transform-origin: 0 0;
  border-radius: calc((46px - var(--bz)) / var(--ds, 1)); outline-width: calc(2px / var(--ds, 1)); outline-offset: calc(-1px / var(--ds, 1));
}
@media (max-width: 559px) { .device.is-fit iframe { border-radius: calc((38px - var(--bz)) / var(--ds, 1)); } }
@media (min-width: 560px) { .brief--spec div { grid-template-columns: 6.5rem minmax(0, 1fr); column-gap: 1.25rem; align-items: baseline; } .brief--spec { max-width: 40rem; } }
/* Under the plate the brief keeps a reading measure: one column, then two from 1100px. */
@media (min-width: 1100px) {
  .brief--spec { display: block; max-width: none; columns: 2; column-gap: clamp(2.5rem, 4vw, 3.5rem); }
  .brief--spec div { break-inside: avoid; margin-bottom: .9rem; }
}
/* Websites (script.js): the live site in a plain desktop window, laid out at 1280 x 800 and scaled to fit, with a
   Desktop / Phone switch in its bar. With under 680px of room, or without script, the phone plate above stays. */
.view__screen { position: relative; justify-self: stretch; display: grid; justify-items: center; }
.plate--device.is-framed { padding: 0; gap: 0; place-items: stretch; background: none; box-shadow: none; --muted: var(--stone); --focus: var(--parch); }
.view__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-left: 1rem; border: 1px solid var(--rule); }
.view__bar .mono { color: var(--muted); }
.view__switch { display: flex; }
.view__switch button {
  min-height: 2.75rem; padding: 0 1.25rem; border: 0; border-left: 1px solid var(--rule); background: none; color: var(--muted); cursor: pointer;
  font: 400 .75rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.view__switch button:hover, .view__switch [aria-pressed="true"] { color: var(--fg); }
.view__switch [aria-pressed="true"] { box-shadow: inset 0 -2px 0 var(--fg); }
.view__switch button:focus-visible { outline-offset: -5px; }
.is-framed .view__screen { padding: clamp(1.25rem, 4vw, 3rem) clamp(.75rem, 3vw, 3rem); border: 1px solid var(--rule); border-top: 0; background: var(--parch); --focus: var(--ox); }
.is-framed .device__cap { padding-top: 1rem; }
.is-desk .view__screen { padding: 0; background: var(--ink); --focus: var(--parch); }
.is-desk .device { position: relative; width: 100%; aspect-ratio: 16 / 10; padding: 0; border-radius: 0; overflow: clip; }
.is-desk iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; aspect-ratio: auto; border-radius: 0; transform: scale(var(--s)); transform-origin: 0 0; }
/* Waking gives the site a layer of its own: Chromium otherwise keeps sending wheels over a scaled frame to the page. */
.is-live iframe { will-change: transform; }
/* Asleep, the page scrolls straight past the window; Explore the site (or a click on it) wakes it. */
.is-desk:not(.is-live) .device { cursor: pointer; }
.view__bar[hidden], .view__go[hidden] { display: none; }
.view__go { position: absolute; z-index: 1; bottom: 1.5rem; left: 50%; translate: -50% 0; border-color: var(--parch); --fg: var(--ink); --bg: var(--parch); }
/* From the brand board: palette chips, the mark, a line of voice. */
.board { display: grid; margin-top: clamp(2rem, 4vw, 2.5rem); border-block: 1px solid var(--rule); }
.board__cell { display: grid; gap: 1rem; align-content: start; padding-block: 1.25rem 1.5rem; }
.board__cell + .board__cell { border-top: 1px solid var(--rule); }
.board__k { color: var(--muted); }
.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.chips li { display: grid; gap: .15rem; font-size: .875rem; line-height: 1.3; }
.chips li::before { content: ""; aspect-ratio: 4 / 3; margin-bottom: .5rem; background: var(--chip); box-shadow: inset 0 0 0 1px var(--rule); }
.chips .mono { color: var(--muted); }
.board__mark { display: block; width: 5rem; height: auto; color: var(--parch); }
/* The mark sits in the middle of its cell, both ways, under the label */
.board__cell:has(.board__mark) { grid-template-rows: auto 1fr; align-content: stretch; padding-bottom: 1rem; }
.board__mark { place-self: center; }
.board__voice { font: italic 500 clamp(1.5rem, 2.6vw, 2.25rem)/1.05 var(--serif); letter-spacing: -.01em; }
@media (min-width: 600px) {
  .board { grid-template-columns: 6fr 2fr 4fr; }
  .board__cell + .board__cell { border-top: 0; border-left: 1px solid var(--rule); padding-left: 1.5rem; }
  .board__cell:first-child { padding-right: 1.5rem; }
  .board__cell:has(.board__mark) { padding-right: 1.5rem; }
}
.project__next { margin-top: clamp(3rem, 6vw, 5rem); border-block: 1px solid var(--rule); }
.project__next a { display: grid; gap: .6rem; padding-block: 1.5rem; text-decoration: none; }
.project__next .mono { color: var(--muted); }
.project__next-title { font: 500 clamp(1.875rem, 3vw, 2.25rem)/1.05 var(--serif); letter-spacing: -.01em; }
.project__close { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; padding-top: clamp(2rem, 4vw, 3rem); }
.project__next a:hover .project__next-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }

/* ---------- Split layout (services, inquiry) ---------- */
.split { display: grid; gap: clamp(2.5rem, 6vw, 4rem); }
.split__head { display: grid; gap: 1.5rem; align-content: start; }
@media (min-width: 900px) {
  .split { grid-template-columns: 5fr 7fr; column-gap: clamp(2rem, 6vw, 6rem); }
  .split__head { position: sticky; top: 5rem; align-self: start; }
}


/* ---------- Beneath the surface ---------- */
.beneath { display: grid; gap: clamp(2.5rem, 6vw, 4rem); }
.beneath__body { display: grid; gap: 1.5rem; align-content: start; }
.beneath__body .lede { max-width: 42ch; color: var(--muted); }
/* The knight, drawn in ink straight on the parchment and faced left toward the text. The box is exactly the image.
   The strip holds 16 frames side by side; the image shows one, at rest the last: the finished figure. */
.beneath__art { position: relative; justify-self: center; }
.beneath__art img { display: block; height: calc(330px * var(--px)); object-fit: cover; object-position: 100% 0; }
@media (min-width: 900px) {
  /* Text 8, knight 4: the knight's column is just wider than the figure, so the figures get the room.
     The figure is taller than the text, so the text sits level with its middle. */
  .beneath { grid-template-columns: 2fr 1fr; column-gap: clamp(2rem, 6vw, 6rem); align-items: center; }
}
/* Proof: three figures measured in the visitor's browser, set large. The caption comes first in the markup and sits below.
   Three across at every width; the numerals are sized to the row, so "1920px" still fits its cell on a phone. */
.proof { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 clamp(1rem, 2.5vw, 1.75rem); container-type: inline-size; }
.proof > div { display: flex; flex-direction: column; min-width: 0; padding-block: .9rem 1.1rem; border-top: 1px solid var(--rule); }
.proof dd { order: -1; font: 500 min(6rem, 12.5cqw)/.9 var(--serif); letter-spacing: -.03em; font-variant-numeric: lining-nums; white-space: nowrap; }
.proof dt { margin-top: .55rem; color: var(--muted); font-size: .875rem; line-height: 1.35; }
.proof__unit { margin-left: .12em; font-size: .38em; letter-spacing: 0; color: var(--muted); }
.proof__rest, .proof__src { color: var(--muted); font-size: .875rem; }

/* ---------- Why Durendal ---------- */
.studio { display: grid; gap: 3rem; }
.studio__art { position: relative; height: calc(var(--px) * 345px); overflow: hidden; border-bottom: 1px solid var(--rule); }
/* The image file holds 16 frames side by side; the box shows one. At rest it is the last: the finished sword. */
.studio__art img { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); height: calc(345px * var(--px)); object-fit: cover; object-position: 100% 0; }
/* Lantern: under the pointer the blade brightens in a small pool. Masked by the sword, so only its pixels light. */
.studio__art::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .2s ease-out;
  background: radial-gradient(circle 4.5rem at var(--lx, 50%) var(--ly, 50%), var(--fg), transparent);
  -webkit-mask: url("assets/sword.png?v=3") center bottom / calc(200px * var(--px)) auto no-repeat;
  mask: url("assets/sword.png?v=3") center bottom / calc(200px * var(--px)) auto no-repeat;
}
.studio__art.is-lit::before { opacity: 1; }
.studio__body { display: grid; gap: 1.75rem; align-content: center; }
.studio__body h2 { font-size: clamp(3rem, 5vw, 4.5rem); line-height: .88; } /* one step above the other sections */
/* The standard is the statement, set large; the legend runs beneath it in one reading column. */
.studio__legend { max-width: 30rem; margin-top: clamp(1rem, 3vw, 2.5rem); } /* the legend: about 65 characters a line */
.studio__legend p + p { margin-top: 1em; }
.studio__k { margin-bottom: 1rem; padding-top: 1rem; border-top: 1px solid var(--rule); color: var(--muted); }
cite { font-style: italic; }
@media (min-width: 900px) {
  .studio { grid-template-columns: 3fr 9fr; column-gap: clamp(2rem, 5vw, 5rem); }
  .studio__art { height: auto; min-height: 690px; border-bottom: 0; }
}

/* ---------- Approach ---------- */
.stages { display: grid; gap: 0 2rem; }
.stages li { display: grid; gap: .85rem; align-content: start; padding-block: 1.25rem 1.75rem; border-top: 1px solid var(--fg); }
.stages li > .mono { color: var(--ox); }
.stages h3 { font-size: clamp(1.875rem, 2.6vw, 2.25rem); }
.stages p { color: var(--muted); font-size: 1rem; }
.stages__have { padding-top: 1rem; border-top: 1px solid var(--rule); color: var(--fg) !important; }
.stages__have .mono, .decisions .mono { display: block; margin-bottom: .4rem; color: var(--muted); }
.decisions { max-width: 46rem; margin-top: clamp(1.5rem, 3vw, 2.5rem); padding: 1.5rem 0 0; border-top: 1px solid var(--rule); font: 500 clamp(1.5rem, 2.4vw, 1.875rem)/1.3 var(--serif); }
@media (min-width: 640px) { .stages { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .stages { grid-template-columns: repeat(4, 1fr); } }

/* ---------- The cut: a small sword in the left margin, drawn from the blade icon at 13px wide.
   Hilt 7px, then 25px of blade and point. Scrolling only lengthens the blade, down to the end of the content.
   Only where the ground is plain: Our approach. Too tight for a margin below 640px. ---------- */
#approach > .wrap { position: relative; }
.cut { display: none; position: absolute; top: 0; bottom: 0; width: 13px; color: var(--ox); pointer-events: none; }
.cut { left: calc(var(--gutter) / 2 - 6px); left: round(calc(var(--gutter) / 2 - 6px), 1px); }
@media (min-width: 640px) { .cut { display: block; } }
.cut__hilt { display: block; fill: currentColor; }
.cut__track { position: absolute; top: 7px; bottom: 0; left: 5px; width: 3px; overflow: hidden; }
/* At rest the blade shows only its last 25px: the whole short sword. */
.cut__blade {
  position: absolute; inset: 0; background: currentColor; transform: translateY(calc(25px - 100%));
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), 50% 100%, 0 calc(100% - 7px));
}

/* ---------- Start a project: the closing line, then the form, on oxblood. Tighter than the other sections. ---------- */
.inquiry {
  --bg: var(--ox); --muted: var(--stone); --accent: var(--stone); --rule: rgba(242, 238, 229, .3); --wipe: var(--ink);
  padding-block: clamp(2.5rem, 5vw, 4.5rem);
}
.inquiry ::selection { background: var(--parch); color: var(--ox); }
.inquiry .wrap { max-width: calc(72rem - 2 * var(--gutter)); padding-inline: 0; width: calc(100% - 2 * var(--gutter)); }
.inquiry h2 { font-size: clamp(3rem, 5vw, 4.5rem); } /* one step above the other sections, like Why Durendal */

.form { display: grid; gap: 1.25rem 2rem; }
.field { display: grid; gap: .4rem; align-content: start; }
.field[hidden] { display: none; }   /* display: grid would otherwise beat the hidden attribute (fields hide after a confirmed send) */
.field label { font-weight: 500; }
.optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: .7rem 1rem; border: 1px solid var(--stone); border-radius: 0;
  background: transparent; color: inherit; font: inherit;
}
.field textarea { resize: vertical; min-height: 7rem; }
.field input:hover, .field textarea:hover { border-color: var(--parch); }
.field [aria-invalid="true"] { border-color: var(--parch); box-shadow: inset 4px 0 0 var(--parch); }
.field__hint { color: var(--muted); font-size: .875rem; }
.field__err { color: var(--parch); font-size: .875rem; font-weight: 500; }
.field__err::before { content: "Error: "; }
.form__status { grid-column: 1 / -1; padding: 1rem 1.25rem; border: 1px solid var(--rule); }
/* Sent: the fields are gone, so this is the whole column. No box: a ruled line level with the heading opposite,
   the confirmation in the heading's serif, then where the reply will go. */
.form__status[data-state="sent"] { align-self: start; padding: 1.5rem 0 0; border: 0; border-top: 1px solid var(--rule); font: 500 clamp(2rem, 3.4vw, 2.75rem)/1.1 var(--serif); letter-spacing: -.02em; }
.form__status[data-state="sent"]:focus-visible { outline: 0; }   /* focused only to be announced; it is not a control, and a ring would box it again */
.form__next { display: block; margin-top: 1rem; color: var(--muted); font: 400 1rem/1.5 var(--sans); letter-spacing: 0; overflow-wrap: anywhere; }
@media (min-width: 640px) { .form { grid-template-columns: 1fr 1fr; } .field--full { grid-column: 1 / -1; } }
.form .btn { justify-self: start; }

/* ---------- Footer ---------- */
.wordmark--large { font-size: clamp(2.875rem, 5.25vw, 3.375rem); }
/* One area: the wordmark with the legal line beneath it, one centred group, and one dithered range along the foot made
   of two landscapes, each from its outer edge to the centre line. From 900px the range fills the height and rises at
   either side of the group; script.js thins its ink to nothing around the text, and the stills are masked off a
   central column --clear wide on each side (half the one-line legal text and a margin). Narrower, the group sits
   above the range. --footer-peak is how high the tallest crest rises, as a share of the art's height; script.js reads it too. */
.site-footer__main { --footer-peak: .62; --clear: 19rem; display: grid; grid-template-columns: 1fr 1fr; align-items: center; min-height: clamp(11rem, 9.5rem + 4vw, 12.5rem); }
.site-footer__top { grid-area: 1 / 1 / 2 / -1; position: relative; z-index: 1; display: grid; gap: .75rem; justify-items: center; padding-block: 1.75rem; text-align: center; }
.site-footer__legal { color: var(--muted); text-wrap: balance; }
.site-footer__art { grid-area: 1 / 2; align-self: stretch; position: relative; overflow: hidden; }
.site-footer__art--left { grid-column: 1; }
@media (max-width: 899px) {
  .site-footer__main { --footer-peak: .8; min-height: 0; grid-template-rows: auto 7rem; }
  .site-footer__top { padding-block: 1.75rem .5rem; }
  .site-footer__art { grid-row: 2; }
}
.site-footer__art :is(img, canvas) { position: absolute; right: 0; bottom: 0; max-width: none; image-rendering: pixelated; }
.site-footer__art--left :is(img, canvas) { right: auto; left: 0; }
/* The canvases start from the centre line, so the two dot grids meet in step there; any part dot falls at the outer edge. */
.site-footer__art canvas { right: auto; left: 0; }
.site-footer__art--left canvas { left: auto; right: 0; }
/* The still (no script): 480 dots at --dot each (the hero's dot size), its highest ink (row 19, or 128 on the left) at the
   peak line, never lifted off the foot. The live canvas thins its own ink; the still borrows a mask for the same fade. */
.site-footer__art img { width: calc(480px * var(--dot)); height: auto; bottom: auto; top: max(calc((1 - var(--footer-peak)) * 100% - 19px * var(--dot)), calc(100% - 271px * var(--dot))); }
.site-footer__art--left img { top: max(calc((1 - var(--footer-peak)) * 100% - 128px * var(--dot)), calc(100% - 271px * var(--dot))); }
.site-footer__art:not(.is-live) {
  --fade-up: linear-gradient(to top, #000 calc(var(--footer-peak) * 50%), transparent calc(var(--footer-peak) * 100% + 5%));
  -webkit-mask: linear-gradient(to right, transparent 10%, #000 70%), var(--fade-up); -webkit-mask-composite: source-in;
  mask: linear-gradient(to right, transparent 10%, #000 70%), var(--fade-up); mask-composite: intersect;
}
.site-footer__art--left:not(.is-live) {
  -webkit-mask: linear-gradient(to left, transparent 10%, #000 70%), var(--fade-up); -webkit-mask-composite: source-in;
  mask: linear-gradient(to left, transparent 10%, #000 70%), var(--fade-up); mask-composite: intersect;
}
@media (min-width: 900px) {
  .site-footer__art:not(.is-live) {
    -webkit-mask: linear-gradient(to right, transparent var(--clear), #000 calc(var(--clear) + 6rem)), var(--fade-up); -webkit-mask-composite: source-in;
    mask: linear-gradient(to right, transparent var(--clear), #000 calc(var(--clear) + 6rem)), var(--fade-up); mask-composite: intersect;
  }
  .site-footer__art--left:not(.is-live) {
    -webkit-mask: linear-gradient(to left, transparent var(--clear), #000 calc(var(--clear) + 6rem)), var(--fade-up); -webkit-mask-composite: source-in;
    mask: linear-gradient(to left, transparent var(--clear), #000 calc(var(--clear) + 6rem)), var(--fade-up); mask-composite: intersect;
  }
}
.site-footer__art.is-live img { opacity: 0; }

/* ---------- Motion: one short fade as plates arrive. Nothing depends on it. ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .plate > img { animation: arrive linear both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
    @keyframes arrive { from { opacity: .25; } to { opacity: 1; } }

    /* The bar's hairline is absent at the very top of the page and draws in as you start to scroll. */
    .site-header { animation: bar-rule linear both; animation-timeline: scroll(root block); animation-range: 0 4rem; }
    @keyframes bar-rule { from { border-bottom-color: transparent; } }

    /* 2. The sword assembles out of dither, hilt first, then light runs once down the blade. */
    .studio__art { view-timeline: --sword block; }
    .studio__art img { opacity: .62; animation: assemble steps(15) both; animation-timeline: --sword; animation-range: entry 10% cover 40%; }
    /* The lantern stays dark until the sword has finished assembling, so it never shows a part not yet built. */
    .studio__art::before { animation: unlit linear backwards; animation-timeline: --sword; animation-range: entry 10% cover 40%; }
    @keyframes unlit { from, to { visibility: hidden; } }
    .studio__art::after {
      content: ""; position: absolute; inset: 0; pointer-events: none;
      background: linear-gradient(to top, transparent, var(--fg) 50%, transparent) 50% -40% / 100% 24% no-repeat;
      -webkit-mask: url("assets/sword.png?v=3") center bottom / calc(200px * var(--px)) auto no-repeat;
      mask: url("assets/sword.png?v=3") center bottom / calc(200px * var(--px)) auto no-repeat;
      animation: glint linear both; animation-timeline: --sword; animation-range: cover 40% cover 62%;
    }
    @keyframes assemble { from { object-position: 0 0; } }
    @keyframes glint { to { background-position: 50% 140%; } }

    /* The knight assembles out of dither the same way, top down, and rests at full ink.
       The figure is most of a screen tall, so the range ends
       when its top is a quarter of the way down the window, not at the sword's cover 52%, which would finish
       only as the figure began to leave. */
    .beneath__art { view-timeline: --knight block; }
    .beneath__art img { animation: assemble-knight steps(15) both; animation-timeline: --knight; animation-range: entry 15% cover 75vh; }
    @keyframes assemble-knight { from { object-position: 0 0; } }

    /* 3. The closing line inks in, a word at a time. */
    .inquiry h2 { view-timeline: --closing block; }
    .inquiry h2 span {
      animation: ink linear both; animation-timeline: --closing;
      animation-range: cover calc(10% + var(--i) * 5%) cover calc(22% + var(--i) * 5%);
    }
    @keyframes ink { from { opacity: .2; } }
    /* After a send the fields are gone and the section is short: the page can no longer scroll far enough to finish
       the inking, so the last words would stay faint. The line is simply inked in from then on. */
    .inquiry:has(.form__status[data-state="sent"]) h2 span { animation: none; }

    /* 5. List rules draw themselves from the left as each row arrives. */
    .stages li { position: relative; border-top-color: transparent; view-timeline: --row block; }
    .stages li::before {
      content: ""; position: absolute; inset: -1px 0 auto; height: 1px; background: var(--rule); transform-origin: left;
      animation: rule linear both; animation-timeline: --row; animation-range: entry 0% cover 26%;
    }
    .stages li::before { background: var(--fg); }
    @keyframes rule { from { scale: 0 1; } }

    /* 6. The cut: the timeline is a single line 60% down the window. The blade starts to grow once the
       resting point reaches it (25px into the track) and stops when the track's end does, so the point rides that line. */
    .cut__track { view-timeline: --blade block; view-timeline-inset: 60% 40%; }
    .cut__blade { animation: cut-grow linear both; animation-timeline: --blade; animation-range: cover 25px cover 100%; }
    @keyframes cut-grow { from { transform: translateY(calc(25px - 100%)); } to { transform: none; } }
  }
}
/* ---------- The cleave: as you scroll, each two-column
   section parts along its gutter, the halves settling a few pixels out of line.
   Pure CSS, desktop only, and nothing depends on it: without support the page simply sits still. ---------- */
@media (prefers-reduced-motion: no-preference) and (min-width: 1024px) {
  @supports (animation-timeline: view()) {
    /* 4. The landscape falls slightly behind the headline as the hero leaves. */
    .hero__art { animation: drift linear both; animation-timeline: scroll(root block); animation-range: 0 100vh; }
    @keyframes drift { to { translate: 0 6%; } }

    .cleave { position: relative; view-timeline: --cleave block; --pad: var(--gutter); --gap: clamp(2rem, 6vw, 6rem); --cut: calc(5 / 12); }
    .studio.cleave { --gap: clamp(2rem, 5vw, 5rem); --cut: .25; }
    .beneath.cleave { --cut: calc(8 / 12); }
    .cleave::before {
      content: ""; position: absolute; inset-block: -2.5rem; width: 1px; background: var(--accent); opacity: .6;
      left: calc(var(--pad) + (100% - 2 * var(--pad) - var(--gap)) * var(--cut) + var(--gap) / 2);
      transform-origin: top; animation: cut linear both; animation-timeline: --cleave; animation-range: cover 5% cover 60%;
    }
    .cleave > :first-child { animation: part-up linear both; animation-timeline: --cleave; animation-range: cover 12% cover 45%; }
    .cleave > :last-child { animation: part-down linear both; animation-timeline: --cleave; animation-range: cover 12% cover 45%; }
    @keyframes cut { from { scale: 1 0; } }
    @keyframes part-up { to { translate: 0 -8px; } }
    @keyframes part-down { to { translate: 0 8px; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
