/* Devboot home. Typography is the image; lime is the signature colour; Devboot red is a punctual accent; native scroll.
   Type is fixed (Cartaz). Mobile first: the base rules are the phone. */

/* ---------- Fonts: self-hosted latin subsets, all SIL OFL. ---------- */
@font-face { font-family: "Big Shoulders Display"; src: url("fonts/big-shoulders-display-latin.woff2") format("woff2"); font-weight: 500 900; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/hanken-grotesk-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

/* ---------- Tokens. Cartaz type, lime signature, red accent, light theme is the default. ----------
   --sig       lime, the signature colour as a SURFACE (bands, buttons, hover fills); --on-sig is the ink text on it.
   --sig-tx    lime as TEXT or a ring on an --ink surface (dark card in light theme, light card in dark theme).
   --red-t     Devboot red as small text or a mark on the PAGE background. Its role is fixed: brand marks only
               (index numbers, section markers, link-hover underline). Never a fill, never a button, never a band.
   --red-sig   the same red as a mark on a LIME surface (the marquee asterisks).
   --sig-edge  a thin ink ring on lime buttons in the light theme: lime on paper is only 1.14:1, so the button's edge needs it. */
:root {
  --bg: #eeece4;
  --surface: #e2dfd4;
  --ink: #14150f;
  --ink-2: #4c4e44;
  --line: #c9c6b9;
  --sig: #cdeb3a;
  --on-sig: #14150f;
  --sig-tx: #cdeb3a;
  --red-t: #a80400;
  --red-sig: #a80400;
  --sig-edge: var(--ink);
  --pend: #6b4a00;
  --wm-light: block;
  --wm-dark: none;

  --f-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --f-text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --d-weight: 800;
  --d-case: uppercase;
  --d-lh: 0.84;
  --d-track: 0;
  --d-style: normal;
  --hl-style: normal;
  /* em-width of the longest hero line, measured in Chrome: drives the fit-to-width hero size */
  --k-m: 4.55;
  --k-d: 8.1;
  --k-ch: 4.35;
  --k-st: 6.6;

  --g: max(16px, env(safe-area-inset-left, 0px));
  --gr: max(16px, env(safe-area-inset-right, 0px));
  --safe-b: env(safe-area-inset-bottom, 0px);
  --r: 4px;
  --ease: cubic-bezier(0.7, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

/* Lime #cdeb3a with ink #14150f on it (13.6:1). --sig-tx is lime as text on an --ink surface: on the dark card of the light
   theme it is the lime itself; on the light card of the dark theme it is a dark lime, #566a00. --red-t is Devboot red on the
   page background: #a80400 on paper (6.6:1), #ff3b30 on the dark page (5.3:1). Measured pairs are listed in the task report. */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10110d; --surface: #1a1b15; --ink: #eeece4; --ink-2: #a6a898; --line: #2e3027;
    --sig-tx: #566a00; --red-t: #ff3b30; --pend: #e8c46a; --sig-edge: transparent;
    --wm-light: none; --wm-dark: block; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10110d; --surface: #1a1b15; --ink: #eeece4; --ink-2: #a6a898; --line: #2e3027;
  --sig-tx: #566a00; --red-t: #ff3b30; --pend: #e8c46a; --sig-edge: transparent;
  --wm-light: none; --wm-dark: block; color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--f-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color 0.4s, color 0.4s;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--sig); color: var(--on-sig); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--g); top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; }
.skip:focus { top: 8px; }
.wm--on-light { display: var(--wm-light); }
.wm--on-dark { display: var(--wm-dark); }

/* Pending fact marker: never mistaken for copy */
.q {
  font: 600 0.78em/1.3 var(--f-text);
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
  color: var(--pend);
  border-bottom: 1.5px dashed currentColor;
  white-space: normal;
}

/* Underline that draws itself on hover */
.ul {
  background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: none; font-weight: 600;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1.5px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 0.45s var(--ease);
  padding-bottom: 2px;
}
@media (hover: hover) {
  .ul:hover { background-image: linear-gradient(var(--red-t), var(--red-t)); }
  .menu .ul:hover { background-image: linear-gradient(currentColor, currentColor); }
  .ul:hover { background-size: 0 1.5px; background-position: 100% 100%; animation: ul-redraw 0.9s var(--ease) 0.35s forwards; }
}
@keyframes ul-redraw { from { background-size: 0 1.5px; background-position: 0 100%; } to { background-size: 100% 1.5px; background-position: 0 100%; } }

.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  min-height: 52px; padding: 0 22px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--sig); color: var(--on-sig); box-shadow: inset 0 0 0 1.5px var(--sig-edge);
  font-weight: 700; font-size: 1rem; text-decoration: none;
  transition: transform 0.35s var(--ease-out);
}
.btn .arw { transition: transform 0.35s var(--ease-out); }
@media (hover: hover) { .btn:hover .arw { transform: translateX(5px); } }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline-color: var(--ink); }

.arw { display: inline-block; font-family: var(--f-text); font-style: normal; }

/* ---------- Bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 60px; padding: 0 var(--gr) 0 var(--g);
  background: var(--bg);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.brand { display: flex; align-items: center; min-height: 44px; }
.brand .wm { width: 112px; height: auto; }
.bar-links { display: none; align-items: center; gap: 22px; margin-left: auto; font-size: 0.9375rem; }
.pill {
  min-height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--ink); background: transparent; font-weight: 700; font-size: 0.875rem;
  transition: background-color 0.25s, color 0.25s;
}
@media (hover: hover) { .pill:hover { background: var(--ink); color: var(--bg); } }
.menu-btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; min-width: 44px; padding: 0 4px 0 10px;
  border: 0; background: none; cursor: pointer; font-weight: 700; font-size: 0.9375rem;
  position: relative; z-index: 45;
}
.menu-btn-i { position: relative; width: 22px; height: 10px; }
.menu-btn-i::before, .menu-btn-i::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor;
  transition: transform 0.4s var(--ease);
}
.menu-btn-i::before { top: 0; }
.menu-btn-i::after { bottom: 0; }
.menu-btn[aria-expanded="true"] .menu-btn-i::before { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn-i::after { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Full-screen menu: huge type, revealed by a circle from the button ---------- */
.menu {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 84px var(--gr) calc(24px + var(--safe-b)) var(--g);
  background: var(--sig); color: var(--on-sig);
  clip-path: circle(0 at calc(100% - 40px) 30px);
  transition: clip-path 0.7s var(--ease);
  overflow-y: auto;
}
.menu.open { clip-path: circle(150% at calc(100% - 40px) 30px); }
.menu-nav a {
  display: flex; align-items: baseline; gap: 14px;
  text-decoration: none; padding: 2px 0;
  border-bottom: 1.5px solid color-mix(in srgb, var(--on-sig) 25%, transparent);
  overflow: hidden;
}
.mn { font: 600 0.8125rem/1 var(--f-text); min-width: 1.8em; }
.ml {
  font-family: var(--f-display); font-weight: var(--d-weight); text-transform: var(--d-case);
  font-size: clamp(3rem, 15vw, 7rem); line-height: 1; letter-spacing: var(--d-track);
  transform: translateY(105%); transition: transform 0.7s var(--ease-out);
}
.menu.open .ml { transform: none; }
.menu.open a:nth-child(2) .ml { transition-delay: 0.05s; }
.menu.open a:nth-child(3) .ml { transition-delay: 0.1s; }
.menu.open a:nth-child(4) .ml { transition-delay: 0.15s; }
.menu.open a:nth-child(5) .ml { transition-delay: 0.2s; }
.menu-foot { display: grid; gap: 14px; justify-items: start; margin-top: 28px; font-weight: 600; }
.menu-foot .btn { background: var(--on-sig); color: var(--sig); }
.menu .btn:focus-visible, .menu a:focus-visible { outline-color: var(--on-sig); }
body.menu-open { overflow: hidden; }
body.menu-open .bar { z-index: 50; background: transparent; border-color: transparent; color: var(--on-sig); }
body.menu-open .brand { visibility: hidden; }

/* ---------- Display type shared ---------- */
.hero-t, .ch-name, .say, .st-l, .doors .dt, .marquee {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  letter-spacing: var(--d-track);
}

/* ---------- 1 · Hero ---------- */
.hero { padding: 28px var(--gr) 0 var(--g); }
.hero-meta {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px;
  font-size: 0.8125rem; font-weight: 600; color: var(--ink-2);
  padding-bottom: 14px; border-bottom: 1.5px solid var(--ink);
}
.hero-t {
  margin-top: 6vh;
  font-size: calc((100vw - 32px) / var(--k-m));
  line-height: var(--d-lh);
  text-transform: var(--d-case);
}
.ln { display: block; overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.li { display: inline-block; }
.br-d { display: none; }
.hl { position: relative; font-style: var(--hl-style); display: inline-block; z-index: 0; color: var(--on-sig); }
.hl::before {
  content: ""; position: absolute; z-index: -1;
  left: -0.04em; right: -0.04em; top: -0.04em; bottom: 0.02em;
  background: var(--sig);
  transform-origin: 0 50%;
}

.hero-foot { display: grid; gap: 22px; margin-top: 7vh; }
.lede { font-size: 1.1875rem; line-height: 1.45; max-width: 34ch; }
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.acts .ul { min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- Marquee band ---------- */
.marquee {
  margin-top: 12vh;
  background: var(--sig); color: var(--on-sig);
  overflow: hidden; white-space: nowrap;
  font-size: clamp(3.4rem, 17vw, 11rem); line-height: 1;
  text-transform: var(--d-case);
  padding: 0.12em 0 0.06em;
}
.mq-track { display: inline-flex; align-items: center; gap: 0.3em; will-change: transform; }
.mq-track i { font-style: normal; font-size: 0.5em; color: var(--red-sig); }

/* ---------- 2 · Method ---------- */
.method { padding: 14vh var(--gr) 10vh var(--g); }
.kicker {
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.kicker::before { content: ""; flex: none; width: 8px; height: 8px; background: var(--red-t); }
.say {
  font-size: clamp(3rem, 15.5vw, 9.5rem); line-height: var(--d-lh);
  text-transform: var(--d-case); max-width: 12ch;
  margin-bottom: 28px;
}
.proofs { display: grid; gap: 12px; margin-top: 44px; }
.proof {
  background: var(--surface); border-radius: var(--r);
  padding: 20px; display: grid; gap: 10px; align-content: start;
}
.pl { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.proof p { font-size: 1.125rem; line-height: 1.4; }

/* ---------- Chapters (three, same scaffold) ---------- */
.chapter { padding: 8vh 0 12vh; border-top: 1.5px solid var(--ink); }
.ch-head { padding: 0 var(--gr) 0 var(--g); overflow: hidden; }
.ch-n { display: block; font-size: 0.8125rem; font-weight: 700; color: var(--red-t); margin-bottom: 8px; }
.ch-name {
  font-size: calc((100vw - 32px) / var(--k-ch));
  line-height: 0.86; text-transform: var(--d-case);
  white-space: nowrap;
}
.ch-name > span { display: inline-block; transform-origin: 0 100%; will-change: transform; }
.ch-sub { margin-top: 14px; font-size: 1rem; font-weight: 600; color: var(--ink-2); }

.beat { padding: 9vh var(--gr) 0 var(--g); display: grid; gap: 28px; }
.beat-copy { display: grid; gap: 14px; max-width: 36rem; }
.beat-copy > p { font-size: 1.0625rem; color: var(--ink-2); }
.say-m {
  font-family: var(--f-display); font-weight: var(--d-weight); letter-spacing: var(--d-track);
  font-size: clamp(2.6rem, 12.5vw, 5.75rem); line-height: 0.88;
}
.say-m--gap {
  color: var(--ink-2);
  -webkit-text-stroke: 0;
  border: 2px dashed var(--line); border-radius: var(--r); padding: 18px 16px;
  font-size: clamp(2rem, 9vw, 3.5rem);
}

.media { position: relative; }
.media img { width: 100%; border-radius: var(--r); background: var(--surface); }
.media figcaption { margin-top: 10px; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.beat > .media picture img { aspect-ratio: 4 / 5; object-fit: cover; object-position: top center; }
.media--tall img { aspect-ratio: 9 / 16; object-fit: cover; object-position: top center; }
.media--render img { object-fit: contain; padding: 8% 14%; background: var(--surface); }

.pair { display: grid; grid-template-columns: 1fr; gap: 12px; }
.pair .media--tall { width: 62%; margin-left: auto; }
.pair--flip .media--tall { margin-left: 0; margin-right: auto; }

.gap .gap-in {
  border: 2px dashed var(--line); border-radius: var(--r);
  aspect-ratio: 1 / 1; padding: 22px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
  color: var(--ink-2);
}
.gap-l { margin-bottom: auto; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.gap-t { font-family: var(--f-display); font-weight: var(--d-weight); font-size: 2.2rem; line-height: 0.95; color: var(--ink); letter-spacing: var(--d-track); }

/* Own products: an index, Locomotive's "featured work" read as a list */
.works { border-top: 1.5px solid var(--ink); }
.work > a, .work > .wk-row {
  display: grid; grid-template-columns: 1fr auto; column-gap: 14px; row-gap: 4px; align-items: center;
  padding: 18px 0; text-decoration: none; border-bottom: 1px solid var(--line); position: relative;
}
.wk-name {
  font-family: var(--f-display); font-weight: var(--d-weight); letter-spacing: var(--d-track);
  font-size: clamp(2.2rem, 10vw, 4.5rem); line-height: 0.95;
  text-transform: var(--d-case);
  transition: transform 0.5s var(--ease-out);
}
.wk-desc { grid-column: 1; font-size: 0.9375rem; color: var(--ink-2); }
.wk-thumb {
  grid-column: 2; grid-row: 1 / span 2;
  width: 64px; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: 3px;
}
.work .arw { position: absolute; right: 0; top: 14px; font-size: 1.1rem; display: none; }
.wk-gap {
  grid-column: 2; grid-row: 1 / span 2;
  width: 64px; aspect-ratio: 3 / 4; border: 1.5px dashed var(--line); border-radius: 3px;
  display: grid; place-items: center; text-align: center;
  font-size: 0.6875rem; font-weight: 700; line-height: 1.15; color: var(--ink-2); padding: 4px;
}
@media (hover: hover) {
  .work:hover .wk-name { transform: translateX(14px); }
}

.ch-acts { padding: 8vh var(--gr) 0 var(--g); display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.ch-acts .ul { min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- Layout break ---------- */
.statement {
  background: var(--sig); color: var(--on-sig);
  padding: 14vh var(--gr) 14vh var(--g); overflow: hidden;
  font-size: calc((100vw - 32px) / var(--k-st)); line-height: var(--d-lh); text-transform: var(--d-case);
}
.st-l { white-space: nowrap; }
.st-l > span { display: inline-block; }
.st-l--last { font-style: var(--hl-style); margin-top: 0.25em; }

/* ---------- 8 · Close ---------- */
.close { padding: 16vh var(--gr) 12vh var(--g); }
.close .say { max-width: 11ch; }
.doors { margin-top: 40px; border-top: 1.5px solid var(--ink); }
.doors a {
  position: relative; width: 100%; overflow: hidden;
  display: grid; grid-template-columns: 2.2em 1fr auto; align-items: center; column-gap: 8px;
  min-height: 72px; padding: 10px 0; text-align: left; cursor: pointer; text-decoration: none; color: inherit;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  isolation: isolate;
}
.doors a::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--sig); transform: scaleY(0); transform-origin: 50% 100%;
  transition: transform 0.5s var(--ease);
}
.dn { font: 700 0.8125rem/1 var(--f-text); color: var(--red-t); padding-left: 2px; transition: color 0.3s; }
.dt { font-size: clamp(2.6rem, 13vw, 6.5rem); line-height: 1; text-transform: var(--d-case); transition: transform 0.5s var(--ease-out), color 0.3s; }
.doors .arw { font-size: 1.6rem; padding-right: 4px; transition: transform 0.5s var(--ease-out); }
@media (hover: hover) {
  .doors a:hover::before { transform: scaleY(1); }
  .doors a:hover { color: var(--on-sig); }
  .doors a:hover .dn { color: var(--on-sig); }
  .doors a:hover .dt { transform: translateX(14px); }
  .doors a:hover .arw { transform: translateX(-8px) rotate(-45deg); }
}
.close .acts { margin-top: 34px; }

/* ---------- Footer ---------- */
.foot { padding: 8vh var(--gr) calc(28px + var(--safe-b)) var(--g); border-top: 1.5px solid var(--ink); }
.foot-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 20px; font-size: 0.9375rem; }
.foot-cols > div:last-child { grid-column: 1 / -1; }
@media (min-width: 600px) { .foot-cols > div:last-child { grid-column: auto; } }
.fh { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.foot-cols .ul { font-weight: 600; text-align: left; }
.foot-mark { margin-top: 10vh; overflow: hidden; }
.foot-mark .wm { width: 100%; height: auto; transform-origin: 50% 100%; will-change: transform; }

/* ======================================================================
   Motion. Nothing here runs on the main thread during scroll:
   - reveals are short time-based transitions, toggled once by IntersectionObserver;
   - scroll-linked motion is CSS scroll-driven animation (compositor), only where supported;
   - the marquee is a plain CSS animation.
   transform / opacity / clip-path only. With reduced motion (data-motion="menos", set from the system preference), everything is simply there.
   ====================================================================== */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.w > span { display: inline-block; }

html.js:not([data-motion="menos"]) .li { transform: translateY(108%); }
html.js:not([data-motion="menos"]) .hl::before { transform: scaleX(0); }
html.js:not([data-motion="menos"]) .rise { opacity: 0; transform: translateY(20px); }
html.js:not([data-motion="menos"]) .mask img { clip-path: inset(100% 0 0 0); transform: scale(1.12); }
html.js:not([data-motion="menos"]) [data-split] .w > span { transform: translateY(105%); }

html.js.ready .li { transform: translateY(0); transition: transform 0.8s var(--ease-out); transition-delay: calc(var(--d, 0) * 70ms + 60ms); }
html.js.ready .hl::before { transform: scaleX(1); transition: transform 0.6s var(--ease) 0.55s; }
html.js .rise.in { opacity: 1; transform: none; transition: opacity 0.5s, transform 0.6s var(--ease-out); transition-delay: calc(var(--d, 0) * 70ms); }
html.js .mask.in img { clip-path: inset(0); transform: scale(1); transition: clip-path 0.8s var(--ease), transform 1s var(--ease-out); transition-delay: calc(var(--d, 0) * 80ms); }
html.js [data-split].in .w > span { transform: none; transition: transform 0.6s var(--ease-out); transition-delay: calc(var(--i, 0) * 45ms); }

/* Marquee: the three fronts drift, one loop, on the compositor */
.mq-track { padding-right: 0.3em; }
html:not([data-motion="menos"]) .mq-track { animation: mq 26s linear infinite; }
@keyframes mq { to { transform: translate3d(-50%, 0, 0); } }

/* Scroll-linked, compositor-driven. Each completes within well under one screen of scroll. */
@supports (animation-timeline: view()) {
  /* Hero: the four lines part left and right as the page leaves the opening */
  html.js.ready:not([data-motion="menos"]) .hero .ln {
    animation: drift linear both;
    animation-timeline: scroll(root);
    animation-range: 0 90vh;
  }
  @keyframes drift { to { transform: translateX(calc(var(--dir, 1) * 18vw)); } }

  /* Chapter names slide in and grow to full width as they arrive */
  .ch-head { view-timeline: --ch block; }
  html.js:not([data-motion="menos"]) .ch-name > span {
    animation: grow linear both;
    animation-timeline: --ch;
    animation-range: entry 0% cover 42%;
  }
  @keyframes grow { from { transform: translateX(40%) scale(0.6); } to { transform: none; } }

  /* Layout break: the two lines cross */
  .statement { view-timeline: --st block; }
  html.js:not([data-motion="menos"]) .st-l > span { animation: cross linear both; animation-timeline: --st; animation-range: entry 10% cover 50%; }
  @keyframes cross { from { transform: translateX(calc(var(--dir, 1) * 55vw)); } to { transform: none; } }

  /* Footer wordmark rises from the floor */
  .foot-mark { view-timeline: --fm block; }
  html.js:not([data-motion="menos"]) .foot-mark .wm { animation: floor linear both; animation-timeline: --fm; animation-range: entry 0% entry 100%; }
  @keyframes floor { from { transform: translateY(70%); } to { transform: none; } }
}

/* Without scroll-driven animations: the same moves, played once on enter, time-based */
@supports not (animation-timeline: view()) {
  html.js:not([data-motion="menos"]) .ch-head .ch-name > span { transform: translateX(40%) scale(0.6); }
  html.js .ch-head.in .ch-name > span { transform: none; transition: transform 0.9s var(--ease-out); }
  html.js:not([data-motion="menos"]) .foot-mark .wm { transform: translateY(70%); }
  html.js .foot-mark.in .wm { transform: none; transition: transform 0.9s var(--ease-out); }
}

/* Reduced motion: honoured from the system (the head script mirrors it into data-motion) */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; transition-delay: 0s !important; }
}
html[data-motion="menos"] { scroll-behavior: auto; }
html[data-motion="menos"] *, html[data-motion="menos"] *::before, html[data-motion="menos"] *::after { animation: none !important; }
html[data-motion="menos"] .menu, html[data-motion="menos"] .ml { transition: none; }

/* ======================================================================
   Wider screens
   ====================================================================== */
@media (min-width: 600px) {
  .bar-links { display: flex; }
  .menu-btn { margin-left: 0; }
  .brand .wm { width: 124px; }
  .proofs { grid-template-columns: repeat(3, 1fr); }
  .pair { grid-template-columns: 1.6fr 1fr; align-items: end; }
  .pair .media--tall { width: auto; margin: 0; }
  .pair--flip { grid-template-columns: 1fr 1.6fr; }
  .pair--flip .media--tall { order: -1; }
  .foot-cols { grid-template-columns: 1fr 1fr 2fr; }
}

@media (min-width: 900px) {
  :root { --g: max(4vw, env(safe-area-inset-left, 0px)); --gr: max(4vw, env(safe-area-inset-right, 0px)); }
  .bar { height: 68px; }
  .hero { padding-top: 32px; }
  .hero-t { font-size: min(calc(92vw / var(--k-d)), 30vh); margin-top: 5vh; }
  .ln { display: inline-block; vertical-align: top; }
  .br-d { display: inline; }
  .hero-foot { grid-template-columns: 1fr auto; align-items: end; margin-top: 6vh; }
  .say { font-size: min(9.5vw, 10rem); }
  .statement { font-size: min(calc(92vw / var(--k-st)), 24vh); }
  .ch-name { font-size: min(calc(92vw / var(--k-ch)), 38vh); }
  .ch-head { display: grid; grid-template-columns: 1fr; }
  .beat { grid-template-columns: 5fr 7fr; align-items: center; gap: 5vw; padding-top: 14vh; }
  .beat:nth-of-type(odd) .beat-copy { order: 2; }
  .beat--list { align-items: start; }
  .beat > .media picture img { aspect-ratio: 16 / 10; }
  .gap .gap-in { aspect-ratio: 16 / 10; padding: 32px; }
  .gap-l { margin-bottom: auto; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.gap-t { font-size: 3.2rem; }
  .wk-thumb, .wk-gap { display: none; }
  .work .arw { display: block; top: 22px; }
  .work > a, .work > .wk-row { grid-template-columns: 1fr; padding: 22px 0; }
  .doors { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3vw; }
  .close .say { max-width: 14ch; }
  .lede { font-size: 1.3125rem; }
}

/* Home additions to the base above.
   Mobile first: the base rules are the phone. Colours come from the base tokens only. */

[id] { scroll-margin-top: 72px; }

/* The hero lines drift sideways with the scroll; clip them at the page edge so the layout width never grows. */
.hero { overflow-x: clip; }
/* Images start scaled up inside their mask; clip the figure so that never widens the page. */
.media.mask { overflow: clip; }

/* Touch targets of 44px or more for every text link in the bar and the footer */
.bar-links { gap: 4px 18px; }
.bar-links .ul, .flinks .ul { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; margin: 0 -8px; background-origin: content-box; background-clip: content-box; background-position: 0 calc(100% - 10px); }
.flinks { display: flex; flex-wrap: wrap; gap: 0 12px; }

/* Wider reading measure for the plan's longer sentences */
.lede--wide { max-width: 40ch; }
.blk { font-size: 1.1875rem; line-height: 1.5; color: var(--ink); max-width: 40ch; }
.note { font-size: 0.875rem; color: var(--ink-2); }
.say-s {
  font-family: var(--f-display); font-weight: var(--d-weight); letter-spacing: var(--d-track);
  font-size: clamp(2rem, 9vw, 3.5rem); line-height: 0.95; text-transform: var(--d-case);
}

/* Outlined pill: second weight of action */
.btn--line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); text-decoration: none; transition: transform 0.35s var(--ease-out), background-color 0.25s, color 0.25s; }
@media (hover: hover) { .btn--line:hover { background: var(--ink); color: var(--bg); } }

/* ---------- Produtos ---------- */
.prods { padding: 12vh var(--gr) 10vh var(--g); border-top: 1.5px solid var(--ink); margin-top: 10vh; }
.say--m { font-size: clamp(2.6rem, 12vw, 7rem); max-width: 14ch; margin-bottom: 36px; }
.prods-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.prod { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border-radius: var(--r); overflow: hidden; }
.prod-fig { margin: 0; }
.prod-img { background: var(--bg); }
.prod-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 30% 60%; border-radius: 0; background: var(--surface); }
.gap--prod .gap-in { aspect-ratio: 4 / 3; padding: 18px; border: 0; border-bottom: 2px dashed var(--line); border-radius: 0; gap: 8px; }
.gap--prod .gap-in p:not(.gap-t):not(.gap-l) { font-size: 0.875rem; line-height: 1.35; }
.gap--prod .gap-l { margin-bottom: auto; }
.gap--prod .gap-t { font-size: 1.7rem; line-height: 0.98; }
.prod-body { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 24px; flex: 1; }
.prod-name {
  font-family: var(--f-display); font-weight: var(--d-weight); letter-spacing: var(--d-track);
  text-transform: var(--d-case); font-size: clamp(2.6rem, 12vw, 4.5rem); line-height: 0.92;
}
.prod-tag { font-size: 1.1875rem; font-weight: 700; line-height: 1.3; }
.prod-txt { color: var(--ink-2); font-size: 1.0625rem; }
.prod-link { margin-top: auto; align-self: flex-start; }
.prod-txt + .prod-link { margin-top: 8px; }

/* ---------- Method: service jump ---------- */
.jump { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.method .lede { margin-top: 0; }

/* ---------- Chapters here carry plan text instead of a headline ---------- */
.beat--list { grid-template-columns: 1fr; }
.region { font-size: 0.9375rem; font-weight: 600; color: var(--ink-2); }

/* ---------- "Também fazemos" strip ---------- */
.also { padding: 10vh var(--gr) 10vh var(--g); border-top: 1.5px solid var(--ink); display: grid; gap: 20px; }
.also-t { font: 600 1rem/1.4 var(--f-text); color: var(--ink-2); }
.also-l { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Footer, three columns ---------- */
.foot-cols > div:first-child { grid-column: 1 / -1; }
.foot-cols > div:last-child { grid-column: auto; }
@media (min-width: 600px) { .foot-cols { grid-template-columns: repeat(3, 1fr); } .foot-cols > div:first-child { grid-column: auto; } }

/* ---------- Wider ---------- */
@media (min-width: 700px) {
  .prods-grid { grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
  .prod-name { font-size: clamp(2.4rem, 6.2vw, 4.5rem); }
}
@media (min-width: 900px) {
  .lede--wide { max-width: 52ch; }
  .prods-grid { gap: 32px; }
  .prod-img img, .gap--prod .gap-in { aspect-ratio: 16 / 10; }
  .gap--prod .gap-in { padding: 24px; }
  .gap--prod .gap-t { font-size: 2.2rem; }
  .gap--prod .gap-in p:not(.gap-t):not(.gap-l) { font-size: 0.9375rem; }
  .prod-body { padding: 18px 28px 28px; }
  .also { grid-template-columns: 1fr auto; align-items: center; }
  .say--m { max-width: 18ch; }
}

/* Word masks must leave room above the cap line, or accents (VOCÊ, AUTOMAÇÃO) are cut off */
[data-split] .w { padding-top: 0.18em; margin-top: -0.18em; }

/* ---------- Illustrative screens (Devboot One, automation) ---------- */
.demo { background: var(--ink); color: var(--bg); border-radius: var(--r); font-size: 0.8125rem; line-height: 1.3; }

.auto-demo { padding: 18px; display: grid; gap: 14px; }
.ad-h { margin: 0; display: flex; justify-content: space-between; gap: 12px; font-weight: 700; padding-bottom: 10px; border-bottom: 1px solid color-mix(in srgb, var(--bg) 30%, transparent); }
.ad-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ad-steps li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: center; }
.ad-steps small { display: block; opacity: 0.65; font-size: 0.75rem; }
.ad-dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--bg) 50%, transparent); font-weight: 700; }
.ad-steps .done .ad-dot { background: var(--sig); border-color: var(--sig); color: var(--on-sig); }
.ad-steps .now .ad-dot { border-color: var(--sig-tx); color: var(--sig-tx); }
.auto-demo { font-size: 0.9375rem; }

/* ---------- GreenVision: measured result over the field photo ---------- */
.prod-img { position: relative; }
.gv-res { position: absolute; left: 12px; bottom: 12px; right: 12px; max-width: 17rem; margin: 0; padding: 10px 12px; border-radius: var(--r); background: var(--ink); color: var(--bg); display: grid; gap: 2px; }
.gv-k { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
.gv-n { font-family: var(--f-display); font-weight: var(--d-weight); font-size: 2rem; line-height: 1; letter-spacing: var(--d-track); text-transform: var(--d-case); color: var(--sig-tx); }
.gv-s { font-size: 0.75rem; line-height: 1.3; opacity: 0.85; }

/* ---------- "Também fazemos" ---------- */
.also-c { display: grid; gap: 10px; max-width: 40ch; }
.also-t { font-family: var(--f-display); font-weight: var(--d-weight); letter-spacing: var(--d-track); text-transform: var(--d-case); font-size: clamp(2.2rem, 9vw, 3.5rem); line-height: 0.95; color: var(--ink); }
.also-p { color: var(--ink-2); font-size: 1.0625rem; }

@media (min-width: 900px) { .gv-res { left: 18px; bottom: 18px; } }
/* ======================================================================
   Hero index: identical to index3 (.fronts). Phone: compact list. 900px and up: three columns side by side.
   Pointer with hover: the row's image follows the cursor (.peek, driven by home.js).
   ====================================================================== */
.fronts { margin-top: 9vh; border-top: 1.5px solid var(--ink); }
.fronts a {
  display: grid; grid-template-columns: 2.2em 1fr; align-items: baseline; column-gap: 8px;
  padding: 16px 0; text-decoration: none; border-bottom: 1px solid var(--line);
  position: relative;
}
.fn { font-size: 0.8125rem; font-weight: 700; color: var(--red-t); }
.ft {
  font-family: var(--f-display); font-weight: var(--d-weight); text-transform: var(--d-case);
  font-size: 2.6rem; line-height: 0.95; letter-spacing: var(--d-track);
  transition: transform 0.5s var(--ease-out);
}
.fd { grid-column: 2; font-size: 0.9375rem; color: var(--ink-2); margin-top: 4px; }
@media (hover: hover) {
  .fronts a:hover .ft { transform: translateX(14px); }
}
@media (min-width: 900px) {
  .fronts { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 2vw; margin-top: 10vh; }
  .fronts a { grid-template-columns: 1fr; padding: 18px 0 22px; border-bottom: 0; }
  .fd { grid-column: 1; }
  .ft { font-size: clamp(2.8rem, 4.6vw, 5rem); }
}

/* The marquee now follows the hero directly: the Produtos section continues from its edge */
.marquee + .prods { margin-top: 0; border-top: 0; }

/* ---------- Cursor follower: one stack of images, the row's own one is revealed ---------- */
.peek {
  position: fixed; left: 0; top: 0; z-index: 35; pointer-events: none;
  display: grid; width: 300px; opacity: 0; transform: translate3d(-999px, -999px, 0);
  transition: opacity 0.25s; contain: layout paint;
}
.peek img {
  grid-area: 1 / 1; align-self: start; width: 100%; height: auto; border-radius: var(--r);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28); background: var(--surface);
  clip-path: inset(0 0 100% 0); transition: clip-path 0.5s var(--ease);
}
.peek.on { opacity: 1; }
.peek img.on { clip-path: inset(0); }
@media (min-width: 900px) { .peek { width: 380px; } }
html[data-motion="menos"] .peek, html[data-motion="menos"] .peek img { transition: none; }

/* Marquee separator: an inline SVG asterisk, so no platform ever swaps in a colour emoji */
.mq-track i svg { display: block; width: 1em; height: 1em; }

/* Devboot One card: a 16:10 device mockup, shown whole (the GreenVision photo beside it is cropped to fit) */
.prod-img--one img { aspect-ratio: 16 / 10; object-fit: contain; object-position: center; background: #050607; }

/* ---------- Settings panel (gear icon): a button in the header, next to Menu, opening a small panel. ----------
   Phone: the panel hangs from the header, against the right edge. 600px and up: anchored under the button. */
.bar-end { display: flex; align-items: center; gap: 6px; }
.dial { position: relative; }
body.menu-open .dial { display: none; }
.dial-btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 10px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer;
  transition: background-color 0.25s, color 0.25s;
}
.dial-btn svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html:not([data-motion="menos"]) .dial-btn svg { transition: transform 0.3s var(--ease-out); }
html:not([data-motion="menos"]) .dial-btn[aria-expanded="true"] svg { transform: rotate(60deg); }
.dial-btn[aria-expanded="true"] { background: var(--ink); color: var(--bg); }
@media (hover: hover) { .dial-btn:hover { background: var(--ink); color: var(--bg); } }
.dial-panel {
  position: fixed; top: 66px; right: var(--gr); z-index: 60;
  width: min(300px, calc(100vw - 32px));
  background: var(--bg); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 10px;
  padding: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
  font-size: 0.875rem;
}
.dial-t { margin: 0; padding-right: 44px; font-size: 1rem; font-weight: 700; line-height: 24px; }
.dial-x {
  position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; padding: 0;
  display: grid; place-items: center; border: 0; background: none; color: inherit; cursor: pointer; border-radius: 50%;
}
.dial-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (hover: hover) { .dial-x:hover { background: var(--surface); } }
.dial-h { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin: 10px 0 6px; }
.dial-t + .dial-h { margin-top: 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg--3 { grid-template-columns: 1fr 1fr 1fr; }
.seg button, .seg a {
  min-height: 44px; padding: 6px 8px; border-radius: 6px; cursor: pointer; text-align: left;
  border: 1.5px solid var(--line); background: transparent; font-weight: 600;
  display: grid; gap: 1px; align-content: center;
}
.seg a { color: inherit; text-decoration: none; }
.seg--3 button { text-align: center; }
.seg button[aria-pressed="true"], .seg a[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
@media (min-width: 600px) {
  .dial-panel { position: absolute; top: calc(100% + 10px); right: 0; }
}
@media (min-width: 900px) { .bar-end { gap: 10px; } }

/* ---------- Contact chat: one question at a time. State and rules live in contato-core.js; this is only the look. ---------- */
.chat { display: none; margin-top: 36px; max-width: 640px; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--bg); }
.chat-log { display: flex; flex-direction: column; gap: 10px; max-height: min(56vh, 27rem); overflow-y: auto; overscroll-behavior: contain; padding: 16px; }
.msg { max-width: 90%; padding: 10px 14px; border-radius: var(--r); font-size: 1.0625rem; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-line; animation: msg-in 0.35s var(--ease-out); }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
.msg--bot { align-self: flex-start; background: var(--surface); }
.msg--me { align-self: flex-end; background: var(--sig); color: var(--on-sig); }
.msg--note { align-self: stretch; max-width: none; padding: 0; background: none; color: var(--ink-2); font-size: 0.875rem; }
.msg--err { box-shadow: inset 4px 0 0 var(--red-t); padding-left: 16px; }
/* The error is never colour alone: the words carry it, and so does this drawn "!" badge */
.msg--err::before { content: "!" / ""; display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; margin-right: 0.5em; border: 2px solid currentColor; border-radius: 50%; font-weight: 800; font-size: 0.85em; line-height: 1; vertical-align: 0.05em; color: var(--red-t); }
.sum { display: grid; gap: 8px; margin: 8px 0 0; white-space: normal; }
.sum dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.sum dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.chat-acts { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 16px 16px; }
.chat-acts:empty { display: none; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 0.9375rem; text-decoration: none; background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); transition: transform 0.2s var(--ease-out), background-color 0.2s, color 0.2s; }
.chip:active { transform: scale(0.97); }
@media (hover: hover) { .chip:hover { background: var(--ink); color: var(--bg); } }
.chip--go { background: var(--sig); color: var(--on-sig); box-shadow: inset 0 0 0 1.5px var(--sig-edge); }
@media (hover: hover) { .chip--go:hover { background: var(--ink); color: var(--bg); } }
.chip[disabled] { opacity: 0.55; cursor: progress; }
.chat-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; padding: 12px; border-top: 1.5px solid var(--ink); }
.chat-in { width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); font: 400 1rem/1.4 var(--f-text); resize: vertical; }
.chat-in::placeholder { color: var(--ink-2); opacity: 1; }
.chat-in:focus-visible { outline-offset: 1px; border-color: var(--ink); }
.chat-in[aria-invalid="true"] { border-color: var(--red-t); }
.chat-count { grid-column: 1 / -1; margin: 0; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.chat-count[data-over="true"] { color: var(--red-t); }
.chat-form .btn { min-height: 48px; }
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.chat-or { margin-top: 36px; font-size: 0.9375rem; font-weight: 600; color: var(--ink-2); }
.chat-or + .doors { margin-top: 10px; }
.chat-nojs { margin-top: 28px; }
html.js .chat { display: block; }
