:root {
  --paper: #f4f4f2;
  --paper-2: #e8e8e5;
  --ink: #1c1b19;
  --ink-2: #4b4945;
  --orange: #ff6a2b;
  --night: #1c1b19;
  --night-ink: #f4f4f2;
  --night-2: #b9b6b0;

  --f-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --f-text: "DM Sans", "Helvetica Neue", Arial, sans-serif;

  --fs-small: 0.875rem;
  --fs-body: 1.125rem;
  --fs-lead: 1.375rem;
  --fs-h3: 2rem;
  --fs-h2: clamp(2.5rem, 5vw, 4.25rem);
  --fs-display: clamp(3.5rem, 10vw, 9.5rem);

  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1360px;
  --radius: 14px;
  --gap-section: clamp(6rem, 12vw, 10rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
p { margin: 0; text-wrap: pretty; }
figure { margin: 0; }

::selection { background: var(--orange); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.about :focus-visible, .lightbox :focus-visible { outline-color: var(--night-ink); }

h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; line-height: 1.1; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: 999px;
}
.skip-link:focus { top: 1rem; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }

.small { font-size: var(--fs-small); color: var(--ink-2); }
.lede { font-size: var(--fs-lead); line-height: 1.45; max-width: 46ch; }

.text-link {
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.22em;
  transition: text-decoration-color .2s ease;
}
@media (hover: hover) { .text-link:hover { text-decoration-color: var(--orange); } }

/* ---------- Navigation ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; transition: transform .5s var(--ease), background-color .3s ease; }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
.nav.is-scrolled { background: var(--paper); }
.nav.is-hidden { transform: translateY(-100%); }

.logo { font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; }

.nav__links { display: flex; align-items: center; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.nav__links a { display: inline-block; padding: .5rem .95rem; border-radius: 999px; font-weight: 500; font-size: 1rem; transition: background-color .2s ease, color .2s ease; }
.nav__links a[aria-current="page"] { background: var(--paper-2); }
@media (hover: hover) { .nav__links a:hover { background: var(--ink); color: var(--paper); } }

.nav__toggle { display: none; min-height: 44px; padding: 0 1.1rem; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 500; font-size: 1rem; }

@media (max-width: 760px) {
  .nav__toggle { display: block; position: relative; z-index: 2; }
  .nav__links {
    position: fixed; inset: 0; z-index: 1; flex-direction: column; justify-content: center; gap: .5rem;
    background: var(--paper); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease;
  }
  .nav__links a { font-family: var(--f-display); font-size: 2.6rem; font-weight: 700; letter-spacing: -.03em; padding: .3rem 1.2rem; }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem; min-height: 52px;
  padding: 0 1.5rem; border-radius: 999px; background: var(--ink); color: var(--paper);
  font-weight: 500; font-size: 1rem;
  transition: background-color .2s ease, color .2s ease, transform .14s var(--ease);
}
.btn:active { transform: scale(.97); }
@media (hover: hover) { .btn:hover { background: var(--orange); color: var(--ink); } }

/* ---------- Hero: scrolling turns the watch ---------- */
.hero { position: relative; }
.hero__stage { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; gap: clamp(2rem, 5vw, 5rem); padding-block: 6rem 3rem; }
.js .hero.is-scrub { height: 190svh; }
.js .hero.is-scrub .hero__stage { position: sticky; top: 0; height: 100svh; min-height: 0; }
.hero__title { font-size: clamp(4rem, 12vw, 11.5rem); line-height: .86; letter-spacing: -.045em; }
.hero__role { font-family: var(--f-display); font-weight: 600; font-size: var(--fs-h3); letter-spacing: -.02em; margin-top: 1.6rem; }
.hero__sub { margin: 1rem 0 2.2rem; max-width: 40ch; }
.hero__watch { justify-self: end; width: 100%; max-width: 560px; height: min(78svh, 700px); border-radius: var(--radius); overflow: hidden; background: #dfe4e9; }
.hero__watch video { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }

/* Phones and small tablets: the film's own grey becomes the first screen,
   the watch turns once on load and the name sits underneath it. */
@media (max-width: 900px) {
  .hero { background: #e4e8ed; }
  .hero__stage { position: relative; display: block; min-height: 100svh; padding: 0; max-width: none; }
  .hero__watch { position: absolute; inset: 0 0 auto 0; width: 100%; max-width: none; height: auto; border-radius: 0; background: none; overflow: hidden; }
  .hero__watch video {
    display: block; width: auto; height: min(177.8vw, 74svh); max-width: 100%; margin: -3svh auto 0; object-fit: contain;
    /* soften the film's edges into the background so no frame shows; a mask, not a visible gradient */
    -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent), linear-gradient(to bottom, #000 78%, transparent); /* taste-skill-ignore */
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent), linear-gradient(to bottom, #000 78%, transparent); /* taste-skill-ignore */
    mask-composite: intersect;
  }
  .hero__text { position: absolute; left: var(--pad); right: var(--pad); bottom: 1.5rem; z-index: 2; }
  .hero__title { font-size: clamp(3.5rem, 19vw, 7rem); }
  .hero__role { font-size: var(--fs-lead); margin-top: .8rem; }
  .hero__sub { display: none; }
  .hero__text .btn { margin-top: 1.2rem; }
}
@media (max-width: 900px) and (max-height: 720px) {
  .hero__watch video { height: 64svh; }
  .hero__title { font-size: 15vw; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--gap-section); position: relative; }
.section--tight { padding-top: 0; }
.section__head { display: flex; justify-content: space-between; align-items: end; gap: 2rem; flex-wrap: wrap; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section__head p { max-width: 40ch; margin: 0; }

/* ---------- Project cards ---------- */
.projects { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(1.25rem, 2.5vw, 2.25rem); row-gap: clamp(2.5rem, 5vw, 4rem); }
.project { grid-column: span 12; }
.project--half { grid-column: span 6; }
.project__link { display: block; }
.project__media { overflow: hidden; border-radius: var(--radius); background: var(--paper-2); aspect-ratio: 16 / 9; }
.project--half .project__media { aspect-ratio: 4 / 3.4; }
.project__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.project__info { padding-top: 1.2rem; display: grid; gap: .45rem; }
.project__meta { font-size: var(--fs-small); color: var(--ink-2); margin-top: .2rem; }
.project__title { text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 2px; text-underline-offset: .15em; transition: text-decoration-color .2s ease; }
.project__desc { max-width: 52ch; }
@media (hover: hover) {
  .project__link:hover .project__media img { transform: scale(1.03); }
  .project__link:hover .project__title { text-decoration-color: var(--orange); }
}
@media (max-width: 760px) { .project--half { grid-column: span 12; } }

/* ---------- Render strip ---------- */
.strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .8rem; }
.strip a { border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; background: var(--paper-2); }
.strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.strip img.top { object-position: center 30%; }
@media (hover: hover) { .strip a:hover img { transform: scale(1.05); } }
@media (max-width: 760px) { .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- About ---------- */
.about { background: var(--night); color: var(--night-ink); }
.about__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.about__photo { max-width: 470px; justify-self: center; }
.about__photo img { border-radius: var(--radius); }
.about__hi { position: relative; display: inline-block; font-size: var(--fs-display); margin-bottom: 1.9rem; }
/* traced from the underline under "Formgivning" in the Vingen sketches */
.scribble { position: absolute; left: -2%; bottom: -.04em; width: 112%; height: auto; overflow: visible; }
.scribble path { fill: none; stroke: var(--orange); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) {
  .js .scribble path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .9s cubic-bezier(.65, 0, .35, 1) .2s; }
  .js .scribble.is-visible path { stroke-dashoffset: 0; }
}
.about__text p { font-size: var(--fs-lead); line-height: 1.5; margin: 0 0 1.1rem; max-width: 44ch; }
.about__text strong { font-weight: 500; color: var(--orange); }
.about__text .about__hobbies { font-size: var(--fs-body); color: var(--night-2); margin-top: 1.6rem; }

.spec { margin-top: clamp(4.5rem, 9vw, 7.5rem); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(2rem, 4vw, 4rem); }
.spec__title { margin-bottom: 1.6rem; }
.spec__item { margin-bottom: 1.8rem; }
.spec__item h4 { font-family: var(--f-display); font-size: var(--fs-lead); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; margin: .2rem 0 .4rem; }
.spec__item .when { font-size: var(--fs-small); color: var(--night-2); }
.spec__item p { color: var(--night-2); }
@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__photo { max-width: 360px; justify-self: start; }
  .spec { grid-template-columns: 1fr; }
}

/* ---------- Contact and footer ---------- */
.contact { text-align: center; }
.contact h2 { font-size: var(--fs-display); margin-bottom: 2.2rem; }
.contact__mail {
  font-family: var(--f-display); font-weight: 600; font-size: var(--fs-h3); letter-spacing: -.02em;
  text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .2em; transition: text-decoration-color .2s ease;
}
@media (hover: hover) { .contact__mail:hover { text-decoration-color: var(--orange); } }
.contact__actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 1rem 2rem; margin-top: 2.6rem; }
.btn--copy { min-width: 9.5rem; justify-content: center; }
.btn--copy.is-copied { background: var(--orange); color: var(--ink); }

.footer { background: var(--paper-2); padding-block: 2rem; font-size: var(--fs-small); }
.footer__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer__links { display: flex; gap: 1.4rem; }
@media (hover: hover) { .footer__links a:hover { text-decoration: underline; text-underline-offset: .2em; } }

/* ---------- Case study pages ---------- */
.case-hero { padding-top: clamp(7rem, 14vw, 10rem); padding-bottom: clamp(2rem, 4vw, 3rem); }
.case-hero h1 { font-size: var(--fs-display); margin-top: .5rem; }
.case-hero .lede { margin-top: 1.6rem; }

.case-cover { padding-inline: clamp(.5rem, 1.5vw, 1.25rem); }
.case-cover__img { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 8.2; background: var(--paper-2); }
.case-cover__img img { width: 100%; height: 115%; object-fit: cover; }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; padding-block: 2.5rem; margin: 0 0 clamp(3rem, 7vw, 6rem); }
.facts dt { font-size: var(--fs-small); color: var(--ink-2); margin-bottom: .3rem; }
.facts dd { margin: 0; line-height: 1.4; }
@media (max-width: 760px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.chapter { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(1.5rem, 5vw, 5rem); padding-block: clamp(2.5rem, 6vw, 5rem); }
.chapter__label { position: sticky; top: 6rem; align-self: start; }
.chapter__body > p { font-size: var(--fs-lead); line-height: 1.5; margin: 0 0 1.4rem; max-width: 56ch; }
.chapter__body strong { font-weight: 500; }
@media (max-width: 860px) { .chapter { grid-template-columns: 1fr; } .chapter__label { position: static; } }
@media (max-width: 600px) { .chapter__body > p, .about__text p, .lede { font-size: var(--fs-body); } }

.quotes { list-style: none; margin: 2.2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem clamp(1.5rem, 3vw, 3rem); }
.quotes blockquote { margin: 0; font-family: var(--f-display); font-weight: 500; font-size: var(--fs-lead); line-height: 1.3; letter-spacing: -.01em; }
.quotes span { display: block; margin-top: .45rem; font-size: var(--fs-small); color: var(--ink-2); }
@media (max-width: 760px) { .quotes { grid-template-columns: 1fr; } }

.stakes { margin: 2rem 0 0; display: grid; gap: 1.6rem; }
.stakes div { display: grid; grid-template-columns: 13rem 1fr; gap: 1rem; }
.stakes dt { font-family: var(--f-display); font-weight: 600; font-size: var(--fs-lead); letter-spacing: -.01em; line-height: 1.2; }
.stakes dd { margin: 0; }
@media (max-width: 760px) { .stakes div { grid-template-columns: 1fr; gap: .2rem; } }

.caption { font-size: var(--fs-small); color: var(--ink-2); margin-top: .8rem; }
.caption--split { display: flex; justify-content: space-between; gap: 1rem; }

.sketches { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1.25rem; margin-block: 2rem clamp(4rem, 9vw, 6rem); align-items: end; }
.sketches figure:nth-child(1) { grid-column: 1 / span 6; }
.sketches figure:nth-child(2) { grid-column: 7 / span 6; }
.sketches--three figure:nth-child(1) { grid-column: 1 / span 4; }
.sketches--three figure:nth-child(2) { grid-column: 5 / span 4; }
.sketches--three figure:nth-child(3) { grid-column: 9 / span 4; }
.sketches--three img { width: 100%; aspect-ratio: 4 / 4.4; object-fit: cover; border-radius: var(--radius); background: var(--paper-2); }
@media (max-width: 760px) { .sketches figure:nth-child(n) { grid-column: 1 / -1; } }

.questions { margin: 0 0 1.6rem; padding-left: 1.4rem; display: grid; gap: .6rem; font-size: var(--fs-lead); line-height: 1.4; max-width: 52ch; }
.questions li::marker { color: var(--ink-2); font-weight: 500; }
.chapter__body > .after-list { margin-top: 2.4rem; }
.features { margin: 0; padding-left: 1.2rem; display: grid; gap: .7rem; max-width: 56ch; }
.features li::marker { color: var(--orange); }

.concepts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-block: 0 clamp(4rem, 9vw, 6rem); }
.concepts img { width: 100%; aspect-ratio: 1400 / 990; object-fit: contain; background: #fff; border-radius: var(--radius); }
.concepts b, .pair b { display: block; font-family: var(--f-display); font-weight: 600; font-size: var(--fs-lead); color: var(--ink); margin-bottom: .2rem; }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: end; margin-block: 0 1.5rem; }
.pair img { width: 100%; aspect-ratio: 4 / 3.2; object-fit: contain; background: #fff; border-radius: var(--radius); }
.proto { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 3rem); align-items: end; margin-block: 0 clamp(4rem, 9vw, 6rem); }
.proto img { width: 100%; height: auto; }
@media (max-width: 760px) { .proto { grid-template-columns: 1fr; gap: 2.5rem; } }
.render-wide { margin: 0 0 1.5rem; }
.render-wide img { width: 100%; border-radius: var(--radius); background: #111; }
.pair--photo img { aspect-ratio: 4 / 3; object-fit: cover; background: #111; }
.cfd { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-block: 0 clamp(4rem, 9vw, 6rem); }
.cfd img { width: 100%; aspect-ratio: 2 / 1.05; object-fit: cover; border-radius: var(--radius); background: var(--paper-2); }
@media (max-width: 760px) { .concepts, .pair, .cfd { grid-template-columns: 1fr; } }

.eval { margin-top: 2rem; overflow-x: auto; }
.eval table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.eval caption { text-align: left; margin-bottom: .8rem; }
.eval th, .eval td { padding: .7rem .8rem; text-align: center; border-bottom: 1px solid rgba(28, 27, 25, .12); }
.eval th[scope="row"], .eval thead th:first-child { text-align: left; font-weight: 500; }
.eval thead th { font-family: var(--f-display); font-weight: 600; font-size: var(--fs-small); color: var(--ink-2); }
.eval .win { background: rgba(255, 106, 43, .14); color: var(--ink); }
.eval thead .win { color: var(--ink); }
.eval tfoot th, .eval tfoot td { border-bottom: 0; font-family: var(--f-display); font-weight: 700; font-size: var(--fs-lead); }

.panel { background: var(--paper-2); border-radius: var(--radius); padding: clamp(1.5rem, 5vw, 4rem); }
.panel img { width: min(100%, 860px); margin-inline: auto; }

.full { padding-inline: clamp(.5rem, 1.5vw, 1.25rem); margin-block: clamp(1rem, 3vw, 2rem); }
.full img, .full video { display: block; width: 100%; height: auto; border-radius: var(--radius); background: #111; }
.full--video { margin-bottom: clamp(4rem, 9vw, 6rem); }
.full .caption { padding-inline: calc(var(--pad) - clamp(.5rem, 1.5vw, 1.25rem)); }
@media (max-width: 760px) { .full .caption { padding-inline: 1rem; } .caption--split { flex-direction: column; gap: .15rem; } }

.next { display: block; padding-block: clamp(4rem, 9vw, 7rem); text-align: center; background: var(--paper-2); transition: background-color .35s ease; }
.next h2 { font-size: var(--fs-display); }
.next p { margin-top: 1rem; }
@media (hover: hover) { .next:hover { background: var(--orange); } }

/* ---------- Visualization gallery ---------- */
.gallery { columns: 3 320px; column-gap: 1.25rem; margin-bottom: clamp(4rem, 9vw, 7rem); }
.gallery__item { break-inside: avoid; margin-bottom: 2rem; display: block; width: 100%; text-align: left; }
.gallery__item img, .gallery__item video { width: 100%; border-radius: var(--radius); background: var(--paper-2); }
button.gallery__item { cursor: zoom-in; }
.gallery__item .caption { display: flex; justify-content: space-between; gap: 1rem; }
.gallery__item .caption b { font-weight: 500; color: var(--ink); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 4.5rem 1rem 2rem;
  background: rgba(20, 19, 17, .95); color: var(--night-ink);
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img { max-height: calc(100svh - 7rem); max-width: min(100%, 1400px); width: auto; border-radius: var(--radius); }
.lightbox__bar { position: absolute; top: 1rem; left: 1rem; right: 1rem; display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-small); }
.lightbox__btn { min-height: 44px; padding: 0 1rem; border-radius: 999px; background: var(--night-ink); color: var(--ink); font-size: var(--fs-small); font-weight: 500; transition: background-color .2s ease; }
@media (hover: hover) { .lightbox__btn:hover { background: var(--orange); } }
.lightbox__nav { position: absolute; bottom: 1rem; }
.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }

/* ---------- Entrances: pictures only, once ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .9s var(--ease); }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- 404: the lamp is off until someone switches it on ---------- */
.lost { min-height: 100svh; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; gap: 2rem; padding: 6rem max(var(--pad), calc((100vw - var(--max)) / 2 + var(--pad))) 4rem; overflow: hidden; }
.lost__lamp { position: relative; width: min(100%, 460px); padding: 0; cursor: pointer; }
.lost__lamp img { position: relative; z-index: 2; width: 100%; transform: scaleX(-1); filter: saturate(.35) brightness(.92); transition: filter .25s ease; }
.lost__lamp[aria-pressed="true"] img { filter: none; }
.lost__beam {
  position: absolute; z-index: 1; left: 61%; top: 39%; width: 260vw; height: 130vw;
  transform-origin: 0 50%; transform: translateY(-50%) rotate(-4deg);
  background: var(--orange); clip-path: polygon(0 48.6%, 100% 8%, 100% 92%, 0 51.4%);
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.lost__lamp[aria-pressed="true"] .lost__beam { opacity: 1; }
.lost__text { position: relative; z-index: 3; }
.lost__text h1 { font-size: var(--fs-display); line-height: .9; }
.lost__text p { font-size: var(--fs-lead); margin: 1.4rem 0 2.2rem; max-width: 32ch; }
@media (max-width: 900px) {
  .lost { grid-template-columns: 1fr; align-content: start; padding-top: 5.5rem; }
  .lost__lamp { width: min(62vw, 320px); }
  .lost__beam { top: 36%; transform: translateY(-50%) rotate(62deg); clip-path: polygon(0 48.6%, 100% 40%, 100% 60%, 0 51.4%); }
}

/* ---------- CAD page: live 3D viewer ---------- */
.cad-index { list-style: none; margin: clamp(2rem, 4vw, 3rem) 0 0; padding: 0; border-top: 1px solid rgba(28, 27, 25, .12); max-width: 40rem; }
.cad-index a { display: flex; align-items: baseline; gap: 1.2rem; padding: 1rem 0; border-bottom: 1px solid rgba(28, 27, 25, .12); font-family: var(--f-display); font-weight: 600; font-size: var(--fs-lead); letter-spacing: -.01em; }
.cad-index span { font-size: var(--fs-small); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cad-index em { margin-left: auto; font-style: normal; font-family: var(--f-text); font-weight: 500; font-size: var(--fs-small); color: var(--ink-2); }
@media (hover: hover) { .cad-index a:hover em { color: var(--ink); } .cad-index a:hover { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: .2em; } }

.cad-project { padding-block: clamp(3rem, 7vw, 5rem) 0; scroll-margin-top: 4rem; }
.cad-project__head { display: grid; grid-template-columns: auto 1fr; column-gap: 1.2rem; align-items: baseline; margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.cad-project__num { font-family: var(--f-display); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cad-project__head p { grid-column: 2; margin-top: 1rem; max-width: 52ch; }
.cad-shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-bottom: clamp(4rem, 9vw, 6rem); }
.cad-shots button { display: block; width: 100%; cursor: zoom-in; border-radius: var(--radius); overflow: hidden; background: #fff; }
.cad-shots img { width: 100%; aspect-ratio: 4 / 5; object-fit: contain; transition: transform .9s var(--ease); }
@media (hover: hover) { .cad-shots button:hover img { transform: scale(1.03); } }
@media (max-width: 760px) { .cad-shots { grid-template-columns: 1fr; gap: 2rem; } }

.cad-stage { margin-bottom: 0; }
.viewer { position: relative; aspect-ratio: 16 / 9; max-height: 82svh; width: 100%; border-radius: var(--radius); overflow: hidden; background: var(--paper-2); touch-action: none; user-select: none; -webkit-user-select: none; }
.viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; outline: none; }
.viewer.is-dragging canvas { cursor: grabbing; }
.viewer__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .6s ease; pointer-events: none; }
.viewer.is-ready .viewer__poster { opacity: 0; }

.viewer__readout { position: absolute; top: clamp(.8rem, 2vw, 1.5rem); left: clamp(.8rem, 2vw, 1.5rem); margin: 0; display: grid; gap: .5rem; pointer-events: none; opacity: 0; transition: opacity .4s ease .3s; }
.viewer.is-ready .viewer__readout { opacity: 1; }
.viewer__readout dt { font-size: .75rem; color: var(--ink-2); }
.viewer__readout dd { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 1.35rem; letter-spacing: -.01em; line-height: 1.1; font-variant-numeric: tabular-nums; min-width: 6ch; }

.viewer__hint, .viewer__status { position: absolute; left: 50%; bottom: clamp(.8rem, 2vw, 1.5rem); transform: translateX(-50%); margin: 0; padding: .5rem 1rem; border-radius: 999px; font-size: var(--fs-small); font-weight: 500; white-space: nowrap; pointer-events: none; }
.viewer__hint { background: var(--ink); color: var(--paper); opacity: 0; transition: opacity .4s ease; }
.viewer.is-ready:not(.is-touched) .viewer__hint { opacity: 1; transition-delay: .8s; }
.viewer__status { background: var(--paper); color: var(--ink-2); }
.viewer__status:empty { display: none; }

.viewer-ui { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.5rem; margin-top: 1rem; padding-inline: calc(var(--pad) - clamp(.5rem, 1.5vw, 1.25rem)); }
.viewer-ui[hidden] { display: none; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--paper-2); }
.seg button, .chip { min-height: 40px; padding: 0 1rem; border-radius: 999px; font-size: var(--fs-small); font-weight: 500; transition: background-color .2s ease, color .2s ease; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip { background: var(--paper-2); min-height: 48px; padding: 0 1.2rem; }
@media (hover: hover) { .seg button[aria-pressed="false"]:hover { background: var(--paper); } .chip:hover { background: var(--ink); color: var(--paper); } }
.viewer-ui__scrub { flex: 1 1 14rem; display: flex; align-items: center; gap: .9rem; font-size: var(--fs-small); color: var(--ink-2); }
.viewer-ui__scrub input { flex: 1; min-width: 0; accent-color: var(--orange); height: 44px; }
.viewer-ui__actions { display: flex; gap: .5rem; }

@media (max-width: 760px) {
  .viewer { aspect-ratio: 1 / 1.05; }
  .viewer__readout { gap: .35rem; }
  .viewer__readout dd { font-size: 1.1rem; }
  .viewer-ui { padding-inline: .25rem; gap: .6rem .4rem; justify-content: space-between; }
  .viewer-ui__scrub { flex-basis: 100%; order: -1; }
  .seg button, .chip { padding: 0 .8rem; }
  .viewer-ui__actions { gap: .4rem; }
  .wide-only { display: none; }
  .cad-project__head { grid-template-columns: 1fr; }
  .cad-project__head p { grid-column: 1; }
}
