/* rvluxurybeds main stylesheet
   Order: base, utilities, header, hero and scene, sections, form, footer, motion. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-display);
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: var(--fs-h2); letter-spacing: -.01em; }
h3 { font-size: var(--fs-h3); line-height: 1.25; }
h4 { font-size: 1.125rem; line-height: 1.3; }

p { margin: 0 0 var(--space-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-s);
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--forest);
  color: var(--ivory);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: var(--space-4); }

.label {
  display: block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.lead { font-size: var(--fs-lead); }
.caption { font-size: var(--fs-small); }

/* ---------- Actions ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .75rem 1.5rem;
  border: 1px solid var(--forest);
  border-radius: var(--radius-m);
  background: var(--action-bg);
  color: var(--action-text);
  font: 700 1rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-control) var(--ease-out), color var(--dur-control) var(--ease-out), transform var(--dur-control) var(--ease-out);
}
.button:hover { background: var(--forest-deep); }
.button:active { transform: translateY(1px); }

.button--quiet { background: transparent; color: var(--charcoal); border-color: var(--line-strong); }
.button--quiet:hover { background: var(--ivory-deep); }

.button--light { background: var(--ivory); color: var(--forest); border-color: var(--ivory); }
.button--light:hover { background: var(--oat); }
.button--light:focus-visible { outline-color: var(--focus-on-dark); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 48px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.text-link svg { transition: transform var(--dur-control) var(--ease-out); }
.text-link:hover svg { transform: translateX(4px); }
.text-link:hover { text-decoration: underline; }
.text-link--light { color: var(--ivory); }
.text-link--light:focus-visible { outline-color: var(--focus-on-dark); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  color: var(--ivory);
  background: rgba(40, 42, 41, .62); /* fallback where color-mix is unsupported */
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--charcoal) var(--header-tint), transparent) 0%,
    color-mix(in srgb, var(--charcoal) var(--header-tint), transparent) 62%,
    color-mix(in srgb, var(--charcoal) var(--header-tint-edge), transparent) 100%
  );
  -webkit-backdrop-filter: blur(var(--header-blur)) saturate(110%);
  backdrop-filter: blur(var(--header-blur)) saturate(110%);
  /* The bar reaches below the nav so its bottom edge can follow the roofline sweep.
     That extra band must not swallow clicks, hence pointer-events. */
  padding-bottom: var(--header-curve);
  pointer-events: none;
  clip-path: url(#header-clip);
  transition: background-color var(--dur-section) var(--ease-out), box-shadow var(--dur-section) var(--ease-out), transform var(--dur-section) var(--ease-out);
}
.site-header__inner { pointer-events: auto; }
/* Once past the hero the bar sits over ordinary content: it firms up and the
   roofline curve gives way to a straight edge. */
.site-header.is-compact {
  clip-path: none;
  padding-bottom: 0;
  background: color-mix(in srgb, var(--charcoal) var(--header-tint-scrolled), transparent);
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--charcoal) var(--header-tint-scrolled), transparent) 0%,
    color-mix(in srgb, var(--charcoal) var(--header-tint-scrolled), transparent) 62%,
    color-mix(in srgb, var(--charcoal) calc(var(--header-tint-scrolled) - 24%), transparent) 100%
  );
  box-shadow: 0 1px 0 rgba(40, 42, 41, .18);
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header :focus-visible { outline-color: var(--focus-on-dark); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: color-mix(in srgb, var(--charcoal) 92%, transparent); }
}

.site-header__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.primary-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.primary-nav__side {
  display: flex;
  gap: clamp(1.5rem, 3vw, 3.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.primary-nav__side--start { justify-content: flex-end; }
.primary-nav__side--end { justify-content: flex-start; }
.primary-nav__side a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-weight: 700;
  font-size: .9375rem;
  text-decoration: none;
  position: relative;
}
.primary-nav__side a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  height: 1px;
  background: var(--oat);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-control) var(--ease-out);
}
.primary-nav__side a:hover::after,
.primary-nav__side a[aria-current]::after { transform: scaleX(1); }

/* Logo: supplied artwork, clear space = 10% of visible width on all sides */
/* Brand guide: on a dark surface the logo sits inside a warm ivory panel,
   keeping its 10% clear space. A reversed logo needs the vector master first. */
.brand {
  display: block;
  padding: var(--logo-clear);
  margin: 0 clamp(1rem, 3vw, 3rem);
  background: var(--ivory);
  border-radius: var(--radius-s);
}
.brand img { width: var(--logo-w); height: auto; }

.menu-toggle { display: none; }

@media (max-width: 63.99rem) {
  .primary-nav { display: block; }
  .primary-nav__side { display: none; }
  .brand { margin: 0 0 0 calc(var(--logo-clear) * -1); display: inline-block; }
  .site-header__inner { display: flex; align-items: center; justify-content: space-between; }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    min-height: 48px;
    min-width: 48px;
    padding: 0 .75rem;
    border: 1px solid var(--line-on-forest);
    border-radius: var(--radius-m);
    background: transparent;
    color: var(--ivory);
    font: 700 .9375rem/1 var(--font-body);
    cursor: pointer;
  }
  .menu-toggle__bars,
  .menu-toggle__bars::before {
    display: block;
    width: 18px;
    height: 1.5px;
    background: currentColor;
    position: relative;
  }
  .menu-toggle__bars { top: -3px; }
  .menu-toggle__bars::before { content: ""; top: 6px; }
}

/* Mobile menu sheet */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(40, 42, 41, .38);
  display: flex;
  align-items: flex-end;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu__panel {
  width: 100%;
  background: var(--ivory);
  padding: var(--space-6) var(--gutter) calc(var(--space-6) + var(--safe-bottom));
  border-top: 1px solid var(--line);
  animation: sheet-in var(--dur-section) var(--ease-out);
}
.mobile-menu__list { list-style: none; margin: 0 0 var(--space-5); padding: 0; }
.mobile-menu__list a {
  display: flex;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-decoration: none;
}
.mobile-menu__line { font-size: var(--fs-small); margin-bottom: var(--space-5); }
.mobile-menu__close {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: transparent;
  font: 700 1rem var(--font-body);
  color: var(--charcoal);
  cursor: pointer;
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }

/* ---------- Hero: full-bleed media, copy on a solid panel ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  padding: 0;
  margin: 0 0 var(--space-8);
}
/* The header floats over the footage, so the media starts at the very top */
.hero__stage { padding-top: 0; }

.hero__stage {
  position: relative;
  margin: 0;
  --scene-h: 100svh;
}

.hero__caption {
  grid-area: caption;
  margin: var(--space-3) 0 0;
  font-size: .75rem;
  text-align: left;
  opacity: .8;
}

/* The roofline: a fine rule that floats above the scene, echoing the logo's roof over the bed */
.roofline {
  position: absolute;
  left: 0;
  top: var(--header-h);
  width: 100%;
  height: var(--header-curve);
  overflow: visible;
  pointer-events: none;
  z-index: 51; /* above the bar (50) so the rule traces its curved edge rather than hiding under it */
  opacity: .95;
  transition: opacity var(--dur-section) var(--ease-out);
}
/* Once the page moves, the rule has nothing to trace: it goes */
.is-scrolled .roofline { opacity: 0; }
.roofline path, .invite__rule path {
  stroke: var(--bronze);
  stroke-width: 1.5;
}

.scene { position: absolute; inset: 0; isolation: isolate; overflow: hidden; }
.scene__frames {
  position: absolute;
  inset: 0;
  /* Slight overscan so the pointer parallax never exposes an edge */
  transform: scale(1.04) translate(calc(var(--px, 0) * 5px), calc(var(--py, 0) * 4px));
  transition: transform 120ms linear;
}
.scene__road,
.scene__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.scene__road { object-position: 50% 52%; }
.scene__frame { object-position: 50% 45%; }

/* One value, t, walks the same stack from the highway to the bedroom at night.
   Each layer reaches full opacity at its own stop, so every stop is a clean image
   and only two layers ever blend at once. */
.scene__frame--day { opacity: var(--w-day, 0); }
.scene__frame--golden { opacity: var(--w-golden, 0); }
.scene__frame--night { opacity: var(--w-night, 0); }

/* Editorial panel over the footage, on a solid surface for legibility */
.hero__copy {
  position: absolute;
  z-index: 4;
  left: max(var(--gutter), calc((100% - var(--page-max)) / 2 + var(--gutter)));
  top: 52%;
  transform: translateY(-50%);
  width: min(40rem, 46vw);
  padding: var(--space-7) var(--space-7) var(--space-6);
  background: rgba(247, 244, 237, .9); /* fallback where color-mix is unsupported */
  background: color-mix(in srgb, var(--ivory) var(--panel-tint), transparent);
  -webkit-backdrop-filter: blur(var(--panel-blur)) saturate(112%);
  backdrop-filter: blur(var(--panel-blur)) saturate(112%);
  border-top: 1px solid var(--bronze);
}
/* Without a backdrop filter the panel carries the legibility on its own */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hero__copy { background: color-mix(in srgb, var(--ivory) 92%, transparent); }
}
.hero__title { display: block; }
.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.hero__eyebrow::before {
  content: "";
  width: 40px;
  height: 1px;
  background: var(--bronze);
}
.hero__headline {
  display: block;
  font-size: var(--fs-display);
  letter-spacing: -.015em;
}
.hero__line { display: block; }
@media (min-width: 90rem) { .hero__line { white-space: nowrap; } }
.hero__lead {
  font-size: var(--fs-lead);
  margin: var(--space-5) 0 var(--space-6);
  max-width: 26rem;
}
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); }

/* The controls sit inside the editorial panel, so the footage runs clean to the
   bottom of the viewport with no band across it. */
.hero__controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "label control"
    "status motion"
    "caption caption";
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}
.scene__label { grid-area: label; display: grid; gap: 2px; cursor: pointer; }
.scene__hint { font-size: var(--fs-small); }
.scene__control { grid-area: control; display: flex; align-items: center; gap: var(--space-3); }
.scene__end { font-size: .8125rem; font-weight: 700; }
.scene__status {
  grid-area: status;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.0625rem;
}

/* Pause control for the looping footage (WCAG 2.2.2) */
.scene__motion {
  grid-area: motion;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  padding: 0 .85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--ivory);
  color: var(--charcoal);
  font: 700 .8125rem/1 var(--font-body);
  cursor: pointer;
  transition: background-color var(--dur-control) var(--ease-out);
}
.scene__motion:hover { background: var(--ivory-deep); }
.scene__motion[hidden] { display: none; }
.scene__motion-icon {
  width: 10px;
  height: 12px;
  background: currentColor;
  clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%, 65% 0);
}
.scene__motion[aria-pressed="true"] .scene__motion-icon {
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* Range: native input, restyled; 44px tall hit area */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --fill: 0%;
}
.range::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--forest) var(--fill), var(--oat) var(--fill));
}
.range::-moz-range-track { height: 3px; border-radius: 2px; background: var(--oat); }
.range::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--forest); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  margin-top: -11.5px;
  border-radius: 50%;
  background: var(--forest);
  border: 3px solid var(--ivory);
  box-shadow: 0 0 0 1px var(--forest);
  transition: transform var(--dur-control) var(--ease-out);
}
.range::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--forest);
  border: 3px solid var(--ivory);
  box-shadow: 0 0 0 1px var(--forest);
}
.range:active::-webkit-slider-thumb { transform: scale(1.12); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--forest), 0 0 0 5px var(--ivory), 0 0 0 7px var(--forest); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 1px var(--forest), 0 0 0 5px var(--ivory), 0 0 0 7px var(--forest); }

/* Tablet: panel drops below the footage */
@media (max-width: 63.99rem) {
  .hero { padding-top: calc(var(--header-h) + var(--header-curve)); }
  .roofline { display: none; }
  .hero__stage {
    --scene-h: clamp(380px, 62vw, 560px);
    display: flex;
    flex-direction: column;
  }
  /* Headline and primary action come first, then the footage */
  .hero__copy { order: -1; }
  .scene { order: 0; }
  .hero__caption { order: 1; }
  .roofline { display: none; } /* decorative; it belongs above the media, which is no longer the first block */
  .hero__copy {
    position: static;
    transform: none;
    width: min(44rem, 100%);
    margin: 0 auto;
    padding: var(--space-7) var(--gutter) 0;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-top: 0;
  }
  .hero { margin-bottom: var(--space-7); }
  .scene { height: auto; }
  .scene__frames { position: relative; height: var(--scene-h); }
  .roofline { top: calc(var(--scene-h) * -0.012 - 12px); }
  .hero__caption { text-align: left; }
  .hero { margin-bottom: var(--space-7); }
}

@media (max-width: 47.99rem) {
  .hero__stage { --scene-h: clamp(380px, 72svh, 560px); }
  .hero__controls { grid-template-columns: 1fr; grid-template-areas: "label" "control" "status" "motion" "caption"; justify-items: start; }
  .scene__motion { justify-self: start; }
}

/* ---------- Section rhythm ---------- */
.section-head {
  max-width: 44rem;
  margin: 0 auto var(--space-8);
  text-align: center;
}
.section-head .label { margin-bottom: var(--space-4); }
.section-head h2 { margin-bottom: var(--space-5); }

/* ---------- What a bed is up against ---------- */
.against { background: var(--ivory); }

/* A full-bleed band of material, with the statement on a solid surface */
.against__band {
  position: relative;
  isolation: isolate;
  min-height: clamp(26rem, 46vw, 36rem);
  display: grid;
  align-items: center;
  overflow: hidden;
  background: var(--oat-soft);
}
.against__texture {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.against__motion { position: absolute; right: var(--gutter); bottom: var(--space-4); z-index: 2; }
.against__statement {
  width: min(38rem, 100%);
  margin-left: max(var(--gutter), calc((100% - var(--page-max)) / 2 + var(--gutter)));
  padding: clamp(2rem, 4vw, 3.25rem);
  background: color-mix(in srgb, var(--ivory) 93%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--bronze);
}
.against__statement .label { margin-bottom: var(--space-4); }
.against__statement h2 { margin-bottom: var(--space-5); font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.75rem); }

/* The room, read as a drawing: each note marks what it is talking about */



















@media (max-width: 63.99rem) {
  .against__statement { width: auto; margin: 0 var(--gutter); }
}

/* ---------- Find your fit ---------- */
.fit {
  max-width: var(--page-max);
  margin: 0 auto;
  /* the panels end with their own note, so the foot of this section runs tight */
  padding: var(--space-9) var(--gutter) var(--space-6);
}
.fit__layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.fit__plan { position: sticky; top: calc(var(--header-h) + var(--space-5)); display: grid; gap: var(--space-5); }

.fit-form { display: grid; gap: var(--space-5); }
.fit-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.fit-form legend { padding: 0; margin-bottom: var(--space-3); font-weight: 700; }
.field { display: grid; gap: var(--space-2); }
.field > label { font-weight: 700; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.unit, .optional { font-weight: 400; }
.optional { font-size: .875rem; margin-left: .35rem; }
.hint { font-size: .875rem; margin: 0; }
.fit-form legend .optional { display: block; margin: .15rem 0 0; }
.error { font-size: .9375rem; font-weight: 700; margin: 0; color: var(--error); }
.error:empty { display: none; }
.error::before { content: "! "; }

.fit-form input[type="text"],
.fit-form textarea {
  width: 100%;
  min-height: 52px;
  padding: .75rem .9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: #FFFDF8;
  color: var(--charcoal);
  font: 400 1.0625rem/1.4 var(--font-body);
  transition: border-color var(--dur-control) var(--ease-out), box-shadow var(--dur-control) var(--ease-out);
}
.fit-form textarea { resize: vertical; }
.fit-form input[type="text"]:focus,
.fit-form textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 2px var(--forest); }
.fit-form [aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.fit-form ::placeholder { color: #6A6C69; }

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  overflow: hidden;
}
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented label, .segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 1.1rem;
  font: 700 .9375rem var(--font-body);
  cursor: pointer;
  background: transparent;
  border: 0;
  color: inherit;
  transition: background-color var(--dur-control) var(--ease-out), color var(--dur-control) var(--ease-out);
}
.segmented input:checked + label { background: var(--forest); color: var(--ivory); }
.segmented input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: -4px; }

.checks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-4); }
.check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  cursor: pointer;
}
.check input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 22px; height: 22px;
  margin: 0;
  border: 1.5px solid var(--charcoal);
  border-radius: var(--radius-s);
  display: grid;
  place-items: center;
  background: #FFFDF8;
  cursor: pointer;
}
.check input::after {
  content: "";
  width: 11px; height: 6px;
  border-left: 2px solid var(--ivory);
  border-bottom: 2px solid var(--ivory);
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform var(--dur-control) var(--ease-out);
}
.check input:checked { background: var(--forest); border-color: var(--forest); }
.check input:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }

.form-summary-error {
  padding: var(--space-4);
  border-left: 3px solid var(--error);
  background: var(--ivory-deep);
  font-weight: 700;
}
.fit-form .button { justify-self: start; }

/* The plan: a measured drawing on oat paper */
.plan {
  background: var(--oat-soft);
  border: 1px solid var(--line);
  padding: var(--space-5);
}
.plan__photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-m);
  background: var(--oat-soft);
}
/* The photograph holds the panel until there is something to draw */
.plan.is-drawing .plan__photo { display: none; }
.plan:not(.is-drawing) .plan__svg { display: none; }
.plan__svg { width: 100%; height: auto; max-height: 520px; margin: 0 auto; overflow: visible; }
.plan__shape { fill: #FFFDF8; stroke: var(--charcoal); stroke-width: 1.5; }
.plan__ref { fill: none; stroke: var(--forest); stroke-width: 1.25; stroke-dasharray: 5 5; }
.plan__dim { stroke: var(--charcoal); stroke-width: 1; }
.plan__val { font: 700 13px var(--font-body); fill: var(--charcoal); }
.plan__head { font: 700 11px var(--font-body); letter-spacing: .12em; text-transform: uppercase; fill: var(--charcoal); }
.plan__note { margin: var(--space-4) 0 0; font-size: var(--fs-small); text-align: center; }
.plan__note strong { font-weight: 700; }

.summary {
  border: 1px solid var(--line-strong);
  padding: var(--space-5);
  background: #FFFDF8;
}
.summary:focus { outline: none; }
.summary h3 { margin-bottom: var(--space-4); }
.summary__text {
  margin: 0 0 var(--space-5);
  white-space: pre-wrap;
  font: 400 .9375rem/1.55 var(--font-body);
  max-height: 22rem;
  overflow: auto;
}
.summary__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.summary__status { margin: var(--space-3) 0 0; font-weight: 700; min-height: 1.5em; }
.summary__next { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); font-size: var(--fs-small); }

.measure { margin-top: var(--space-9); }
.measure__title { text-align: center; margin-bottom: var(--space-3); }
.measure__intro { text-align: center; max-width: 34rem; margin: 0 auto var(--space-8); font-size: var(--fs-lead); }
.measure__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
  counter-reset: s;
}
.measure__steps li {
  counter-increment: s;
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  background: #FFFDF8;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 22px 48px -34px rgba(52, 71, 63, .5);
}
.measure__photo {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin: 0;
  background: var(--oat-soft);
}
.measure__figure { position: relative; margin: 0; }
/* The numeral straddles the photo edge, so the eye reads image then step */
.measure__figure::after {
  content: counter(s, decimal-leading-zero);
  position: absolute;
  bottom: -1.55rem;
  left: clamp(1rem, 2vw, 1.5rem);
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 10px;
  background: var(--forest);
  color: var(--ivory);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 10px 24px -12px rgba(40, 42, 41, .6);
}
.measure__steps h4 {
  margin: var(--space-6) clamp(1rem, 2vw, 1.5rem) var(--space-3);
  padding-top: var(--space-2);
}
.measure__steps p {
  margin: 0 clamp(1rem, 2vw, 1.5rem) clamp(1.25rem, 2.5vw, 1.75rem);
  font-size: var(--fs-small);
}
.measure__note { text-align: center; margin-top: var(--space-6); }

@media (max-width: 63.99rem) {
  .fit__layout { grid-template-columns: 1fr; }
  .fit__plan { position: static; order: -1; }
  .plan__svg { max-height: 340px; }
}
@media (max-width: 47.99rem) {
  .field-pair, .checks { grid-template-columns: 1fr; }
  .measure__steps { grid-template-columns: 1fr; gap: var(--space-5); }
  .measure__steps::before { left: 1.25rem; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .measure__steps li { display: grid; grid-template-columns: 2.5rem 1fr; column-gap: var(--space-4); }
  .measure__steps li::before { grid-row: span 2; margin: 0; }
  .fit-form .button, .summary__actions .button { width: 100%; }
}

/* ---------- Beds (forest) ---------- */
.beds {
  background: var(--ivory);
  color: var(--charcoal);
  padding: var(--space-7) var(--gutter) var(--space-9);
}
.beds__intro {
  max-width: 44rem;
  margin: 0 auto var(--space-8);
  text-align: center;
}
.beds__intro .label { margin-bottom: var(--space-4); color: var(--forest); }
.beds__intro h2 { margin-bottom: var(--space-5); }
.beds__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--space-4) var(--space-6); margin-top: var(--space-6); }

.sizes {
  max-width: 76rem;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding-top: var(--space-6);
}
.sizes__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.segmented--dark { border-color: var(--line-strong); }
.segmented--dark button[aria-pressed="true"] { background: var(--forest); color: var(--ivory); }
.sizes__body {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr) minmax(0, 6fr);
  gap: clamp(1.5rem, 3.5vw, 3rem);
  align-items: center;
}
.sizes__photo { margin: 0; }
.sizes__photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--oat-soft);
  transition: opacity var(--dur-control) var(--ease-out);
}
.sizes__photo.is-swapping img { opacity: .35; }
.sizes__photo figcaption { margin-top: var(--space-3); font-size: .75rem; opacity: .75; }
.sizes__canvas svg { width: 100%; max-height: 380px; }
.sizes__canvas .sz { fill: none; stroke: rgba(40, 42, 41, .28); stroke-width: 1; transition: stroke var(--dur-control) var(--ease-out), fill var(--dur-control) var(--ease-out); }
.sizes__canvas .sz.is-home { stroke-dasharray: 4 4; }
.sizes__canvas .sz.is-active { stroke: var(--forest); stroke-width: 2.5; fill: rgba(52, 71, 63, .1); }
.sizes__canvas .sz-label { font: 700 12px var(--font-body); fill: var(--forest); }
.sizes__canvas .sz-head { font: 700 10px var(--font-body); letter-spacing: .12em; fill: var(--charcoal); opacity: .6; }

.sizes__list { list-style: none; margin: 0; padding: 0; }
.sizes__list li + li { border-top: 1px solid var(--line); }
.sizes__list button {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  min-height: 64px;
  padding: var(--space-4) var(--space-3);
  background: transparent;
  border: 0;
  color: var(--charcoal);
  text-align: left;
  cursor: pointer;
  font: 400 1.0625rem var(--font-body);
  transition: background-color var(--dur-control) var(--ease-out);
}
.sizes__list button:hover { background: #FFFDF8; }
.sizes__list button[aria-pressed="true"] { background: #FFFDF8; }
/* forest marks the selection rather than flooding the section */
.sizes__list button::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--forest);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform var(--dur-control) var(--ease-out);
}
.sizes__list button[aria-pressed="true"]::before { transform: scaleY(1); }
.sizes__list .name { font-family: var(--font-display); font-size: 1.25rem; }
.sizes__list .tag { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--forest); opacity: .85; margin-top: 3px; }
.sizes__list .dims { font-weight: 700; font-variant-numeric: tabular-nums; }
.sizes__note { margin-top: var(--space-6); font-size: var(--fs-small); }

.compare { max-width: 68rem; margin: var(--space-9) auto 0; }
.compare h3 { text-align: center; margin-bottom: var(--space-6); font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.table-wrap { overflow-x: auto; }
.table-wrap:focus-visible { outline-color: var(--focus-on-dark); }
.compare table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.compare caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.compare th, .compare td { text-align: left; padding: var(--space-4) var(--space-4) var(--space-4) 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--forest); }
.compare tbody th { font-family: var(--font-display); font-weight: 400; font-size: 1.125rem; width: 22%; }
.compare td:last-child { font-weight: 700; }

@media (max-width: 47.99rem) {
  .sizes__body { grid-template-columns: 1fr; }
  .sizes__photo { order: -1; }
  .sizes__canvas svg { max-height: 300px; margin: 0 auto; }
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .compare table, .compare tbody, .compare tr, .compare th, .compare td { display: block; width: 100%; }
  .compare tr { padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
  .compare tbody th, .compare td { border: 0; padding: var(--space-1) 0; }
  .compare tbody th { width: auto; margin-bottom: var(--space-2); }
  .compare td::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--forest); }
  .compare td + td { margin-top: var(--space-2); }
}

/* ---------- Life inside the RV: text over the footage ---------- */
.life { position: relative; }
.life__frame {
  position: relative;
  isolation: isolate;
  min-height: min(92svh, 880px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: #1C2422;
}
.life__video {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 55%;
}
.life__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(18, 22, 21, .88) 0%, rgba(18, 22, 21, .5) 34%, rgba(18, 22, 21, .12) 62%, rgba(18, 22, 21, .3) 100%);
}
.life__copy {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  padding: var(--space-9) var(--gutter) var(--space-8);
  color: var(--ivory);
}
.life__kicker { color: var(--oat); margin-bottom: var(--space-4); }
.life__copy h2 {
  color: var(--ivory);
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
  margin-bottom: var(--space-5);
  max-width: 24ch;
}
.life__lead { color: var(--ivory); font-size: var(--fs-lead); max-width: 46ch; margin-bottom: var(--space-4); }
.life__line {
  color: var(--oat);
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 1rem + .5vw, 1.5rem);
  max-width: 30ch;
}
.life__motion { position: absolute; right: var(--gutter); top: calc(var(--header-h) + var(--space-4)); z-index: 3; }

@media (max-width: 47.99rem) {
  .life__frame { min-height: 0; padding-top: 58vw; }
  .life__motion { top: auto; bottom: var(--space-4); right: var(--space-4); }
}

/* ---------- About ---------- */
.about {
  max-width: 44rem;
  margin: 0 auto;
  padding: var(--space-9) var(--gutter);
  text-align: center;
}
.about h2 { margin-bottom: var(--space-6); }

/* ---------- FAQ ---------- */
.faq {
  max-width: 50rem;
  margin: 0 auto;
  padding: 0 var(--gutter) var(--space-9);
}
.faq h2 { text-align: center; margin-bottom: var(--space-7); }
.accordion__item { border-top: 1px solid var(--line-strong); }
.accordion__item:last-child { border-bottom: 1px solid var(--line-strong); }
.accordion h3 { font-size: 1.125rem; }
.accordion button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  min-height: 64px;
  padding: var(--space-4) 0;
  background: transparent;
  border: 0;
  color: var(--charcoal);
  font: 400 clamp(1.0625rem, 1rem + .3vw, 1.25rem)/1.35 var(--font-display);
  text-align: left;
  cursor: pointer;
}
.accordion button::after {
  content: "";
  flex: none;
  width: 12px; height: 12px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  transition: transform var(--dur-control) var(--ease-out);
}
.accordion button[aria-expanded="true"]::after { transform: translateY(3px) rotate(225deg); }
.accordion__panel { overflow: hidden; }
.accordion__panel p { padding: 0 0 var(--space-5); max-width: 42rem; }

/* ---------- Invitation and contact ---------- */
.invite {
  background: var(--oat);
  text-align: center;
  padding: var(--space-9) var(--gutter);
  position: relative;
}
.invite__rule {
  width: min(560px, 80%);
  height: 60px;
  margin: 0 auto var(--space-6);
  overflow: visible;
}
.invite h2 { margin-bottom: var(--space-5); }
.invite .lead { max-width: 32rem; margin-left: auto; margin-right: auto; }
.invite__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-4); margin-top: var(--space-6); }
.contact {
  max-width: 34rem;
  margin: var(--space-8) auto 0;
  padding-top: var(--space-6);
  border-top: 1px solid var(--line-strong);
}
.contact h3 { margin-bottom: var(--space-4); }
.contact__channels { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.contact__channels a { font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-7) var(--gutter) var(--space-7);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-6);
  font-size: var(--fs-small);
}
.site-footer__brand { padding: var(--logo-clear); margin-left: calc(var(--logo-clear) * -1); }
.site-footer__brand img { width: var(--logo-w); }
.site-footer__nav { display: flex; justify-content: center; gap: var(--space-7); }
.site-footer__nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 var(--space-5); }
.site-footer__nav a { display: inline-flex; min-height: 44px; align-items: center; }
.site-footer__legal { margin: 0; }

@media (max-width: 63.99rem) {
  .site-footer { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .site-footer__brand { margin-left: 0; }
  .site-footer__nav { flex-direction: column; align-items: center; gap: var(--space-3); }
  .site-footer__nav ul { justify-content: center; }
}

/* ---------- Mobile action bar ---------- */
.mobile-bar { display: none; }
@media (max-width: 63.99rem) {
  body { padding-bottom: calc(var(--mobile-bar-h) + var(--safe-bottom)); }
  .mobile-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: 1fr 1.3fr 1fr;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3) calc(var(--space-2) + var(--safe-bottom));
    background: var(--ivory);
    border-top: 1px solid var(--line);
  }
  .mobile-bar a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: var(--radius-m);
    font-weight: 700;
    font-size: .9375rem;
    text-decoration: none;
  }
  .mobile-bar__primary { background: var(--forest); color: var(--ivory); }
}

/* ---------- Motion (enhancement only; content is visible without JS) ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition: opacity var(--dur-section) var(--ease-out), transform var(--dur-section) var(--ease-out);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

.js .hero__eyebrow, .js .hero__line, .js .hero__lead, .js .hero__actions {
  animation: rise var(--dur-section) var(--ease-out) both;
}
.js .hero__line:nth-child(1) { animation-delay: 60ms; }
.js .hero__line:nth-child(2) { animation-delay: 160ms; }
.js .hero__lead { animation-delay: 260ms; }
.js .hero__actions { animation-delay: 340ms; }
.js .scene { animation: scene-in var(--dur-atmosphere) var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(var(--reveal-distance)); } }
@keyframes scene-in { from { opacity: 0; } }

.js [data-draw] { stroke-dasharray: 3000; stroke-dashoffset: 3000; }
.js [data-draw].is-drawn { stroke-dashoffset: 0; transition: stroke-dashoffset 1800ms var(--ease-in-out); }

.js .life__frame { clip-path: inset(8% 6% 8% 6%); transition: clip-path 1100ms var(--ease-out); }
.js .life__frame.is-in { clip-path: inset(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal], .js .hero__eyebrow, .js .hero__line, .js .hero__lead, .js .hero__actions, .js .scene { animation: none; opacity: 1; transform: none; }
  .js [data-draw] { stroke-dashoffset: 0; }
  .js .life__frame { clip-path: none; }
  .mobile-menu__panel { animation: none; }
}

/* ---------- Secondary pages (legal, 404) ---------- */
.prose {
  max-width: 44rem;
  margin: 0 auto;
  padding: calc(var(--header-h) + var(--header-curve) + var(--space-6)) var(--gutter) var(--space-9);
}
.prose h1 { font-size: var(--fs-display); margin-bottom: var(--space-5); text-align: center; }
.prose h2 { font-size: var(--fs-h3); margin: var(--space-7) 0 var(--space-4); }
.prose ul { padding-left: 1.2rem; }
.prose li + li { margin-top: var(--space-2); }
.prose__meta { text-align: center; font-size: var(--fs-small); }
.prose__note { margin: var(--space-6) 0; padding: var(--space-4) var(--space-5); border-left: 3px solid var(--bronze); background: var(--ivory-deep); }
.prose .lead { text-align: center; }
.prose__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-4); margin-top: var(--space-6); }
.breadcrumb ol { display: flex; justify-content: center; gap: var(--space-2); list-style: none; margin: 0 0 var(--space-5); padding: 0; font-size: var(--fs-small); }
.breadcrumb li + li::before { content: "/"; margin-right: var(--space-2); }

/* ---------- How it works: scroll-stacked step cards ---------- */
/* Palette and type mapped to the brand guide: forest for the accent,
   oat for the band, Rubik and Noto Sans for the faces. */
.steps {
  position: relative;
  isolation: isolate;
  padding: var(--space-9) var(--gutter) var(--space-8);
  background: var(--charcoal) url("../img/room-night-1600.webp") center 38% / cover no-repeat;
  color: var(--ivory);
}
/* A scrim keeps the cards and the heading legible over the photograph */
.steps::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--charcoal) 74%, transparent),
    color-mix(in srgb, var(--charcoal) 84%, transparent)
  );
}
/* Over the photograph, oat measures 3.97:1 for small text. Ivory clears AA. */
.steps__kicker { color: var(--ivory); }
.steps__head h2 { color: var(--ivory); }
.steps__lede { color: var(--ivory); }
.steps__rule { background: var(--oat); }
.step-chevron { color: var(--oat); }
.steps__head {
  max-width: 44rem;
  margin: 0 auto var(--space-8);
  text-align: center;
}
.steps__kicker {
  margin: 0 0 var(--space-4);
  color: var(--forest);
  font-weight: 700;
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  letter-spacing: .18em;
  text-transform: uppercase;
}
.steps__head h2 { margin-bottom: var(--space-5); }
.steps__line { display: block; }
.steps__lede { font-size: var(--fs-lead); margin-bottom: var(--space-5); }
.steps__rule {
  display: block;
  width: 4.5rem;
  height: 4px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--forest);
}

.steps__list {
  list-style: none;
  max-width: 60rem;
  margin: 0 auto;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}
/* A card pins under the fixed header, each one 14px lower than the last,
   so the stack builds a stepped edge as you scroll. The index comes from
   --i, set per card in JS: chevrons sit between the cards and would throw
   :nth-child() off by one every time. */
.step {
  position: sticky;
  top: calc(var(--header-h) + 1.4rem + (var(--i, 0) * 14px));
  z-index: 2; /* above the chevrons: they animate opacity, which would otherwise paint them on top */
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1rem, 2.4vw, 1.75rem);
  align-items: start;
  padding: clamp(1.75rem, 3.4vw, 3rem);
  border: 1px solid rgba(151, 115, 72, .35);
  border-radius: 3px;
  background: color-mix(in srgb, var(--ivory) 96%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--charcoal); /* the section runs ivory-on-photo; the cards do not */
  box-shadow: 0 40px 70px -48px rgba(18, 22, 21, .8);
}
/* A numeral and a hairline, not a filled chip */
.step__badge {
  display: block;
  padding-right: clamp(1rem, 2vw, 1.75rem);
  border-right: 1px solid rgba(151, 115, 72, .4);
  color: var(--forest);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2.125rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.step__body h3 { margin-bottom: var(--space-3); font-weight: 400; font-size: clamp(1.25rem, 1.1rem + .5vw, 1.6rem); letter-spacing: -.01em; }
.step__body p { margin: 0; }
/* Without this the last card has nothing left to scroll against and the stack never closes */
.steps__list::after {
  content: "";
  display: block;
  height: 4vh;
}

.step-chevron {
  display: grid;
  place-items: center;
  height: 2.25rem;
  z-index: 1;
  color: var(--forest);
  opacity: 0;
  transition: opacity var(--dur-section) var(--ease-out);
}
.step-chevron.is-in { opacity: 1; }
.step-chevron svg { animation: chevron-bob 1.9s ease-in-out infinite; }
@keyframes chevron-bob {
  0%, 100% { transform: translateY(-22%); }
  50% { transform: translateY(22%); }
}

@media (max-width: 47.99rem) {
  .step { grid-template-columns: 1fr; gap: var(--space-4); }
  .step__badge { padding: 0 0 var(--space-3); border-right: 0; border-bottom: 1px solid rgba(151, 115, 72, .4); }
}

@media (prefers-reduced-motion: reduce) {
  /* the same content as a plain vertical list */
  .step { position: relative; top: auto; }
  .step-chevron { opacity: 1; }
  .step-chevron svg { animation: none; }
}

/* The material detail plays as a slow macro loop, with its own pause control */
.comfort__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
}
.comfort__art { overflow: hidden; }
.comfort__motion {
  position: absolute;
  left: var(--space-4);
  bottom: var(--space-4);
  z-index: 2;
}

@media (max-width: 63.99rem) {
  .measure__steps { grid-template-columns: 1fr; max-width: 34rem; margin-inline: auto; }
}

/* ---------- Measuring panels: full-bleed photo per panel ----------
   Structure and motion follow the supplied panel spec. Palette and type are the
   brand's: charcoal scrim, bronze accent, ivory headlines, Rubik and Noto Sans. */
.panels {
  margin-top: var(--space-9);
  /* break out of the section's measure: these panels run edge to edge */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.panels__note { text-align: center; font-size: var(--fs-small); padding: var(--space-6) var(--gutter) 0; }

.panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(92svh, 860px);
  display: grid;
  align-items: center;
  padding: calc(var(--header-h) * .5 + var(--space-7)) var(--gutter) var(--space-7);
  background: var(--charcoal);
}
.panel__photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 28% 50%;
  transform: scale(1.04);
  transition: transform 1200ms var(--ease-out);
}
.panel.is-near .panel__photo { transform: scale(1.04); }
/* Two-part scrim: the photograph stays readable on the left, the right goes near-solid */
.panel__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(to right,
      rgba(26, 28, 27, .10) 0%,
      rgba(26, 28, 27, .30) 26%,
      rgba(26, 28, 27, .72) 45%,
      rgba(26, 28, 27, .86) 68%,
      rgba(26, 28, 27, .82) 100%),
    linear-gradient(to bottom,
      rgba(26, 28, 27, .5) 0%,
      rgba(26, 28, 27, 0) 34%,
      rgba(26, 28, 27, 0) 66%,
      rgba(26, 28, 27, .6) 100%);
}
.panel__grid {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) auto;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 5rem);
}

/* The numeral: outlined, oversized, holding over the photograph */
.panel__figure {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: .12em;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: .78;
  color: transparent;
  -webkit-text-stroke: 1.5px color-mix(in srgb, var(--bronze) 92%, transparent);
  text-shadow: 0 18px 40px rgba(20, 22, 21, .7);
}
.panel__num { font-size: clamp(6rem, 15vw, 16rem); letter-spacing: -.04em; }
.panel__unit {
  font-size: .22em;
  -webkit-text-stroke: 0;
  color: var(--oat); /* small text on the dark panel: oat clears AA, bronze does not */
  letter-spacing: .22em;
  text-transform: uppercase;
  font-family: var(--font-body);
  font-weight: 700;
}

.panel__kicker { color: var(--oat); letter-spacing: .24em; margin-bottom: var(--space-4); }
.panel__headline {
  color: var(--ivory);
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  max-width: 22ch;
  text-wrap: balance;
  margin-bottom: var(--space-4);
}
.panel__text { color: var(--oat); max-width: 52ch; margin-bottom: var(--space-5); }

.panel__specs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5) clamp(1.5rem, 3vw, 3rem);
  margin: 0 0 var(--space-5);
  padding: var(--space-4) 0;
  border-top: 1px solid rgba(247, 244, 237, .22);
  border-bottom: 1px solid rgba(247, 244, 237, .22);
}
.panel__specs dt {
  font-size: .5625rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--oat);
  margin-bottom: .35rem;
}
.panel__specs dd { margin: 0; font-family: var(--font-display); font-size: 1.25rem; color: var(--ivory); }

.panel__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.panel__chips li {
  padding: .3rem .6rem;
  border: 1px solid rgba(247, 244, 237, .3);
  border-radius: var(--radius-s);
  font-size: .5625rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ivory);
}

/* Depth gauge, relabelled as step progress */
.panel__gauge { display: grid; justify-items: center; gap: var(--space-3); }
.panel__rail {
  position: relative;
  width: 3px;
  height: clamp(200px, 26vw, 380px);
  background:
    repeating-linear-gradient(to bottom, rgba(247, 244, 237, .35) 0 1px, transparent 1px 10%),
    rgba(247, 244, 237, .14);
}
.panel__fill {
  position: absolute;
  inset: 0 0 auto 0;
  height: 0;
  background: linear-gradient(to bottom, var(--bronze), var(--forest));
  box-shadow: 0 0 12px rgba(151, 115, 72, .5);
  transition: height 900ms var(--ease-out);
}
.panel.is-near .panel__fill { height: var(--fill, 50%); }
.panel__gauge-label {
  writing-mode: vertical-rl;
  font-size: .5625rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--oat);
}
.panel__gauge-figure { font-family: var(--font-display); color: var(--ivory); font-size: 1.125rem; }

/* Sequenced rise as each panel arrives */
.js .panel__figure,
.js .panel__kicker,
.js .panel__headline,
.js .panel__text,
.js .panel__specs,
.js .panel__chips {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-section) var(--ease-out), transform var(--dur-section) var(--ease-out);
}
.js .panel.is-near .panel__figure { opacity: 1; transform: none; transition-delay: 40ms; }
.js .panel.is-near .panel__kicker { opacity: 1; transform: none; transition-delay: 120ms; }
.js .panel.is-near .panel__headline { opacity: 1; transform: none; transition-delay: 190ms; }
.js .panel.is-near .panel__text { opacity: 1; transform: none; transition-delay: 260ms; }
.js .panel.is-near .panel__specs { opacity: 1; transform: none; transition-delay: 330ms; }
.js .panel.is-near .panel__chips { opacity: 1; transform: none; transition-delay: 400ms; }

@media (max-width: 53.75rem) {
  .panel__gauge { display: none; }
  .panel__grid { grid-template-columns: 1fr; }
  .panel__photo { object-position: 30% 50%; }
  .panel__scrim {
    background: linear-gradient(to bottom,
      rgba(26, 28, 27, .5) 0%,
      rgba(26, 28, 27, .84) 32%,
      rgba(26, 28, 27, .92) 100%);
  }
  .panel { min-height: 0; padding-top: var(--space-8); padding-bottom: var(--space-8); }
  .panel__num { font-size: clamp(5rem, 24vw, 9rem); }
}

@media (prefers-reduced-motion: reduce) {
  .panel__photo { transform: none; }
  .js .panel__figure, .js .panel__kicker, .js .panel__headline, .js .panel__text, .js .panel__specs, .js .panel__chips { opacity: 1; transform: none; }
  .panel__fill { transition: none; height: var(--fill, 50%); }
}


/* ---------- Principles, drawn as a sheet ----------
   Structure and behaviour follow the supplied drawing-sheet spec. The accent is
   the brand's bronze rather than an electric blue, and the faces are Rubik and
   Noto Sans. */
.sheet {
  max-width: min(104rem, 96vw);
  width: 100%;
  margin: 0 auto;
  padding: clamp(1rem, 2vw, 2rem) 0;
}
.sheet__frame {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto auto auto;
  min-height: min(84svh, 940px);
  border: 1px solid rgba(40, 42, 41, .35);
  padding: clamp(1.75rem, 3vw, 3.25rem);
  /* two-scale blueprint grid */
  background-color: var(--ivory);
  background-image:
    linear-gradient(to right, rgba(40, 42, 41, .055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(40, 42, 41, .055) 1px, transparent 1px),
    linear-gradient(to right, rgba(40, 42, 41, .03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(40, 42, 41, .03) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 16px 16px, 16px 16px;
}
/* corner ticks sitting on the border */
.sheet__tick { position: absolute; width: 14px; height: 14px; border: 1px solid var(--bronze); }
.sheet__tick--tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.sheet__tick--tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.sheet__tick--bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.sheet__tick--br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.sheet__title {
  align-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}
/* The title block is the display: panels share one grid cell */
/* Without the script the panels simply stack and all four read in order */
.sheet__display { display: block; }
.js .sheet__display { display: grid; min-height: 17rem; }
.sheet__panel {
  position: relative;
  isolation: isolate;
  padding: clamp(1rem, 2vw, 1.75rem);
  overflow: hidden;
}
.sheet__wash {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: 50% 50%;
  /* The photograph holds the outer edge and washes out under the copy. Measured:
     charcoal body text stays above 4.5:1 across all four panels. */
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,.95) 0%, rgba(0,0,0,.55) 34%, rgba(0,0,0,.08) 62%, transparent 78%);
  mask-image: linear-gradient(to left, rgba(0,0,0,.95) 0%, rgba(0,0,0,.55) 34%, rgba(0,0,0,.08) 62%, transparent 78%);
  opacity: .9;
}
.sheet__panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to right,
    color-mix(in srgb, var(--ivory) 94%, transparent) 0%,
    color-mix(in srgb, var(--ivory) 86%, transparent) 42%,
    color-mix(in srgb, var(--ivory) 30%, transparent) 72%,
    transparent 100%);
}
.sheet__label { color: var(--forest); margin-bottom: var(--space-3); }
.sheet__heading {
  font-size: clamp(1.75rem, 1.3rem + 2.1vw, 3.25rem);
  letter-spacing: -.015em;
  margin-bottom: var(--space-3);
  max-width: 26ch;
}
.sheet__text { max-width: 46ch; font-size: var(--fs-lead); }
.sheet__panel .sheet__heading,
.sheet__panel .sheet__text { position: relative; }

.sheet__meta { display: grid; gap: var(--space-4); margin: 0; }
.sheet__meta dt {
  font-size: .5625rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--forest);
}
.sheet__meta dd {
  margin: .2rem 0 0;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 1.125rem;
}

/* live conductor with a charge running along it */
.sheet__conductor {
  position: relative;
  height: 1px;
  margin: clamp(1.5rem, 3vw, 2.5rem) 0 0;
  background: rgba(40, 42, 41, .3);
  overflow: hidden;
}
.sheet__charge {
  position: absolute;
  inset: 0 auto 0 0;
  width: 18%;
  background: linear-gradient(to right, transparent, var(--bronze), transparent);
}
.js .sheet__charge { animation: charge 4.5s linear infinite; }
@keyframes charge { from { transform: translateX(-120%); } to { transform: translateX(640%); } }

/* Four equal ruled cells. A 1px gap over a tinted bed draws every divider. */
.sheet__cells {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(40, 42, 41, .3);
  border-bottom: 1px solid rgba(40, 42, 41, .3);
}
.sheet__cells li { display: grid; }
.sheet__cells button {
  position: relative;
  display: grid;
  align-content: center;
  gap: var(--space-3);
  width: 100%;
  min-height: clamp(9rem, 15vh, 13rem);
  padding: clamp(1rem, 2vw, 2rem);
  border: 0;
  background: color-mix(in srgb, var(--ivory) 70%, transparent);
  color: var(--charcoal);
  text-align: left;
  cursor: pointer;
  transition: background-color 180ms var(--ease-out);
}
.sheet__cells button::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--bronze);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms var(--ease-out);
}
.sheet__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.75rem, 4vw, 4.5rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.25px rgba(40, 42, 41, .45);
  transition: -webkit-text-stroke-color 180ms var(--ease-out);
}
.sheet__name { font-family: var(--font-display); font-size: clamp(1.0625rem, .95rem + .4vw, 1.375rem); }
.sheet__cells button:hover,
.sheet__cells button:focus-visible,
.sheet__cells button[aria-pressed="true"] { background: #FFFDF8; }
.sheet__cells button:hover::before,
.sheet__cells button:focus-visible::before,
.sheet__cells button[aria-pressed="true"]::before { transform: scaleX(1); }
.sheet__cells button:hover .sheet__num,
.sheet__cells button:focus-visible .sheet__num,
.sheet__cells button[aria-pressed="true"] .sheet__num { -webkit-text-stroke-color: var(--bronze); }

.sheet__index {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
  font-size: .5625rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--forest);
}

/* Crossfade: the outgoing panel clears before the incoming one lands */
.js .sheet__panel { grid-area: 1 / 1; opacity: 0; transition: opacity 150ms var(--ease-out); pointer-events: none; }
.js .sheet__panel.is-on { opacity: 1; transition: opacity 340ms var(--ease-out) 120ms; }

@media (max-width: 63.99rem) {
  .sheet__title { grid-template-columns: 1fr; }
  .sheet__meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet__cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .js .sheet__charge { animation: none; }
  .js .sheet__panel { transition: none; }
}


/* ---------- The run: hero and statement over one continuous media ----------
   An absolutely positioned track holds a sticky layer. No negative margins:
   a negative margin makes a sticky element behave as if it had no height, and
   the media would keep covering the page after the run ends. */
.run { position: relative; }
.run__track {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.run__layer {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: #1B1F1D; /* base colour under the media */
}
.run__frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform: scale(var(--frame-scale, 1));
  transform-origin: 56% 50%;
  will-change: transform;
}
/* a blurred copy of the poster sits underneath, so there is never a flash of flat colour */
.run__frame::before {
  content: "";
  position: absolute;
  inset: -4%;
  background: url("../img/road-poster-v2-1200.webp") center / cover no-repeat;
  filter: blur(28px) saturate(.9);
  transform: scale(1.06);
}
/* ambient sway, like a camera on a moving deck */
.run__rig {
  position: absolute;
  inset: 0;
  transform-origin: 56% 60%;
  animation: rig-sway 9s ease-in-out infinite;
}
@keyframes rig-sway {
  0%, 100% { transform: scale(1.002) rotate(.12deg); }
  50% { transform: scale(1.0005) rotate(-.1deg); }
}
/* the media itself carries the approach zoom */
.run__rig .scene {
  transform: scale(var(--media-scale, 1.04)) translateX(var(--media-drift, 0%));
  transform-origin: var(--media-origin, 58% 52%);
  will-change: transform;
}
.run__vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(95deg,
    rgba(20, 24, 22, .90) 0%,
    rgba(20, 24, 22, .72) 34%,
    rgba(20, 24, 22, .30) 62%,
    rgba(20, 24, 22, .10) 100%);
}
.run__shade {
  position: absolute;
  inset: 0;
  background: #161A18;
  opacity: var(--shade, 0);
}
/* the pin: one screen of scroll for the approach */
.run__pin { height: 100svh; }
@media (max-width: 47.99rem) { .run__pin { height: 80svh; } }

/* hero and statement sit above the media with no background of their own */
.run > .hero { position: relative; z-index: 1; background: transparent; }
.run > .hero { height: 100svh; position: sticky; top: 0; }

/* the hero copy clears out of the way as the camera closes in: the panel itself
   goes last, so the stagger reads before the surface disappears */
.run > .hero .hero__copy { opacity: var(--panel-alpha, 1); visibility: var(--panel-vis, visible); }
.hero__title { transform: translateY(var(--copy-rise, 0)); opacity: var(--copy-alpha, 1); visibility: var(--copy-vis, visible); }
.hero__lead, .hero__actions { transform: translateY(var(--sub-rise, 0)); opacity: var(--sub-alpha, 1); visibility: var(--sub-vis, visible); }
.hero__controls { opacity: var(--ctrl-alpha, 1); visibility: var(--ctrl-vis, visible); }

/* the sheet arrives over the same media */
.run > .against {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: grid;
  align-items: center;
  background: transparent;
}
/* Fallback scrim: without the scroll-driven shade the copy still reads */
.no-js .run > .against::before,
.run--static .run > .against::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, transparent 0%, rgba(22, 26, 24, .74) 20%, rgba(22, 26, 24, .92) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .run__rig { animation: none; }
  .run__frame { transform: none; }
  .run__rig .scene { transform: scale(1.04); }
}



/* Guide pages: tables break out of the reading measure */
.prose .table-wrap {
  width: min(64rem, 92vw);
  margin-left: 50%;
  transform: translateX(-50%);
  margin-block: var(--space-5);
}
.prose table { width: 100%; border-collapse: collapse; }
.prose caption { text-align: left; }
.prose th, .prose td { text-align: left; padding: var(--space-3) var(--space-4) var(--space-3) 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th { font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--forest); }
.prose tbody th { font-family: var(--font-display); font-weight: 400; white-space: nowrap; }
.prose ol { padding-left: 1.2rem; }
@media (max-width: 47.99rem) {
  .prose .table-wrap { width: 100%; margin-left: 0; transform: none; overflow-x: auto; }
}

/* The size stage: footage for the room, drawn marks for the measurements */
.sizes__stage {
  position: relative;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--oat-soft);
  aspect-ratio: 16 / 9;
}
.sizes__video { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.sizes__marks { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.sizes__marks .rule,
.sizes__marks .tick {
  stroke: var(--ivory);
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 1px 3px rgba(20, 22, 21, .75));
}
.sizes__marks .rule { stroke-dasharray: 1; stroke-dashoffset: 0; }
/* each dimension draws itself when the size changes */
.js .sizes__marks .rule { stroke-dasharray: 200; stroke-dashoffset: 200; }
.js .is-measuring .sizes__dim--w .rule { animation: draw-rule 620ms var(--ease-out) 120ms forwards; }
.js .is-measuring .sizes__dim--l .rule { animation: draw-rule 620ms var(--ease-out) 360ms forwards; }
.js .sizes__marks .tick { opacity: 0; }
.js .is-measuring .sizes__dim--w .tick { animation: tick-in 260ms var(--ease-out) 640ms forwards; }
.js .is-measuring .sizes__dim--l .tick { animation: tick-in 260ms var(--ease-out) 880ms forwards; }
@keyframes draw-rule { to { stroke-dashoffset: 0; } }
@keyframes tick-in { to { opacity: 1; } }

.sizes__readout {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  display: flex;
  align-items: baseline;
  gap: .4rem;
  margin: 0;
  padding: .5rem .75rem;
  background: color-mix(in srgb, var(--ivory) 92%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
}
.sizes__readout .x { font-family: var(--font-body); font-size: .6875rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--forest); }
.sizes__motion { position: absolute; right: var(--space-3); bottom: var(--space-3); }

@media (prefers-reduced-motion: reduce) {
  .js .sizes__marks .rule { stroke-dasharray: 1; stroke-dashoffset: 0; animation: none; }
  .js .sizes__marks .tick { opacity: 1; animation: none; }
}
