/* Bimmerlinks, version 5: pillars. A light page, white rounded cards, near-black bands, rows of cards,
   one sans face from the visitor's system. Written for the phone first; wider screens add columns. */
:root {
  --page: #eceae6; --card: #fff; --ink: #16171a; --mute: #5c5f66; --line: #dcdad5; --dark: #1a1a1c; --dark2: #26262a;
  --blue: #2146c7; --blue2: #18369e; --tag: #ffd84a; --film: #a9b5e6; --lamp: #2146c7;
  --sans: "Inter", "Helvetica Neue", Helvetica, "Segoe UI", Roboto, Arial, system-ui, sans-serif;
  --gut: 16px; --r: 18px;
}
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 17px/1.5 var(--sans); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.08; }
h1 { font-size: 40px; }
h2 { font-size: 30px; }
h3 { font-size: 18px; letter-spacing: -.01em; line-height: 1.25; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gut); }

/* bands and cards */
.band { padding: 12px 0; }
.band.dark { background: var(--dark); color: #fff; padding: 44px 0; margin: 12px 0; }
.card { background: var(--card); border-radius: var(--r); padding: 24px 20px; }
.card + .card { margin-top: 12px; }
.head { display: grid; gap: 14px; margin-bottom: 22px; }
.label { font-weight: 600; font-size: 17px; }
.lead { color: var(--mute); font-size: 17px; margin-top: 10px; max-width: 34em; }
.dark .lead { color: rgba(255, 255, 255, .68); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 28px; border-radius: 40px; background: var(--blue); color: #fff; font-weight: 500; font-size: 15px; text-decoration: none; transition: background .2s; }
.btn:hover { background: var(--blue2); }
.btn.link { background: none; color: var(--blue); padding: 0; gap: 8px; }
.btn.link:hover { background: none; text-decoration: underline; }
.btn.link i { font-style: normal; }
.quote { margin: 30px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; max-width: 24em; padding-left: 16px; border-left: 4px solid var(--blue); }
.dark .quote { border-color: var(--tag); }

/* pictures */
.ph { display: block; position: relative; overflow: hidden; border-radius: 12px; background: var(--line); }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.js .ph { cursor: zoom-in; }
@media (hover: hover) { .ph:hover img, a.tile:hover .ph img { transform: scale(1.04); } }

/* rows of tiles: swipe on the phone, columns on wide screens */
.row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 calc(var(--gut) * -1); padding: 0 var(--gut); scroll-padding: 0 var(--gut); }
.row::-webkit-scrollbar, .tabs::-webkit-scrollbar, .slides::-webkit-scrollbar { display: none; }
.card .row { margin: 0 -20px; padding: 0 20px; scroll-padding: 0 20px; }
.tile { flex: 0 0 72%; min-width: 0; scroll-snap-align: start; margin: 0; text-decoration: none; position: relative; }
.tile .ph { aspect-ratio: 4 / 3; }
.tile h3 { margin-top: 12px; }
.tile p { color: var(--mute); font-size: 15px; margin-top: 4px; }
.dark .tile p { color: rgba(255, 255, 255, .66); }
.tile ul { margin: 10px 0 0; padding-left: 18px; font-size: 14px; color: var(--mute); }
.tag { display: inline-block; margin-top: 10px; padding: 3px 8px; border-radius: 4px; background: var(--tag); color: #16171a; font-size: 12px; font-weight: 600; }
.nums { display: grid; align-content: center; gap: 10px; background: var(--dark2); color: var(--tag); padding: 20px; cursor: default; aspect-ratio: 4 / 3; }
.nums b { font-size: 19px; font-weight: 600; letter-spacing: .03em; }
figcaption { font-size: 14px; color: var(--mute); margin-top: 8px; }
.dark figcaption { color: rgba(255, 255, 255, .66); }
.bc figcaption span { display: block; font-weight: 600; font-size: 16px; color: #fff; }
.bc .km { display: block; font-size: 30px; font-weight: 600; letter-spacing: -.02em; color: #fff; font-variant-numeric: tabular-nums; }
.sub-head { margin: 28px 4px 14px; }

/* top bar and menu */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--blue); transform-origin: 0 50%; transform: scaleX(0); }
.top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 18px; padding: calc(10px + env(safe-area-inset-top)) max(var(--gut), env(safe-area-inset-right)) 10px max(var(--gut), env(safe-area-inset-left)); background: rgba(236, 234, 230, .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.brand { font-weight: 800; font-style: italic; font-size: 20px; letter-spacing: -.03em; text-decoration: none; text-transform: uppercase; }
.inline { display: none; gap: 22px; font-size: 14px; }
.inline a { text-decoration: none; }
.inline a:hover, .inline a.here { color: var(--blue); }
.burger { margin-left: auto; width: 46px; height: 46px; border: 0; background: none; display: grid; place-content: center; gap: 7px; padding: 0; }
.burger span { display: block; width: 24px; height: 2px; background: var(--ink); }
html:not(.js) .burger { display: none; }
.menu { border: 0; padding: 0; margin: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: none; overflow-y: auto; background: var(--page); color: var(--ink); }
.menu[open] { display: grid; animation: menu-in .3s ease-out; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.menu-in { align-self: start; max-width: 760px; width: 100%; margin: 0 auto; padding: 76px var(--gut) 32px; }
.menu-k { font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: -.03em; font-size: 20px; margin-bottom: 14px; }
.menu ol { list-style: none; margin: 0; padding: 6px 20px; background: var(--card); border-radius: var(--r); }
.menu li + li { border-top: 1px solid var(--line); }
.menu ol a { display: flex; align-items: baseline; gap: 14px; padding: 15px 0; text-decoration: none; }
.menu ol a b { font-size: 12px; font-weight: 600; color: var(--mute); min-width: 22px; }
.menu ol a span { font-size: 22px; font-weight: 600; letter-spacing: -.02em; display: flex; flex-direction: column; gap: 2px; }
.menu ol a small { font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--mute); }
.menu ol a.here, .menu ol a:hover { color: var(--blue); }
.menu-f { margin-top: 18px; font-size: 14px; color: var(--mute); padding: 0 4px; }
.menu-x { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: var(--gut); min-height: 46px; padding: 0 20px; border-radius: 40px; border: 1.5px solid var(--ink); background: none; font-size: 14px; font-weight: 500; }

/* hero */
.hero { padding-top: 4px; }
.ticker { overflow: hidden; position: relative; height: 1.5em; margin-top: 8px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.5; color: var(--blue); }
.ticker span { position: absolute; inset: 0 auto auto 0; white-space: nowrap; opacity: 0; transform: translateY(50%); transition: opacity .45s, transform .45s; }
.ticker span.on { opacity: 1; transform: none; }
.hero-media { display: grid; gap: 10px; margin: 0 -8px; }
.hero-photo { display: none; border-radius: 14px; overflow: hidden; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-vid { border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 5; background: #14152a; }
.hero-vid video { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; display: block; }
.counters { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 20px 0 0; padding: 0; }
.counters b { display: block; font-size: 30px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.counters span { display: block; font-size: 13px; color: var(--mute); line-height: 1.3; }

/* the 328i: slides in place */
.e36 .card:first-child { border-top: 6px solid var(--stage, #4f5b8d); transition: border-color .5s; }
.tabs { position: relative; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px 14px; }
.tabs button { flex: none; min-height: 44px; padding: 0 16px 0 9px; display: flex; align-items: center; gap: 9px; border: 1.5px solid var(--line); border-radius: 40px; background: none; font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .25s, color .25s, border-color .25s; }
.tabs b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff; font-size: 12px; font-weight: 600; }
.tabs b.light { color: #16171a; }
.tabs button[aria-selected=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.slides { position: relative; display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.st { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; display: grid; gap: 16px; align-content: start; }
.st .ph { aspect-ratio: 4 / 3; border-radius: 14px; }
.st .num { font-size: 13px; font-weight: 600; color: var(--mute); margin-bottom: 6px; }
.st h3 { font-size: 26px; letter-spacing: -.02em; }
.st .tx p:last-child { margin-top: 8px; color: var(--mute); max-width: 30em; }
.gctrl { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.gctrl button { width: 50px; height: 50px; border-radius: 50%; border: 1.5px solid var(--ink); background: none; font-size: 20px; }
.gctrl button:hover { background: var(--ink); color: #fff; }
.gctrl button:disabled { opacity: .25; pointer-events: none; }
.count { font-size: 14px; font-weight: 500; color: var(--mute); }
html:not(.js) .tabs, html:not(.js) .gctrl { display: none; }
.facts { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { padding: 7px 12px; border-radius: 40px; background: var(--page); font-size: 13px; font-weight: 500; }
.layers { display: grid; gap: 18px; }
.layers h3 { font-size: 24px; letter-spacing: -.02em; margin-top: 10px; }
.hint { color: var(--blue); font-size: 13px; font-weight: 600; margin: 10px 0 12px; }
.texts { display: grid; }
.lt { grid-area: 1 / 1; color: var(--mute); font-size: 16px; }
.lt b { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; margin-bottom: 4px; }
.lt i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .25); }
.js .lt { opacity: 0; visibility: hidden; transition: opacity .3s; }
.js .lt.on { opacity: 1; visibility: visible; }
html:not(.js) .lt { grid-area: auto; margin-bottom: 10px; }
.pile { display: flex; flex-direction: column-reverse; gap: 4px; }
.bar { height: 36px; border: 0; border-radius: 6px; background: var(--c); text-align: left; padding: 0 12px; transition: transform .3s, box-shadow .3s; }
.bar span { font-size: 12px; font-weight: 600; line-height: 36px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); opacity: 0; transition: opacity .3s; }
.bar.on span, .bar:hover span { opacity: 1; }
.bar.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--blue); }

/* x5 */
.x5 .head { margin-bottom: 18px; }
.mods { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.mod { min-height: 44px; padding: 0 16px; border-radius: 40px; border: 1.5px solid var(--line); background: none; font-size: 14px; font-weight: 500; transition: background .2s, color .2s, border-color .2s; }
.mod.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.mtext { display: grid; margin-top: 14px; min-height: 3em; }
.mt { grid-area: 1 / 1; font-size: 19px; font-weight: 500; letter-spacing: -.01em; line-height: 1.3; }
.js .mt { opacity: 0; transition: opacity .35s; }
.js .mt.on { opacity: 1; }
html:not(.js) .mt { grid-area: auto; }
.pics .ph { flex: 0 0 72%; aspect-ratio: 4 / 3; scroll-snap-align: start; }

/* thanks */
.split { display: grid; gap: 20px; }
.split .head { margin-bottom: 0; }
.split h2 { font-size: 26px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair figure { margin: 0; }
.pair .ph { aspect-ratio: 3 / 4; }

/* footer */
footer { background: var(--dark); color: #fff; padding: 40px 0 34px; margin-top: 12px; }
.bye { font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; max-width: 26em; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 22px 0 0; font-size: 14px; }
footer nav a { text-decoration: none; color: rgba(255, 255, 255, .75); }
footer nav a:hover { color: #fff; }
.small { font-size: 13px; color: rgba(255, 255, 255, .55); max-width: 46em; margin-top: 22px; }

/* Impressum, Datenschutz */
.legal-page main { padding: 24px 0 40px; }
.legal { max-width: 760px; background: var(--card); border-radius: var(--r); padding: 28px 22px; margin: 0 auto; }
.legal-page .wrap.legal { padding: 28px 22px; width: calc(100% - 2 * var(--gut)); }
.legal h1 { font-size: 34px; margin-bottom: 12px; }
.legal h2 { font-size: 19px; margin: 28px 0 6px; }
.legal p { margin: 0 0 10px; }
.legal .stand { color: var(--mute); font-size: 14px; margin-top: 24px; }
.todo { background: var(--tag); padding: 1px 6px; border-radius: 3px; font-weight: 600; font-size: .85em; }
.legal-page .now { margin-left: auto; font-size: 14px; }
.legal-page .now a { text-decoration: none; color: var(--blue); }

/* under construction page */
.wip main { padding-bottom: 24px; }
.wip-pic { margin: 0; }
.wip-pic .ph { aspect-ratio: 4 / 3; cursor: default; }
@media (min-width: 760px) { .wip-pic .ph { aspect-ratio: 21 / 9; } .wip-pic figcaption { padding-left: 194px; } }
/* picture viewer */
.lb { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; color: #fff; }
.lb::backdrop { background: rgba(12, 12, 14, .95); }
.lb[open] { display: grid; grid-template-rows: 1fr auto; place-items: center; }
.lb figure { margin: 0; text-align: center; padding: 60px 12px 0; max-height: 100%; }
.lb img { max-height: calc(100vh - 170px); max-height: calc(100svh - 170px); margin: 0 auto; border-radius: 8px; }
.lb figcaption { color: rgba(255, 255, 255, .8); max-width: 40em; margin: 12px auto 0; }
.lb .nav { display: flex; align-items: center; gap: 16px; padding: 10px 16px 22px; font-size: 14px; }
.lb button { background: none; border: 1.5px solid rgba(255, 255, 255, .5); color: #fff; min-height: 44px; padding: 0 18px; border-radius: 40px; font-size: 14px; }
.lb .x { position: absolute; top: 12px; right: 12px; }

/* wider screens */
@media (min-width: 760px) {
  :root { --gut: 24px; }
  body { font-size: 18px; }
  h1 { font-size: 60px; } h2 { font-size: 44px; } h3 { font-size: 19px; }
  .card { padding: 36px; }
  .band.dark { padding: 72px 0; }
  .head { grid-template-columns: 170px 1fr; gap: 24px; margin-bottom: 34px; }
  .head h1, .head h2 { max-width: 15em; }
  .lead { font-size: 19px; }
  .row, .card .row { display: grid; overflow: visible; margin: 0; padding: 0; }
  .row.three { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .row.four { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .row.pics { grid-template-columns: repeat(5, 1fr); gap: 12px; }
  .pics .ph { aspect-ratio: 1; }
  .inline { display: flex; }
  .brand { font-size: 22px; }
  .hero-media { grid-template-columns: 2.2fr 1fr; height: 460px; margin: 0; }
  .hero-photo { display: block; }
  .hero-vid { aspect-ratio: auto; }
  .ticker { font-size: 26px; }
  .counters { display: flex; gap: 56px; margin-top: 28px; padding-left: 194px; }
  .counters b { font-size: 40px; }
  .tabs { margin: 0; padding: 2px 0 16px; }
  .gal, .facts { margin-left: 194px; }
  .st { grid-template-columns: 1.3fr 1fr; gap: 36px; align-items: center; }
  .st .ph { aspect-ratio: 3 / 2; }
  .st h3 { font-size: 36px; }
  .layers { grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
  .layers h3 { font-size: 32px; }
  .quote { font-size: 30px; margin: 44px 0 0 194px; }
  .split { grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
  .split h2 { font-size: 34px; }
  .sub-head { margin: 44px 0 18px; }
  .bye { font-size: 26px; }
  .menu ol a span { font-size: 28px; flex-direction: row; align-items: baseline; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-vid video { display: none; }
  .hero-vid { background: url("../video/hero.jpg") center / cover; }
  .ticker span { position: static; display: none; transform: none; opacity: 1; }
  .ticker span.on { display: block; }
}
