/* ==========================================================================
   GX Painting — single stylesheet
   --------------------------------------------------------------------------
   Structure:
     1. Tokens          — the palette (black / white / cobalt) and scale units
     2. Base            — resets and shared primitives
     3. Board           — the one-screen home app (topbar, rail, stage views)
     4. Plain pages     — thanks.html / 404.html
     5. Footer          — shared black footer
     6. Mobile          — the single responsive block
     7. Reduced motion
   Load-bearing rules are commented. Three colors only: ink, white, cobalt.
   ========================================================================== */

/* 1. TOKENS ---------------------------------------------------------------- */

@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;

  --ink: #181818;
  --white: #fafafa;
  --paper: #ececee;          /* page canvas + input fields */
  --paper-2: #d9dade;        /* gallery stage backdrop */
  --panel: #f6f6f7;          /* board title/meta area */
  --rail-line: #696b70;      /* the 2px grid lines of the board */
  --line: rgba(24, 24, 24, 0.18);
  --line-light: rgba(255, 255, 255, 0.22);

  /* Semantic chrome and interaction colors stay intentional in both themes. */
  --chrome: #181818;
  --chrome-text: #fafafa;
  --chrome-hover: #303030;
  --surface-hover: #f3f3f3;
  --surface-raised: #ffffff;
  --action-surface: #fafafa;
  --action-text: #181818;
  --action-hover: #ffffff;
  --header-surface: rgba(236, 236, 238, 0.97);
  --control-surface: rgba(250, 250, 250, 0.94);
  --tag-surface: rgba(24, 24, 24, 0.82);
  --placeholder: #64676d;
  --shadow-soft: rgba(12, 12, 12, 0.14);
  --shadow-strong: rgba(12, 12, 12, 0.2);
  --button-bg: #181818;
  --button-text: #fafafa;
  --button-hover: #303030;

  --blue: #2353d4;           /* painter's-tape cobalt — the one signature color */
  --blue-dark: #1a3ea3;
  --blue-on-dark: #8aa6ff;
  --blue-tint: rgba(35, 83, 212, 0.16);
  --accent-text: #fafafa;

  --font: "Outfit", "Segoe UI", Helvetica, Arial, sans-serif;

  /* Board chrome scale: one unit that tracks viewport width AND height so the
     no-scroll board keeps its proportions on any screen. */
  --u: clamp(7px, min(0.8vw, 1.35vh), 12px);

  /* Small-text steps used across the board chrome and footer. */
  --t-label: clamp(8px, 0.58vw, 11px);
  --t-small: clamp(10px, 0.72vw, 14px);
  --t-body: clamp(11px, 0.82vw, 16px);
}

/* 2. BASE ------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  color: var(--accent-text);
  background: var(--blue);
}

img {
  display: block;
  max-width: 100%;
}

/* Load-bearing: every image on the site is a <picture> with an AVIF source.
   contents/none keep those wrappers out of grid and flex layout. */
picture {
  display: contents;
}

source {
  display: none;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p,
figure,
ul {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2000;
  padding: 0.7rem 1rem;
  color: var(--chrome-text);
  background: var(--chrome);
  border-radius: 999px;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Brand lockup (board topbar + plain-page headers) */
.brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 0.75vw, 13px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: clamp(40px, 3.4vw, 46px);
  height: clamp(40px, 3.4vw, 46px);
  color: var(--accent-text);
  background: var(--blue);
  border-radius: 50%;
  font-size: var(--t-small);
  font-weight: 850;
  letter-spacing: -0.12em;
}

.brand-name {
  display: grid;
  font-size: var(--t-small);
  font-weight: 820;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.brand-name small {
  margin-top: 0.24em;
  color: var(--chrome-text);
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: 0.18em;
}

/* 3. BOARD ----------------------------------------------------------------- */

/* The board page fills the viewport exactly: board row + footer row. */
body.page-board {
  display: grid;
  height: 100vh;
  height: 100svh;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

body.page-board > main {
  min-height: 0;
  padding: calc(var(--u) * 0.75);
}

.home-overview {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(0, 4fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 2px;
  overflow: hidden;
  background: var(--rail-line);
  border-radius: calc(var(--u) * 1.25);
}

/* Topbar */
.home-topbar {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 108px;
  background: var(--chrome);
}

.home-topbar .brand {
  padding-left: calc(var(--u) * 1.35);
  color: var(--chrome-text);
}

/* The board's brand lockup runs a step larger than the shared default. */
.home-topbar .brand-mark {
  width: clamp(48px, 4.1vw, 58px);
  height: clamp(48px, 4.1vw, 58px);
  font-size: clamp(12px, 0.92vw, 17px);
}

.home-topbar .brand-name {
  font-size: clamp(12px, 0.92vw, 17px);
}

.home-topbar .brand-name small {
  font-size: clamp(9px, 0.7vw, 13px);
}

.home-topbar__phone {
  display: grid;
  justify-items: center;
  row-gap: clamp(2px, 0.35vh, 5px);
  margin-right: clamp(16px, 1.6vw, 28px);
  padding: clamp(10px, 1.4vh, 16px) clamp(18px, 1.7vw, 30px);
  color: var(--action-text);
  background: var(--action-surface);
  border-radius: 14px;
  text-align: center;
  transition: background-color 180ms ease;
}

.home-topbar__phone:hover {
  background: var(--action-hover);
}

.home-topbar__phone span {
  font-size: clamp(17px, 1.4vw, 25px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.home-topbar__phone small {
  color: var(--action-text);
  font-size: clamp(11px, 0.85vw, 15px);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

/* Rail: four service tabs + the contact card. All labels share one JS-fitted
   font size (app.js) so they always match and never clip. */
.home-tabs {
  display: grid;
  grid-row: 2;
  grid-template-rows: repeat(4, minmax(0, 1fr)) auto;
  min-height: 0;
  gap: 2px;
  background: var(--rail-line);
}

.home-tabs [role="tab"] {
  --thumb: 5.5rem;                 /* JS overwrites per rail height */
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--thumb);
  grid-template-rows: var(--thumb) minmax(0, 1fr);
  gap: calc(var(--u) * 0.5) calc(var(--u) * 0.7);
  min-width: 0;
  min-height: 0;
  padding: calc(var(--u) * 0.65) calc(var(--u) * 0.7);
  overflow: hidden;
  color: var(--ink);
  background: var(--white);
  border: 0;
  text-align: left;
}

.home-tabs [role="tab"]:hover {
  background: var(--surface-hover);
  box-shadow: inset 4px 0 0 0 var(--paper-2);
}

.home-tabs [role="tab"][aria-selected="true"] {
  color: var(--chrome-text);
  background: var(--chrome);
  box-shadow: inset 4px 0 0 0 var(--blue);
}

.home-tabs [role="tab"]:focus-visible,
.home-tabs .nav-cta:focus-visible {
  outline-offset: -3px;            /* keep the ring inside the clipped card */
}

.tab-label {
  display: block;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  font-size: 16px;                 /* JS fits the real size */
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 0.86;
  white-space: nowrap;
}

.home-tabs img {
  grid-column: 2;
  grid-row: 1;
  width: var(--thumb);
  height: var(--thumb);
  max-width: none;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 240ms ease;
}

.home-tabs img.is-ready {
  opacity: 1;
}

.home-tabs .nav-cta {
  display: flex;
  align-items: flex-start;
  min-height: 108px;
  margin: 0;
  padding: calc(var(--u) * 0.65) calc(var(--u) * 0.7);
  color: var(--chrome-text);
  background: var(--chrome);
  border: 0;
  text-align: left;
  transition: background-color 180ms ease;
}

.home-tabs .nav-cta:hover {
  background: var(--chrome-hover);
}

.home-tabs .nav-cta .tab-label {
  flex: 1;
  align-self: stretch;   /* full card height, so the shared fitter sees the real space */
  min-width: 0;
}

/* Stage view 1: the wordmark */
.home-gallery {
  --pad-top: 28px;
  --pad-right: 44px;
  --pad-bottom: 28px;
  --pad-left: 32px;
  display: grid;
  grid-column: 2;
  grid-row: 2;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(12px, 1.7vh, 22px);
  min-height: 0;
  padding: var(--pad-top) var(--pad-right) var(--pad-bottom) var(--pad-left);
  overflow: hidden;
  background: var(--panel);
}

.home-titlebar {
  display: flex;
  align-items: center;
  min-height: 0;
  margin: calc(-1 * var(--pad-top)) calc(-1 * var(--pad-right)) 0 calc(-1 * var(--pad-left));
  padding: 0 var(--pad-right) 0 var(--pad-left);
  background: var(--white);
}

.home-title {
  min-width: 0;
  width: 100%;
  font-size: clamp(48px, 6.4vw, 152px);   /* JS fits to exact width */
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.92;
  white-space: nowrap;
}

.home-title__gx {
  display: inline-block;
  margin-right: 0.075em;
  color: var(--blue);
}

.home-title__name {
  display: inline;
}

.home-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: clamp(8px, 1vh, 12px);
  border-top: 1px solid var(--line);
  font-size: var(--t-small);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.home-meta__lead {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
}

.home-meta__lead::before {
  width: 7px;
  height: 7px;
  background: var(--blue);
  border-radius: 50%;
  content: "";
}

/* Parked photo strip: flip display back to flex to revive it. */
.home-photos {
  display: none;
  align-items: stretch;
  justify-content: space-between;
  gap: clamp(10px, 0.9vw, 16px);
  width: 100%;
  height: 100%;
  min-height: 0;
}

.home-hero {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.home-hero img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
}

/* Stage view 2: the gallery (title + caption column, photo area) */
.work-stage {
  display: none;
  position: relative;
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
  overflow: hidden;
  background: var(--white);
}

body.is-gallery .home-gallery,
body.is-contact .home-gallery,
body.is-contact .work-stage {
  display: none;
}

body.is-gallery .work-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.work-board {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(230px, 0.22fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.work-copy {
  display: grid;
  z-index: 2;
  align-content: start;
  gap: clamp(8px, 1.2vh, 14px);
  min-width: 0;
  min-height: 0;
  padding: clamp(18px, 2vw, 30px) clamp(18px, 1.7vw, 28px);
  overflow-y: auto;
  background: var(--white);
  border-right: 1px solid var(--line);
}

.work-copy h3 {
  font-size: clamp(26px, 2.2vw, 42px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.92;
}

.work-copy__caption {
  padding-top: clamp(10px, 1.4vh, 16px);
  border-top: 1px solid var(--line);
  font-size: clamp(13px, 0.95vw, 16px);
  line-height: 1.4;
}

.work-picture {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--paper-2);
}

.work-picture img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Single photos: complete, just a touch larger than a pure fit. */
.work-picture img[data-work-image] {
  transform: scale(1.08);
}

/* Crossfade: out fast, back in only once the next image is fully decoded
   (app.js awaits decode) — so nothing ever pops or flashes. */
.work-picture img,
.work-tag {
  transition: opacity 200ms ease;
}

.work-picture.is-swapping img,
.work-picture.is-swapping .work-tag {
  opacity: 0;
  transition-duration: 90ms;
}

/* Before/after pairs: two equal cover panels + corner chips. */
.work-picture.is-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
}

.work-picture.is-pair img {
  object-fit: cover;
}

.work-tag {
  position: absolute;
  bottom: 14px;
  z-index: 5;
  padding: 0.5em 1em;
  color: var(--chrome-text);
  background: var(--tag-surface);
  border-radius: 999px;
  font-size: clamp(11px, 0.85vw, 15px);
  font-weight: 760;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.work-tag--before {
  left: 14px;
}

.work-tag--after {
  left: calc(50% + 14px);
  color: var(--accent-text);
  background: var(--blue);
}

.work-arrow {
  position: absolute;
  top: min(46vh, 42%);
  z-index: 4;
  width: 52px;
  height: 52px;
  color: var(--ink);
  background: var(--control-surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 10px 24px var(--shadow-soft);
  transform: translateY(-50%);
}

.work-arrow:hover {
  background: var(--surface-raised);
}

.work-arrow--prev {
  left: calc(var(--u) * 1.1);
}

.work-arrow--next {
  right: calc(var(--u) * 1.1);
}

.work-arrow::before {
  display: block;
  font-size: 1.7rem;
  line-height: 1;
  content: "‹";
}

.work-arrow--next::before {
  content: "›";
}

.work-close {
  position: absolute;
  top: calc(var(--u) * 0.65);
  right: calc(var(--u) * 0.65);
  z-index: 9;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 8px 22px var(--shadow-strong);
  font-size: 1.55rem;
  line-height: 1;
}

.work-close:hover {
  background: var(--paper);
}

/* Stage view 3: the contact panel */
.contact-stage {
  display: none;
  position: relative;
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
  overflow: auto;
  background: var(--white);
}

body.is-contact .contact-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.contact-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-content: stretch;
  gap: clamp(16px, 2.2vh, 28px) clamp(16px, 1.6vw, 28px);
  height: 100%;
  padding: clamp(32px, 3.4vw, 68px) clamp(36px, 4.5vw, 96px);
}

.form-honeypot {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.contact-panel h2 {
  grid-column: 1 / -1;
  align-self: end;
  font-size: clamp(40px, 5vw, 92px);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.contact-panel label {
  display: grid;
  gap: clamp(6px, 0.7vh, 10px);
  font-size: clamp(11px, 0.8vw, 14px);
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-panel__message {
  grid-column: 1 / -1;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.contact-panel input,
.contact-panel textarea {
  width: 100%;
  padding: clamp(12px, 1.5vh, 18px) clamp(14px, 1.1vw, 20px);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid transparent;
  border-radius: 10px;
  outline: none;
  font-size: clamp(15px, 1.05vw, 18px);
}

.contact-panel textarea {
  height: 100%;
  min-height: 0;
  resize: none;
}

.contact-panel input:focus,
.contact-panel textarea:focus {
  background: var(--white);
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-tint);
}

.contact-panel input::placeholder,
.contact-panel textarea::placeholder {
  color: var(--placeholder);   /* deliberate gray: placeholders must not read as input */
}

.contact-panel .button {
  grid-column: 1 / -1;
  justify-self: start;
  min-width: clamp(180px, 15vw, 280px);
  min-height: clamp(48px, 6.2vh, 60px);
  font-size: clamp(11px, 0.8vw, 14px);
}

.contact-panel__status {
  grid-column: 1 / -1;
  font-size: clamp(14px, 1vw, 17px);
}

/* Buttons (send button + plain-page header CTA) */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7em 1.4em;
  border: 0;
  border-radius: 999px;
  font-weight: 780;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background-color 180ms ease, transform 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button--dark {
  color: var(--button-text);
  background: var(--button-bg);
}

.button--dark:hover {
  background: var(--button-hover);
}

/* 4. PLAIN PAGES (thanks / 404) ------------------------------------------- */

body.page-plain {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-surface);
}

.site-header .brand-mark {
  color: var(--accent-text);
}

.site-header .brand-name small {
  color: var(--ink);
}

.nav-shell {
  display: flex;
  min-height: clamp(58px, 7.2vh, 68px);
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2vw, 20px);
}

.primary-nav > a:not(.button) {
  padding: 0.5rem 0.25rem;
  font-size: var(--t-small);
  font-weight: 690;
}

.primary-nav > a:not(.button):hover {
  color: var(--blue);
}

.primary-nav .button {
  min-height: clamp(38px, 4.7vh, 46px);
  padding-inline: clamp(13px, 1.15vw, 20px);
  font-size: var(--t-label);
}

body.page-plain > main {
  min-height: 0;
  margin: calc(var(--u) * 0.75);
  overflow: hidden;
  background: var(--white);
  border-radius: calc(var(--u) * 1.25);
  box-shadow: inset 0 0 0 1px var(--line);
}

.page-hero {
  height: 100%;
}

.page-hero > .shell {
  display: grid;
  height: 100%;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(24px, 3vw, 54px);
  padding: clamp(24px, 3vw, 52px);
}

.page-hero__topline {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  padding-bottom: clamp(10px, 1vw, 16px);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65em;
  font-size: var(--t-label);
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 8px;
  height: 8px;
  background: var(--blue);
  border-radius: 50%;
  content: "";
}

.page-hero h1 {
  grid-column: 1;
  align-self: center;
  font-size: clamp(64px, 7.6vw, 138px);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 0.82;
}

.page-hero h1 em {
  color: var(--blue);
  font-style: italic;
  font-weight: 400;
}

.page-hero__lede {
  grid-column: 2;
  align-self: center;
  font-size: clamp(17px, 1.4vw, 24px);
  line-height: 1.5;
}

.page-hero__lede a {
  color: var(--blue);
}

/* 5. FOOTER ---------------------------------------------------------------- */

.site-footer {
  color: var(--chrome-text);
  background: var(--chrome);
}

.shell {
  width: calc(100vw - clamp(32px, 5vw, 112px));
  margin-inline: auto;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 8vw, 9rem);
  padding-block: clamp(12px, 1.8vh, 18px);
}

.site-footer__name {
  display: block;
  margin-bottom: 0.8em;
  font-size: var(--t-small);
  font-weight: 820;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.site-footer__grid p {
  max-width: none;
  color: var(--chrome-text);
  font-size: var(--t-label);
}

.site-footer__phone {
  display: inline-block;
  margin-top: 1em;
  color: var(--blue-on-dark);
  font-size: var(--t-small);
  font-weight: 760;
}

.site-footer__mobile-summary {
  display: none;
}

.site-footer__heading {
  display: block;
  margin-bottom: 0.8em;
  font-size: var(--t-label);
  font-weight: 720;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(6px, 0.8vh, 9px);
  border-top: 1px solid var(--line-light);
  font-size: var(--t-label);
  font-weight: 670;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* 6. MOBILE ---------------------------------------------------------------- */

@media (max-width: 1100px) {
  :root {
    --u: clamp(6px, 1.6vw, 10px);
    --t-label: clamp(8px, 2.15vw, 10px);
    --t-small: clamp(10px, 2.55vw, 12px);
  }

  body.page-board {
    display: grid;
    height: 100vh;
    height: 100svh;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
  }

  body.page-board > main {
    min-height: 0;
    padding:
      max(6px, env(safe-area-inset-top))
      max(6px, env(safe-area-inset-right))
      6px
      max(6px, env(safe-area-inset-left));
  }

  .home-overview {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows:
      clamp(70px, 9.8svh, 84px)
      clamp(82px, 11.5svh, 98px)
      minmax(0, 1fr);
    gap: 2px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: clamp(8px, 2.5vw, 14px);
  }

  .home-topbar {
    grid-column: 1;
    grid-row: 1;
    gap: clamp(6px, 2vw, 14px);
    min-width: 0;
    min-height: 0;
    padding-inline: clamp(7px, 2.4vw, 14px);
  }

  .home-topbar .brand {
    min-width: 0;
    padding-left: 0;
  }

  .home-topbar .brand-mark {
    flex: 0 0 auto;
    width: clamp(38px, 11vw, 48px);
    height: clamp(38px, 11vw, 48px);
    font-size: clamp(10px, 3vw, 13px);
  }

  .home-topbar .brand-name {
    font-size: clamp(9px, 2.9vw, 12px);
  }

  .home-topbar .brand-name small {
    font-size: clamp(7px, 1.95vw, 9px);
    letter-spacing: 0.12em;
  }

  .home-topbar__phone {
    flex: 0 0 auto;
    row-gap: 2px;
    max-width: 46vw;
    margin-right: 0;
    padding: clamp(7px, 1.7svh, 10px) clamp(9px, 3vw, 16px);
    border-radius: 10px;
  }

  .home-topbar__phone span {
    font-size: clamp(11px, 3.4vw, 16px);
    white-space: nowrap;
  }

  .home-topbar__phone small {
    font-size: clamp(7px, 2vw, 9px);
    white-space: nowrap;
  }

  .home-tabs {
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    min-width: 0;
    gap: 2px;
  }

  .home-tabs [role="tab"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: center;
    justify-items: center;
    gap: 4px;
    min-width: 0;
    min-height: 0;
    padding: clamp(5px, 1.5vw, 8px);
    text-align: center;
  }

  .home-tabs [role="tab"]:hover {
    box-shadow: inset 0 3px 0 0 var(--paper-2);
  }

  .home-tabs [role="tab"][aria-selected="true"] {
    box-shadow: inset 0 3px 0 0 var(--blue);
  }

  .home-tabs .tab-label {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    font-size: clamp(9px, 2.65vw, 12px);
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.05;
    text-align: center;
  }

  .home-tabs img {
    grid-column: 1;
    grid-row: 2;
    width: clamp(30px, 9.5vw, 46px);
    height: clamp(30px, 9.5vw, 46px);
    max-width: 100%;
    border-radius: 5px;
  }

  .home-tabs .nav-cta {
    display: grid;
    grid-column: 5;
    grid-row: 1;
    place-items: center;
    min-width: 0;
    min-height: 0;
    padding: clamp(5px, 1.5vw, 8px);
    text-align: center;
  }

  .home-tabs .nav-cta .tab-label {
    flex: none;
    align-self: center;
    height: auto;
    line-height: 1.05;
    white-space: normal;
  }

  .home-tabs .nav-cta[aria-pressed="true"] {
    background: var(--chrome-hover);
    box-shadow: inset 0 3px 0 0 var(--blue);
  }

  .home-gallery {
    --pad-top: clamp(12px, 3svh, 22px);
    --pad-right: clamp(12px, 4vw, 22px);
    --pad-bottom: clamp(10px, 2.4svh, 18px);
    --pad-left: clamp(12px, 4vw, 22px);
    grid-column: 1;
    grid-row: 3;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: clamp(8px, 1.7svh, 14px);
    min-width: 0;
    min-height: 0;
  }

  .home-titlebar {
    justify-content: center;
    overflow: hidden;
    text-align: center;
  }

  .home-title {
    letter-spacing: -0.06em;
    line-height: 0.84;
    text-align: center;
    white-space: nowrap;
  }

  .home-meta {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 3px 10px;
    padding-top: clamp(6px, 1.2svh, 9px);
    font-size: clamp(9px, 2.55vw, 11px);
    letter-spacing: 0.08em;
    line-height: 1.25;
  }

  .home-meta__lead {
    gap: 0.45em;
  }

  .home-meta__lead::before {
    width: 5px;
    height: 5px;
  }

  body.is-gallery .work-stage,
  body.is-contact .contact-stage {
    grid-column: 1;
    grid-row: 3;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  .work-board {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .work-copy {
    gap: 8px;
    max-height: clamp(72px, 13svh, 108px);
    padding: clamp(11px, 2svh, 17px) clamp(14px, 4vw, 20px);
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .work-copy h3 {
    font-size: clamp(22px, 6.5vw, 31px);
  }

  .work-copy__caption {
    display: -webkit-box;
    padding-top: 6px;
    overflow: hidden;
    font-size: clamp(10px, 2.75vw, 13px);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .work-picture {
    min-height: 0;
    touch-action: pan-y;
  }

  .work-arrow {
    width: clamp(44px, 11.5vw, 50px);
    height: clamp(44px, 11.5vw, 50px);
  }

  .work-close {
    width: clamp(42px, 11vw, 46px);
    height: clamp(42px, 11vw, 46px);
    font-size: 1.3rem;
  }

  .work-tag {
    bottom: 10px;
    font-size: clamp(8px, 2.2vw, 11px);
  }

  .contact-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    gap: clamp(9px, 1.7svh, 14px) clamp(10px, 2.8vw, 16px);
    min-height: 0;
    padding: clamp(16px, 3.5svh, 28px) clamp(13px, 4vw, 24px);
  }

  .contact-panel__message,
  .contact-panel .button,
  .contact-panel__status {
    grid-column: 1 / -1;
  }

  .contact-panel h2 {
    padding-right: 52px;
    font-size: clamp(34px, 9.5vw, 52px);
  }

  .contact-panel label {
    gap: 5px;
    font-size: clamp(9px, 2.35vw, 11px);
  }

  .contact-panel input,
  .contact-panel textarea {
    padding: clamp(8px, 1.5svh, 12px) clamp(9px, 2.5vw, 13px);
    border-radius: 7px;
    font-size: clamp(14px, 3.35vw, 16px);
  }

  .contact-panel textarea {
    min-height: 0;
  }

  .contact-panel .button {
    min-width: min(42vw, 180px);
    min-height: clamp(38px, 5.5svh, 46px);
    font-size: clamp(9px, 2.3vw, 11px);
  }

  .page-hero > .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }

  .page-hero h1,
  .page-hero__lede {
    grid-column: auto;
  }

  .page-hero h1 {
    font-size: clamp(44px, 13vw, 80px);
  }

  body.page-board .shell {
    width: auto;
    margin-left: max(12px, env(safe-area-inset-left));
    margin-right: max(12px, env(safe-area-inset-right));
  }

  body.page-board .site-footer {
    padding-bottom: env(safe-area-inset-bottom);
  }

  body.page-board .site-footer__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-block: clamp(7px, 1.1svh, 10px);
  }

  body.page-board .site-footer__grid > div:nth-child(2) {
    display: none;
  }

  body.page-board .site-footer__grid > div:first-child {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name phone"
      "summary phone";
    align-items: center;
    gap: 1px 14px;
  }

  body.page-board .site-footer__name {
    grid-area: name;
    margin: 0;
    font-size: clamp(10px, 2.65vw, 12px);
  }

  body.page-board .site-footer__description {
    display: none;
  }

  body.page-board .site-footer__mobile-summary {
    display: block;
    grid-area: summary;
    font-size: clamp(9px, 2.35vw, 11px);
    font-weight: 500;
    line-height: 1.2;
  }

  body.page-board .site-footer__phone {
    grid-area: phone;
    margin: 0;
    font-size: clamp(11px, 2.9vw, 13px);
    white-space: nowrap;
  }

  body.page-board .site-footer__bottom {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding-block: 4px 5px;
    font-size: clamp(9px, 2.35vw, 11px);
  }

  body.page-plain .site-footer__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }

  body.page-plain .site-footer__bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }
}

/* Phone forms use the full width of the stage. Stacking the fields preserves
   comfortable type and touch targets, and the stage can scroll when a virtual
   keyboard shortens the viewport. */
@media (max-width: 600px) {
  .home-title {
    white-space: normal;
  }

  .home-title__gx,
  .home-title__name {
    display: block;
  }

  .home-title__gx {
    margin: 0 0 0.1em;
  }

  .home-title__name {
    white-space: nowrap;
  }

  body.is-contact .contact-stage {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .contact-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(120px, 1fr) auto auto;
    min-height: 480px;
    padding: clamp(14px, 2.8svh, 24px) clamp(14px, 4vw, 20px);
  }

  .contact-panel h2,
  .contact-panel label,
  .contact-panel__message,
  .contact-panel .button,
  .contact-panel__status {
    grid-column: 1;
  }

  .contact-panel textarea {
    min-height: 120px;
  }

  .contact-panel .button {
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    min-height: 48px;
  }
}

/* Short phone screens and landscape phones keep the same composition, but
   collapse secondary chrome before it can steal room from the working stage. */
@media (max-width: 1100px) and (max-height: 650px) {
  .home-overview {
    grid-template-rows: 52px 48px minmax(0, 1fr);
  }

  .home-tabs [role="tab"] {
    grid-template-rows: minmax(0, 1fr);
  }

  .home-tabs img {
    display: none;
  }

  .home-tabs .tab-label {
    align-self: center;
    font-size: clamp(9px, 2.5vw, 12px);
  }

  .home-meta > span:last-child,
  body.page-board .site-footer__mobile-summary,
  body.page-board .site-footer__bottom {
    display: none;
  }

  body.page-board .site-footer__grid > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  body.page-board .site-footer__name,
  body.page-board .site-footer__phone {
    margin: 0;
  }
}

/* 7. REDUCED MOTION -------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
