/* Avery Prime
   Layout: a showroom. Full-screen photographs that stack over one another,
   each carrying one short title and two actions; between them, hard cuts to
   ivory chapters that hold the reading. Dark-first, near-black with a navy
   undertone. Display in Cormorant Garamond (brand), everything else in Jost
   at normal tracking. Square-ish 4px controls, square photographs. */

@font-face { font-family: "Cormorant Garamond"; src: url("/assets/fonts/cormorant-garamond.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Jost"; src: url("/assets/fonts/jost.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  /* brand */
  --navy: #2c3e50;
  --slate: #3b4550;
  --stone: #b1a99f;
  --ivory: #f6f3ef;
  /* grounds */
  --carbon: #0a0d11;
  --carbon-2: #141a21;
  --carbon-3: #1d252e;
  --ivory-2: #ebe6df;
  /* ink */
  --ink: #15191f;
  --graphite: #4b5059;
  --mist: #a9adb3;

  --display: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --text: "Jost", "Futura", "Century Gothic", "Helvetica Neue", Arial, sans-serif;

  /* five sizes, far apart */
  --t-s: 0.875rem;
  --t-m: 1.0625rem;
  --t-l: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --t-xl: clamp(2.4rem, 1.6rem + 3.4vw, 4.6rem);
  --t-xxl: clamp(2.9rem, 1.7rem + 5.6vw, 7rem);

  --gutter: max(20px, 4vw);
  --max: 1380px;
  --r: 4px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-exit: cubic-bezier(0.55, 0, 1, 0.45);
  --header-h: 64px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--carbon);
  color: var(--ivory);
  font: 400 var(--t-m)/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }
::selection { background: var(--stone); color: var(--carbon); }
:focus-visible { outline: 2px solid var(--stone); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.02; margin: 0; text-wrap: balance; letter-spacing: -0.005em; }
p { margin: 0; text-wrap: pretty; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 200; background: var(--ivory); color: var(--ink); padding: 10px 16px; border-radius: var(--r); text-decoration: none; }
.skip:focus { top: 16px; }

.wrap {
  width: 100%; max-width: var(--max); margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* ---------- Header: transparent, ink follows the chapter beneath ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  color: var(--header-ink, var(--ivory));
  background: var(--header-bg, transparent);
  transition: color 300ms ease, background-color 300ms ease;
}
.site-header .wrap { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand svg { width: 26px; height: 32px; flex: none; }
.brand svg text { fill: currentColor; font-family: var(--display); }
.brand svg line { stroke: currentColor; stroke-width: 1; }
.brand span { font-family: var(--display); font-size: 1.15rem; letter-spacing: 0.26em; font-weight: 500; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; font-size: 0.9375rem; font-weight: 400;
  padding: 8px 16px; border-radius: var(--r);
  transition: background-color 330ms ease;
}
.nav a:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.nav a[aria-current="page"] { background: color-mix(in srgb, currentColor 14%, transparent); }
.nav__phone { display: none; }
.menu-btn { display: none; background: none; border: 0; color: inherit; padding: 8px 14px; border-radius: var(--r); font-size: var(--t-s); font-weight: 500; cursor: pointer; }
.menu-btn:hover { background: color-mix(in srgb, currentColor 12%, transparent); }

@media (max-width: 900px) {
  .menu-btn { display: block; position: relative; z-index: 110; }
  .nav {
    position: fixed; inset: 0; z-index: 105;
    flex-direction: column; align-items: stretch; justify-content: center; gap: 2px;
    padding: calc(var(--header-h) + 16px) max(20px, env(safe-area-inset-right, 0px)) max(32px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
    background: var(--carbon); color: var(--ivory);
    opacity: 0; visibility: hidden; transform: translateY(-12px);
    transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out), visibility 0s 240ms;
  }
  .menu-open .nav { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .menu-open .site-header { color: var(--ivory); }
  .nav a { font-family: var(--display); font-size: clamp(2rem, 8vw, 2.8rem); font-weight: 500; padding: 10px 12px; }
  .nav .nav__phone { display: block; font-family: var(--text); font-size: var(--t-m); color: var(--stone); margin-top: 24px; }
}

/* ---------- Photographs: darkened for a dark page, neutral scrims only ---------- */
.ph { position: relative; overflow: hidden; background: var(--carbon-2); }
.ph img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.8) contrast(1.06) saturate(0.88); }
.on-ivory .ph img { filter: brightness(0.94) contrast(1.04) saturate(0.9); }

/* ---------- Buttons (Tesla geometry: 4px, 40-48px tall, fixed width) ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px 16px; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 240px; min-height: 54px; padding: 14px 28px;
  border-radius: var(--r); border: 1px solid transparent;
  font: 400 0.9375rem/1.2 var(--text); letter-spacing: 0.01em; text-decoration: none; cursor: pointer;
  transition: background-color 400ms ease, color 400ms ease, border-color 400ms ease, transform 140ms var(--ease-out);
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--ivory); color: var(--ink); }
.btn--primary:hover { background: #fff; }
.btn--secondary { background: rgba(10, 13, 17, 0.28); color: var(--ivory); border-color: rgba(246, 243, 239, 0.42); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.btn--secondary:hover { background: rgba(10, 13, 17, 0.55); border-color: rgba(246, 243, 239, 0.8); }
.on-ivory .btn--primary { background: var(--navy); color: var(--ivory); }
.on-ivory .btn--primary:hover { background: #22313f; }
.on-ivory .btn--secondary { background: var(--ivory-2); color: var(--ink); }
.on-ivory .btn--secondary:hover { background: #e0dad2; }
@media (max-width: 560px) { .actions { flex-direction: column; align-items: stretch; width: 100%; } .btn { min-width: 0; } }

.text-link { text-decoration: none; box-shadow: inset 0 -1px 0 currentColor; transition: box-shadow 330ms cubic-bezier(0.5, 0, 0, 0.75); }
.text-link:hover { box-shadow: inset 0 -2px 0 currentColor; }

/* ---------- Panel: one full screen, one picture, one idea ---------- */
.panel {
  position: relative; height: 100svh; min-height: 560px;
  display: grid; grid-template-rows: 1fr auto; overflow: hidden;
  background: var(--carbon); color: var(--ivory);
  isolation: isolate;
}
.panel > .ph { position: absolute; inset: 0; z-index: -1; transform: scale(var(--sc, 1)); transform-origin: 50% 30%; }
.panel > .ph::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 38%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0) 42%),
    radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.38) 100%);
}
.panel__shade { position: absolute; inset: 0; z-index: 0; background: #000; opacity: var(--dim, 0); pointer-events: none; }
.panel__top { position: relative; z-index: 1; align-self: start; text-align: center; padding-top: calc(var(--header-h) + clamp(40px, 9svh, 110px)); opacity: var(--fade, 1); }
.panel__top h1, .panel__top h2 { font-size: var(--t-xxl); }
.panel__top h2 { font-size: var(--t-xl); }
.panel__top p { margin-top: 18px; font-size: var(--t-l); font-weight: 300; color: rgba(246, 243, 239, 0.86); }
/* Search heading as a small line, the client's headline as the big read */
.panel__top .eyebrow { font: 500 var(--t-m)/1.3 var(--text); letter-spacing: 0; color: rgba(246, 243, 239, 0.86); margin-bottom: 20px; }
.panel__top .headline { margin-top: 0; font-family: var(--display); font-weight: 400; font-size: var(--t-xxl); line-height: 1.02; letter-spacing: -0.005em; color: var(--ivory); text-wrap: balance; }
.panel__bottom { position: relative; z-index: 1; padding-bottom: max(clamp(40px, 8svh, 80px), env(safe-area-inset-bottom, 0px)); display: grid; gap: 28px; justify-items: center; opacity: var(--fade, 1); }
.panel--short { height: 72svh; min-height: 480px; }

/* Spec row: Tesla's figures under the title, words here because the facts are words */
.specs { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px clamp(28px, 5vw, 72px); list-style: none; margin: 0; padding: 0; text-align: center; }
.specs strong { display: block; font-family: var(--display); font-weight: 500; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); line-height: 1.1; }
.specs span { font-size: var(--t-s); color: rgba(246, 243, 239, 0.8); }
@media (max-width: 560px) { .specs { gap: 12px 24px; } .specs li { flex: 1 1 40%; } }

/* Stack: each panel holds while the next slides over it (JS sets --sc / --dim) */
.stack > .panel { position: sticky; top: 0; }

/* ---------- Chapters (hard colour cuts) ---------- */
.chapter { padding-block: clamp(72px, 11vw, 140px); }
.on-ivory { background: var(--ivory); color: var(--ink); }
.on-carbon { background: var(--carbon); color: var(--ivory); }
.on-carbon-2 { background: var(--carbon-2); color: var(--ivory); }

.split { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.split > * { min-width: 0; }
.split h2 { font-size: var(--t-xl); }
.body { display: grid; gap: 22px; max-width: 62ch; }
.lead { font-size: var(--t-l); line-height: 1.5; }
.on-ivory .body p:not(.lead) { color: var(--graphite); }
.on-carbon .body p:not(.lead), .on-carbon-2 .body p:not(.lead) { color: var(--mist); }
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.points li { padding-left: 22px; position: relative; }
.points li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 8px; background: var(--stone); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Facts: the visible early summary for search and answer engines */
.facts { font-size: var(--t-l); line-height: 1.5; max-width: 60ch; }

/* ---------- Index with preview (services) ---------- */
.index { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 8px 40px; align-items: baseline;
  padding: 22px 24px; border-radius: var(--r); background: var(--ivory-2);
  transition: background-color 200ms ease, color 200ms ease;
}
.row h3 { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.2rem); }
.row p { color: var(--graphite); transition: color 200ms ease; }
.row__img { position: absolute; z-index: 3; right: 24px; top: 50%; width: 220px; aspect-ratio: 4 / 3; pointer-events: none; opacity: 0; transform: translateY(-50%) scale(0.96); clip-path: inset(0 0 100% 0); transition: opacity 300ms var(--ease-out), transform 400ms var(--ease-out), clip-path 400ms var(--ease-out); }
@media (hover: hover) and (min-width: 1000px) {
  .row { padding-right: 270px; }
  .row:hover { background: var(--carbon); color: var(--ivory); }
  .row:hover p { color: var(--mist); }
  .row:hover .row__img { opacity: 1; transform: translateY(-50%); clip-path: inset(0 0 0 0); }
}
@media (max-width: 860px) { .row { grid-template-columns: 1fr; padding: 18px 18px; } .row__img { display: none; } }

/* Headline lines stack with or without motion (the rise itself is in the motion block) */
.mask, .mask > span { display: block; }

/* ---------- A service in full (label, sign-off, alternating picture side) ---------- */
.label { font-size: var(--t-s); font-weight: 500; color: var(--stone); }
.on-ivory .label { color: #746c62; }
.signoff { font-family: var(--display); font-weight: 500; font-size: clamp(1.45rem, 1.2rem + 0.9vw, 2rem); line-height: 1.2; }
@media (min-width: 861px) { .split--flip > :first-child { order: 2; } }
.foot-nav--services { margin-top: 10px; opacity: 0.8; }

/* ---------- Statement that fills with ink as it rises ---------- */
.statement { font-family: var(--display); font-weight: 500; font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3.4rem); line-height: 1.16; max-width: 30ch; }
.js .statement .w { opacity: 0.45; transition: opacity 200ms ease; }
.js .statement .w.lit { opacity: 1; }

/* ---------- Principles: two columns of plain text, tone-step tiles ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--carbon-3); border-radius: var(--r); padding: clamp(24px, 3vw, 40px); display: grid; gap: 12px; align-content: start; }
.tile h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); }
.tile p { color: var(--mist); }
.on-ivory .tile { background: var(--ivory-2); }
.on-ivory .tile p { color: var(--graphite); }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Areas ---------- */
.areas { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.areas li { background: var(--ivory-2); border-radius: var(--r); padding: 8px 14px; font-size: var(--t-s); font-weight: 500; }

/* ---------- FAQ: tone-step blocks, no rules ---------- */
.faq { display: grid; gap: 8px; }
.faq details { background: var(--ivory-2); border-radius: var(--r); interpolate-size: allow-keywords; }
.on-carbon .faq details, .on-carbon-2 .faq details { background: var(--carbon-3); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 20px 24px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem); line-height: 1.25; }
.faq summary i { flex: none; width: 16px; height: 16px; position: relative; }
.faq summary i::before, .faq summary i::after { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: currentColor; transition: transform 240ms var(--ease-out); }
.faq summary i::after { transform: rotate(90deg); }
.faq details[open] summary i::after { transform: rotate(0deg); }
.faq details::details-content { block-size: 0; overflow: clip; transition: block-size 300ms var(--ease-out), content-visibility 300ms allow-discrete; }
.faq details[open]::details-content { block-size: auto; }
.faq .answer { padding: 0 24px 24px; max-width: 70ch; color: var(--graphite); }
.on-carbon .faq .answer, .on-carbon-2 .faq .answer { color: var(--mist); }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact > * { min-width: 0; }
.direct { display: grid; gap: 26px; }
.direct dt { font-size: var(--t-s); color: var(--mist); margin-bottom: 2px; }
.direct dd { margin: 0; font-family: var(--display); font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); line-height: 1.15; overflow-wrap: anywhere; }
.direct a { text-decoration: none; }
.direct a:hover { color: var(--stone); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; }
.field label { font-size: var(--t-s); color: var(--mist); }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ivory); background: var(--carbon-3); border: 0; border-radius: var(--r);
  padding: 14px 16px; width: 100%; outline: none; transition: background-color 200ms ease, box-shadow 200ms ease;
  appearance: none; -webkit-appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--mist) 50%), linear-gradient(135deg, var(--mist) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; cursor: pointer; }
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { box-shadow: inset 0 0 0 2px var(--stone); }
.form__note { font-size: var(--t-s); color: var(--mist); }
.form__status { font-size: var(--t-s); color: var(--stone); min-height: 1.4em; }
/* Shown after a no-JS submit: the admin redirects to /contact/?sent=1#sent (or ?sent=0#not-sent). */
.form__notice { display: none; scroll-margin-top: 120px; padding: 14px 16px; border-radius: var(--r); background: var(--carbon-3); color: var(--ivory); outline: none; }
.form__notice:target { display: block; }
.form__notice a { color: inherit; }
/* Honeypot: off-screen for people, still in the form for bots. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 860px) { .contact, .form { grid-template-columns: 1fr; } }

/* ---------- Survey: a slow field of setting-out points over the hero ---------- */
.survey { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  -webkit-mask-image: radial-gradient(90% 70% at 50% 55%, #000 30%, transparent 85%); mask-image: radial-gradient(90% 70% at 50% 55%, #000 30%, transparent 85%); }
.survey i { position: absolute; inset: -40px; background-image: radial-gradient(circle, rgba(246, 243, 239, 0.34) 1px, transparent 1.4px); background-size: 34px 34px; }
.survey i + i { background-image: radial-gradient(circle, rgba(177, 169, 159, 0.55) 1.2px, transparent 1.6px); background-size: 136px 136px; background-position: 17px 17px; }

/* ---------- Elevation: the house drawn in light ---------- */
.elev { position: relative; background: var(--carbon); color: var(--ivory); padding-block: clamp(88px, 12vw, 160px) clamp(56px, 8vw, 110px); overflow: hidden; }
.elev::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(177, 169, 159, 0.16) 1px, transparent 1.3px); background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 60%, #000, transparent); mask-image: radial-gradient(70% 60% at 50% 60%, #000, transparent); }
.elev__head { position: relative; text-align: center; display: grid; gap: 18px; justify-items: center; }
.elev__head h2 { font-size: var(--t-xl); }
.elev__head p { max-width: 46ch; font-size: var(--t-l); font-weight: 300; color: var(--mist); }
.elev__sheet { position: relative; width: min(1180px, 100%); margin: clamp(32px, 5vw, 64px) auto 0; padding-inline: max(8px, 2vw); }
.elev__svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 0 6px rgba(214, 198, 172, 0.35)); }
/* Strokes scale with the drawing (no non-scaling-stroke: it breaks pathLength dashes when scaled up) */
.elev .ln { fill: none; stroke: #e9dfcf; stroke-width: 1.1; stroke-linecap: round; }
.elev .ln.heavy { stroke-width: 1.8; stroke: #f6f0e6; }
.elev .ln.fine { stroke-width: 0.7; stroke: rgba(233, 223, 207, 0.72); }
.elev .ln.grid { stroke-width: 0.6; stroke: rgba(177, 169, 159, 0.32); stroke-dasharray: 0.004 0.008; }
.elev .ln.faint { stroke-width: 0.8; stroke: rgba(177, 169, 159, 0.28); }
.elev .ln.dim { stroke-width: 0.8; stroke: var(--stone); }
.elev .tx { fill: var(--stone); font: 400 13px var(--text); letter-spacing: 0.04em; }
.elev .tx.mid { text-anchor: middle; }
.elev .tx.title { fill: #efe6d8; font-size: 15px; letter-spacing: 0.18em; }
.elev .tx.note { font-size: 12px; fill: rgba(177, 169, 159, 0.8); }
.elev .glow { fill: url(#lamp); opacity: calc(var(--o, 1) * 0.85); }
.elev ellipse.glow { fill: url(#pool); }
.elev .tx.end { text-anchor: end; }
.elev .tx.room { fill: rgba(233, 223, 207, 0.8); font-size: 12px; letter-spacing: 0.16em; }
.elev--door .elev__sheet { width: min(760px, 100%); }
@media (max-width: 640px) { .elev .ln { stroke-width: 2.2; } .elev .ln.heavy { stroke-width: 3.2; } .elev .ln.fine, .elev .ln.faint, .elev .ln.dim { stroke-width: 1.5; } .elev .ln.grid { stroke-width: 1.2; } .elev .tx { font-size: 18px; } .elev .tx.title { font-size: 20px; } .elev .tx.note { display: none; } }

/* ---------- Person: the closing contact card ---------- */
.person { font-style: normal; display: grid; gap: 10px; justify-items: center; text-align: center; }
.person__name { font-family: var(--display); font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.5rem); line-height: 1.1; }
.person__name span { display: block; margin-top: 6px; font: 300 var(--t-m)/1.4 var(--text); color: rgba(246, 243, 239, 0.82); }
.person__lines { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px; font-size: var(--t-l); font-weight: 300; }
.person__lines a { text-decoration: none; box-shadow: inset 0 -1px 0 rgba(246, 243, 239, 0.4); transition: box-shadow 330ms ease; }
.person__lines a:hover { box-shadow: inset 0 -1px 0 var(--ivory); }

/* ---------- Footer ---------- */
.site-footer { background: var(--carbon); color: var(--mist); font-size: var(--t-s); }
.site-footer .wrap { padding-block: 40px max(32px, env(safe-area-inset-bottom, 0px)); display: grid; gap: 22px; }
.foot-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 26px; }
.foot-nav a { text-decoration: none; }
.foot-nav a:hover { color: var(--ivory); }
.foot-legal { text-align: center; }
.foot-legal a { text-decoration: none; box-shadow: inset 0 -1px 0 rgba(169, 173, 179, 0.5); }
.foot-legal a:hover { color: var(--ivory); }

/* ---------- Motion (all hidden states only when motion is welcome) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Load: masked headline lines, then sentence, then actions. Settled by 1.2s. */
  .mask { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
  .mask > span { display: block; animation: rise 1000ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 100ms + 80ms); }
  .load-in { animation: fade-up 800ms var(--ease-out) both; animation-delay: var(--d, 300ms); }
  @keyframes rise { from { transform: translateY(105%); } }
  @keyframes fade-up { from { opacity: 0; transform: translateY(16px); } }

  /* The one moving picture: the home hero drifts slowly */
  .drift img { animation: drift 24s ease-in-out infinite alternate; }
  @keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.09) translate(-1%, -1%); } }

  /* Below-the-fold reveals, once, varied by kind */
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out); transition-delay: var(--d, 0ms); }
  .js [data-reveal="picture"] { opacity: 1; transform: none; clip-path: inset(0 0 100% 0); transition: clip-path 1200ms var(--ease-in-out); }
  .js [data-reveal="picture"] img { transform: scale(1.12); transition: transform 1300ms var(--ease-out); }
  .js [data-reveal].is-in { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
  .js [data-reveal="picture"].is-in img { transform: none; }
  .js [data-reveal="rows"] > * { opacity: 0; transform: translateY(14px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); transition-delay: calc(var(--n, 0) * 60ms); }
  .js [data-reveal="rows"] { opacity: 1; transform: none; }
  .js [data-reveal="rows"].is-in > * { opacity: 1; transform: none; }

  /* Survey points drift, the fine field and the coarse one at different speeds */
  .survey i { animation: survey 60s linear infinite; }
  .survey i + i { animation-duration: 90s; animation-direction: reverse; }
  @keyframes survey { to { transform: translate(34px, -34px); } }
  .survey { animation: survey-in 2400ms var(--ease-out) 600ms both; }
  @keyframes survey-in { from { opacity: 0; } }

  /* The elevation draws itself in order once it is on screen, then the windows light */
  .js [data-draw] .ln { stroke-dashoffset: 1; stroke-dasharray: 1 1; }
  .js [data-draw] .ln.grid { stroke-dasharray: 1 1; }
  .js [data-draw] .tx, .js [data-draw] .glow { opacity: 0; }
  .js [data-draw].is-in .ln { animation: draw 1400ms var(--ease-in-out) both; animation-delay: var(--d, 0ms); }
  .js [data-draw].is-in .tx { animation: fade-in 900ms ease both; animation-delay: var(--d, 0ms); }
  .js [data-draw].is-in .glow { animation: lamp 2600ms ease both, flicker 7s ease-in-out infinite; animation-delay: calc(var(--d, 0ms) + 3600ms), calc(var(--d, 0ms) + 6400ms); }
  .js [data-draw].is-in .ln.grid { animation: draw-grid 1600ms var(--ease-in-out) both; animation-delay: var(--d, 0ms); }
  @keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes draw-grid { from { stroke-dashoffset: 1; stroke-dasharray: 1 1; } 70% { stroke-dashoffset: 0; stroke-dasharray: 1 1; } to { stroke-dashoffset: 0; stroke-dasharray: 0.004 0.008; } }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes lamp { from { opacity: 0; } to { opacity: calc(var(--o, 1) * 0.85); } }
  @keyframes flicker { 0%, 100% { opacity: calc(var(--o, 1) * 0.85); } 50% { opacity: calc(var(--o, 1) * 0.7); } }

  /* Page to page */
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-leave 200ms var(--ease-exit) both; }
  ::view-transition-new(root) { animation: vt-arrive 380ms var(--ease-out) 60ms both; }
  @keyframes vt-leave { to { opacity: 0; } }
  @keyframes vt-arrive { from { opacity: 0; transform: translateY(16px); } }
}
@media (prefers-reduced-motion: reduce) {
  .stack > .panel { position: relative; }
  .panel > .ph { transform: none !important; }
  .panel__shade { opacity: 0 !important; }
  .panel__top, .panel__bottom { opacity: 1 !important; }
}
