/* Variant H — Swiss drawing sheet. Tokens mirror portfolio.pen ($zest-h-*). */

/* Self-hosted fonts (from Google Fonts, SIL Open Font License; licences in assets/fonts/). Latin and Latin
   Extended only; Schibsted Grotesk is one variable file covering weights 400–800. */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-mono-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-mono-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/schibsted-grotesk-400-800-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/schibsted-grotesk-400-800-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #F6F6F2;
  --ink: #0B0B0B;
  --grey: #5E5E5A;
  --blue: #1A35E0;
  --blue2: #132AB8;
  --grid: #1A35E01A;
  --grid2: #1A35E033;
  --rule: #0B0B0B2E;
  --wline: #FFFFFF33;
  --wgrid: #FFFFFF14;
  --wdim: #FFFFFFC0;
  --white: #FFFFFF;

  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 240ms;
  --gutter: 40px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }

/* The page is the container, so 1 "drawing unit" = 1px at 1440 and scales below it. */
.page {
  container-type: inline-size;
  overflow-x: clip;
  --u: calc(min(100cqw, 1440px) / 1440);
}

::selection { background: var(--blue); color: var(--white); }
.work ::selection, .contact ::selection, .footer-tb ::selection,
.detail ::selection, .tb-brand ::selection { background: var(--white); color: var(--blue); }
/* SVG text paints with fill, not color. */
.draw text::selection { fill: var(--blue); }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
.work :focus-visible, .contact :focus-visible, .footer-tb :focus-visible, .tb-brand:focus-visible {
  outline-color: var(--white);
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--ink); color: var(--white); padding: 10px 14px;
  font-weight: 600;
}
.skip:focus { top: 16px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.mono, .mono-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.6px;
  font-weight: 400;
  line-height: 1.4;
}
.muted { color: var(--grey); }
.blue { color: var(--blue); }
.dim-white { color: var(--wdim); }
h2.mono { font-weight: 500; }

.icon {
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Header — title block ---------- */
.titleblock {
  display: flex;
  border-bottom: 1.5px solid var(--ink);
  position: sticky; top: 0; z-index: 5;
  background: var(--paper);
}
.tb-brand {
  flex: 0 0 320px;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: var(--ink); color: var(--white);
}
.signal { width: 14px; height: 14px; background: var(--blue); flex: none; }
.tb-brand-name { font-size: 20px; font-weight: 700; letter-spacing: -0.4px; }
.tb-cell {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 20px;
  border-right: 1px solid var(--ink);
}
.tb-cell .mono-label { color: var(--grey); }
.tb-value { font-size: 15px; font-weight: 500; white-space: nowrap; }
.tb-project { flex: 1 1 auto; min-width: 0; }
.tb-sheet { flex: 0 0 140px; }
.tb-nav {
  flex: 0 0 180px;
  display: flex; flex-direction: column; justify-content: center; gap: 0;
  padding: 8px 20px;
}
/* 24px tall rows meet the minimum touch-target size (WCAG 2.2, 2.5.8) without growing the header. */
.tb-nav a {
  display: flex; align-items: center; min-height: 24px;
  font-size: 14px; font-weight: 500; width: fit-content; transition: color var(--dur) var(--ease);
}
.tb-nav a:hover { color: var(--blue); }

/* ---------- Hero — drawing sheet ---------- */
.hero {
  --g: calc(40 * var(--u));
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, var(--grid2) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid2) 1px, transparent 1px),
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: calc(var(--g) * 6) calc(var(--g) * 6), calc(var(--g) * 6) calc(var(--g) * 6), var(--g) var(--g), var(--g) var(--g);
  background-position: calc((100cqw - 1440 * var(--u)) / 2) 0;
  overflow: hidden;
}
.hero-sheet {
  position: relative;
  width: calc(1440 * var(--u));
  height: calc(900 * var(--u));
  margin: 0 auto;
}
.hero-sheet > * { position: absolute; }
.hero-kicker { left: calc(40 * var(--u)); top: calc(34 * var(--u)); }

.name { left: calc(32 * var(--u)); top: calc(104 * var(--u)); }
.name h1 {
  font-size: calc(272 * var(--u));
  font-weight: 800;
  letter-spacing: -0.0515em;
  line-height: 0.84;
}
.name h1 > span { display: block; width: fit-content; }
.fullstop {
  display: inline-block;
  width: 0.191em; height: 0.191em;
  margin-left: 0.03em;
  background: var(--blue);
}

/* Dimension lines: a hairline with end ticks, label sitting on the line. */
.dim { position: absolute; background: var(--blue); transform-origin: left center; }
.dim::before, .dim::after { content: ""; position: absolute; background: var(--blue); }
.dim-w {
  left: calc(8 * var(--u)); width: calc(1022 * var(--u));
  top: calc(-20 * var(--u)); height: 1px;
}
.dim-w::before, .dim-w::after { width: 1px; height: 13px; top: -6px; }
.dim-w::before { left: 0; }
.dim-w::after { right: 0; }
.dim-label {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  padding: 2px 6px;
  background: var(--paper); color: var(--blue);
  font: 500 11px/1.4 var(--mono); letter-spacing: 0.6px;
  white-space: nowrap;
}
.dim-h {
  left: calc(-16 * var(--u)); top: calc(16 * var(--u));
  width: 1px; height: calc(420 * var(--u));
  transform-origin: center top;
}
.dim-h::before, .dim-h::after { height: 1px; width: 13px; left: -6px; }
.dim-h::before { top: 0; }
.dim-h::after { bottom: 0; }


/* Detail 01 — the primary button, drawn at 2:1 with its dimensions. */
.detail {
  --du: var(--u);
  right: calc(40 * var(--u)); top: calc(384 * var(--u));
  width: calc(400 * var(--du)); height: calc(236 * var(--du));
  background: var(--blue); color: var(--white);
}
.detail > * { position: absolute; }
.detail .mono { font-weight: 500; white-space: nowrap; }
.detail-title { left: calc(20 * var(--du)); top: calc(18 * var(--du)); }
.detail-ref { right: calc(20 * var(--du)); top: calc(18 * var(--du)); font-weight: 400 !important; }
.detail-button {
  left: calc(60 * var(--du)); top: calc(84 * var(--du));
  width: calc(240 * var(--du)); height: calc(64 * var(--du));
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 calc(24 * var(--du));
  background: var(--white); color: var(--ink);
  font-size: calc(20 * var(--du)); font-weight: 700;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.detail-button .icon { width: calc(24 * var(--du)); height: calc(24 * var(--du)); transition: transform var(--dur) var(--ease); }
.detail-button:hover { background: var(--ink); color: var(--white); }
.detail-button:hover .icon { transform: translate(2px, 2px); }
.detail-button:focus-visible { outline-color: var(--white); }
.detail-dim-h {
  left: calc(60 * var(--du)); top: calc(166 * var(--du));
  width: calc(240 * var(--du)); height: 1px; background: var(--white);
}
.detail-dim-v {
  left: calc(318 * var(--du)); top: calc(84 * var(--du));
  width: 1px; height: calc(64 * var(--du)); background: var(--white);
}
.detail-dim-h::before, .detail-dim-h::after,
.detail-dim-v::before, .detail-dim-v::after { content: ""; position: absolute; background: var(--white); }
.detail-dim-h::before, .detail-dim-h::after { width: 1px; height: 13px; top: -6px; }
.detail-dim-h::before { left: 0; }
.detail-dim-h::after { right: 0; }
.detail-dim-v::before, .detail-dim-v::after { height: 1px; width: 13px; left: -6px; }
.detail-dim-v::before { top: 0; }
.detail-dim-v::after { bottom: 0; }
.detail-w { left: calc(180 * var(--du)); top: calc(176 * var(--du)); transform: translateX(-50%); font-weight: 400 !important; }
.detail-h { left: calc(330 * var(--du)); top: calc(116 * var(--du)); transform: translateY(-50%); font-weight: 400 !important; }
.detail-spec { left: calc(20 * var(--du)); top: calc(206 * var(--du)); font-weight: 400 !important; }

.hero-rule {
  left: calc(40 * var(--u)); top: calc(652 * var(--u));
  width: calc(1360 * var(--u));
  margin: 0; border: 0; height: 1.5px; background: var(--ink);
}

.intro {
  left: calc(40 * var(--u)); top: calc(684 * var(--u));
  width: calc(720 * var(--u));
  display: flex; flex-direction: column; gap: calc(32 * var(--u));
}
.intro-text {
  font-size: calc(28 * var(--u));
  line-height: 1.25; letter-spacing: -0.4px;
}
/* Pinned to the hero grid: the button fills cells 1–4 of row 840–880, the email starts one cell after it. */
.cta-row {
  position: absolute; left: 0; top: calc(156 * var(--u));
  height: calc(40 * var(--u));
  display: flex; align-items: center; gap: calc(40 * var(--u));
}
.btn-primary {
  display: inline-flex; align-items: center; justify-content: space-between;
  width: calc(160 * var(--u)); height: calc(40 * var(--u));
  padding: 0 calc(14 * var(--u));
  background: var(--ink); color: var(--white);
  font-size: max(12px, calc(15 * var(--u))); font-weight: 700;
  white-space: nowrap;
  transition: background var(--dur) var(--ease);
}
.btn-primary .icon { width: calc(16 * var(--u)); height: calc(16 * var(--u)); transition: transform var(--dur) var(--ease); }
.btn-primary:hover { background: var(--blue); }
.btn-primary:hover .icon { transform: translate(2px, 2px); }
/* Fills the second major grid group (240–480), text centred inside it. */
.email-link {
  display: inline-block; width: calc(240 * var(--u)); text-align: center;
  font-size: 17px; font-weight: 500;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
  transition: color var(--dur) var(--ease);
}
.email-link:hover { color: var(--blue); }


/* ---------- Numbers — schedule of quantities ---------- */
.schedule { border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.schedule-head {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px var(--gutter);
  border-bottom: 1px solid var(--ink);
}
.schedule-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.qty {
  display: flex; flex-direction: column; gap: 20px;
  padding: 28px var(--gutter) 32px;
  border-right: 1px solid var(--ink);
}
.qty:last-child { border-right: 0; }
.qty-code { font: 500 11px/1.4 var(--mono); letter-spacing: 0.6px; color: var(--blue); }
.qty-figure { display: flex; align-items: flex-end; gap: 8px; }
.qty-number {
  font-size: clamp(64px, 7.2cqw, 104px);
  font-weight: 800; letter-spacing: -0.048em; line-height: 0.9;
}
.qty-unit { font: 400 13px/1.4 var(--mono); letter-spacing: 0.6px; }
.qty-text { font-size: 16px; line-height: 1.35; max-width: 200px; }

/* ---------- Work — blueprint sheets ---------- */
.work {
  display: flex; flex-direction: column; gap: 56px;
  padding: 96px var(--gutter);
  background-color: var(--blue);
  background-image:
    linear-gradient(to right, var(--wgrid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--wgrid) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: calc((100cqw - 1440 * var(--u)) / 2) 0;
  color: var(--white);
}
.work-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; }
.work-title-block { display: flex; flex-direction: column; gap: 24px; }
.work-title-block .mono { font-weight: 500; }
.work-header h2 {
  font-size: clamp(52px, 7.78cqw, 112px);
  font-weight: 800; letter-spacing: -0.0446em; line-height: 0.92;
}
.work-intro { font-size: 18px; line-height: 1.45; color: var(--wdim); max-width: 340px; }

.sheet-feature { display: flex; border: 1.5px solid var(--white); }
.sheet-drawing { flex: 1 1 auto; min-width: 0; border-right: 1px solid var(--white); }
.sheet-drawing svg { width: 100%; height: auto; }

.draw rect, .draw circle, .draw line {
  fill: none; stroke: var(--white); stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.draw .solid { fill: var(--white); stroke: none; }
.draw .dash { stroke-dasharray: 6 5; }
.draw .ma { fill: none; stroke: var(--white); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.draw text { fill: var(--white); dominant-baseline: hanging; }
.svg-mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.6px; }
.svg-balance { font-family: var(--sans); font-size: 40px; font-weight: 700; letter-spacing: -1.5px; }

.sheet-tb { flex: 0 0 400px; display: flex; flex-direction: column; }
.sheet-tb-cell {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--white);
}
.sheet-tb-cell dt { font: 400 11px/1.4 var(--mono); letter-spacing: 0.6px; color: var(--wdim); }
.sheet-tb-cell dd { font-size: 17px; font-weight: 500; line-height: 1.3; }
.sheet-tb-cell .sheet-tb-name { font-size: 48px; font-weight: 800; letter-spacing: -2px; line-height: 1.3; }
.sheet-tb-foot {
  flex: 1 1 auto;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 18px 24px;
  font: 400 11px/1.4 var(--mono); letter-spacing: 0.6px;
}

.sheet-tb-link {
  font-weight: 500;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.sheet-tb-link:hover { color: var(--wdim); }

.sheet-index { border-top: 1.5px solid var(--white); }
.sheet-index li { border-bottom: 1px solid var(--white); }
.sheet-row {
  display: grid;
  grid-template-columns: auto 460px minmax(0, 1fr) 168px 28px;
  align-items: center; gap: 40px;
  padding: 28px 0;
  transition: background var(--dur) var(--ease), padding var(--dur) var(--ease);
}
.sheet-row:hover { background: #FFFFFF0F; padding-left: 16px; padding-right: 16px; }
.sheet-code { font: 500 13px/1.4 var(--mono); letter-spacing: 0.6px; }
.sheet-name { font-size: 56px; font-weight: 800; letter-spacing: -2.5px; line-height: 1.1; }
.sheet-text { display: flex; flex-direction: column; gap: 10px; }
.sheet-desc { font-size: 17px; line-height: 1.4; }
.sheet-stack { font: 400 11px/1.4 var(--mono); letter-spacing: 0.6px; color: var(--wdim); }
.sheet-thumb { width: 168px; height: 104px; }
.sheet-arrow { width: 28px; height: 28px; transition: transform var(--dur) var(--ease); }
.sheet-row:hover .sheet-arrow { transform: translate(3px, -3px); }

/* ---------- About — specification ---------- */
.about {
  display: flex; gap: 80px;
  padding: 112px var(--gutter);
}
.portrait-col { flex: 0 0 400px; display: flex; flex-direction: column; gap: 14px; }
.portrait {
  --pu: 1px;
  position: relative;
  width: calc(400 * var(--pu)); height: calc(520 * var(--pu));
}
.portrait > * { position: absolute; }
.portrait-photo {
  left: 0; top: calc(16 * var(--pu));
  width: calc(360 * var(--pu)); height: calc(450 * var(--pu));
  background:
    repeating-linear-gradient(135deg, transparent 0 9px, var(--rule) 9px 10px),
    #E9E9E3;
  overflow: hidden;
}
.portrait-photo img { width: 100%; height: 100%; object-fit: cover; }
.pdim { background: var(--blue); }
.pdim::before, .pdim::after { content: ""; position: absolute; background: var(--blue); }
.pdim-top { left: 0; top: 0; width: calc(360 * var(--pu)); height: 1px; }
.pdim-top::before, .pdim-top::after { width: 1px; height: 13px; top: -6px; }
.pdim-top::before { left: 0; }
.pdim-top::after { right: 0; }
.pdim-side { left: calc(378 * var(--pu)); top: calc(16 * var(--pu)); width: 1px; height: calc(450 * var(--pu)); }
.pdim-side::before, .pdim-side::after { height: 1px; width: 13px; left: -6px; }
.pdim-side::before { top: 0; }
.pdim-side::after { bottom: 0; }
.pdim-label { font: 400 11px/1.4 var(--mono); color: var(--blue); }
.pdim-label-w {
  left: calc(180 * var(--pu)); top: 0;
  transform: translate(-50%, -50%);
  padding: 1px 6px; background: var(--paper);
}
.pdim-label-h { left: calc(384 * var(--pu)); top: calc(241 * var(--pu)); transform: translateY(-50%); }
.portrait figcaption { left: 0; top: calc(482 * var(--pu)); }

.about-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 40px; padding-top: 30px; container-type: inline-size; }
.about-statement {
  /* Sized from the text column (.about-text is a container) so two lines fit wherever the column allows. */
  font-size: clamp(28px, 100cqw / 17.5, 46px);
  font-weight: 700; letter-spacing: -0.0348em; line-height: 1.08;
  /* Capped so it sets as two even lines rather than one long line and a stray word. */
  max-width: 17em; text-wrap: balance;
}
.about-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.about-columns p { font-size: 17px; line-height: 1.5; }

.skills { width: 100%; border-collapse: collapse; border-top: 1.5px solid var(--ink); }
.skills th, .skills td { padding: 0 24px 0 0; text-align: left; vertical-align: middle; }
.skills th:last-child, .skills td:last-child { padding-right: 0; }
.skills th {
  font: 400 11px/1.4 var(--mono); letter-spacing: 0.6px;
  padding-top: 10px; padding-bottom: 10px;
  border-bottom: 1px solid var(--ink);
}
.skills td { padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); font: 400 11px/1.4 var(--mono); letter-spacing: 0.6px; }
.skills th:nth-child(1) { width: 64px; }
.skills th:nth-child(3) { width: 200px; }
.skills .s-code { color: var(--blue); font-weight: 500; }
.skills .s-item { font: 500 17px/1.3 var(--sans); letter-spacing: 0; }
.skills td.c-note { color: var(--grey); }

/* ---------- Contact — final sheet ---------- */
.contact {
  display: flex; flex-direction: column; gap: 48px;
  padding: 104px var(--gutter) 48px;
  background: var(--ink); color: var(--white);
}
.contact-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.contact-top .mono:first-child { font-weight: 500; }
.contact-headline {
  font-size: clamp(44px, 12.2cqw, 176px);
  font-weight: 800; letter-spacing: -0.0511em; line-height: 0.88;
}
.email-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 28px 0;
  border-top: 1px solid var(--wline); border-bottom: 1px solid var(--wline);
}
.contact-email {
  font-size: clamp(22px, 4.45cqw, 64px);
  font-weight: 600; letter-spacing: -0.031em;
  overflow-wrap: anywhere;
}
.email-button {
  flex: none;
  width: clamp(56px, 6.7cqw, 96px); height: clamp(56px, 6.7cqw, 96px);
  display: flex; align-items: center; justify-content: center;
  background: var(--blue);
  transition: background var(--dur) var(--ease);
}
.email-button .icon { width: 42%; height: 42%; transition: transform var(--dur) var(--ease); }
.email-row:hover .email-button { background: var(--blue2); }
.email-row:hover .email-button .icon { transform: translate(3px, -3px); }
.email-row:hover .contact-email { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
.links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.links li { display: flex; flex-direction: column; gap: 6px; }
.links a {
  font-size: 18px; font-weight: 600; width: fit-content;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.links a:hover { color: var(--wdim); }

.footer-tb {
  display: flex;
  margin: 0; padding: 0 var(--gutter);
  background: var(--ink); color: var(--white);
}
.ftb {
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px;
  border-top: 1px solid var(--wline);
  border-right: 1px solid var(--wline);
  font-size: 14px; font-weight: 500;
}
.ftb-drawn { flex: 0 0 240px; }
.ftb-checked { flex: 1 1 auto; }
.ftb-date { flex: 0 0 160px; }
.ftb-sheet { flex: 0 0 180px; background: var(--blue); border-right: 0; border-top-color: var(--blue); font-weight: 700; }

/* ---------- Hero entrance (plays once on load; html.motion is set in <head>) ---------- */
html.motion .hero-kicker { animation: rise 600ms var(--ease) 0ms both; }
html.motion .name-l1 { animation: rise-big 900ms var(--ease) 120ms both; }
html.motion .name-l2 { animation: rise-big 900ms var(--ease) 260ms both; }
html.motion .fullstop { animation: drop 650ms cubic-bezier(.3, 1.45, .5, 1) 820ms both; }
html.motion .dim-w { animation: draw-x 900ms var(--ease) 700ms both; }
html.motion .dim-h { animation: draw-y 900ms var(--ease) 820ms both; }
html.motion .dim-label { animation: fade 300ms var(--ease) 1000ms both; } /* main.js counts the number up */
html.motion .detail { animation: wipe 800ms var(--ease) 900ms both; }
html.motion .detail > * { animation: fade 500ms var(--ease) 1450ms both; }
html.motion .hero-rule { transform-origin: left center; animation: draw-x 900ms var(--ease) 1100ms both; }
html.motion .intro-text { animation: rise 700ms var(--ease) 1250ms both; }
html.motion .cta-row { animation: rise 700ms var(--ease) 1400ms both; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes rise-big { from { opacity: 0; transform: translateY(0.22em); } }
@keyframes drop { from { opacity: 0; transform: translateY(-1.4em); } }
@keyframes draw-x { from { transform: scaleX(0); } }
@keyframes draw-y { from { transform: scaleY(0); } }
@keyframes fade { from { opacity: 0; } }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- Scroll reveals (html.motion is set in <head>; main.js adds .is-in) ---------- */
html.motion [data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  transition-delay: var(--delay, 0ms);
}
html.motion [data-reveal].is-in { opacity: 1; transform: none; }
/* A wipe draws the element in from the left, like a rule being ruled. It starts hidden with opacity rather than a clip,
   because IntersectionObserver treats a fully clipped element as never visible; main.js runs the clip animation. */
html.motion [data-reveal="wipe"] { transform: none; transition: none; }

/* Chart Buddy drawing: hidden until it scrolls into view, then main.js draws it part by part. */
html.motion [data-chart]:not(.is-drawn) { visibility: hidden; }
[data-chart] .candle { transform-box: fill-box; transform-origin: 50% 100%; }
[data-chart] [data-part="axis"] line,
[data-chart] [data-part="alert"] line { transform-box: fill-box; transform-origin: 0 50%; }

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

/* ---------- Below the 1440 frame's comfortable range: reflow ---------- */
@media (max-width: 1279px) {
  .tb-brand { flex-basis: 260px; }

  .sheet-row { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.2fr) 28px; }
  .sheet-name { font-size: 44px; }
  .sheet-thumb { display: none; }
}

@media (max-width: 1099px) {
  .page { --u: 1px; }
  :root { --gutter: 24px; }
  .tb-brand { flex-basis: 220px; }

  .hero { background-position: 0 0; }
  .hero-sheet {
    width: auto; height: auto;
    display: flex; flex-direction: column;
    padding: 28px var(--gutter) 48px;
  }
  .hero-sheet > * { position: static; inset: auto; }
  .hero-kicker { order: 0; }
  .name { position: relative; order: 2; margin: 56px 0 0 -0.04em; }
  .name h1 { font-size: calc((100cqw - 2 * var(--gutter)) / 3.85); }
  .dim-w { left: 0.04em; }
  .dim-h { display: none; }
  .detail {
    order: 4; position: relative; margin-top: 40px;
    --du: min(1px, (100cqw - 2 * var(--gutter)) / 400);
  }
  .hero-rule { order: 5; width: 100%; margin-top: 40px; }
  .intro { order: 6; width: auto; margin-top: 32px; gap: 28px; }
  .intro-text { font-size: clamp(21px, 3.4cqw, 28px); }
  .cta-row { position: static; height: auto; gap: 24px; flex-wrap: wrap; }
  .email-link { width: auto; text-align: left; }

  .schedule-row { grid-template-columns: 1fr 1fr; }
  .qty:nth-child(2) { border-right: 0; }
  .qty:nth-child(-n+2) { border-bottom: 1px solid var(--ink); }

  .work { padding-top: 72px; padding-bottom: 72px; gap: 40px; }
  .work-header { flex-direction: column; align-items: flex-start; gap: 24px; }
  .sheet-feature { flex-direction: column; }
  .sheet-drawing { border-right: 0; border-bottom: 1px solid var(--white); }
  .sheet-tb { flex-basis: auto; }

  .about { flex-direction: column; gap: 48px; padding-top: 80px; padding-bottom: 80px; }
  .portrait-col { flex-basis: auto; }
  .portrait { --pu: min(1px, (100cqw - 2 * var(--gutter)) / 400); }
  .about-text { padding-top: 0; }

  .contact { padding-top: 80px; }
  .links { grid-template-columns: 1fr 1fr; row-gap: 28px; }
  .footer-tb { flex-wrap: wrap; }
  .ftb { flex: 1 1 50% !important; }
  .ftb-checked { order: 5; flex-basis: 100% !important; }
}

@media (max-width: 759px) {
  :root { --gutter: 16px; }
  .titleblock { flex-wrap: wrap; }
  .tb-brand { flex: 1 1 auto; padding: 14px 16px; }
  .tb-project, .tb-sheet { display: none; }
  .tb-nav { flex: 1 1 100%; flex-direction: row; align-items: center; gap: 24px; padding: 10px 16px; }

  .schedule-row { grid-template-columns: 1fr; }
  .qty { border-right: 0 !important; border-bottom: 1px solid var(--ink); }
  .qty:last-child { border-bottom: 0; }
  .qty-number { font-size: 72px; }

  .sheet-row { grid-template-columns: minmax(0, 1fr) 28px; gap: 12px 16px; padding: 24px 0; }
  .sheet-row:hover { padding-left: 0; padding-right: 0; }
  .sheet-code { grid-column: 1; }
  .sheet-arrow { grid-column: 2; grid-row: 1; }
  .sheet-name { grid-column: 1 / -1; font-size: 36px; letter-spacing: -1.5px; }
  .sheet-text { grid-column: 1 / -1; }
  .sheet-tb-cell .sheet-tb-name { font-size: 40px; }

  .about-columns { grid-template-columns: 1fr; gap: 20px; }
  .skills .c-note { display: none; }
  .skills th:nth-child(1) { width: 44px; }
  .skills th, .skills td { padding-right: 12px; }
  .skills .s-item { font-size: 15px; }

  .links { grid-template-columns: 1fr 1fr; }
  .ftb { flex-basis: 100% !important; border-right: 0; }
}
