/* cashbox.rocks — Kassenbon-Design
   Eine Schrift (Martian Mono, variabel in Breite und Stärke), eine Akzentfarbe (Logo-Cyan). */

@font-face {
  font-family: "Martian Mono";
  src: url("fonts/martian-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}

:root {
  --ink: #0a0e12;          /* Seitenhintergrund */
  --ink-2: #0e1419;        /* Player */
  --ink-line: #1f2a33;
  --chalk: #eef3f5;        /* Text auf Dunkel */
  --fog: #8696a2;          /* gedämpfter Text auf Dunkel */
  --paper: #f4f1e9;        /* Bonpapier */
  --print: #1b1c1e;        /* Druckfarbe */
  --print-2: #68665f;      /* blasser Druck */
  --cyan: #2cc3e8;         /* Logofarbe */
  --cyan-deep: #0a7fa0;    /* Cyan, lesbar auf Papier */
  --wave-idle: #36444f;
  --player-h: 88px;
  --mono: "Martian Mono", ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background:
    radial-gradient(1100px 700px at 12% -8%, rgba(44, 195, 232, .13), transparent 62%),
    var(--ink);
  background-attachment: fixed;
  color: var(--chalk);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
svg { fill: currentColor; display: block; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ───────── Seitenraster ───────── */

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px calc(var(--player-h) + 64px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 540px);
  gap: 72px;
  align-items: start;
}

/* ───────── Kopf (links, bleibt stehen) ───────── */

.mast {
  position: sticky;
  top: 0;
  height: calc(100vh - var(--player-h));
  height: calc(100svh - var(--player-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  container-type: inline-size;
  padding: 32px 0;
}

.mast__logo { width: 76px; height: 76px; }

.mast__word {
  margin: 30px 0 26px -0.045em;
  font-size: clamp(60px, 9vw, 150px);
  font-size: min(24cqw, 150px);
  font-weight: 800;
  font-stretch: 112.5%;
  line-height: .9;
  letter-spacing: -.02em;
}
.mast__word span { display: block; }
.mast__word b { color: var(--cyan); font-weight: inherit; margin-left: -.13em; }

.mast__tag {
  margin: 0;
  color: var(--fog);
  font-size: 12px;
  font-stretch: 100%;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.mast__tag b { color: var(--cyan); font-weight: 400; }

.mast__nav {
  margin-top: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.mast__nav a {
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid var(--ink-line);
  transition: border-color .15s, color .15s;
}
.mast__nav a span { color: var(--fog); margin-right: .7em; }
.mast__nav a:hover { color: var(--cyan); border-color: var(--cyan); }

/* ───────── Bon ───────── */

.strip {
  padding-top: 64px;
  filter: drop-shadow(0 26px 44px rgba(0, 0, 0, .6));
}

.receipt {
  --zig: 14px;
  background: linear-gradient(180deg, #f7f4ed, var(--paper) 140px);
  color: var(--print);
  padding: 40px 26px 46px;
  font-stretch: 78%;
  min-height: 60vh;
  -webkit-mask:
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--zig) 51% repeat-x,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--zig) 51% repeat-x;
          mask:
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--zig) 51% repeat-x,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--zig) 51% repeat-x;
}
.receipt :focus-visible { outline-color: var(--cyan-deep); }
.receipt ::selection { background: var(--cyan); color: var(--print); }

.r-head { text-transform: uppercase; letter-spacing: .06em; }
.r-head__row { display: flex; justify-content: space-between; gap: 12px; padding: 0 6px; white-space: nowrap; }
.r-head__row strong { font-weight: 700; font-stretch: 100%; letter-spacing: .1em; }
.r-head__cols {
  margin-top: 14px;
  padding: 7px 6px;
  border-block: 1px dashed var(--print);
  color: var(--print-2);
  font-size: 11px;
}

.r-note { margin: 28px 6px; color: var(--print-2); text-transform: uppercase; letter-spacing: .06em; }

.r-sec { scroll-margin-top: 20px; }
.r-sec__title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 30px 0 6px;
  padding: 7px 8px;
  background: var(--print);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  font-stretch: 100%;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.r-sec__title small { font-size: 11px; font-weight: 400; letter-spacing: .08em; opacity: .75; }

.items { list-style: none; margin: 0; padding: 0; }

.item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  --p: 0;
}
/* Textmarker: Grundton für die aktuelle Zeile, kräftiger Strich für den Fortschritt */
.item::before,
.item::after {
  content: "";
  position: absolute;
  inset: 3px 0;
  background: var(--cyan);
  opacity: 0;
  pointer-events: none;
}
.item::after { right: auto; width: calc(var(--p) * 100%); mix-blend-mode: multiply; transition: width .25s linear; }
.item:hover::before { opacity: .1; }
.item.is-current::before { opacity: .2; }
.item.is-current::after { opacity: .62; }

.item__play {
  all: unset;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 2.6em minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 9px 4px 9px 6px;
  cursor: pointer;
}
.item__play:focus-visible { outline: 2px solid var(--cyan-deep); outline-offset: -2px; }

.item__mark { position: relative; height: 1.45em; margin-top: 1px; color: var(--print-2); font-variant-numeric: tabular-nums; }
.item__ico { display: none; position: absolute; left: 0; top: 50%; translate: 0 -50%; color: var(--print); }
.item__ico svg { width: 15px; height: 15px; }
.item:hover .item__no, .item.is-current .item__no,
.item__play:focus-visible .item__no { visibility: hidden; }
.item:hover .item__ico--go, .item.is-current .item__ico--go,
.item__play:focus-visible .item__ico--go { display: block; }
.item.is-playing .item__ico--go { display: none; }
.item.is-playing .item__ico--eq { display: block; }

.eq { display: flex; align-items: flex-end; gap: 2px; width: 13px; height: 12px; }
.eq i { flex: 1; height: 100%; background: currentColor; transform-origin: bottom; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

.item__line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.item__title {
  font-size: 14px;
  font-weight: 650;
  font-stretch: 86%;
  letter-spacing: .015em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item__dots { flex: 1 1 14px; min-width: 14px; height: 0; border-bottom: 2px dotted var(--print); opacity: .32; translate: 0 -3px; }
.item__dur { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item__dur--link { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.item__sub { display: block; margin-top: 2px; color: var(--print-2); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.item.is-current .item__sub { color: var(--print); }
.item.is-broken .item__title { text-decoration: line-through; }

.item__dl {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  color: var(--print-2);
  transition: color .15s;
}
.item__dl svg { width: 17px; height: 17px; }
.item__dl:hover { color: var(--print); }
.item__dl--none { visibility: hidden; }

.item__panel { grid-column: 1 / -1; position: relative; z-index: 1; padding: 4px 6px 12px; }
.item__panel video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; }
.item__panel iframe { display: block; width: 100%; height: 60px; border: 0; }
.item.is-open::before { opacity: .2; }

/* Summen */
.r-total { margin-top: 30px; padding: 12px 6px 0; border-top: 1px dashed var(--print); text-transform: uppercase; letter-spacing: .05em; }
.r-total__row { display: grid; grid-template-columns: 1fr auto 6.5em; gap: 12px; padding: 2px 0; }
.r-total__row > :last-child { text-align: right; font-variant-numeric: tabular-nums; }
.r-total__row > :nth-child(2):not(:last-child) { color: var(--print-2); }
.r-total__row--sum {
  margin-top: 10px;
  padding: 10px 0;
  border-block: 1px dashed var(--print);
  font-size: 20px;
  font-weight: 800;
  font-stretch: 100%;
  letter-spacing: .04em;
  grid-template-columns: 1fr auto;
}
.r-total__row--due { margin-top: 10px; grid-template-columns: 1fr auto; }

.r-foot { margin-top: 34px; text-align: center; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; }
.r-foot svg { width: min(78%, 330px); height: 52px; margin: 0 auto 12px; fill: var(--print); }
.r-foot p { margin: 2px 0; }
.r-foot p + p { color: var(--print-2); }

/* ───────── Textseite (Essay) ───────── */

.strip--essay { max-width: 720px; margin: 0 auto; padding: 56px 12px 88px; }
.essay a { color: var(--cyan-deep); text-underline-offset: 3px; }
.essay__back { font-weight: 700; font-stretch: 100%; letter-spacing: .1em; text-decoration: none; }
.essay__title {
  margin: 38px 6px 30px;
  font-size: clamp(27px, 6.4vw, 44px);
  font-weight: 800;
  font-stretch: 100%;
  line-height: 1.04;
  letter-spacing: -.01em;
  text-transform: uppercase;
  text-wrap: balance;
}
.essay > p { margin: 0 6px .75em; font-size: 13.5px; font-stretch: 84%; line-height: 1.75; overflow-wrap: anywhere; }
.essay > p.gap { margin-top: 2em; }
.essay > p b { font-weight: 800; background: rgba(44, 195, 232, .45); padding: 0 .25em; }

/* ───────── Player ───────── */

.player {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10;
  height: calc(var(--player-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 28px env(safe-area-inset-bottom, 0px);
  display: grid;
  grid-template-columns: auto minmax(120px, 230px) minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 24px;
  background: rgba(14, 20, 25, .94);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  border-top: 1px solid var(--ink-line);
}

.player__transport { display: flex; align-items: center; gap: 6px; }

.btn {
  appearance: none;
  border: 0;
  background: none;
  color: var(--chalk);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
}
.btn svg { width: 22px; height: 22px; }
.btn:hover { background: rgba(255, 255, 255, .08); }
.btn:active { transform: scale(.94); }
.btn--play { width: 52px; height: 52px; background: var(--cyan); color: var(--ink); }
.btn--play:hover { background: #5cd4f1; }
.btn--play svg { width: 26px; height: 26px; }
.i-pause { display: none; }
.player.is-playing .i-play { display: none; }
.player.is-playing .i-pause { display: block; }

.player__meta { min-width: 0; }
.player__title {
  font-size: 14px;
  font-weight: 700;
  font-stretch: 90%;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player__sub {
  margin-top: 3px;
  color: var(--fog);
  font-size: 11px;
  font-stretch: 82%;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player.is-error .player__sub { color: #ff8a7a; }

.player__wave { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; min-width: 0; }
.player__time { min-width: 4.4em; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--fog); }
#t-cur { color: var(--cyan); text-align: right; }

.wave { position: relative; min-width: 0; }
.wave canvas { display: block; width: 100%; height: 46px; cursor: pointer; touch-action: none; border-radius: 2px; }
.wave__tip {
  position: absolute;
  bottom: calc(100% + 6px);
  translate: -50% 0;
  padding: 3px 7px;
  background: var(--chalk);
  color: var(--ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}

.player__extra { display: flex; align-items: center; gap: 10px; }
.vol { display: flex; align-items: center; gap: 8px; color: var(--fog); }
.vol svg { width: 20px; height: 20px; }
.vol input { width: 92px; accent-color: var(--cyan); cursor: pointer; }

/* ───────── Schmale Bildschirme ───────── */

@media (max-width: 1200px) {
  .page { padding-inline: 28px; gap: 48px; }
  .mast__nav { gap: 8px 22px; }
  .mast__nav a span { display: none; }
}

@media (max-width: 1020px) {
  :root { --player-h: 128px; }

  .page { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 12px calc(var(--player-h) + 36px); }

  .mast {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 14px;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 26px 6px 22px;
  }
  .mast__logo { width: 52px; height: 52px; grid-row: span 2; }
  .mast__word { margin: 0; font-size: 7.4vw; font-size: min(7.6cqw, 44px); line-height: 1.1; letter-spacing: -.03em; white-space: nowrap; }
  .mast__word span { display: inline; }
  .mast__tag { margin-top: 5px; font-size: 10px; letter-spacing: .1em; }
  .mast__nav { grid-column: 1 / -1; margin-top: 20px; gap: 6px 22px; font-size: 11px; }

  .strip { padding-top: 0; max-width: 560px; width: 100%; margin: 0 auto; }
  .receipt { padding: 34px 14px 42px; }

  .player {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "transport meta extra" "wave wave wave";
    align-content: center;
    row-gap: 8px;
    column-gap: 12px;
    padding-inline: 12px;
  }
  .player__transport { grid-area: transport; gap: 0; }
  .player__meta { grid-area: meta; }
  .player__wave { grid-area: wave; gap: 10px; }
  .player__extra { grid-area: extra; }
  .vol { display: none; }
  .btn--play { width: 46px; height: 46px; }
  .wave canvas { height: 46px; }   /* fingertaugliche Fläche zum Springen */
  .player__time { min-width: 3.6em; font-size: 11px; }
}

@media (max-width: 420px) {
  #prev { display: none; }
  .item__title, .item__dur { font-size: 13px; }
  .item__play { grid-template-columns: 2.4em minmax(0, 1fr); column-gap: 8px; }
  .item__dl { width: 32px; }
  .r-head__row strong { letter-spacing: .04em; }
}

@media (max-width: 380px) {
  /* Lange Titel umbrechen statt abschneiden; die Punktlinie entfällt dafür */
  .item__line { justify-content: space-between; }
  .item__title { white-space: normal; }
  .item__dots { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .eq i { animation: none; transform: scaleY(.7); }
  .eq i:nth-child(2) { transform: scaleY(1); }
  .eq i:nth-child(3) { transform: scaleY(.45); }
  .item::after, .btn { transition: none; }
}
