@font-face { font-family: 'Archivo'; src: url('/fonts/archivo.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/instrument-sans.woff2') format('woff2'); font-weight: 400 700; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/fonts/plex-mono-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --bg: #ECEFF3;
  --surface: #F7F8FA;
  --ink: #14161B;
  --muted: #5B6270;
  --line: #D3D8E0;
  --shelf: #B9C0CA;
  --bluray: #0A5BD3;
  --dvd: #2A2C31;
  --uhd: #111215;
  --silver: #AEB6C1;
  --sticker: #FFD43B;
  --sticker-ink: #241C00;
  --ok: #17803D;
  --shadow: 0 1px 2px rgb(20 22 27 / 0.06), 0 8px 24px -12px rgb(20 22 27 / 0.18);

  --display: 'Archivo', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --radius: 10px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1014;
    --surface: #171A20;
    --ink: #E9ECF1;
    --muted: #9AA2AF;
    --line: #2A2F38;
    --shelf: #3A414D;
    --bluray: #3D84F0;
    --dvd: #34373E;
    --uhd: #050506;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 30px -14px rgb(0 0 0 / 0.7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
  font-feature-settings: 'tnum' 1;
}
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter) 64px; outline: none; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--bluray); outline-offset: 2px; border-radius: 4px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip:focus { top: 8px; }

/* ── Top bar ───────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.top.scrolled { border-bottom-color: var(--line); }
.wordmark {
  display: flex; align-items: flex-end; gap: 10px;
  font: 800 22px/1 var(--display); font-stretch: 112%;
  letter-spacing: -0.02em; text-decoration: none;
}
.wordmark-spines { display: flex; align-items: flex-end; gap: 2px; padding-bottom: 2px; border-bottom: 2px solid var(--shelf); }
.wordmark-spines i { display: block; width: 5px; border-radius: 1px; }
.wordmark-spines i:nth-child(1) { height: 16px; background: var(--dvd); }
.wordmark-spines i:nth-child(2) { height: 19px; background: var(--bluray); }
.wordmark-spines i:nth-child(3) { height: 14px; background: var(--uhd); box-shadow: inset 0 3px 0 var(--silver); }
.top-search { flex: 1; max-width: 360px; margin-left: auto; }
.top-search input { width: 100%; }
body[data-route='home'] .top-search { visibility: hidden; }

input[type='search'] {
  appearance: none;
  height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface);
}
input[type='search']::placeholder { color: var(--muted); }

.zettel-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 8px 0 16px;
  border: 0; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.zettel-count {
  min-width: 24px; height: 24px; padding: 0 7px;
  display: grid; place-items: center;
  border-radius: 999px; background: color-mix(in srgb, var(--bg) 20%, transparent);
  font-size: 13px;
}
.zettel-count:not([data-count='0']) { background: var(--sticker); color: var(--sticker-ink); }
.zettel-count.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.35); } }

/* ── Type ──────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.lede { color: var(--muted); max-width: 46ch; margin: 12px 0 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .86em; }

/* ── Home ──────────────────────────────────────────── */
.hero { padding: clamp(40px, 9vw, 112px) 0 clamp(32px, 6vw, 64px); }
.hero h1 {
  font-size: clamp(40px, 8.4vw, 104px); line-height: .92;
  font-weight: 850; font-stretch: 118%; letter-spacing: -0.045em;
  max-width: 11ch;
}
.hero h1 em { font-style: normal; font-stretch: 62%; font-weight: 700; letter-spacing: -0.02em; color: var(--bluray); }
.big-search { display: flex; gap: 8px; margin-top: 32px; max-width: 640px; }
.big-search input { flex: 1; height: 56px; font-size: 18px; padding: 0 22px; border-width: 2px; border-color: var(--ink); }
.big-search button, .button {
  height: 56px; padding: 0 24px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 600; cursor: pointer;
}
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; color: var(--muted); font-size: 14px; }
.chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; cursor: pointer; text-decoration: none; color: var(--ink); font-size: 14px;
}
.chip:hover { border-color: var(--ink); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 48px 0 8px; }
.section-head h2 { font-size: 22px; font-stretch: 105%; }

/* ── Shelf & spines (the signature) ─────────────────── */
/* Shelves sit side by side like a wall unit; every row of a shelf gets its own board. */
.shelves { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 28px 44px; margin-top: 20px; }
.shelf-group { max-width: 100%; }
.shelf {
  --row: 286px; --board: 10px; --gap: 18px;
  display: flex; flex-wrap: wrap; row-gap: var(--gap); column-gap: 3px;
  width: fit-content; max-width: 100%; min-width: 120px;
  padding: 0 12px;
  background: repeating-linear-gradient(to bottom,
    transparent 0 calc(var(--row) - var(--board)),
    var(--shelf) calc(var(--row) - var(--board)) var(--row),
    transparent var(--row) calc(var(--row) + var(--gap)));
}
.slot { height: var(--row); padding-bottom: var(--board); display: flex; align-items: flex-end; }
.shelf-label { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 0 12px; }

.spine {
  --w: 40px; --h: 250px; --c: var(--dvd); --t: #fff;
  position: relative; flex: none;
  width: var(--w); height: var(--h);
  scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center;
  border-radius: 3px 3px 1px 1px;
  background: var(--c); color: var(--t);
  text-decoration: none;
  box-shadow: inset -3px 0 0 rgb(0 0 0 / .18), inset 2px 0 0 rgb(255 255 255 / .08);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1.2);
  cursor: pointer;
}
.spine:hover, .spine:focus-visible { transform: translateY(-16px) rotate(-1.5deg); }
.spine:focus-visible { outline-offset: 3px; }
.spine[data-format='bd'] { --c: var(--bluray); }
.spine[data-format='bd3d'] { --c: var(--bluray); }
.spine[data-format='uhd'] { --c: var(--uhd); }
.spine[data-format='dvd'] { --c: var(--dvd); --w: 46px; }
.spine[data-case='steel'] { --c: linear-gradient(90deg, #6F7782, #C9D0D8 35%, #8A929D 70%, #5E656F); --t: #111; }
.spine[data-case='book'] { --w: 54px; --c: #E7E2D8; --t: #222; box-shadow: inset -4px 0 0 rgb(0 0 0 / .12); }

.spine-band {
  width: 100%; padding: 6px 0 5px; text-align: center; flex: none;
  font: 800 10px/1 var(--display); font-stretch: 80%; letter-spacing: .06em; text-transform: uppercase;
  border-bottom: 1px solid rgb(255 255 255 / .2);
}
.spine[data-format='bd'] .spine-band, .spine[data-format='bd3d'] .spine-band { background: rgb(255 255 255 / .14); }
.spine[data-format='uhd'] .spine-band { background: var(--silver); color: #111; }
.spine[data-case='steel'] .spine-band, .spine[data-case='book'] .spine-band { background: rgb(0 0 0 / .1); border-color: rgb(0 0 0 / .1); }

/* European spines read bottom to top. */
.spine-text {
  flex: 1; min-height: 0; padding: 10px 0;
  writing-mode: vertical-rl; transform: rotate(180deg);
  display: flex; align-items: center; gap: 10px;
  overflow: hidden; white-space: nowrap;
}
.spine-title { font: 700 14px/1 var(--display); font-stretch: 72%; letter-spacing: .01em; }
.spine-label { font: 600 12.5px/1 var(--display); font-stretch: 68%; overflow: hidden; text-overflow: ellipsis; }
.spine-title + .spine-label { font-weight: 500; font-size: 11.5px; opacity: .78; }
.spine-price {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%) rotate(-6deg);
  padding: 3px 5px; border-radius: 3px;
  background: var(--sticker); color: var(--sticker-ink);
  font: 800 11px/1 var(--display); font-stretch: 80%;
  box-shadow: 0 1px 2px rgb(0 0 0 / .25);
}

.shelf-empty { align-self: center; margin: 0; max-width: 32ch; color: var(--muted); font-size: 15px; padding: 0 0 24px; }

/* ── Search results ─────────────────────────────────── */
.page-head { padding: 40px 0 8px; }
.page-head h1 { font-size: clamp(30px, 5vw, 52px); font-stretch: 112%; font-weight: 800; line-height: 1; }
.films { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 20px; margin-top: 28px; }
.film { text-decoration: none; display: flex; flex-direction: column; gap: 10px; }
.film-cover {
  aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden;
  background: var(--line); box-shadow: var(--shadow);
  transition: transform .2s;
}
.film-cover img { width: 100%; height: 100%; object-fit: cover; }
.film:hover .film-cover, .film:focus-visible .film-cover { transform: translateY(-4px) rotate(-1deg); }
.film-title { font-weight: 600; line-height: 1.25; }
.film-meta { font-size: 13px; color: var(--muted); }

/* ── Film ──────────────────────────────────────────── */
.film-head { display: grid; grid-template-columns: 120px 1fr; gap: 24px; align-items: end; padding: 40px 0 8px; }
.film-head img { border-radius: 6px; box-shadow: var(--shadow); aspect-ratio: 2/3; object-fit: cover; width: 120px; background: var(--line); }
.film-head h1 { font-size: clamp(32px, 6vw, 64px); font-weight: 850; font-stretch: 115%; line-height: .95; letter-spacing: -0.04em; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 16px; border-radius: 2px; background: var(--c); display: inline-block; }

/* ── Edition ───────────────────────────────────────── */
.edition { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: clamp(24px, 5vw, 56px); padding-top: 40px; align-items: start; }
.case {
  position: relative; border-radius: 6px; aspect-ratio: 0.8;
  background: var(--line) center / cover no-repeat;
  box-shadow: var(--shadow);
}
.case[data-format='bd'], .case[data-format='bd3d'] { border-top: 18px solid var(--bluray); aspect-ratio: .78; }
.case[data-format='uhd'] { border-top: 18px solid var(--uhd); aspect-ratio: .78; }
.case[data-format='dvd'] { border-left: 6px solid var(--dvd); aspect-ratio: .71; }
.case .case-band { position: absolute; top: -15px; left: 0; right: 0; text-align: center; font: 800 11px/1 var(--display); font-stretch: 80%; color: #fff; letter-spacing: .08em; }
.case[data-format='uhd'] .case-band { color: var(--silver); }

.sticker {
  position: absolute; right: -14px; bottom: 22px;
  min-width: 96px; padding: 10px 14px 9px;
  background: var(--sticker); color: var(--sticker-ink);
  border-radius: 8px;
  transform: rotate(-7deg);
  box-shadow: 0 2px 0 rgb(0 0 0 / .08), 0 10px 18px -8px rgb(0 0 0 / .4);
  text-align: center;
  animation: stick .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.sticker::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(135deg, rgb(255 255 255 / .35), transparent 45%); pointer-events: none; }
.sticker small { display: block; font: 600 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .04em; opacity: .75; }
.sticker strong { display: block; font: 850 30px/1.05 var(--display); font-stretch: 85%; letter-spacing: -0.02em; }
.sticker span { display: block; font-size: 11px; font-weight: 600; }
@keyframes stick { from { opacity: 0; transform: rotate(-20deg) scale(1.3) translateY(-12px); } }

.edition-info h1 { font-size: clamp(30px, 5vw, 54px); font-weight: 850; font-stretch: 112%; line-height: .98; letter-spacing: -0.035em; }
.edition-info .release { font-size: 19px; margin: 8px 0 0; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.facts dt { display: inline; }
.facts dd { display: inline; margin: 0 0 0 4px; color: var(--ink); }

.prices { margin-top: 32px; border-top: 2px solid var(--ink); }
.price-row { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: center; }
.shop-name { font: 800 18px/1.1 var(--display); font-stretch: 105%; }
.shop-ship { display: block; font: 400 12px/1.4 var(--body); color: var(--muted); margin-top: 3px; font-stretch: 100%; }
.offers { display: flex; flex-wrap: wrap; gap: 8px; }
.offer {
  display: flex; flex-direction: column; min-width: 92px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.offer:hover { border-color: var(--ink); transform: translateY(-2px); }
.offer small { font-size: 12px; color: var(--muted); }
.offer strong { font: 750 20px/1.2 var(--display); font-stretch: 90%; }
.offer.best { background: var(--sticker); border-color: var(--sticker); color: var(--sticker-ink); }
.offer.best small { color: inherit; opacity: .75; }
.offer.dimmed { opacity: .45; }
.row-note { color: var(--muted); font-size: 14px; }
.row-note button { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.asking { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.asking::before { content: ''; width: 48px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--line) 25%, var(--muted) 50%, var(--line) 75%) 0 0 / 200% 100%; animation: shimmer 1.1s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.add { margin-top: 28px; padding: 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.add h2 { font-size: 18px; font-stretch: 105%; }
.add p { margin: 4px 0 14px; color: var(--muted); font-size: 14px; }
.grades { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.grades label { position: relative; }
.grades input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.grades span { display: block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; }
.grades input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.grades input:focus-visible + span { outline: 3px solid var(--bluray); outline-offset: 2px; }
.button { height: 46px; }
.button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--ink); }

.notice { margin-top: 24px; padding: 16px 18px; border-left: 4px solid var(--sticker); background: var(--surface); border-radius: 0 10px 10px 0; }

/* ── Einkaufszettel ────────────────────────────────── */
.zettel { position: fixed; inset: 0; z-index: 40; display: flex; justify-content: flex-end; background: rgb(10 12 16 / .35); }
.zettel[hidden] { display: none; }
.zettel-sheet {
  width: min(520px, 100%); height: 100%; overflow-y: auto;
  background: var(--surface); box-shadow: -20px 0 40px -20px rgb(0 0 0 / .4);
  animation: slide .28s cubic-bezier(.2, .8, .2, 1);
}
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.zettel-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 1; }
.zettel-head h2 { font-size: 24px; font-stretch: 110%; font-weight: 850; }
.icon-button { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 22px; line-height: 1; cursor: pointer; }
.zettel-body { padding: 8px 22px 40px; }
.total { display: flex; align-items: baseline; justify-content: space-between; padding: 18px 0 6px; }
.total strong { font: 850 40px/1 var(--display); font-stretch: 90%; letter-spacing: -0.03em; }
.saving { font-size: 14px; color: var(--ok); margin: 0 0 8px; }
.split { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.split-head { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; background: var(--bg); }
.split-head h3 { font-size: 17px; }
.split-head span { font-size: 13px; color: var(--muted); }
.split ul { list-style: none; margin: 0; padding: 0; }
.split li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.split li a { text-decoration: none; font-weight: 600; }
.split li a:hover { text-decoration: underline; }
.split li .muted { grid-column: 1; font-size: 12px; }
.split li .amount { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 700; }
.split li.ship { color: var(--muted); }
.zettel-items { margin-top: 28px; }
.zettel-items h3 { font-size: 15px; margin-bottom: 6px; }
.zettel-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.zettel-item select { padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.zettel-item .remove { border: 0; background: none; color: var(--muted); cursor: pointer; text-decoration: underline; font-size: 13px; }
.zettel-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.zettel-empty { padding: 40px 0; color: var(--muted); }
.zettel-empty strong { display: block; color: var(--ink); font: 800 20px/1.2 var(--display); margin-bottom: 6px; }

/* ── Text pages ────────────────────────────────────── */
.prose { max-width: 68ch; padding-top: 40px; }
.prose h1 { font-size: clamp(32px, 5vw, 48px); font-stretch: 112%; font-weight: 850; margin-bottom: 20px; }
.prose h2 { font-size: 20px; margin: 28px 0 6px; }
.prose p { margin: 0 0 12px; }

/* ── Footer & toast ────────────────────────────────── */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; padding: 28px var(--gutter); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot p { margin: 0; max-width: 70ch; }
.foot nav { display: flex; gap: 18px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  transform: translate(-50%, 140%); opacity: 0;
  padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .3s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.error-state { padding: 60px 0; }
.error-state h1 { font-size: 32px; margin-bottom: 8px; }

/* ── Small screens ─────────────────────────────────── */
@media (max-width: 720px) {
  .top { gap: 10px; flex-wrap: wrap; }
  .top-search { order: 3; flex-basis: 100%; max-width: none; }
  body[data-route='home'] .top-search { display: none; }
  .zettel-toggle { margin-left: auto; }
  .big-search { flex-direction: column; }
  .big-search button { height: 50px; }
  .film-head { grid-template-columns: 84px 1fr; gap: 16px; }
  .film-head img { width: 84px; }
  .edition { grid-template-columns: 1fr; }
  .case { max-width: 220px; }
  .price-row { grid-template-columns: 1fr; gap: 10px; }
  .films { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .shelf { --row: 256px; }
  .spine { --h: 220px; }
  .shelves { gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
