/*
  Weyl Sato: architecture studio portfolio (Screenery template "atelier")
  A monochrome architectural monograph: white paper, black ink, hairline rules, one rigorous 12-column grid,
  small precise type against a few very large words. The only images are line drawings (axonometrics and plans).

  Contents
   1. Tokens
   2. Base and browser surfaces
   3. Grid, headings, shared bits (chips, icons, buttons, grid overlay)
   4. Header and menu
   5. Cover
   6. Index of works: list, drawings grid, preview, slot
   7. Line drawings (axonometric and plan)
   8. Project sheets
   9. Practice, partners, phases, record, positions
  10. Enquiry form
  11. Footer
  12. Motion
  13. Narrow screens
*/

/* ---------- 1. Tokens ---------- */
:root {
  /* Ink on paper. No accent: emphasis comes from weight, size and solid black. */
  --paper: #ffffff;
  --ink: #0a0a0a;
  --ink-2: #4d4d4d;      /* secondary text, 8.4:1 */
  --ink-3: #6e6e6e;      /* tertiary text and labels, 5.1:1 */
  --rule: #d4d4d4;       /* hairlines */
  --rule-2: #a3a3a3;     /* stronger hairline: field underlines, row hover */
  --wash: #f4f4f3;       /* the faintest surface: drawing wells, hover rows */

  /* Type */
  --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --mono: "Fragment Mono", ui-monospace, "SF Mono", Menlo, monospace;   /* figures only: numbers, dates, areas */

  --fs-xs: 0.75rem;      /* 12, mono labels */
  --fs-s: 0.875rem;      /* 14 */
  --fs-m: 1rem;          /* 16, body */
  --fs-l: 1.375rem;      /* 22, project names */
  --fs-xl: clamp(1.75rem, 1rem + 2.4vw, 3.25rem);           /* statement */
  --fs-sheet: clamp(2.5rem, 1.2rem + 4.4vw, 5.5rem);         /* project sheet titles */
  --fs-word: clamp(3.5rem, 1rem + 9vw, 9.5rem);             /* the few very large words */
  --fs-cover: clamp(5.5rem, 0.5rem + 19vw, 23rem);           /* the name on the cover: the type is the composition */

  /* Space and grid */
  --margin: clamp(16px, 3.4vw, 56px);
  --gutter: clamp(12px, 1.6vw, 24px);
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;
  --s-9: clamp(96px, 12vw, 200px);   /* between sections */
  --header: 56px;
  --radius: 0;                        /* everything is square */

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 160ms;
  --t-med: 420ms;
}

/* ---------- 2. Base and browser surfaces ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 16px);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--ink) var(--paper);
  scrollbar-width: thin;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--fs-m) / 1.55 var(--sans);
  font-feature-settings: "ss01", "cv11";
  overflow-x: clip;
  caret-color: var(--ink);
  accent-color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }

::selection { background: var(--ink); color: var(--paper); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--ink); }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 400; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }

.skip {
  position: absolute; left: var(--margin); top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 14px; text-decoration: none;
}
.skip:focus { top: 8px; }

.num, .work__no, .work__year, .work__area, .chip .n, .steps__n, .steps__t, .plain li > span:first-child,
.count, .done__no, .sheet__no { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- 3. Grid, headings, shared bits ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--margin);
  max-width: 1920px;
  margin-inline: auto;
}

/* Section heads: a small heading in the first three columns under a full-width hairline */
.h-s {
  grid-column: 1 / span 3;
  font-size: var(--fs-s);
  font-weight: 500;
  letter-spacing: 0.01em;
  padding-top: var(--s-3);
}
.h-xl {
  font-size: var(--fs-word);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: square; }

.chip {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-4);
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--radius);
  font-size: var(--fs-s);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .n { font-size: var(--fs-xs); color: var(--ink-3); }
.chip[aria-pressed="true"] .n { color: #c9c9c9; }
.chip[disabled] { cursor: not-allowed; color: var(--ink-3); border-style: dashed; }

.btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: var(--s-6);
  min-height: 56px; padding: 0 var(--s-5);
  min-width: 260px;
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); border-radius: var(--radius);
  font-size: var(--fs-m); font-weight: 500;
  position: relative; overflow: hidden;
  transition: background var(--t-fast), color var(--t-fast);
}
.btn:hover { background: var(--paper); color: var(--ink); }
.btn[aria-busy="true"] { cursor: progress; background: var(--ink); color: var(--paper); }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--paper); transform-origin: left; animation: sending 1.4s var(--ease-out) infinite;
}
@keyframes sending { from { transform: scaleX(0); } to { transform: scaleX(1); opacity: 0.2; } }

.link-btn {
  background: none; border: 0; padding: 0; min-height: 44px;
  font-size: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em;
}

/* 12-column grid overlay */
.overlay-grid { position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0; transition: opacity var(--t-med) var(--ease-out); }
.overlay-grid .grid { height: 100%; }
.overlay-grid i { background: rgb(10 10 10 / 0.035); border-inline: 1px solid rgb(10 10 10 / 0.12); }
.show-grid .overlay-grid { opacity: 1; }

/* ---------- 4. Header and menu ---------- */
.top {
  position: sticky; top: 0; z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.top__in { height: var(--header); align-items: center; }
.mark {
  grid-column: 1 / span 4;
  display: inline-flex; align-items: center; gap: var(--s-3);
  min-height: 44px; width: max-content;
  text-decoration: none; font-weight: 500; letter-spacing: -0.01em;
}
.mark svg { width: 18px; height: 18px; }
.nav { grid-column: 6 / -1; display: flex; justify-content: space-between; gap: var(--s-5); }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: var(--fs-s); text-decoration: none; color: var(--ink-2);
  transition: color var(--t-fast);
}
.nav a:hover, .nav a[aria-current="true"] { color: var(--ink); text-decoration: underline; }
.menu-btn { display: none; }

/* ---------- 5. Cover ---------- */
.cover {
  min-height: calc(100svh - var(--header));
  grid-template-rows: auto 1fr auto;
  padding-top: var(--s-6);
  padding-bottom: var(--s-4);
  row-gap: var(--s-5);
}
.cover p { font-size: var(--fs-s); line-height: 1.5; color: var(--ink-2); }
.cover__a { grid-column: 1 / span 3; color: var(--ink) !important; }
.cover__b { grid-column: 5 / span 4; max-width: 38ch; }
.cover__c { grid-column: 10 / span 3; max-width: 30ch; }
.cover__go {
  grid-column: 10 / span 3; grid-row: 2; align-self: end; justify-self: start;
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px;
  font-size: var(--fs-s); text-decoration: none; border-bottom: 1px solid var(--ink);
}
.cover__fig {
  grid-column: 5 / span 5; grid-row: 2; align-self: center;
  display: grid; justify-items: center; gap: var(--s-3);
  min-height: 0; padding-block: var(--s-4);
}
.cover__fig .axo { width: 100%; height: auto; max-height: min(34svh, 330px); }
/* Line widths in drawing units here (no non-scaling stroke), so script.js can draw the lines in with dash offsets */
.axo.axo--cover path { vector-effect: none; }
.axo.axo--cover .f, .axo.axo--cover .fi { stroke-width: var(--u); }
.axo.axo--cover .h { stroke-width: calc(var(--u) * 0.5); }
.axo.axo--cover .d { stroke-width: calc(var(--u) * 0.75); }
.cover__fig figcaption {
  justify-self: stretch; padding-top: var(--s-2); border-top: 1px solid var(--rule);
  font-size: var(--fs-xs); color: var(--ink-3);
}
.cover__fig .num { color: var(--ink-2); margin-right: var(--s-2); }
.cover__t {
  grid-column: 1 / -1; grid-row: 3;
  font-size: var(--fs-cover);
  font-weight: 300;
  line-height: 0.78;
  letter-spacing: -0.04em;
  text-indent: -0.03em;
  padding-top: var(--s-4);
  padding-bottom: 0.14em;
  border-top: 1px solid var(--ink);
  white-space: nowrap;
}
.cover__t span { display: inline-block; }

/* ---------- 6. Index of works ---------- */
.works { padding-top: var(--s-9); }
.works__head { row-gap: var(--s-6); align-items: end; }
.works__head .h-xl { grid-column: 1 / span 6; }
.works__lede { grid-column: 7 / span 4; font-size: var(--fs-s); color: var(--ink-2); max-width: 44ch; padding-bottom: 0.6em; }
.tools { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.filters, .views { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.chip--icon { gap: var(--s-2); }

.index { position: relative; margin-top: var(--s-6); padding-inline: var(--margin); max-width: 1920px; margin-inline: auto; }
.index__cols,
.work__link {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: 0;
}
.index__cols {
  margin-inline: 0; max-width: none;
  border-bottom: 1px solid var(--ink);
  font-size: var(--fs-xs); color: var(--ink-3); align-items: end;
  padding-bottom: var(--s-2);
}
.index__cols > * { min-height: 32px; display: flex; align-items: end; }
.sort {
  background: none; border: 0; padding: 0; gap: 2px; color: var(--ink-3); font-size: var(--fs-xs);
  min-height: 44px !important;
}
.sort .i { width: 12px; height: 12px; opacity: 0.45; }
.sort:hover, .sort[aria-pressed="true"] { color: var(--ink); }
.sort[aria-pressed="true"] .i { opacity: 1; }
.c-no { grid-column: 1; }
.c-name, .work__name { grid-column: 2 / span 4; }
.c-place, .work__place { grid-column: 6 / span 2; }
.c-type, .work__type { grid-column: 8; }
.c-status, .work__status { grid-column: 9 / span 2; }
.c-year, .work__year { grid-column: 11; }
.c-area, .work__area { grid-column: 12; justify-content: end; text-align: right; }

.list { position: relative; }
.work { border-bottom: 1px solid var(--rule); background: var(--paper); }
.work__link {
  align-items: baseline;
  padding-block: var(--s-4);
  text-decoration: none;
  font-size: var(--fs-s);
  color: var(--ink-2);
  transition: color var(--t-fast) var(--ease-out), background var(--t-fast);
}
.work__link > span { min-width: 0; }
.work__no, .work__year, .work__area { font-size: var(--fs-xs); }
.work__no { color: var(--ink-3); }
.work__name {
  font-size: var(--fs-l); line-height: 1.15; color: var(--ink); letter-spacing: -0.015em;
  transition: transform var(--t-med) var(--ease-out);
}
.work__area .u { color: var(--ink-3); }
.work__fig, .work__open { display: none; }

/* Hover: the hovered row stays black, the others step back to grey */
@media (hover: hover) {
  .list:hover .work__link { color: var(--ink-3); }
  .list:hover .work__link .work__name { color: var(--ink-2); }
  .list .work__link:hover, .list .work__link:focus-visible { color: var(--ink); }
  .list .work__link:hover .work__name, .list .work__link:focus-visible .work__name { color: var(--ink); transform: translateX(10px); }
}
.work.is-active .work__name { color: var(--ink); }
.work__link:focus-visible { outline-offset: -2px; }

.index__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Drawings view: a 3-up grid of axonometrics with captions */
.index[data-view="grid"] .index__cols { display: none; }
.index[data-view="grid"] .list {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-7) var(--gutter);
  padding-top: var(--s-5);
}
.index[data-view="grid"] .work { border: 0; display: flex; flex-direction: column; }
.index[data-view="grid"] .work__fig { display: block; order: -1; }
.index[data-view="grid"] .work__fig figcaption { display: none; }
.index[data-view="grid"] .work__link {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-3);
  padding-block: var(--s-3) 0; border-top: 1px solid var(--ink); margin-top: var(--s-3);
}
.index[data-view="grid"] .work__link > span { grid-column: auto; }
.index[data-view="grid"] .work__place,
.index[data-view="grid"] .work__type,
.index[data-view="grid"] .work__status,
.index[data-view="grid"] .work__area { display: none; }
.index[data-view="grid"] .work__name { font-size: var(--fs-m); transform: none !important; }
.index[data-view="grid"] .work__fig .axo { aspect-ratio: 4 / 3; width: 100%; height: auto; background: var(--wash); padding: 8%; }
@media (hover: hover) {
  .index[data-view="grid"] .work:hover .axo { background: #ececea; }
}

.work[hidden] { display: none !important; }

/* Floating preview that follows the pointer */
.preview {
  position: fixed; left: 0; top: 0; z-index: 30;
  width: clamp(280px, 27vw, 460px);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: var(--s-4) var(--s-4) var(--s-3);
  will-change: transform;
}
.preview.is-on { visibility: visible; }
.preview__in { aspect-ratio: 4 / 3; display: grid; place-items: center; }
.preview__in .axo { width: 100%; height: 100%; }
.preview__cap {
  margin-top: var(--s-3); padding-top: var(--s-2); border-top: 1px solid var(--rule);
  font-size: var(--fs-xs); color: var(--ink-2); display: flex; justify-content: space-between; gap: var(--s-3);
}

/* Fixed slot: used instead of the pointer preview when motion is reduced */
.slot { display: none; }
.index--slot:not([data-view="grid"]) {
  display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); column-gap: var(--s-7);
}
.index--slot:not([data-view="grid"]) .index__cols { grid-column: 1; }
.index--slot:not([data-view="grid"]) .list { grid-column: 1; }
.index--slot:not([data-view="grid"]) .slot { display: block; grid-column: 2; grid-row: 1 / span 2; }
.index--slot .c-status, .index--slot:not([data-view="grid"]) .work__status { display: none; }
.index--slot:not([data-view="grid"]) .c-name, .index--slot:not([data-view="grid"]) .work__name { grid-column: 2 / span 4; }
.index--slot:not([data-view="grid"]) .c-place, .index--slot:not([data-view="grid"]) .work__place { grid-column: 6 / span 2; }
.index--slot:not([data-view="grid"]) .c-type, .index--slot:not([data-view="grid"]) .work__type { grid-column: 8 / span 2; }
.index--slot:not([data-view="grid"]) .c-year, .index--slot:not([data-view="grid"]) .work__year { grid-column: 10; }
.index--slot:not([data-view="grid"]) .c-area, .index--slot:not([data-view="grid"]) .work__area { grid-column: 11 / span 2; white-space: nowrap; }
.slot__in {
  position: sticky; top: calc(var(--header) + var(--s-5));
  border: 1px solid var(--rule); padding: var(--s-4);
  min-height: 280px; display: grid; align-content: center;
}
.slot__in .axo { width: 100%; height: auto; aspect-ratio: 4 / 3; }
.slot__hint { font-size: var(--fs-s); color: var(--ink-3); text-align: center; }
.slot .preview__cap { display: flex; }

/* ---------- 7. Line drawings ---------- */
.axo { color: var(--ink); overflow: visible; }
.axo .f { fill: var(--paper); stroke: currentColor; stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.axo .fi { fill: currentColor; stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.axo .h { fill: none; stroke: currentColor; stroke-width: 0.5; vector-effect: non-scaling-stroke; }
.axo .d { fill: none; stroke: currentColor; stroke-width: 0.75; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

.plan { width: 100%; height: auto; overflow: visible; color: var(--ink); }
.plan path { fill: none; stroke: currentColor; }
.plan .p-w { stroke-width: 0.36; stroke-linecap: square; }
.plan .p-t { stroke-width: 0.06; }
.plan .p-d { stroke-width: 0.06; }
.plan .p-ax { stroke-width: 0.04; stroke: var(--ink-3); stroke-dasharray: 1.2 0.35 0.2 0.35; }
.plan text { font: 400 var(--fs) / 1 var(--mono); fill: var(--ink-2); text-anchor: middle; }
.plan .p-bar path { stroke-width: 0.06; }
.plan .p-bar text { text-anchor: start; }
.plan .p-bar text:last-child { text-anchor: middle; }
.plan .p-n path { fill: currentColor; stroke: none; }

/* ---------- 8. Project sheets ---------- */
.sheet {
  display: none;
  position: fixed; inset: 0; z-index: 60;
  background: var(--paper);
  overflow-y: auto;
  overscroll-behavior: contain;
}
html:not(.js) .sheet:target, .sheet.is-open { display: block; }
.sheet:focus { outline: none; }
.sheet__bar {
  position: sticky; top: 0; z-index: 2;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-5);
  height: var(--header); padding-inline: var(--margin);
  background: var(--paper); border-bottom: 1px solid var(--rule);
  font-size: var(--fs-s);
}
.sheet__no { font-size: var(--fs-xs); color: var(--ink-3); }
.sheet__nav { display: flex; justify-content: center; gap: var(--s-6); }
.sheet__nav a, .sheet__close {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px;
  text-decoration: none; color: var(--ink-2);
}
.sheet__nav a:hover, .sheet__close:hover { color: var(--ink); text-decoration: underline; }
.sheet__close { color: var(--ink); }

.sheet__body { padding-top: var(--s-7); padding-bottom: var(--s-9); row-gap: var(--s-6); align-items: start; }
.sheet__head { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: end; padding-bottom: var(--s-5); border-bottom: 1px solid var(--ink); }
.sheet__title { grid-column: 1 / span 9; font-size: var(--fs-sheet); font-weight: 300; line-height: 0.95; letter-spacing: -0.035em; }
.sheet__sub { grid-column: 10 / span 3; font-size: var(--fs-s); color: var(--ink-2); padding-bottom: 0.5em; }
.sheet__plan { grid-column: 1 / span 7; grid-row: 2 / span 3; position: sticky; top: calc(var(--header) + var(--s-5)); }
.sheet__plan .plan { max-height: calc(100svh - var(--header) - 140px); }
.sheet figcaption { margin-top: var(--s-3); font-size: var(--fs-xs); color: var(--ink-3); }
.sheet__axo { grid-column: 9 / span 4; }
.sheet__axo .axo { width: 100%; height: auto; aspect-ratio: 4 / 3; background: var(--wash); padding: 8%; }
.facts { grid-column: 9 / span 4; border-top: 1px solid var(--ink); }
.facts div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s-3); padding-block: var(--s-2); border-bottom: 1px solid var(--rule); font-size: var(--fs-s); }
.facts dt { color: var(--ink-3); }
.sheet__text { grid-column: 9 / span 4; display: grid; gap: var(--s-4); max-width: 62ch; }

/* ---------- 9. Practice, partners, phases, record, positions ---------- */
.practice, .partners, .phases, .record, .positions, .enquiry { margin-top: var(--s-9); }
.practice, .partners, .phases, .record, .positions { row-gap: var(--s-6); }
.practice::before, .partners::before, .phases::before, .record::before, .positions::before {
  content: ""; grid-column: 1 / -1; border-top: 1px solid var(--ink);
}
.statement {
  grid-column: 4 / -1;
  font-size: var(--fs-xl); font-weight: 300; line-height: 1.12; letter-spacing: -0.025em;
  max-width: 30ch;
  text-wrap: balance;
}
.practice__cols { grid-column: 7 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); font-size: var(--fs-s); color: var(--ink-2); margin-top: var(--s-5); }

.people { grid-column: 4 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); }
.person { display: grid; gap: var(--s-4); align-content: start; font-size: var(--fs-s); color: var(--ink-2); }
.person h3 { font-size: var(--fs-l); color: var(--ink); letter-spacing: -0.015em; line-height: 1.1; }
.person__role { color: var(--ink); margin-top: calc(var(--s-3) * -1); }
.person__cv { border-top: 1px solid var(--rule); }
.person__cv div { display: grid; grid-template-columns: 5.5em 1fr; gap: var(--s-3); padding-block: var(--s-2); border-bottom: 1px solid var(--rule); }
.person__cv dt { color: var(--ink-3); }
.person__cv dd { color: var(--ink); }

.phases__lede { grid-column: 4 / span 6; font-size: var(--fs-m); color: var(--ink-2); max-width: 58ch; }
.steps { grid-column: 4 / -1; border-top: 1px solid var(--ink); counter-reset: none; }
.steps li {
  display: grid; grid-template-columns: 3em minmax(0, 2fr) minmax(0, 5fr) minmax(0, 2fr);
  gap: var(--gutter); align-items: baseline;
  padding-block: var(--s-4); border-bottom: 1px solid var(--rule);
}
.steps__n { font-size: var(--fs-xs); color: var(--ink-3); }
.steps h3 { font-size: var(--fs-l); letter-spacing: -0.015em; line-height: 1.15; }
.steps p { font-size: var(--fs-s); color: var(--ink-2); max-width: 56ch; }
.steps__t { font-size: var(--fs-xs); text-align: right; }

.record__col { grid-column: 4 / span 4; }
.record__col + .record__col { grid-column: 9 / span 4; }
.record h3 { font-size: var(--fs-s); font-weight: 500; padding-bottom: var(--s-3); border-bottom: 1px solid var(--ink); }
.plain li { display: grid; grid-template-columns: 4em 1fr; gap: var(--s-3); padding-block: var(--s-3); border-bottom: 1px solid var(--rule); font-size: var(--fs-s); }
.plain li > span:first-child { font-size: var(--fs-xs); color: var(--ink-3); padding-top: 0.15em; }

.roles { grid-column: 4 / -1; border-top: 1px solid var(--ink); }
.role { border-bottom: 1px solid var(--rule); }
.role summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; gap: var(--s-5); align-items: center;
  min-height: 72px; cursor: pointer; list-style: none;
}
.role summary::-webkit-details-marker { display: none; }
.role__t { font-size: var(--fs-l); letter-spacing: -0.015em; }
.role__m { font-size: var(--fs-s); color: var(--ink-2); }
.role summary .i { transition: transform var(--t-med) var(--ease-out); }
.role[open] summary .i { transform: rotate(45deg); }
.role__b { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); padding-bottom: var(--s-6); font-size: var(--fs-s); color: var(--ink-2); max-width: 980px; }

/* ---------- 10. Enquiry form ---------- */
.enquiry { row-gap: var(--s-7); }
.enquiry::before { content: ""; grid-column: 1 / -1; border-top: 1px solid var(--ink); margin-bottom: calc(var(--s-7) * -1 + var(--s-5)); }
.enquiry .h-xl { grid-column: 1 / -1; }
.enquiry__lede { grid-column: 1 / span 4; font-size: var(--fs-m); color: var(--ink-2); max-width: 40ch; }
.form, .done { grid-column: 6 / -1; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6) var(--gutter); }
.field { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: var(--s-2); align-content: start; }
.field--type, .field--budget, .field--msg, .field--site { grid-column: 1 / -1; }
.field legend, .field > label { font-size: var(--fs-s); font-weight: 500; padding: 0; margin-bottom: var(--s-2); }
.field input[type="text"], .field input[type="email"], .field textarea {
  width: 100%; border: 0; border-bottom: 1px solid var(--rule-2); border-radius: 0;
  background: transparent; padding: var(--s-3) 0; min-height: 48px;
  font-size: var(--fs-m); line-height: 1.45;
  transition: border-color var(--t-fast);
}
.field textarea { resize: vertical; min-height: 140px; border: 1px solid var(--rule-2); padding: var(--s-3); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); opacity: 1; }
.field input:hover, .field textarea:hover { border-color: var(--ink-2); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 1px 0 0 var(--ink); }
.field textarea:focus { box-shadow: inset 0 0 0 1px var(--ink); }
.field input:focus-visible, .field textarea:focus-visible { outline: none; }

.choice { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.choice label { position: relative; display: inline-flex; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; gap: var(--s-3);
  min-height: 44px; padding: 0 var(--s-4);
  border: 1px solid var(--rule-2); font-size: var(--fs-s);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.choice span::before { content: ""; width: 9px; height: 9px; border: 1px solid currentColor; flex: none; }
.choice label:hover span { border-color: var(--ink); }
.choice input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.choice input:checked + span::before { background: var(--paper); }
.choice input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.choice--seg { gap: 0; }
.choice--seg label + label span { border-left-width: 0; }
.choice--seg input:checked + span { border-color: var(--ink); }

.field__err { font-size: var(--fs-s); color: var(--ink); font-weight: 500; display: flex; gap: var(--s-2); align-items: center; min-height: 0; }
.field__err:empty { display: none; }
.field__err:not(:empty)::before {
  content: ""; width: 14px; height: 14px; flex: none;
  background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M0 0h14v14H0z M6.25 3v5h1.5V3z M6.25 9.5V11h1.5V9.5z' fill-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M0 0h14v14H0z M6.25 3v5h1.5V3z M6.25 9.5V11h1.5V9.5z' fill-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat;
}
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--ink); border-bottom-width: 2px; }
.field.is-invalid .choice span { border-color: var(--ink); border-style: dashed; }
.field__help { display: flex; justify-content: space-between; gap: var(--s-4); }
.count { font-size: var(--fs-xs); color: var(--ink-3); margin-left: auto; padding-top: 2px; }
.count.is-ok { color: var(--ink); }

.form__foot { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--s-5); flex-wrap: wrap; padding-top: var(--s-3); }
.form__note { font-size: var(--fs-xs); color: var(--ink-3); max-width: 42ch; }
.form__msg { grid-column: 1 / -1; border: 1px solid var(--ink); padding: var(--s-4) var(--s-5); font-size: var(--fs-s); display: grid; gap: var(--s-2); }
.form__msg[hidden], .form[hidden] { display: none; }
.form__msg strong { font-weight: 600; }
.form.is-sending .field { opacity: 0.55; pointer-events: none; transition: opacity var(--t-med); }

.done { border-top: 1px solid var(--ink); padding-top: var(--s-6); display: grid; gap: var(--s-5); align-content: start; }
.done[hidden] { display: none; }
.done:focus { outline: none; }
.done__t { font-size: var(--fs-word); font-weight: 300; letter-spacing: -0.04em; line-height: 0.9; }
.done__b { font-size: var(--fs-l); max-width: 36ch; line-height: 1.3; letter-spacing: -0.01em; }
.done__ref { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: var(--gutter); }
.done__ref div { border-top: 1px solid var(--rule); padding-top: var(--s-2); font-size: var(--fs-s); }
.done__ref dt { color: var(--ink-3); font-size: var(--fs-xs); }
.done .link-btn { justify-self: start; }

/* ---------- 11. Footer ---------- */
.foot { margin-top: var(--s-9); background: var(--ink); color: var(--paper); padding-block: var(--s-6) var(--s-5); }
.foot__in { row-gap: var(--s-6); align-items: start; }
.foot__big {
  grid-column: 1 / -1;
  font-size: var(--fs-cover); font-weight: 300; line-height: 0.8; letter-spacing: -0.04em;
  text-indent: -0.05em; padding-bottom: var(--s-5); border-bottom: 1px solid #5a5a5a;
}
.foot__addr, .foot__contact, .foot__col { font-size: var(--fs-s); font-style: normal; line-height: 1.6; }
.foot__addr { grid-column: 1 / span 3; }
.foot__contact { grid-column: 5 / span 3; }
.foot__col { grid-column: 9 / span 4; color: #bdbdbd; max-width: 40ch; }
.foot a { text-decoration-color: #8a8a8a; }
.foot a:hover { text-decoration-color: currentColor; }
.foot :focus-visible { outline-color: var(--paper); }
.foot__end { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-6); font-size: var(--fs-xs); color: #bdbdbd; border-top: 1px solid #5a5a5a; padding-top: var(--s-3); }
.foot__end a, .foot__end .link-btn { color: var(--paper); display: inline-flex; align-items: center; min-height: 44px; }
.foot__end .link-btn { margin-left: auto; }
.foot ::selection { background: var(--paper); color: var(--ink); }

/* ---------- 12. Motion ---------- */
/* Plan draws itself when its sheet opens (classes set by script.js; reduced motion skips them) */
.sheet.is-pre .plan .p-w, .sheet.is-pre .plan .p-t, .sheet.is-pre .plan .p-d { stroke-dasharray: 1 1.02; stroke-dashoffset: 1; opacity: 0; }
.sheet.is-drawing .plan .p-w, .sheet.is-drawing .plan .p-t, .sheet.is-drawing .plan .p-d {
  stroke-dasharray: 1 1.02; stroke-dashoffset: 0; opacity: 1;
  transition: stroke-dashoffset 2.2s var(--ease-out), opacity 0.01s;
}
.sheet.is-drawing .plan .p-t { transition-duration: 1.8s, 0.01s; transition-delay: 0.9s, 0.9s; }
.sheet.is-drawing .plan .p-d { transition-duration: 1.2s, 0.01s; transition-delay: 1.6s, 1.6s; }
.sheet.is-pre .plan .p-ax, .sheet.is-pre .plan text { opacity: 0; }
.sheet.is-drawing .plan .p-ax, .sheet.is-drawing .plan text { opacity: 1; transition: opacity 0.8s var(--ease-out) 0.2s; }

/* View transitions: the clicked row's name becomes the sheet title */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 360ms; animation-timing-function: var(--ease-out); }
::view-transition-group(work-title) { animation-duration: 560ms; animation-timing-function: var(--ease-out); }
::view-transition-old(work-title), ::view-transition-new(work-title) { height: 100%; object-fit: contain; object-position: left; }

@media (prefers-reduced-motion: no-preference) {
  .cover__t span { animation: rise 1.1s var(--ease-out) both; }
  .cover__t span + span { animation-delay: 0.08s; }
}
@keyframes rise { from { clip-path: inset(0 0 100% 0); transform: translateY(0.12em); } to { clip-path: inset(0 0 -10% 0); transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- 13. Narrow screens ---------- */
@media (max-width: 1100px) {
  .nav { grid-column: 5 / -1; }
  .index__cols .c-status, .work__status { display: none; }
  .c-name, .work__name { grid-column: 2 / span 4; }
  .c-place, .work__place { grid-column: 6 / span 2; }
  .c-type, .work__type { grid-column: 8 / span 2; }
  .c-year, .work__year { grid-column: 10; }
  .c-area, .work__area { grid-column: 11 / span 2; white-space: nowrap; }
  .people { grid-column: 1 / -1; }
  .statement, .phases__lede, .steps, .roles, .record__col { grid-column: 1 / -1 !important; }
  .h-s { grid-column: 1 / -1; }
  .record__col { grid-column: 1 / span 6 !important; }
  .record__col + .record__col { grid-column: 7 / span 6 !important; }
  .practice__cols { grid-column: 1 / -1; }
  .index[data-view="grid"] .list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .enquiry__lede { grid-column: 1 / -1; }
  .form, .done { grid-column: 1 / -1; }
  .sheet__plan { grid-column: 1 / -1; grid-row: auto; position: static; }
  .sheet__axo { grid-column: 1 / span 6; }
  .facts { grid-column: 7 / span 6; }
  .sheet__text { grid-column: 1 / span 8; }
  .sheet__title { grid-column: 1 / -1; }
  .sheet__sub { grid-column: 1 / -1; }
  .cover__b { grid-column: 4 / span 5; }
  .cover__fig { grid-column: 3 / span 6; }
}

@media (max-width: 760px) {
  :root { --header: 56px; }
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .menu-btn {
    display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--s-2);
    grid-column: 4 / -1; justify-self: end;
    min-height: 44px; padding: 0; background: none; border: 0; font-size: var(--fs-s);
  }
  .menu-btn__a { transition: d var(--t-med) var(--ease-out); }
  .menu-btn[aria-expanded="true"] .menu-btn__a { d: path("M3.5 3.5l9 9M12.5 3.5l-9 9"); }
  .mark { grid-column: 1 / span 3; }
  .nav {
    position: fixed; top: var(--header); left: 0; right: 0; bottom: 0; z-index: 39;
    display: none; flex-direction: column; justify-content: flex-start; gap: 0;
    padding: var(--s-5) var(--margin); background: var(--paper);
  }
  .nav.is-open { display: flex; }
  .nav a { font-size: 2.25rem; font-weight: 300; letter-spacing: -0.03em; color: var(--ink); min-height: 64px; border-bottom: 1px solid var(--rule); }
  html:not(.js) .nav { position: static; display: flex; flex-direction: row; flex-wrap: wrap; padding: 0; grid-column: 1 / -1; }
  html:not(.js) .nav a { font-size: var(--fs-s); min-height: 44px; border: 0; }

  .cover { min-height: calc(100svh - var(--header) - 40px); grid-template-rows: auto auto 1fr auto auto; }
  .cover__fig { grid-column: 1 / -1; grid-row: 3; width: min(100%, 250px); justify-self: start; padding-block: 0; }
  .cover__fig .axo { max-height: 20svh; }
  .cover__a { grid-column: 1 / span 3; }
  .cover__b { grid-column: 1 / -1; grid-row: 2; }
  .cover__c { grid-column: 4 / span 3; grid-row: 1; }
  .cover__go { grid-column: 1 / -1; grid-row: 4; }
  .cover__t { grid-row: 5; font-size: clamp(4rem, 37vw, 12rem); line-height: 0.8; white-space: normal; }
  .cover__t span { display: block; }

  .works__head .h-xl, .works__lede { grid-column: 1 / -1; }
  .tools { flex-direction: column; align-items: stretch; }
  .filters { display: grid; grid-template-columns: repeat(2, 1fr); }
  .filters .chip:first-child { grid-column: 1 / -1; justify-content: space-between; }
  .filters .chip { justify-content: space-between; padding: 0 var(--s-3); }
  .views { display: grid; grid-template-columns: 1fr 1fr; }
  .views .chip { justify-content: center; }

  /* Index on a phone: two lines per row; a tap opens the drawing inline under the row */
  .index__cols { display: none; }
  .work__link {
    grid-template-columns: 3.2em minmax(0, 1fr) auto; row-gap: 2px;
    padding-block: var(--s-4) var(--s-4);
  }
  .work__no { grid-column: 1; grid-row: 1; padding-top: 0.45em; }
  .work__name { grid-column: 2 / span 2; grid-row: 1; font-size: 1.25rem; }
  .work__place { grid-column: 2; grid-row: 2; font-size: var(--fs-s); }
  .work__type { display: none; }
  .work__year { grid-column: 3; grid-row: 2; text-align: right; }
  .work__area { display: none; }
  .work.is-open .work__fig, html:not(.js) .work__fig { display: block; padding: 0 0 var(--s-3) 3.2em; }
  .work__fig .axo { width: 100%; height: auto; aspect-ratio: 4 / 3; background: var(--wash); padding: 6%; }
  .work__fig figcaption { display: none; }
  .work.is-open .work__open, html:not(.js) .work__open {
    display: flex; justify-content: space-between; align-items: center; min-height: 48px;
    margin: 0 0 var(--s-4) 3.2em; padding: 0 var(--s-4); background: var(--ink); color: var(--paper);
    text-decoration: none; font-size: var(--fs-s);
  }
  .work.is-open .work__link .work__name { text-decoration: underline; text-decoration-thickness: 1px; }

  .index[data-view="grid"] .list { grid-template-columns: 1fr; gap: var(--s-6); }
  .index[data-view="grid"] .work__fig { padding: 0 !important; }
  .index[data-view="grid"] .work__link { grid-template-columns: 3.2em 1fr auto; }
  .index[data-view="grid"] .work__name { grid-column: 2; }
  .index[data-view="grid"] .work__year { grid-row: 1; }
  .index[data-view="grid"] .work__open { display: none !important; }

  .people { grid-template-columns: 1fr; gap: var(--s-7); }
  .practice__cols { grid-template-columns: 1fr; }
  .steps li { grid-template-columns: 2em minmax(0, 1fr); row-gap: var(--s-2); }
  .steps h3, .steps__n { grid-row: 1; }
  .steps p, .steps__t { grid-column: 2; }
  .steps__t { text-align: left; color: var(--ink-3); }
  .record__col, .record__col + .record__col { grid-column: 1 / -1 !important; }
  .role summary { grid-template-columns: 1fr 16px; row-gap: 2px; padding-block: var(--s-4); }
  .role__m { grid-column: 1; grid-row: 2; }
  .role summary .i { grid-column: 2; grid-row: 1 / span 2; }
  .role__b { grid-template-columns: 1fr; }

  .form { grid-template-columns: 1fr; }
  .choice--seg { gap: var(--s-2); }
  .choice--seg label + label span { border-left-width: 1px; }
  .btn { width: 100%; }

  .foot__big { font-size: clamp(4rem, 30vw, 9rem); }
  .foot__addr, .foot__contact, .foot__col { grid-column: 1 / -1; }
  .foot__end .link-btn { margin-left: 0; }

  .sheet__nav { gap: var(--s-2); }
  .sheet__nav a { min-width: 44px; justify-content: center; }
  .sheet__nav span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sheet__close span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sheet__body { padding-top: var(--s-5); }
  .sheet__axo, .facts, .sheet__text { grid-column: 1 / -1; }
}

/* Phones: plan lettering scales up so the grid letters stay readable at a small drawing size */
@media (max-width: 760px) {
  .sheet__head { row-gap: var(--s-3); }
  .plan text { font-size: calc(var(--fs) * 1.9); }
}

/* Without JavaScript the filters and view switch cannot work, so they are not shown */
html:not(.js) .tools { display: none; }
