/* ==========================================================================
   LAST PALLET
   Aesthetic: warehouse manifest. Concrete and kraft, stencil signage type,
   monospace spec labels, forklift orange as the only saturated colour.
   The material photography is the only imagery, so everything else stays
   flat, ruled and typographic to keep the floors the loudest thing here.
   ========================================================================== */

@layer tokens, base, layout, components, hero, world, utilities;

@layer tokens {
  :root {
    /* ---------------------------------------------------------------
       PALETTE - sampled from the reference build.
       Near-black and warm off-white carry the whole page; a single
       high-voltage lime is the only saturated colour and is used as a
       fill, never as text on light ground.
       --------------------------------------------------------------- */

    /* light surfaces */
    --paper:      #F1F1EE;
    --paper-2:    #E9E9E5;
    --paper-3:    #DEDED8;

    /* ink */
    --ink:        #0D0D0C;
    --ink-2:      #4A4A47;
    --ink-3:      #7C7C77;
    --ink-rgb:    13, 13, 12;

    /* rules */
    --rule:       #D6D6D0;
    --rule-soft:  #E5E5E0;

    /* the one saturated colour */
    --accent:     #E0FE61;
    --accent-rgb: 224, 254, 97;
    --accent-ink: #0D0D0C;

    /* dark surfaces: the scroll world, the ticker and the footer */
    --dark-0:      #070707;
    --dark:        #0D0D0C;
    --dark-2:      #131312;
    --dark-3:      #1B1B19;
    --dark-rgb:    13, 13, 12;
    --dark-rule:   #2A2A27;
    --dark-ink:    #F1F1EE;
    --dark-ink-2:  #B7B7B3;
    --dark-ink-3:  #7C7C77;
    --dark-ink-4:  #46463F;

    --shadow-lift: 0 1px 0 var(--rule-soft), 0 18px 40px -28px rgba(var(--ink-rgb), 0.5);

    --font-display: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
    --font-body:    'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

    --step--1: clamp(0.78rem, 0.74rem + 0.16vw, 0.86rem);
    --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
    --step-1:  clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
    --step-2:  clamp(1.6rem, 1.4rem + 1vw, 2.2rem);
    --step-3:  clamp(2.2rem, 1.7rem + 2.4vw, 3.6rem);
    --step-4:  clamp(3rem, 1.9rem + 5.2vw, 6.5rem);

    --gutter: clamp(1.25rem, 4vw, 4rem);
    --maxw: 1420px;

    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  }
}

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

  html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
  }

  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--step-0);
    font-optical-sizing: auto;
    line-height: 1.6;
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  /* paper grain, kept extremely light so it never muddies a swatch */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.05;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.0;
    letter-spacing: -0.035em;
    margin: 0;
    text-wrap: balance;
  }

  p { margin: 0 0 1em; text-wrap: pretty; }
  p:last-child { margin-bottom: 0; }

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

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

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

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

  .world :focus-visible,
  .footer :focus-visible,
  .ticker :focus-visible {
    outline-color: var(--accent);
  }

  .skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--ink);
    color: var(--paper);
    padding: 0.75rem 1rem;
    z-index: 10000;
    font-family: var(--font-mono);
    font-size: var(--step--1);
  }
  .skip:focus { left: 0; }
}

@layer layout {
  .wrap {
    width: min(100% - (var(--gutter) * 2), var(--maxw));
    margin-inline: auto;
  }

  .section { padding-block: clamp(3.5rem, 9vw, 8rem); }
  .section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

  /* the ruled band that gives the page its manifest feel */
  .rule-top { border-top: 1px solid var(--rule); }
  .rule-bottom { border-bottom: 1px solid var(--rule); }
}

@layer components {

  /* ---------- shared micro-typography ---------- */

  .mono {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    font-weight: 500;
    letter-spacing: 0.02em;
  }

  .eyebrow {
    font-family: var(--font-mono);
    font-size: clamp(0.68rem, 0.64rem + 0.16vw, 0.78rem);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-3);
    display: block;
  }

  /* Lime has no contrast on the light ground, so an accented label on a
     light surface is simply ink. Lime returns on the dark surfaces. */
  .eyebrow--accent { color: var(--ink); }

  .lede {
    font-size: var(--step-1);
    line-height: 1.5;
    max-width: 46ch;
    color: var(--ink-2);
  }

  /* ---------- header ---------- */

  .masthead {
    position: sticky;
    top: 0;
    z-index: 500;
    background: color-mix(in oklab, var(--paper) 88%, transparent);
    backdrop-filter: blur(14px) saturate(1.1);
    border-bottom: 1px solid var(--rule);
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
  }

  /* Transparent over the hero, so the video actually shows through instead
     of sitting under a frosted bar. This is an opt-in state added by JS
     (header-contrast.js) rather than the default: the default has to stay
     legible with zero script (a page with no dark hero, or the instant
     before JS runs on one that has), and light text over the light page
     background it falls back to would be unreadable. JS adds this only on
     pages with a `.world` section, and only while still above its bottom
     edge - i.e. for exactly as long as the header is sitting over the dark
     hero/material-flight run rather than the paper-coloured page below it. */
  .masthead--transparent {
    background: transparent;
    backdrop-filter: none;
    border-bottom-color: transparent;
  }
  .masthead--transparent .wordmark,
  .masthead--transparent .nav a {
    color: var(--dark-ink);
    text-shadow: 0 1px 10px rgba(var(--dark-rgb), 0.5);
  }
  .masthead--transparent .nav a:hover,
  .masthead--transparent .nav a[aria-current='page'] {
    color: var(--ink);
  }

  .masthead__inner {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 2.5rem);
    min-height: 62px;
  }

  .wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    white-space: nowrap;
  }

  .wordmark__mark {
    width: 15px;
    height: 15px;
    background: var(--accent);
    /* a stacked-pallet glyph */
    clip-path: polygon(0 0, 100% 0, 100% 26%, 0 26%, 0 37%, 100% 37%, 100% 63%, 0 63%, 0 74%, 100% 74%, 100% 100%, 0 100%);
    flex: none;
  }

  .nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: clamp(0.7rem, 2.2vw, 2rem);
  }

  .nav a {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink-2);
    white-space: nowrap;
    transition: color 0.2s var(--ease);
  }
  /* Lime as text would vanish on the light ground, so the active and hover
     states use it as a highlighter behind the ink instead. */
  .nav a:hover,
  .nav a[aria-current='page'] {
    color: var(--ink);
    box-shadow: inset 0 -0.42em 0 var(--accent);
  }

  .nav__phone { display: none; }
  @media (min-width: 900px) { .nav__phone { display: inline; } }

  /* ---------- buttons ---------- */

  .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    cursor: pointer;
    transition: background 0.22s var(--ease), color 0.22s var(--ease), transform 0.22s var(--ease);
  }
  .btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }

  .btn--ghost { background: transparent; color: var(--ink); }
  .btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

  .btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .btn--accent:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

  /* ---------- ticker ---------- */

  .ticker {
    background: var(--ink);
    color: var(--paper);
    overflow: hidden;
    border-bottom: 1px solid var(--ink);
  }

  .ticker__track {
    display: flex;
    width: max-content;
    animation: ticker 42s linear infinite;
  }

  .ticker__item {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 0.6rem 0;
    white-space: nowrap;
  }

  .ticker__item span { color: var(--accent); padding-inline: 1.4rem; }

  @keyframes ticker {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-50%, 0, 0); }
  }

  .ticker:hover .ticker__track { animation-play-state: paused; }

  /* ---------- manifest table (the signature component) ---------- */

  .manifest {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: var(--step--1);
  }

  .manifest th {
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: 0.5rem 1rem 0.5rem 0;
    border-bottom: 1px solid var(--ink);
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .manifest td {
    padding: 0.72rem 1rem 0.72rem 0;
    border-bottom: 1px solid var(--rule-soft);
    vertical-align: top;
  }

  .manifest tr:last-child td { border-bottom: 1px solid var(--ink); }

  .manifest__key { color: var(--ink-3); width: 42%; }
  .manifest__val { color: var(--ink); }

  /* ---------- product cards ---------- */

  /* Rules are drawn by each card's own outline rather than by the container
     background, so a part-filled last row does not leave a block of colour. */
  .grid-cards {
    display: grid;
    gap: 1px;
    background: var(--paper);
    grid-template-columns: 1fr;
  }
  @media (min-width: 640px)  { .grid-cards { grid-template-columns: repeat(2, 1fr); } }
  @media (min-width: 1080px) { .grid-cards { grid-template-columns: repeat(3, 1fr); } }

  .card {
    background: var(--paper);
    box-shadow: 0 0 0 1px var(--rule);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: background 0.25s var(--ease);
  }
  .card:hover { background: var(--paper-2); }

  .card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--paper-3);
  }

  .card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s var(--ease), filter 0.4s var(--ease);
  }
  .card:hover .card__media img { transform: scale(1.045); }

  /* second image (the room scene) reveals on hover where one exists */
  .card__media .card__room {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.45s var(--ease);
  }
  .card:hover .card__room { opacity: 1; }

  .card__tag {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    z-index: 2;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.3rem 0.55rem;
  }
  .card__tag--pending { background: var(--accent); color: var(--accent-ink); }

  .card__body {
    padding: 1.15rem 1.25rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
  }

  .card__brand {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-3);
  }

  .card__name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--step-1);
    line-height: 1.05;
    letter-spacing: -0.03em;
  }

  .card__meta {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--ink-3);
    letter-spacing: 0.04em;
    margin-top: auto;
    padding-top: 0.8rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
  }

  .card__meta strong { color: var(--ink); font-weight: 600; }

  .card__off {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    z-index: 2;
    background: var(--accent);
    color: var(--accent-ink);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.3rem 0.55rem;
  }

  /* placeholder used only where the source zip had no photography */
  .swatch-pending {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 0.4rem;
    text-align: center;
    padding: 1rem;
    background:
      repeating-linear-gradient(
        45deg,
        var(--paper-2) 0 10px,
        var(--paper-3) 10px 20px
      );
  }

  .swatch-pending__label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-2);
    background: var(--paper);
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--ink);
  }

  /* ---------- product detail ---------- */

  .pdp {
    display: grid;
    gap: clamp(2rem, 5vw, 4.5rem);
    grid-template-columns: 1fr;
    align-items: start;
  }
  @media (min-width: 940px) { .pdp { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }

  .pdp__gallery { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); align-content: start; }

  /* The spec table runs far longer than the two gallery images, so the left
     column used to end early and leave a tall empty gap beside it. Pinning
     the gallery keeps the material visible the whole way down the specs,
     which is also when someone most wants to look at it. Only above the
     breakpoint - stacked on narrow screens there is nothing to pin against. */
  @media (min-width: 940px) {
    .pdp__gallery {
      position: sticky;
      top: calc(var(--header-h, 101px) + 1.5rem);
    }
  }

  .pdp__figure { position: relative; background: var(--paper); margin: 0; }
  .pdp__figure img { width: 100%; }
  .pdp__figure figcaption {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: 0.6rem 0.85rem;
    border-top: 1px solid var(--rule-soft);
  }

  .pdp__figure--pending { aspect-ratio: 4 / 3; }

  .pdp__title { font-size: var(--step-3); margin-block: 0.4rem 0.9rem; }

  .pdp__price {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    flex-wrap: wrap;
    padding-block: 1.1rem;
    margin-block: 1.2rem;
    border-block: 1px solid var(--rule);
  }

  .pdp__price-figure {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--step-3);
    line-height: 1;
    letter-spacing: -0.035em;
  }

  .pdp__price-unit {
    font-size: var(--step-1);
    font-weight: 500;
    color: var(--ink-3);
  }

  .pdp__price-was {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    color: var(--ink-3);
    text-decoration: line-through;
  }

  .pdp__price-off {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 0.28rem 0.55rem;
  }

  .pdp__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-block: 1.4rem; }

  .pdp__specs { margin-top: 2.2rem; }

  /* ---------- footer ---------- */

  .footer {
    background: var(--ink);
    color: var(--paper);
    padding-block: clamp(3rem, 7vw, 5.5rem);
  }

  /* Scoped to plain links only - `.btn--accent` and `.btn--ghost` set their
     own text colour, and ".footer a" (one class + one element) would
     otherwise outrank ".btn--accent" (one class) by specificity and paint
     button text the same pale colour as body links, which is how the
     footer's lime "Call the warehouse" button ended up with near-white
     text on a light lime background - unreadable. */
  .footer a:not(.btn) { color: var(--paper); }
  .footer .eyebrow { color: var(--dark-ink-3); }

  .footer__grid {
    display: grid;
    gap: 2.5rem;
    grid-template-columns: 1fr;
  }
  @media (min-width: 780px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }

  .footer__big {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--step-3);
    line-height: 0.95;
    letter-spacing: -0.035em;
    margin: 0 0 1rem;
  }

  .footer__list {
    list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem;
    /* Was only set on .footer__list a - plain <li> text (the address, the
       hours, the contractor's name) had no rule at all and fell back to
       body's Inter Tight, standing out against the mono labels and links
       surrounding it in the same block. Moved to the list itself so every
       line in a contact block reads as one font, not two. */
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.06em;
  }

  .footer__legal {
    margin-top: 3.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--dark-rule);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    color: var(--dark-ink-3);
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.8rem;
  }

  /* ---------- scroll reveal ----------
     Gated behind .js (set by an inline script in <head>). Without JS the
     content is simply visible, so a blocked or failed script can never
     leave the page blank. */

  .js .reveal {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  }
  .js .reveal.is-in { opacity: 1; transform: none; }
  .js .reveal:nth-child(2) { transition-delay: 0.06s; }
  .js .reveal:nth-child(3) { transition-delay: 0.12s; }
  .js .reveal:nth-child(4) { transition-delay: 0.18s; }
}

/* ==========================================================================
   THE HERO
   Scroll drives the clip: on desktop the section pins and currentTime maps
   to scroll position across the pinned track, the same "scroll is a
   scrubber" idea as the material flight below it, simplified to one clip
   with no chain and no seams to hold. Phones get the content, not the
   interaction: the pinned track is dropped and the same clip plays as a
   normal muted, looping background video instead.
   ========================================================================== */

@layer hero {
  .hero {
    position: relative;
    background: var(--dark-0);
    color: var(--dark-ink);
    /* Without this, the sticky masthead+ticker (about 101px) pushes the
       hero down in normal flow on first paint, and hero__stage doesn't
       become sticky-pinned until the page has been scrolled that same
       101px - cutting the bottom of the hero (CTAs, scroll hint) below
       the fold until then. Pulling the hero up to start at y:0 makes it
       pinned from the very first frame; the masthead's own higher
       z-index still layers on top exactly as it does once scrolled. */
    margin-top: calc(-1 * var(--header-h, 101px));
  }

  .hero__track { position: relative; height: 220vh; }

  .hero__stage {
    position: sticky;
    top: 0;
    height: 100svh;
    overflow: hidden;
    background: var(--dark-0);
  }

  .hero__poster,
  .hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .hero__poster { z-index: 1; }

  .hero__video {
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s var(--ease);
  }

  /* Set once the first real frame has actually painted (a JS 'seeked' or
     'playing' event), never on load start — this is what prevents the iOS
     blank-video flash the skill's engine also guards against. */
  .hero.is-ready .hero__video { opacity: 1; }
  .hero.is-ready .hero__poster { opacity: 0; }

  .hero__scrim {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background:
      linear-gradient(0deg, rgba(var(--dark-rgb), 0.82) 0%, rgba(var(--dark-rgb), 0.32) 32%, rgba(var(--dark-rgb), 0.05) 55%, rgba(var(--dark-rgb), 0.28) 100%);
  }

  .hero__copy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(2.5rem, 8vh, 5.5rem);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 4;
  }

  .hero__copy-inner {
    width: min(100% - (var(--gutter) * 2), var(--maxw));
    margin-inline: auto;
  }

  .hero__copy .eyebrow { color: var(--dark-ink-2); }

  .hero__title {
    font-size: var(--step-4);
    line-height: 0.94;
    margin-block: 0.5rem 0.9rem;
    color: var(--dark-ink);
    max-width: 15ch;
    text-shadow: 0 2px 30px rgba(var(--dark-rgb), 0.7);
  }

  .hero__lede {
    font-size: var(--step-1);
    color: var(--dark-ink-2);
    max-width: 40ch;
    text-shadow: 0 1px 16px rgba(var(--dark-rgb), 0.8);
  }

  .hero__actions { margin-top: 1.6rem; display: flex; gap: 0.7rem; flex-wrap: wrap; }

  .hero__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: var(--dark-rule);
    z-index: 5;
  }
  .hero__progress i { display: block; height: 100%; width: 0%; background: var(--accent); }

  .hero__hint {
    position: absolute;
    left: 50%;
    bottom: clamp(1.6rem, 5vh, 3rem);
    transform: translateX(-50%);
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--dark-ink);
    text-shadow: 0 1px 12px rgba(var(--dark-rgb), 0.8);
    opacity: 1;
    transition: opacity 0.4s var(--ease);
  }
  .hero__hint svg {
    display: block;
    width: 18px;
    height: 10px;
    animation: hero-hint-bounce 1.6s var(--ease) infinite;
  }
  .hero__hint svg path {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .hero.has-scrolled .hero__hint { opacity: 0; }

  @keyframes hero-hint-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(6px); }
  }

  /* Phones: content, not the interaction. No pinned track, no scrub — the
     clip plays as a normal muted, looping background video instead. Same
     reasoning as the material world below: fighting the URL bar for a
     pinned effect on a small viewport costs battery for very little payoff. */
  @media (max-width: 780px) {
    .hero__track { height: auto; }
    .hero__stage { position: static; height: 78vh; min-height: 420px; }
    .hero__hint { display: none; }
    .hero__progress { display: none; }
  }

  @media (prefers-reduced-motion: reduce) {
    .hero__track { height: auto; }
    .hero__stage { position: static; height: 78vh; min-height: 420px; }
    .hero__video { display: none; }
    .hero__hint { display: none; }
    .hero__progress { display: none; }
  }
}

/* ==========================================================================
   THE WORLD
   A single continuous floor plane that the camera flies across. The material
   under the camera changes at each waypoint, but the plane never cuts, so the
   whole sequence reads as one uninterrupted take.
   ========================================================================== */

@layer world {
  .world {
    position: relative;
    background: var(--ink);
    color: var(--paper);
  }

  .world__track { position: relative; }

  .world__stage {
    position: sticky;
    top: 0;
    height: 100svh;
    overflow: hidden;
    perspective: 620px;
    perspective-origin: 50% 22%;
    background: var(--ink);
    isolation: isolate;
  }

  /* horizon glow, sits behind the plane */
  .world__sky {
    position: absolute;
    inset: 0;
    background:
      radial-gradient(120% 62% at 50% 46%, rgba(255, 255, 255, 0.05) 0%, transparent 62%),
      linear-gradient(180deg, var(--dark-0) 0%, var(--dark-2) 30%, var(--dark-3) 100%);
    z-index: 0;
  }

  .world__plane-wrap {
    position: absolute;
    left: 50%;
    top: 26%;
    width: 320vmax;
    height: 190vmax;
    transform: translate3d(-50%, 0, 0);
    transform-style: preserve-3d;
    z-index: 1;
  }

  .world__plane {
    position: absolute;
    inset: 0;
    transform: rotateX(var(--world-tilt, 74deg)) translate3d(0, 0, 0);
    transform-origin: 50% 0%;
    background-repeat: repeat;
    background-position: center var(--world-pan, 0px);
    background-size: var(--world-tile, 640px) auto;
    will-change: background-position;
  }

  /* the crossfade layer: the next material rises through the current one so
     there is never a hard cut between lots */
  .world__plane--next { opacity: var(--world-mix, 0); }

  /* depth: darken toward the horizon so the repeat is never legible far off */
  .world__haze {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
      /* horizon: the repeat must never be legible in the distance */
      linear-gradient(180deg, var(--dark-0) 0%, rgba(var(--dark-rgb), 0.92) 26%, rgba(var(--dark-rgb), 0.12) 52%, rgba(var(--dark-rgb), 0) 68%),
      /* foreground scrim: holds the caption legible over the pale lots */
      linear-gradient(0deg, rgba(var(--dark-rgb), 0.86) 0%, rgba(var(--dark-rgb), 0.42) 26%, rgba(var(--dark-rgb), 0) 50%),
      radial-gradient(78% 58% at 50% 78%, transparent 38%, rgba(var(--dark-rgb), 0.62) 100%);
  }

  /* copy sits above everything, one caption per waypoint */
  .world__copy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(2.5rem, 8vh, 6rem);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 3;
    pointer-events: none;
  }

  .world__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transform: translate3d(0, 16px, 0);
    transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
  }
  .world__caption.is-live { opacity: 1; transform: none; }

  .world__caption-inner {
    width: min(100% - (var(--gutter) * 2), var(--maxw));
    margin-inline: auto;
  }

  .world__caption h3 {
    font-size: var(--step-4);
    line-height: 0.86;
    margin-block: 0.35rem 0.6rem;
    max-width: 14ch;
    color: var(--dark-ink);
    text-shadow: 0 2px 30px rgba(var(--dark-rgb), 0.85);
  }

  .world__caption p {
    font-size: var(--step-0);
    color: var(--dark-ink);
    max-width: 34ch;
    text-shadow: 0 1px 16px rgba(var(--dark-rgb), 0.9);
  }

  .world__caption .eyebrow { color: var(--accent); }

  .world__caption a {
    pointer-events: auto;
    display: inline-flex;
    margin-top: 1.1rem;
  }

  /* route rail: which lot the camera is over */
  .world__rail {
    position: absolute;
    right: clamp(1rem, 3vw, 2.5rem);
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    display: none;
    flex-direction: column;
    gap: 0.9rem;
    align-items: flex-end;
  }
  @media (min-width: 900px) { .world__rail { display: flex; } }

  .world__rail-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--dark-ink-3);
    transition: color 0.3s var(--ease);
  }

  .world__rail-item i {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--dark-ink-4);
    transition: width 0.35s var(--ease), background 0.35s var(--ease);
  }

  .world__rail-item.is-live { color: var(--paper); }
  .world__rail-item.is-live i { width: 52px; background: var(--accent); }

  /* progress hairline along the bottom of the stage */
  .world__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: var(--dark-rule);
    z-index: 5;
  }
  .world__progress i {
    display: block;
    height: 100%;
    width: var(--world-progress, 0%);
    background: var(--accent);
  }

  /* ---- static fallback: no pinning, no 3D, just the materials ---- */
  .world__fallback { display: none; }

  .world__fallback-item {
    display: grid;
    gap: 1.4rem;
    padding-block: 2.5rem;
    border-bottom: 1px solid var(--dark-rule);
    grid-template-columns: 1fr;
    align-items: center;
  }
  @media (min-width: 700px) { .world__fallback-item { grid-template-columns: 1fr 1fr; } }

  .world__fallback-item img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
  .world__fallback-item h3 { font-size: var(--step-2); color: var(--paper); }
  .world__fallback-item p { color: var(--dark-ink-2); }
}

@layer components {
  /* ---------- fancy floors panel: text + a real swatch mosaic ---------- */

  .ff-panel {
    display: grid;
    gap: clamp(2rem, 5vw, 4rem);
    grid-template-columns: 1fr;
    align-items: center;
  }
  @media (min-width: 860px) { .ff-panel { grid-template-columns: 1fr 1fr; } }

  .ff-mosaic {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 100px;
    gap: 6px;
  }
  @media (min-width: 520px) { .ff-mosaic { grid-auto-rows: 118px; } }

  .ff-mosaic__tile {
    position: relative;
    overflow: hidden;
    background: var(--paper-3);
  }
  /* First tile spans the full width as a hero swatch; the remaining four
     fill a tidy 2x2 beneath it, so the grid never leaves an orphan gap. */
  .ff-mosaic__tile--big { grid-column: 1 / -1; grid-row: span 2; }

  .ff-mosaic__tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .ff-mosaic__label {
    position: absolute;
    left: 0;
    bottom: 0;
    right: 0;
    padding: 0.4rem 0.55rem;
    background: linear-gradient(0deg, rgba(var(--ink-rgb), 0.72) 0%, transparent 100%);
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    line-height: 1.35;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}

@layer utilities {

  .u-hide { display: none !important; }
  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
  }
}

/* ==========================================================================
   MOTION AND DEVICE HARDENING
   ========================================================================== */

/* Phones get the material, not the flight. Pinning a 3D plane on a small
   viewport fights the URL bar and burns battery for very little payoff. */
@media (max-width: 780px) {
  .world__track { height: auto !important; }
  .world__stage { position: static; height: auto; perspective: none; }
  .world__plane-wrap, .world__haze, .world__copy, .world__rail, .world__progress, .world__sky { display: none; }
  .world__fallback { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal { opacity: 1; transform: none; }

  .world__track { height: auto !important; }
  .world__stage { position: static; height: auto; perspective: none; }
  .world__plane-wrap, .world__haze, .world__copy, .world__rail, .world__progress, .world__sky { display: none; }
  .world__fallback { display: block; }
}

@media print {
  .masthead, .ticker, .world, .footer { display: none; }
  body { background: #fff; color: #000; }
}
