/* ==========================================================================
   Good Morning Framing: shared stylesheet for /, /work/, /estimate/, /crew/
   --------------------------------------------------------------------------
   One external file, no inline styles and no data-URI assets, so the strict
   production CSP (style-src 'self'; img-src 'self'; font-src 'self') holds.
   System fonts only: nothing is fetched from another origin.
   Two rules run through everything:
     built things are square (photos, sheets, bands);
     pressable things are round (buttons, inputs, choices).
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --ivory: #F6F0E2;
  --paper: #FCF8EF;
  --white: #FFFEFB;
  --kraft: #EADFC8;
  --ink: #02251B;            /* the logo green */
  --forest: #0D3A29;
  --amber: #C6800D;          /* the logo amber */
  --amber-light: #E9A32E;
  --amber-pale: #F3D391;
  --brick: #A3320B;
  --brick-pale: #F6E2D6;

  --ink-soft: rgba(2, 37, 27, .76);
  --ink-line: rgba(2, 37, 27, .36);
  --ink-faint: rgba(2, 37, 27, .14);
  --field-line: rgba(2, 37, 27, .55);
  --ivory-soft: rgba(246, 240, 226, .84);
  --ivory-line: rgba(246, 240, 226, .3);

  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", Times, serif;

  --gutter: clamp(18px, 5vw, 72px);
  --gap: clamp(16px, 2.2vw, 28px);
  --section: clamp(56px, 8vw, 120px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --focus: var(--ink);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 108px; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset, legend, table { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { min-width: 0; border: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
a, button, input, select, textarea, label { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
main:focus { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; z-index: 60; top: 10px; left: var(--gutter);
  padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: var(--ivory); font-weight: 600; text-decoration: none;
  transform: translateY(-300%);
}
.skip:focus { transform: none; outline-color: var(--amber-light); }

.wrap { width: 100%; max-width: calc(1280px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Type ---------- */
.display {
  font: 800 clamp(2.3rem, 5.6vw, 5.25rem)/.94 var(--sans);
  letter-spacing: -.04em;
  text-wrap: balance;
}
.display--sm { font-size: clamp(2.1rem, 4.4vw, 3.75rem); }
.kicker { margin-bottom: 14px; font: 700 1rem/1.2 var(--sans); color: var(--ink-soft); }
.voice { max-width: 34em; font: 400 clamp(1.125rem, 1.35vw, 1.3125rem)/1.55 var(--serif); }
.small { font-size: .9375rem; color: var(--ink-soft); }

.head { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); column-gap: var(--gap); align-items: end; }
.head .voice { padding-bottom: .35em; }

/* ---------- Buttons: pressable things are round ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .65em;
  min-height: 56px; padding: 10px 1.7em;
  border: 1.5px solid transparent; border-radius: 999px;
  font: 600 1.0625rem/1.2 var(--sans); text-align: center; text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease);
}
/* every button carries a small sun; it lifts on hover and pulses while a form is sending */
.btn::before {
  content: ""; flex: none; width: .6em; height: .6em; border-radius: 50%;
  background: var(--amber-light);
  transition: transform .35s var(--ease);
}
.btn:hover::before { transform: translateY(-.16em) scale(1.25); }
.btn:active { transform: scale(.975); }
.btn--ink { background: var(--ink); color: var(--ivory); }
.btn--ink:hover { background: var(--forest); }
.btn--amber { background: var(--amber-light); color: var(--ink); }
.btn--amber::before { background: var(--ink); }
.btn--amber:hover { background: #F2B74F; }
.btn--ivory { background: var(--ivory); color: var(--ink); }
.btn--ivory::before { background: var(--amber); }
.btn--ivory:hover { background: var(--amber-pale); }
.btn--line { border-color: currentColor; background: transparent; }
.btn--line:hover { background: var(--ink); border-color: var(--ink); color: var(--ivory); }

/* Sending. The form scripts disable the submit button and swap its text while a request is in flight.
   The delay keeps the half-second before the script has loaded from looking like a send. */
.btn:disabled { cursor: progress; }
@keyframes wait { to { opacity: .72; } }
@keyframes pulse { from { transform: scale(.7); opacity: .55; } to { transform: scale(1.35); opacity: 1; } }

.textlink {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 600; text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1.5px;
}
.textlink:hover { text-decoration-color: var(--amber); text-decoration-thickness: 3px; }

/* ---------- The plate: a framer's layout marks, a line and an X every 16 inches at 6px to the inch ---------- */
.plate {
  --mark: var(--ink-line);
  height: 23px;
  border-block: 1px solid var(--mark);
  background:
    linear-gradient(90deg, var(--mark) 0, var(--mark) 1.5px, transparent 1.5px) 0 0 / 96px 100% repeat-x,
    linear-gradient(45deg, transparent 17.6px, var(--mark) 17.6px, var(--mark) 18.9px, transparent 18.9px) 0 0 / 96px 100% repeat-x,
    linear-gradient(135deg, transparent 17.6px, var(--mark) 17.6px, var(--mark) 18.9px, transparent 18.9px) 0 0 / 96px 100% repeat-x;
}
.plate--light { --mark: var(--ivory-line); }

/* ---------- Photo frames: built things are square ---------- */
.frame { position: relative; display: block; overflow: hidden; background: var(--kraft); }
.frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: 50% 50%;
  font: italic .95rem/1.4 var(--serif); color: var(--ink-soft);   /* alt text, if a photo fails to load */
}
figcaption { margin-top: 10px; font: italic .95rem/1.4 var(--serif); color: var(--ink-soft); }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 40; background: var(--ivory); border-bottom: 1px solid var(--ink-faint); }
.top__row { display: flex; align-items: center; justify-content: space-between; gap: 4px 24px; min-height: 88px; }
.masthead { display: flex; align-items: center; }
.brand { flex: none; display: block; border-radius: 4px; text-decoration: none; }
.brand img { width: auto; height: 60px; font: 800 1.15rem/1.1 var(--sans); color: var(--ink); }
.nav ul { display: flex; align-items: center; justify-content: flex-end; gap: 0 clamp(18px, 2.6vw, 40px); }
.nav a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.nav a:not(.nav__cta):hover { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 3px; text-underline-offset: .3em; }
.nav a[aria-current="page"]:not(.nav__cta) { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .3em; }
.nav__cta { gap: .6em; padding: 0 22px; border-radius: 999px; background: var(--ink); color: var(--ivory); transition: background-color .2s; }
.nav__cta::before { content: ""; flex: none; width: .55em; height: .55em; border-radius: 50%; background: var(--amber-light); }
.nav__cta:hover { background: var(--forest); }
.nav__cta[aria-current="page"] { background: var(--amber-light); color: var(--ink); }
.nav__cta[aria-current="page"]::before { background: var(--ink); }

/* ---------- Hero (home and crew) ---------- */
.hero { padding-block: clamp(20px, 3vw, 44px) clamp(40px, 6vw, 88px); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(24px, 4vw, 64px); }
.hero__copy { display: flex; flex-direction: column; justify-content: space-between; }
/* the headline grows with the window, but never so tall that the button leaves the first screen */
.hero__title {
  font: 800 clamp(2.75rem, min(7vw, calc((100vh - 330px) / 3)), 6.5rem)/.9 var(--sans);
  letter-spacing: -.045em;
}
.hero__title--four { font-size: clamp(3rem, min(8.6vw, calc((100vh - 440px) / 3.6)), 7.5rem); line-height: .88; }
.hero__line { display: block; margin-left: -.03em; }
.hero__pitch { display: flex; flex-direction: column; margin-top: clamp(24px, 3vw, 44px); }
.hero__lede { max-width: 25em; font: 400 clamp(1.2rem, 1.7vw, 1.5rem)/1.4 var(--serif); }
.hero__lede--voice { max-width: 21em; font-style: italic; font-size: clamp(1.3rem, 1.9vw, 1.7rem); line-height: 1.35; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 26px; margin-top: clamp(20px, 2.2vw, 30px); }
.hero__aside { margin-top: 14px; font: 500 1rem/1.4 var(--sans); color: var(--ink-soft); }
.hero__aside strong { font-weight: 700; color: var(--ink); }
.hero__actions .hero__aside { margin-top: 0; }

/* the sun comes up behind the photo, the way it does behind "Morning" in the logo */
.hero__visual { position: relative; isolation: isolate; justify-self: end; width: 100%; max-width: 540px; }
.sun { position: absolute; z-index: -1; top: clamp(-34px, -2.4vw, -14px); right: clamp(-40px, -2.7vw, -12px); width: 46%; aspect-ratio: 1; }
.sun__disc { display: block; width: 100%; height: 100%; border-radius: 50%; background: linear-gradient(200deg, var(--amber-light) 20%, var(--amber) 70%); }
.frame--hero { width: 100%; aspect-ratio: 5 / 6; min-height: 280px; max-height: max(300px, calc(100vh - 250px)); background: linear-gradient(#4A688A, #86A5BF 56%, #D1BFA0 84%, var(--forest) 91%); }
.frame--hero img { object-position: 50% 34%; color: var(--ivory); }
.frame--sign::after {       /* the ground, faded into forest, so the sign reads */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, var(--forest) 0, var(--forest) 9%, rgba(13, 58, 41, 0) 30%);
}
.frame__sign { position: absolute; z-index: 1; left: 6%; right: 6%; bottom: 4%; color: var(--ivory); font: 700 clamp(.95rem, 1.2vw, 1.0625rem)/1.25 var(--sans); }

/* ---------- Home: the Granville photos ---------- */
.work { padding-block: var(--section); }
.work .display { max-width: 12em; }
.mosaic { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(28px, 4vw, 48px) var(--gap); margin-top: clamp(32px, 5vw, 64px); }
.shot { display: flex; flex-direction: column; min-width: 0; }
.shot__link { position: relative; display: block; flex: none; text-decoration: none; }
/* the enlarge mark: a round, pressable plus in the corner of each photo */
.shot__link::after, .tile__link::after {
  content: ""; position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 16px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 2px 16px no-repeat,
    var(--ivory);
  transition: background-color .2s, transform .25s var(--ease);
}
.shot__link:hover::after, .tile__link:hover::after { background-color: var(--amber-light); transform: scale(1.08); }
.shot--lead { grid-column: 1 / span 8; }
.shot--lead .frame { aspect-ratio: 3 / 2; }
.shot--lead img { object-position: 50% 72%; }
.shot--tall { grid-column: 9 / span 4; }
.shot--tall .shot__link { display: flex; flex: 1 1 auto; }
.shot--tall .frame { flex: 1; min-height: 260px; }
.shot--tall img { object-position: 52% 50%; }
.shot--wide { grid-column: 1 / span 7; }
.shot--wide .frame { aspect-ratio: 2 / 1; }
.shot--wide img { object-position: 50% 52%; }
.mosaic__note { grid-column: 9 / span 4; align-self: start; padding-top: 14px; border-top: 1px solid var(--ink-line); }
.mosaic__note p { max-width: 26em; font: 400 clamp(1.0625rem, 1.3vw, 1.25rem)/1.5 var(--serif); }
.mosaic__note .btn { margin-top: 22px; }

/* ---------- Scope: what GMF does ---------- */
.scope { padding-block: var(--section); }
.scope--forest { background: var(--forest); color: var(--ivory); --focus: var(--amber-light); }
.scope--forest .kicker, .scope--forest .voice { color: var(--ivory-soft); }
.scope__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(24px, 4vw, 64px); align-items: start; }
.scope__head .voice { margin-top: 22px; }
.scope__head .btn { margin-top: 28px; }
.scope__list li {
  padding-block: clamp(14px, 1.6vw, 22px);
  border-top: 1px solid var(--ink-line);
  font: 800 clamp(1.75rem, 3.7vw, 3.4rem)/1.04 var(--sans); letter-spacing: -.035em;
}
.scope__list li:last-child { border-bottom: 1px solid var(--ink-line); }
.scope--forest .scope__list li { border-color: var(--ivory-line); }

/* ---------- Estimate call: the one amber band ---------- */
.cta { position: relative; overflow: hidden; padding-block: var(--section); background: var(--amber-light); }
.cta__grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(24px, 4vw, 64px); align-items: end; }
.cta .kicker { color: var(--ink); }
.cta__body .voice { max-width: 24em; }
.cta__body .btn { margin-top: 26px; }
.cta__sun { position: absolute; right: clamp(-60px, 3vw, 80px); bottom: 0; width: min(46vw, 560px); aspect-ratio: 2 / 1; overflow: hidden; }
.cta__sun span { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 1; border-radius: 50%; background: var(--amber-pale); opacity: .6; }

/* ---------- Recruiting, secondary ---------- */
.crewline { padding-block: clamp(36px, 5vw, 64px); }
.crewline__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(24px, 4vw, 64px); align-items: end; }
.crewline h2, .crewline h3 { font: 800 clamp(1.7rem, 3vw, 2.6rem)/1.02 var(--sans); letter-spacing: -.035em; }
.crewline__body p { max-width: 26em; font: 400 1.125rem/1.5 var(--serif); }
.crewline--kraft { background: var(--kraft); }

.crosslink { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; padding-block: 22px; font: 400 1.125rem/1.5 var(--serif); }
.crosslink .textlink { font: 600 1.0625rem/1.3 var(--sans); }

/* ---------- Page openings (work, estimate) ---------- */
.opening { padding-block: clamp(28px, 5vw, 72px) clamp(32px, 5vw, 64px); }
.opening__title { max-width: 11em; font: 800 clamp(2.6rem, 7.2vw, 6.25rem)/.92 var(--sans); letter-spacing: -.045em; text-wrap: balance; }
.opening__grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); column-gap: var(--gap); align-items: end; }
.opening__note { padding-bottom: .5em; }
.opening__note .small { margin-top: 12px; }

/* ---------- Work: the stage ---------- */
.stage { padding-block: 18px clamp(44px, 6vw, 88px); background: var(--ink); color: var(--ivory); --focus: var(--amber-light); }
.stage__bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; padding-block: 0 16px; }
.stage__bar h2 { font: 700 1rem/1.3 var(--sans); }
.stage__bar p { font: 400 1rem/1.3 var(--serif); font-style: italic; color: var(--ivory-soft); }
.stage__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(26px, 3vw, 40px) 10px; padding-inline: 10px; }
.tile { display: flex; flex-direction: column; min-width: 0; }
.tile__link { position: relative; display: block; text-decoration: none; }
.tile .frame { height: clamp(300px, 43vw, 680px); background: var(--forest); }
.tile figcaption { display: flex; gap: 14px; padding-inline: clamp(8px, 1.4vw, 20px); color: var(--ivory-soft); font-size: 1rem; }
.tile figcaption b { flex: none; font: 700 .9375rem/1.5 var(--sans); font-style: normal; color: var(--amber-light); }
.tile--floor { grid-column: span 5; }
.tile--floor img { object-position: 58% 50%; }
.tile--walls { grid-column: span 7; }
.tile--walls img { object-position: 50% 78%; }
.tile--site { grid-column: span 8; }
.tile--site .frame, .tile--shell .frame { height: clamp(280px, 37vw, 600px); }
.tile--shell { grid-column: span 4; }
.tile--shell img { object-position: 46% 60%; }

/* ---------- Lightbox (IDs and behaviour belong to gallery.js) ---------- */
.lightbox {
  width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0; overflow: hidden;
  background: var(--ink); color: var(--ivory); --focus: var(--amber-light);
}
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lightbox::backdrop { background: var(--ink); }
.lightbox > img { width: 100%; height: 100%; min-height: 0; padding: 4px clamp(6px, 2vw, 28px); object-fit: contain; font: italic 1rem/1.4 var(--serif); color: var(--ivory-soft); }
.lightbox-close {
  justify-self: end; display: inline-flex; align-items: center; gap: .6em;
  min-height: 48px; margin: 12px var(--gutter) 8px; padding: 0 20px;
  border: 1.5px solid var(--ivory-line); border-radius: 999px; background: transparent; color: var(--ivory);
  font: 600 1rem/1 var(--sans); cursor: pointer; transition: background-color .2s, color .2s;
}
.lightbox-close:hover, .lightbox-bottom button:hover { background: var(--ivory); color: var(--ink); }
.lightbox-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px var(--gutter) max(16px, env(safe-area-inset-bottom)); }
.lightbox-bottom p { font: italic 1.0625rem/1.4 var(--serif); }
.lightbox-bottom > div { flex: none; display: flex; gap: 10px; }
.lightbox-bottom button {
  width: 52px; height: 52px; border: 1.5px solid var(--ivory-line); border-radius: 50%;
  background: transparent; color: var(--ivory); font: 400 1.35rem/1 var(--sans); cursor: pointer;
  transition: background-color .2s, color .2s;
}
html:has(.lightbox[open]) { overflow: hidden; }

/* ---------- Estimate: the inquiry ---------- */
.inquiry { padding-block: clamp(28px, 4vw, 56px) var(--section); background: var(--kraft); }
.inquiry__grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto 1fr;
  grid-template-areas: "intro sheet" "next sheet";
  column-gap: clamp(24px, 4vw, 64px); row-gap: clamp(28px, 3.4vw, 44px); align-items: start;
}
.inquiry__intro { grid-area: intro; }
.inquiry__sheet { grid-area: sheet; }
.inquiry__next { grid-area: next; }
.frame--aside { aspect-ratio: 3 / 2; margin-bottom: clamp(22px, 3vw, 34px); }
.frame--aside img { object-position: 62% 30%; }
.inquiry__intro p:not(.kicker) { max-width: 30em; margin-top: 18px; font: 400 1.125rem/1.55 var(--serif); }

.next__title { font: 800 1.35rem/1.15 var(--sans); letter-spacing: -.025em; }
.next__steps { margin-top: 16px; counter-reset: next; border-top: 1px solid var(--ink-line); }
.next__steps li { counter-increment: next; display: grid; grid-template-columns: 2.4em minmax(0, 1fr); align-items: baseline; padding-block: 14px; border-bottom: 1px solid var(--ink-line); }
.next__steps li::before { content: counter(next); font: 800 1.35rem/1 var(--sans); letter-spacing: -.02em; }
.next__steps strong { display: block; font: 700 1.0625rem/1.35 var(--sans); }
.next__steps span { display: block; margin-top: 2px; font: 400 1rem/1.5 var(--serif); color: var(--ink-soft); }
.next__private { margin-top: 18px; max-width: 34em; font-size: .9375rem; line-height: 1.5; color: var(--ink-soft); }

/* ---------- Sheets and forms ---------- */
.sheet { background: var(--paper); color: var(--ink); --focus: var(--ink); border-top: 6px solid var(--amber-light); }
.sheet__body { padding: clamp(22px, 3vw, 40px) clamp(18px, 3vw, 40px) clamp(26px, 3.4vw, 44px); }
.sheet__head { margin-bottom: 30px; padding-bottom: 24px; border-bottom: 1px solid var(--ink-line); }
.sheet__head .kicker { margin-bottom: 8px; }
.sheet__title { font: 800 clamp(1.7rem, 2.6vw, 2.25rem)/1.05 var(--sans); letter-spacing: -.03em; }
.form .sheet__title { margin-bottom: 26px; }

.progress { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.progress span { height: 6px; border-radius: 3px; background: var(--kraft); }
.progress .is-current { background: var(--amber); }
.progress .is-done { background: var(--ink); }
.step { margin-bottom: 8px; font: 700 .8125rem/1.2 var(--sans); letter-spacing: .08em; color: var(--ink-soft); }

.field { position: relative; }
.field + .field, .field + .consent { margin-top: 28px; }
.field > label, .field > legend { display: block; margin-bottom: 8px; font: 700 1.0625rem/1.3 var(--sans); }
.optional { margin-left: 4px; font-weight: 500; color: var(--ink-soft); }
.hint { display: block; margin-top: 8px; font: 400 .9375rem/1.45 var(--serif); color: var(--ink-soft); }
.quiet { margin-top: 22px; font: 400 .9375rem/1.5 var(--serif); color: var(--ink-soft); }

.input {
  display: block; width: 100%; min-height: 56px; margin: 0; padding: 0 22px;
  border: 1.5px solid var(--field-line); border-radius: 999px;
  background: var(--white); font: 500 1.0625rem/1.25 var(--sans);
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: rgba(2, 37, 27, .62); font-weight: 400; opacity: 1; }
.input:hover { border-color: var(--ink); }
.input:focus-visible { border-color: var(--ink); outline-offset: 2px; }
textarea.input { min-height: 0; padding: 14px 22px; border-radius: 24px; line-height: 1.5; resize: vertical; }
select.input {
  padding-right: 54px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 29px) 50%, calc(100% - 22px) 50%;
  background-size: 7px 7px; background-repeat: no-repeat;
}
input[type="date"].input { max-width: 16em; text-align: left; }
input[type="date"].input::-webkit-date-and-time-value { text-align: left; }
.rate { position: relative; display: flex; align-items: center; max-width: 11em; }
.rate > span { position: absolute; left: 22px; font-weight: 600; pointer-events: none; }
.rate .input { padding-left: 40px; }

/* a field the person has tried and got wrong (the browser's own message says what to fix) */
.input:user-invalid { border-color: var(--brick); box-shadow: inset 0 0 0 1px var(--brick); }
.input:user-invalid ~ .hint { color: var(--brick); font-weight: 700; font-family: var(--sans); }

/* choices: the real radio sits invisibly over its label, so the keyboard, the validation bubble and form data stay native */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.options { display: grid; gap: 10px; }
.chip, .option { position: relative; display: block; }
.chip input, .option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span, .option span {
  display: flex; align-items: center; border: 1.5px solid var(--field-line); background: var(--white);
  transition: background-color .15s, color .15s, border-color .15s;
}
.chip span { gap: 10px; min-width: 112px; min-height: 52px; padding: 0 22px 0 16px; border-radius: 999px; font: 600 1.0625rem/1.2 var(--sans); }
.option span { gap: 14px; min-height: 60px; padding: 12px 22px 12px 18px; border-radius: 30px; font: 600 1.0625rem/1.3 var(--sans); }
.chip span::before, .option span::before {
  content: ""; flex: none; width: 16px; height: 16px; border: 1.5px solid currentColor; border-radius: 50%;
  transition: background-color .15s, border-color .15s, transform .25s var(--ease);
}
.chip input:hover + span, .option input:hover + span { border-color: var(--ink); }
.chip input:checked + span, .option input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.chip input:checked + span::before, .option input:checked + span::before { border-color: var(--amber-light); background: var(--amber-light); transform: scale(1.1); }
.chip input:focus-visible + span, .option input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.chip input:user-invalid + span, .option input:user-invalid + span { border-color: var(--brick); }

.reveal { margin-top: 14px; padding: 18px 20px 20px; border-left: 4px solid var(--amber); background: #F6EEDB; }
.reveal > label { display: block; margin-bottom: 8px; font: 700 1.0625rem/1.3 var(--sans); }

.consent { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: start; cursor: pointer; }
.consent input {
  -webkit-appearance: none; appearance: none;
  display: inline-grid; place-content: center; width: 30px; height: 30px; margin: 1px 0 0;
  border: 1.5px solid var(--field-line); border-radius: 9px; background: var(--white); cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.consent input::after { content: ""; width: 13px; height: 7px; border: solid var(--amber-light); border-width: 0 0 2.5px 2.5px; transform: translateY(-2px) rotate(-45deg) scale(0); transition: transform .2s var(--ease); }
.consent input:checked { border-color: var(--ink); background: var(--ink); }
.consent input:checked::after { transform: translateY(-2px) rotate(-45deg) scale(1); }
.consent input:user-invalid { border-color: var(--brick); border-width: 2px; }
.consent span { padding-block: 4px; font: 500 1rem/1.5 var(--sans); }

.form > .btn { width: 100%; margin-top: 30px; }

.identity { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 18px; margin-bottom: 28px; padding: 10px 18px; background: #F6EEDB; border-left: 4px solid var(--ink); }
#identity { font-weight: 600; overflow-wrap: anywhere; }
.text-button {
  min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink);
  font: 600 1rem/1.3 var(--sans); text-align: left; text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1.5px; cursor: pointer;
}
.text-button:hover { text-decoration-color: var(--amber); text-decoration-thickness: 3px; }
.text-button:disabled { opacity: .5; cursor: progress; }

/* the upload panel: the real file input covers the whole panel, so a click anywhere opens the picker */
.upload__panel { position: relative; display: grid; justify-items: start; gap: 8px; min-height: 118px; padding: 22px 22px 20px 88px; }
.upload__panel input[type="file"] { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.upload__frame { position: absolute; inset: 0; border: 1.5px dashed var(--field-line); border-radius: 24px; background: var(--white); transition: border-color .15s, background-color .15s; }
.upload__sheet {      /* a small drawing sheet with a folded corner */
  position: absolute; z-index: 1; left: 26px; top: 24px; width: 40px; height: 50px;
  border: 1.5px solid var(--ink); border-radius: 3px;
  background:
    linear-gradient(225deg, var(--amber-light) 9px, transparent 9px),
    linear-gradient(var(--ink), var(--ink)) 8px 22px / 21px 1.5px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 8px 30px / 21px 1.5px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 8px 38px / 13px 1.5px no-repeat,
    var(--paper);
}
.upload__choose {
  position: relative; z-index: 1; display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper); font: 600 1rem/1.2 var(--sans);
  transition: background-color .15s, color .15s;
}
.upload__panel .hint { position: relative; z-index: 1; margin-top: 0; }
.upload__panel input:hover ~ .upload__frame { border-color: var(--ink); }
.upload__panel input:hover ~ .upload__choose { background: var(--ink); color: var(--ivory); }
.upload__panel input:focus-visible ~ .upload__frame { border-color: var(--ink); outline: 3px solid var(--focus); outline-offset: 3px; }
.upload__panel input:user-invalid ~ .upload__frame { border: 2px solid var(--brick); }
.upload__panel input:user-invalid ~ .hint { color: var(--brick); font-weight: 700; font-family: var(--sans); }

.file-list { display: grid; gap: 8px; margin-top: 12px; }
.file-list:empty { display: none; }
.file-list li { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 9px 18px; border-radius: 24px; background: #F6EEDB; font: 600 .9375rem/1.35 var(--sans); overflow-wrap: anywhere; }
.file-list li::before { content: ""; flex: none; width: 13px; height: 17px; border: 1.5px solid var(--ink); border-radius: 2px; background: linear-gradient(225deg, var(--amber-light) 5px, transparent 5px); }

/* Live messages. Both scripts write plain text into one element.
   crew.js only ever writes problems into #status.
   builder.js writes the receipt and the problems into the same #quote-status, with no state hook; after a
   successful send it resets the form, so an empty file list beside a message means "received".
   If builder.js ever sets data-state="received" | "error" on the element, those attributes win. */
.status { margin-top: 18px; font: 600 1rem/1.45 var(--sans); }
.status:empty { display: none; }
.status:not(:empty) {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: start;
  padding: 16px 18px; border-left: 4px solid var(--brick); background: var(--brick-pale); color: var(--ink);
}
.status:not(:empty)::before {
  content: "!"; display: inline-grid; place-content: center; width: 1.5em; height: 1.5em; border-radius: 50%;
  background: var(--brick); color: var(--paper); font: 800 .9375rem/1 var(--sans);
}
.file-list:empty ~ .status:not(:empty), .status[data-state="received"]:not(:empty) {
  padding: 20px 20px 22px; border-left-color: var(--amber-light); background: var(--forest); color: var(--ivory); outline-color: var(--amber);
  font-size: 1.0625rem;
}
.file-list:empty ~ .status:not(:empty)::before, .status[data-state="received"]:not(:empty)::before {
  content: ""; width: 34px; height: 17px; margin-top: 4px; border-radius: 34px 34px 0 0;
  background: linear-gradient(var(--amber-light), var(--amber));
}
.status[data-state="error"]:not(:empty) { padding: 16px 18px; border-left-color: var(--brick); background: var(--brick-pale); color: var(--ink); font-size: 1rem; }
.status[data-state="error"]:not(:empty)::before { content: "!"; width: 1.5em; height: 1.5em; margin-top: 0; border-radius: 50%; background: var(--brick); }

.noscript { margin-top: 18px; padding: 14px 18px; border: 1.5px solid var(--ink-line); font: 400 1rem/1.5 var(--serif); }

/* the application receipt */
.received { outline-offset: 10px; }
.received__sun { position: relative; width: 132px; height: 66px; margin-bottom: 26px; overflow: hidden; border-bottom: 1.5px solid var(--ink); }
.received__sun span { position: absolute; left: 21px; top: 21px; width: 90px; height: 90px; border-radius: 50%; background: linear-gradient(var(--amber-light), var(--amber) 46%); }
.received h3 { font: 800 clamp(2.1rem, 4vw, 3.1rem)/1 var(--sans); letter-spacing: -.035em; }
.received > p:not(.step) { max-width: 34em; margin-top: 16px; font: 400 clamp(1.0625rem, 1.3vw, 1.1875rem)/1.55 var(--serif); }
.received .textlink { margin-top: 18px; }

/* ---------- Crew: the terms and the week ---------- */
.terms-band { padding-block: var(--section); background: var(--kraft); }
.terms-band .display { max-width: 11em; }
.terms-band__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; margin-top: clamp(32px, 5vw, 64px); }
.terms { grid-column: 1 / span 7; }
.terms__row { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr); column-gap: var(--gap); padding-block: 22px; border-top: 1px solid var(--ink-line); }
.terms__row:last-child { border-bottom: 1px solid var(--ink-line); }
.terms dt { font: 700 1.0625rem/1.35 var(--sans); }
.terms dd { font: 400 clamp(1.125rem, 1.35vw, 1.3125rem)/1.5 var(--serif); }
.terms dd strong { display: block; margin-bottom: 4px; font: 800 clamp(1.35rem, 1.9vw, 1.75rem)/1.15 var(--sans); letter-spacing: -.025em; }
.week { grid-column: 9 / span 4; }
.week table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.week caption { padding-bottom: 14px; text-align: left; font: 700 1.0625rem/1.35 var(--sans); }
.week th { padding: 0 0 8px; text-align: left; font: 600 .875rem/1 var(--sans); color: var(--ink-soft); }
.week td { padding: 74px 0 0; vertical-align: top; font: 700 1rem/1.25 var(--sans); }
/* five working days drawn as five studs; the Saturday is hatched because it is only two a month */
.week__days { background: linear-gradient(to right, var(--ink) 0, var(--ink) calc(100% - 6px), transparent calc(100% - 6px)) 0 0 / 20% 64px repeat-x; }
.week__sat { background: repeating-linear-gradient(135deg, var(--amber) 0, var(--amber) 5px, var(--amber-light) 5px, var(--amber-light) 10px) 0 0 / 100% 64px no-repeat; }
.week p { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--ink-line); font: 400 1.0625rem/1.5 var(--serif); }

/* ---------- Crew: the application room ---------- */
.apply { padding-block: var(--section); background: var(--forest); color: var(--ivory); --focus: var(--amber-light); }
.apply__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(24px, 4vw, 64px); align-items: start; }
.apply__intro { position: sticky; top: 124px; }
.apply__intro .kicker { color: var(--ivory-soft); }
.apply__intro .voice { margin-top: 22px; color: var(--ivory-soft); }
.reassure { margin-top: 26px; border-top: 1px solid var(--ivory-line); }
.reassure li { display: flex; align-items: baseline; gap: 12px; padding-block: 13px; border-bottom: 1px solid var(--ivory-line); font-weight: 600; line-height: 1.45; }
.reassure li::before { content: ""; flex: none; width: .55em; height: .55em; border-radius: 50%; background: var(--amber-light); transform: translateY(-.08em); }

/* ---------- Footer ---------- */
.foot { position: relative; overflow: hidden; padding-block: clamp(28px, 4vw, 44px) clamp(40px, 6vw, 72px); background: var(--ink); color: var(--ivory); --focus: var(--amber-light); }
.foot__tag { position: relative; z-index: 1; margin-top: clamp(40px, 6vw, 88px); font: 800 clamp(2.6rem, 6.6vw, 6rem)/.92 var(--sans); letter-spacing: -.045em; }
.foot__tag span { display: block; }
.foot__row { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); max-width: 66%; margin-top: clamp(40px, 6vw, 80px); }
.foot__id { grid-column: 1 / span 5; font-weight: 600; line-height: 1.6; }
.foot__links { grid-column: 6 / span 7; }
.foot__links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-underline-offset: .25em; text-decoration-thickness: 1.5px; }
.foot__links a:hover, .foot__note a:hover { text-decoration-color: var(--amber-light); text-decoration-thickness: 3px; }
.foot__note { grid-column: 1 / -1; max-width: 34em; padding-top: 18px; border-top: 1px solid var(--ivory-line); font-size: .9375rem; color: var(--ivory-soft); }
.foot__note a { color: var(--ivory); font-weight: 600; text-underline-offset: .22em; }
.foot__sun { position: absolute; right: clamp(-40px, 4vw, 96px); bottom: 0; width: min(40vw, 500px); aspect-ratio: 2 / 1; overflow: hidden; }
.foot__sun span { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 1; border-radius: 50%; background: linear-gradient(var(--amber-light), var(--amber) 46%); }

/* ---------- Motion: one sunrise at load, and feedback for things the person does ---------- */
@keyframes sunrise { from { transform: translate(-24%, 30%); } }
@keyframes sunup { from { transform: translateY(56%); } }
@keyframes arrive { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .sun__disc { animation: sunrise 1.6s cubic-bezier(.16, .84, .3, 1) .15s both; }
  #application:not([hidden]), .received:not([hidden]) { animation: arrive .4s var(--ease) both; }
  .received:not([hidden]) .received__sun span { animation: sunup 1.4s cubic-bezier(.16, .84, .3, 1) .1s both; }
  .btn:disabled { animation: wait .25s .4s both; }
  .btn:disabled::before { animation: pulse .7s ease-in-out .4s infinite alternate; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .btn:disabled { opacity: .72; }
}
/* scripting off: the forms cannot send, so their buttons read as unavailable rather than busy */
@media (scripting: none) {
  .btn:disabled, .btn:disabled::before { animation: none; }
  .btn:disabled { opacity: .5; cursor: not-allowed; }
}

/* ---------- Narrower screens ---------- */
@media (max-width: 1099px) {
  html { scroll-padding-top: 96px; }
  .top__row { min-height: 78px; column-gap: 16px; }
  .brand img { height: 52px; }
  .nav ul { column-gap: clamp(12px, 1.8vw, 24px); }
}
@media (max-width: 899px) {
  .terms, .week { grid-column: 1 / -1; }
  .week { max-width: 30em; margin-top: 12px; }
  .apply__grid, .scope__grid, .cta__grid, .crewline__grid { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  .apply__intro { position: static; }
  .inquiry__grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "intro" "sheet" "next"; }
  .frame--aside { aspect-ratio: 5 / 2; }
  .frame--aside img { object-position: 60% 22%; }
  .foot__row { max-width: none; }
}
@media (max-width: 819px) {
  html { scroll-padding-top: 68px; }
  /* the logo row scrolls away; the three journeys stay pinned */
  .top, .top__row { display: contents; }
  .masthead { padding: 9px var(--gutter) 7px; }
  .brand img { height: 46px; }
  .nav { position: sticky; top: 0; z-index: 40; padding-inline: var(--gutter); border-block: 1px solid var(--ink-faint); background: var(--ivory); }
  .nav ul { flex-wrap: wrap; justify-content: space-between; gap: 2px 6px; min-height: 54px; padding-block: 5px; }   /* wraps to a second line before it would ever overflow */
  .nav a { min-height: 44px; font-size: clamp(.75rem, 3.55vw, .9375rem); }
  .nav__cta { padding: 0 12px; }

  .hero { padding-top: clamp(20px, 5vw, 32px); }
  .hero__grid { display: flex; flex-direction: column; }
  .hero__title { font-size: clamp(2.375rem, 12.2vw, 5.5rem); }
  .hero__title--four { font-size: clamp(3rem, 15.4vw, 6rem); }
  .hero__visual { justify-self: start; max-width: 520px; margin-top: 40px; }
  .frame--hero { max-height: none; }

  /* home, on a phone: the photo, the headline and the estimate button share the first screen */
  .hero--home { padding-top: 0; }
  .hero--home .hero__visual { order: -1; width: auto; max-width: none; margin: 0 calc(var(--gutter) * -1); }
  .hero--home .sun { display: none; }
  .hero--home .frame--hero { aspect-ratio: auto; min-height: 0; height: clamp(150px, 31vh, 300px); height: clamp(150px, 31svh, 300px); }
  .hero--home .frame--hero img { object-position: 50% 44%; }
  .hero--home .frame--hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(2, 37, 27, .82) 0, rgba(2, 37, 27, 0) 46%); }
  .hero--home figcaption { position: absolute; z-index: 1; left: var(--gutter); right: var(--gutter); bottom: 9px; margin: 0; color: var(--ivory); }
  .hero--home .hero__copy { padding-top: 18px; }
  .hero--home .hero__pitch { margin-top: 16px; }
  .hero--home .hero__actions { order: -1; margin-top: 0; }
  .hero--home .hero__lede { margin-top: 18px; }

  .head, .opening__grid { grid-template-columns: minmax(0, 1fr); row-gap: 18px; }
  .mosaic { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .shot--lead, .shot--tall, .shot--wide, .mosaic__note { grid-column: 1 / -1; }
  .shot--lead .frame { aspect-ratio: 4 / 3; }
  .shot--tall .shot__link { display: block; }
  .shot--tall .frame { aspect-ratio: 1 / 1; min-height: 0; }
  .shot--tall img { object-position: 68% 50%; }
  .shot--wide .frame { aspect-ratio: 3 / 2; }

  .stage__bar { padding-bottom: 14px; }
  .stage__grid { grid-template-columns: minmax(0, 1fr); gap: 26px; padding-inline: 0; }
  .tile--floor, .tile--walls, .tile--site, .tile--shell { grid-column: 1 / -1; }
  .tile .frame, .tile--site .frame, .tile--shell .frame { height: auto; aspect-ratio: 4 / 3; }
  .tile--shell .frame { aspect-ratio: 4 / 5; }
  .tile--shell img { object-position: 50% 42%; }
  .tile figcaption { padding-inline: var(--gutter); }

  .terms__row { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
  .foot__id, .foot__links { grid-column: 1 / -1; }
  .foot__tag { margin-top: 28px; }
  .foot__sun { right: -8vw; width: 64vw; }
  .foot { padding-bottom: calc(32vw + 28px); }
  .cta__sun { right: -14vw; width: 78vw; }
}
@media (max-width: 599px) {
  .btn { width: 100%; }
  .hero__actions .btn { width: auto; }
  .hero--home .hero__actions { gap: 4px 22px; }
  .apply > .wrap, .inquiry > .wrap { padding-inline: 0; }
  .apply__intro, .inquiry__intro, .inquiry__next { padding-inline: var(--gutter); }
  .upload__panel { padding: 84px 20px 20px; }
  .upload__sheet { left: 22px; top: 20px; }
  .lightbox-bottom p { font-size: .9375rem; }
}
@media (max-width: 359px) {
  .brand img { height: 42px; }
  .nav { padding-inline: 12px; }
  .nav__cta { padding: 0 10px; }
  .nav__cta::before { display: none; }
  .hero--home .hero__actions .btn { width: 100%; }
}

/* ---------- Other modes ---------- */
@media (forced-colors: active) {
  .chip input:checked + span, .option input:checked + span { outline: 3px solid Highlight; outline-offset: -4px; }
  .sun__disc, .foot__sun span, .received__sun span, .progress span { forced-color-adjust: none; }
  .upload__frame { border-color: CanvasText; }
}
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .top, .nav, .apply__intro { position: static; }
  .hero__visual, .shot, .tile, .terms__row, .week, .field { break-inside: avoid; }
  .lightbox, .skip { display: none !important; }
}
