/* DSB locomotive models showcase. Darren Wilden, dwinnovation.dk
   Mobile-first. System font stack only (no third-party font requests). */

:root {
  --bg: #0d0e11;
  --bg-2: #14161b;
  --bg-3: #1b1e25;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --text: #eef0f3;
  --muted: #a5abb6;
  --faint: #79808c;
  --red: #d2122e;
  --red-2: #ef3349;
  --red-glow: rgba(210, 18, 46, .35);
  --amber: #f2b33d;
  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1120px;
  --gutter: 16px;
  --top: 60px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, picture, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.12; margin: 0; letter-spacing: -.015em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--amber); color: #111; padding: 10px 14px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

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

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red-2); margin-bottom: 12px; }
.eyebrow--plate { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); letter-spacing: .1em; }
.eyebrow--plate span { border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px;
  font-weight: 650; font-size: 15px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .2s var(--ease), background-color .2s, border-color .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn--primary { background: var(--red); color: #fff; box-shadow: 0 8px 24px -10px var(--red-glow); }
.btn--primary:hover { background: var(--red-2); transform: translateY(-1px); }
.btn--ghost { background: rgba(255, 255, 255, .06); border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { background: rgba(255, 255, 255, .12); }
.btn--block { width: 100%; }
.btn--small { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Top bar ---------- */
/* No safe-area-inset-top here on purpose: the page never draws under the status bar (no viewport-fit=cover),
   and Facebook's Android in-app browser reports a false top inset that would push the bar down. */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  background: rgba(13, 14, 17, .72);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) { .topbar { background: rgba(13, 14, 17, .96); } }
.topbar__in { height: var(--top); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; white-space: nowrap; text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--red); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .02em; }
.brand__text { font-size: 15px; }

.navtoggle { flex: none; width: 44px; height: 44px; display: grid; place-items: center; background: transparent; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; }
.navtoggle__bars, .navtoggle__bars::before, .navtoggle__bars::after { content: ""; display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.navtoggle__bars { position: relative; }
.navtoggle__bars::before { position: absolute; top: -6px; }
.navtoggle__bars::after { position: absolute; top: 6px; }
.navtoggle[aria-expanded="true"] .navtoggle__bars { background: transparent; }
.navtoggle[aria-expanded="true"] .navtoggle__bars::before { transform: translateY(6px) rotate(45deg); }
.navtoggle[aria-expanded="true"] .navtoggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Mobile menu: a full-height, fully opaque sheet below the bar, so nothing from the page shows through */
.nav {
  position: absolute; left: 0; right: 0; top: 100%;
  height: calc(100vh - var(--top));
  height: calc(100dvh - var(--top));
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  display: flex; flex-direction: column;
  padding: 8px max(var(--gutter), env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) max(var(--gutter), env(safe-area-inset-left, 0px));
  background: var(--bg); border-top: 1px solid var(--line);
  visibility: hidden; opacity: 0; transform: translateY(-8px);
  transition: opacity .2s, transform .25s var(--ease), visibility 0s .25s;
}
.nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .2s, transform .25s var(--ease); }
.nav a { display: block; padding: 17px 4px; text-decoration: none; color: var(--text); font-size: 18px; font-weight: 650; border-bottom: 1px solid var(--line); }
.nav a:hover, .nav a:focus-visible { color: var(--red-2); }
.nav .nav__cta { margin-top: 24px; padding: 15px 20px; text-align: center; background: var(--red); color: #fff; border: 0; border-radius: 999px; }
.nav .nav__cta:hover { color: #fff; background: var(--red-2); }
html.nav-open { overflow: hidden; }
html.nav-open .topbar { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; padding-top: calc(var(--top)); }
.hero__bg { position: relative; z-index: -2; height: 62vw; min-height: 230px; max-height: 460px; overflow: hidden; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 36% 50%; transform: scale(1.04); animation: heroIn 2.4s var(--ease) both; }
.hero__shade { position: absolute; left: 0; right: 0; top: calc(var(--top)); height: calc(62vw + 2px); min-height: 232px; max-height: 462px; z-index: -1;
  background: linear-gradient(0deg, var(--bg) 0%, rgba(13, 14, 17, .4) 26%, rgba(13, 14, 17, 0) 55%); pointer-events: none; }
.hero__in { margin-top: -28px; padding-bottom: 44px; }
.hero h1 { font-size: clamp(34px, 9vw, 72px); font-weight: 800; max-width: 14ch; text-wrap: balance; }
.lede { margin-top: 16px; max-width: 58ch; color: #d5d9df; font-size: clamp(16px, 2.2vw, 19px); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero__actions .btn { flex: 1 1 200px; }
.hero__facts { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.hero__facts li { background: rgba(13, 14, 17, .78); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.hero__facts strong { font-size: 17px; font-weight: 750; }
.hero__facts span { font-size: 13px; color: var(--muted); }
@keyframes heroIn { from { transform: scale(1.12); opacity: .2; } to { transform: scale(1.04); opacity: 1; } }

/* Track rail divider */
.rail { height: 10px; margin: 0 auto; max-width: var(--wrap);
  background:
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(255, 255, 255, .07) 22px 34px) 0 50% / 100% 10px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) 0 2px / 100% 1px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) 0 7px / 100% 1px no-repeat; }

/* ---------- Video ---------- */
.video { padding: 56px 0 60px; }
.video__grid { display: grid; gap: 26px; align-items: center; }
.video__text h2 { font-size: clamp(28px, 6.4vw, 44px); font-weight: 800; line-height: 1.1; }
.video__intro { margin-top: 14px; color: var(--muted); max-width: 52ch; font-size: 17px; }
.video__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.video__player { margin: 0; }
.video__facade, .video__frame { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line-2); box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .8); }
@supports not (aspect-ratio: 16 / 9) { .video__facade, .video__frame { height: 0; padding-top: 56.25%; } }
.video__facade picture, .video__facade img, .video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__facade img { object-fit: cover; transition: transform .5s var(--ease), filter .3s; }
.video__facade:hover img, .video__facade:focus-visible img { transform: scale(1.03); filter: brightness(.9); }
.video__play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .45)); transition: transform .2s var(--ease); }
.video__facade:hover .video__play { transform: translate(-50%, -50%) scale(1.08); }
.video__len { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .78); color: #fff; font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.video__note { margin-top: 10px; font-size: 13px; color: var(--faint); }

/* 20 second film: muted loop, starts when scrolled into view, pause button (WCAG 2.2.2) */
.promo { padding: 52px 0 56px; }
.promo__head h2 { font-size: clamp(28px, 6.4vw, 44px); font-weight: 800; line-height: 1.1; }
.promo__player { margin: 22px 0 0; }
.promo__frame { position: relative; }
.promo__video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: #000; border: 1px solid var(--line-2); box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .8); }
@supports not (aspect-ratio: 16 / 9) { .promo__video { height: 56.25vw; max-height: 630px; } }
.promo__toggle { position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255, 255, 255, .28); border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .2s, transform .2s var(--ease); }
.promo__toggle[hidden] { display: none; }
.promo__toggle:hover { background: rgba(210, 18, 46, .85); }
.promo__toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.promo__toggle .promo__i-pause { display: none; }
.promo__player.is-playing .promo__i-pause { display: block; }
.promo__player.is-playing .promo__i-play { display: none; }
.promo__player:not(.is-playing) .promo__toggle { width: 64px; height: 64px; right: auto; bottom: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(210, 18, 46, .9); border-color: transparent; }
.promo__player:not(.is-playing) .promo__toggle svg { width: 30px; height: 30px; }
.promo__note { margin-top: 10px; font-size: 13px; color: var(--faint); min-height: 20px; }
@media (min-width: 900px) {
  .video { padding: 80px 0; }
  .promo { padding: 76px 0 80px; }
  .promo__toggle { right: 14px; bottom: 14px; }
  .video__grid { grid-template-columns: 5fr 7fr; gap: 48px; }
}

/* ---------- Model sections ---------- */
.model { padding: 64px 0; }
.model--alt { background: linear-gradient(180deg, transparent, var(--bg-2) 18%, var(--bg-2) 82%, transparent); }
.model__head { margin-bottom: 26px; }
.model__head h2 { font-size: clamp(30px, 7vw, 52px); font-weight: 800; }
.model__intro { margin-top: 14px; color: var(--muted); max-width: 64ch; font-size: 17px; }

/* Gallery */
.gallery { margin-bottom: 28px; }
.gallery__stage { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); border: 1px solid var(--line); }
.gallery__open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; aspect-ratio: 1600 / 670; }
.gallery__open picture, .gallery__img { width: 100%; height: 100%; }
.gallery__img { object-fit: cover; transition: opacity .35s; }
.gallery__img.is-fading { opacity: .25; }
.gallery__zoom { position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; border-radius: 50%; background: rgba(0, 0, 0, .5) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E") center / 18px no-repeat; border: 1px solid rgba(255, 255, 255, .2); }
.gallery__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 10px; font-size: 13px; color: #e6e8ec; background: linear-gradient(0deg, rgba(0, 0, 0, .7), transparent); pointer-events: none; }
.gallery__thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 6px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.thumb { flex: 0 0 31%; scroll-snap-align: start; padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; background: var(--bg-3); aspect-ratio: 1600 / 670; opacity: .62; transition: opacity .2s, border-color .2s; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: .9; }
.thumb.is-active { border-color: var(--red); opacity: 1; }

/* Cards */
.model__grid { display: grid; gap: 16px; }
.card { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; }
.card__title { font-size: 13px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 28px; color: #d9dce2; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .42em; width: 16px; height: 16px; border-radius: 50%; background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 10px no-repeat; }
.ticks--tight { margin-top: 18px; gap: 8px; }

.card--plate { background:
  linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 40%), #191b20;
  border-color: rgba(242, 179, 61, .22); position: relative; }
.card--plate::before, .card--plate::after { content: ""; position: absolute; top: 12px; width: 7px; height: 7px; border-radius: 50%; background: #3b3f47; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.card--plate::before { left: 12px; }
.card--plate::after { right: 12px; }
.card--plate .card__title { color: var(--amber); text-align: center; }
.specs { margin: 0; display: grid; gap: 0; }
.specs div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--line-2); }
.specs div:last-child { border-bottom: 0; }
.specs dt { color: var(--muted); font-size: 14px; }
.specs dd { margin: 0; font-family: var(--mono); font-size: 14px; text-align: right; }

/* 3D viewer */
.viewer { margin-top: 16px; position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: radial-gradient(120% 90% at 50% 100%, #262a33 0%, #121318 70%); min-height: 260px; display: grid; }
.viewer__idle { display: grid; place-content: center; justify-items: center; text-align: center; gap: 8px; padding: 34px 20px; }
.viewer__title { font-weight: 750; font-size: 20px; }
.viewer__note { color: var(--muted); font-size: 14px; max-width: 40ch; margin-bottom: 10px; }
.viewer model-viewer { width: 100%; height: 62vh; height: 62svh; min-height: 320px; max-height: 640px; background: transparent; --poster-color: transparent; --progress-bar-height: 0px; }
.viewer__hint { position: absolute; left: 12px; bottom: 10px; font-size: 12px; color: var(--muted); background: rgba(0, 0, 0, .45); padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.viewer__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .08); }
.viewer__progress i { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s; }
.viewer__error { color: var(--muted); font-size: 14px; }

/* ---------- Downloads ---------- */
.downloads { padding: 72px 0 56px; }
.downloads h2, .licence h2 { font-size: clamp(30px, 6.5vw, 48px); font-weight: 800; }
.section__lede { margin-top: 12px; color: var(--muted); max-width: 62ch; font-size: 17px; }
.dlnote { margin-top: 18px; padding: 12px 16px; border: 1px solid rgba(242, 179, 61, .45); background: rgba(242, 179, 61, .1); color: #f6d48e; border-radius: var(--radius-sm); font-weight: 600; }
.dlgrid { display: grid; gap: 18px; margin-top: 30px; }
.dlcard { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s, transform .25s var(--ease); }
.dlcard:hover { border-color: rgba(210, 18, 46, .5); }
.dlcard__img img { width: 100%; aspect-ratio: 1600 / 670; object-fit: cover; }
.dlcard__body { padding: 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.dlcard__body h3 { font-size: 22px; font-weight: 750; }
.dlcard__meta { color: var(--muted); font-size: 14px; margin-top: -6px; }
.chips { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 12px; font-weight: 650; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: #cfd3da; }
.dlcard .btn--primary { margin-top: auto; }
.dlcard__link { color: var(--muted); font-size: 14px; text-align: center; text-underline-offset: 3px; }
.dlcard__link:hover { color: var(--text); }
.dlcard__hash { font-size: 13px; color: var(--faint); }
.dlcard__hash summary { cursor: pointer; padding: 4px 0; }
.dlcard__hash code { display: block; margin-top: 6px; padding: 10px; border-radius: 8px; background: rgba(0, 0, 0, .35); font: 12px/1.5 var(--mono); color: #c9ced6; word-break: break-all; overflow-wrap: anywhere; -webkit-user-select: all; user-select: all; }

.inzip { margin-top: 30px; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; background: rgba(255, 255, 255, .02); }
.inzip h3 { font-size: 13px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.inzip__list { margin: 0; display: grid; }
.inzip__list div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.inzip__list div:last-child { border-bottom: 0; }
.inzip__list dt { font-family: var(--mono); font-size: 14px; color: var(--text); }
.inzip__list dd { margin: 2px 0 0; color: var(--muted); font-size: 15px; }

/* ---------- Licence ---------- */
.licence { padding: 56px 0 72px; }
.licence__in { display: grid; gap: 26px; }
.licence p { color: #d0d4db; margin-top: 12px; max-width: 62ch; }
.licence a { color: var(--text); text-decoration-color: var(--red-2); text-underline-offset: 3px; }
.credit { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; align-self: start; }
.credit__label { font-size: 13px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 !important; }
.credit__text { font-family: var(--mono); font-size: 14px; padding: 14px; border-radius: 10px; background: rgba(0, 0, 0, .35); border: 1px dashed var(--line-2); color: var(--text) !important; overflow-wrap: anywhere; margin: 12px 0 14px !important; }
.credit__fine { font-size: 13px; color: var(--faint) !important; line-height: 1.55; margin-top: 18px !important; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 34px 0 calc(34px + env(safe-area-inset-bottom)); background: #0a0b0d; }
.footer__in { display: grid; gap: 20px; }
.footer__by { color: var(--muted); font-size: 14px; margin-top: 10px; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer__nav a { color: var(--muted); text-decoration: none; font-size: 14px; padding: 6px 0; }
.footer__nav a:hover { color: var(--text); }
.footer__copy { color: var(--faint); font-size: 12px; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(5, 6, 8, .96); display: flex; align-items: center; justify-content: center; padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); touch-action: pan-y; }
.lightbox[hidden] { display: none; }
.lightbox__fig { margin: 0; width: 100%; max-width: 1800px; padding: 0 8px; }
.lightbox__img { width: 100%; max-height: 82vh; max-height: 82svh; object-fit: contain; margin: 0 auto; }
.lightbox__cap { text-align: center; color: var(--muted); font-size: 14px; margin-top: 12px; padding: 0 56px; }
.lightbox__close, .lightbox__nav { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .08); cursor: pointer; font-size: 28px; line-height: 1; color: #fff; }
.lightbox__close { top: 12px; right: calc(12px + env(safe-area-inset-right)); }
.lightbox__nav { bottom: calc(18px + env(safe-area-inset-bottom)); }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255, 255, 255, .18); }
body.is-locked { overflow: hidden; }

/* Reveal on scroll (only when JS has marked the page) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: #fff; color: #111; font-weight: 650; font-size: 14px; padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); z-index: 300; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ================= Larger screens ================= */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .hero__facts { grid-template-columns: repeat(4, 1fr); }
  .thumb { flex-basis: 23%; }
  .lightbox__nav { top: 50%; bottom: auto; transform: translateY(-50%); }
  .lightbox__cap { padding: 0 8px; }
}
@media (min-width: 760px) {
  .model { padding: 96px 0; }
  .model__grid { grid-template-columns: 1.35fr 1fr; gap: 20px; }
  .dlgrid { grid-template-columns: 1fr 1fr; gap: 22px; }
  .inzip__list { grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .inzip__list div:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
  .licence__in { grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; }
  .footer__in { grid-template-columns: 1fr auto; align-items: start; }
  .footer__copy { grid-column: 1 / -1; }
  .card, .credit, .inzip { padding: 26px; }
}
/* three download cards: two columns with the odd last card laid out wide, then three columns */
@media (min-width: 760px) and (max-width: 1039.98px) {
  .dlgrid .dlcard:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; }
  .dlgrid .dlcard:last-child:nth-child(odd) .dlcard__img { flex: 0 0 50%; }
  .dlgrid .dlcard:last-child:nth-child(odd) .dlcard__img img { height: 100%; aspect-ratio: auto; }
}
@media (min-width: 1040px) {
  .dlgrid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  :root { --top: 68px; }
  .navtoggle { display: none; }
  .nav { position: static; height: auto; overflow: visible; flex-direction: row; align-items: center; gap: 6px; padding: 0; background: none; border: 0; visibility: visible; opacity: 1; transform: none; transition: none; }
  .nav a { padding: 8px 14px; font-size: 15px; font-weight: 600; color: var(--muted); border: 0; border-radius: 8px; }
  .nav a:hover { color: var(--text); }
  html.nav-open { overflow: visible; }
  .nav .nav__cta { margin: 0 0 0 8px; padding: 9px 20px; }
  .nav .nav__cta:hover { background: var(--red-2); }
  .hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding-top: 0; }
  .hero__bg { position: absolute; inset: 0 0 0 34%; height: auto; min-height: 0; max-height: none; }
  .hero__in { margin-top: 0; padding-top: calc(var(--top) + 80px); padding-bottom: 80px; }
  .hero__bg img { object-position: 37% 50%; }
  .hero__shade { inset: 0; height: auto; min-height: 0; max-height: none; background:
    linear-gradient(90deg, var(--bg) 0%, var(--bg) 34%, rgba(13, 14, 17, .55) 44%, rgba(13, 14, 17, 0) 58%),
    linear-gradient(0deg, var(--bg) 0%, rgba(13, 14, 17, 0) 24%),
    linear-gradient(180deg, rgba(13, 14, 17, .5) 0%, rgba(13, 14, 17, 0) 18%); }
  .hero h1 { max-width: 11ch; }
  .lede { max-width: 46ch; }
  .hero__actions .btn { flex: 0 0 auto; }
  .hero__facts { max-width: 720px; }
  .thumb { flex: 1 1 0; }
  .gallery__thumbs { overflow: visible; }
  .gallery__cap { font-size: 14px; padding: 34px 18px 14px; }
}

@media (hover: none) { .btn--primary:hover { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .topbar, .viewer, .lightbox, .hero__actions, .navtoggle { display: none !important; }
  body { background: #fff; color: #000; }
}
