/* Nachtkorn Backkollektiv — Beispiel-Website, Stil aus MXL-023 */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/sg-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/sg-latin-ext-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/sg-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/sg-latin-ext-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --canvas: #fbfbf9;
  --ink: #101010;
  --rest: #75726f;          /* Ruhezeilen unter 24px: 4,6:1 */
  --hush: #e3e1e1;          /* nur Flächen und Spuren, nie Text */
  --tile: #efede8;
  --mid: #434343;           /* Steuerleiste der Ofenplatte */
  --ember: #dc5e70;         /* der Nachtring, einziger Farbton */
  --signal: #4a90e2;        /* Fokus und der Knopf „Von vorn“ */
  --on-ink: #fbfbf9;
  --on-ink-rest: #b8b5b2;

  --t: 1.125rem;            /* die eine Größe */
  --t-pill: 1.125rem;
  --lh: 1.42;
  --track: -0.01em;

  --gutter: 16px;
  --img-col: 0px;
  --text-col: 100%;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px; --s6: 48px; --s8: 64px; --s10: 80px; --s12: 96px; --s15: 120px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (min-width: 768px) {
  :root { --t: 1.3125rem; --gutter: 24px; }
}
@media (min-width: 960px) {
  :root {
    --t: 1.5rem;            /* 24px: große Schrift, Ruhegrau darf 3:1 */
    --gutter: 32px;
    --img-col: 200px;
    --text-col: 600px;
  }
}
@media (min-width: 1280px) {
  :root { --img-col: 256px; --text-col: 650px; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 112px;
  scrollbar-color: var(--ink) var(--canvas);
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  font-size: var(--t);
  line-height: var(--lh);
  letter-spacing: var(--track);
  font-feature-settings: "ss01" 0;
  caret-color: var(--ember);
}

::selection { background: var(--ink); color: var(--canvas); }

h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
h1, h2, h3 { font-size: inherit; font-weight: 600; letter-spacing: inherit; line-height: inherit; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--hush);
  transition: text-decoration-color 160ms var(--ease-out);
}
a:hover { text-decoration-color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: fixed;
  left: var(--gutter);
  top: 12px;
  z-index: 100;
  transform: translateY(-160%);
  background: var(--ink);
  color: var(--canvas);
  padding: 10px 20px;
  border-radius: 999px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.skip:focus { transform: none; }

/* ---------- Kopf: Wortzeichen links, Pillen rechts ---------- */

.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: var(--s2) var(--gutter);
  pointer-events: none;
}
.bar > * { pointer-events: auto; }

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-decoration: none;
  font-size: var(--t-pill);
  background: var(--canvas);
  padding: 0 14px 0 6px;
  border-radius: 999px;
}
.mark svg { width: 30px; height: 30px; flex: none; }

.bar__end { display: flex; gap: var(--s1); align-items: center; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: var(--t-pill);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out), border-color 180ms var(--ease-out);
}
.pill:hover { background: var(--ink); color: var(--canvas); }
.pill[aria-current="page"] { background: var(--ink); color: var(--canvas); }
.pill--signal { border-color: var(--signal); }
.pill--signal:hover { background: var(--signal); border-color: var(--signal); color: var(--ink); }
.pill:disabled, .pill[aria-disabled="true"] { border-color: var(--hush); color: var(--rest); background: var(--canvas); cursor: not-allowed; }
@media (hover: none) {
  .pill:active { background: var(--ink); color: var(--canvas); }
}

/* Seitenmenü als <details>: geht auch ohne JavaScript */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { background: var(--ink); color: var(--canvas); }
.menu__sheet {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  gap: var(--s1);
  justify-items: end;
}
.menu__sheet .pill { min-width: 0; }

@media (max-width: 559.98px) {
  .bar__order { display: none; }
}

/* ---------- Raster: schmale Bildspalte, eine Textspalte ---------- */

main { display: block; }

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 0 var(--gutter);
}
@media (min-width: 960px) {
  .row {
    grid-template-columns: minmax(0, 24px) var(--img-col) minmax(0, var(--text-col)) minmax(0, 1fr);
    column-gap: 40px;
  }
  .row > .text { grid-column: 3; }
  .row > .aside { grid-column: 2; grid-row: 1 / span 20; }
}

.text > * + * { margin-top: 1em; }
.text h2 + * { margin-top: 0; }
.text .quiet { color: var(--rest); }

.section { padding-top: var(--s12); }
@media (min-width: 960px) { .section { padding-top: var(--s15); } }

.lead { padding-top: 136px; }
@media (min-width: 960px) { .lead { padding-top: 168px; } }

/* ---------- Ofenplatte (Startseite) ---------- */

.oven {
  position: relative;
  height: 170vh;
  height: 170svh;
}
.oven__stick {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: grid;
  align-items: center;
  padding: 80px var(--gutter) var(--s3);
}
.plate {
  --shrink: 0;
  position: relative;
  width: 100%;
  max-width: 1376px;
  margin-inline: auto;
  height: 100%;
  max-height: 860px;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: 16px;
  transform: scale(calc(1 - var(--shrink) * var(--shrink-by, 0.2)));
  transform-origin: 50% 40%;
  will-change: transform;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
}
@media (max-width: 767.98px) {
  .plate { --shrink-by: 0; }
}

.plate__stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  gap: var(--s3);
  padding: var(--s4) var(--s3) var(--s2);
  min-height: 0;
}
@media (min-width: 960px) {
  .plate__stage {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    padding: var(--s6) var(--s8);
    gap: var(--s8);
  }
}

.ring {
  width: min(64vmin, 520px);
  max-height: 100%;
  aspect-ratio: 1;
  position: relative;
}
@media (max-width: 959.98px) {
  .ring { width: min(72vw, 40svh, 360px); }
}
.ring svg { width: 100%; height: 100%; overflow: visible; }
.ring__track { stroke: var(--mid); }
.ring__tick { stroke: var(--on-ink-rest); }
.ring__arc {
  stroke: var(--ember);
  transition: stroke-dashoffset 600ms var(--ease-out);
}
.ring__dot { fill: var(--ember); transition: transform 600ms var(--ease-out); }
.ring__clock {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 2px;
}
.ring__time { font-weight: 600; font-size: var(--t); }
.ring__label { color: var(--on-ink-rest); font-size: var(--t-pill); }

.plate__now { max-width: 30ch; justify-self: start; }
@media (max-width: 959.98px) { .plate__now { justify-self: center; text-align: center; } }
.plate__now p + p { margin-top: 0.6em; }
.plate__now .dim { color: var(--on-ink-rest); }
.plate__now [data-crew] { color: var(--on-ink-rest); }

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1) var(--s2);
  margin: 0 var(--s2) var(--s2);
  padding: var(--s1);
  background: var(--mid);
  border-radius: 999px;
}
@media (max-width: 559.98px) {
  .controls { border-radius: 28px; }
}
.controls .pill {
  background: transparent;
  color: var(--on-ink);
  border-color: var(--on-ink);
  min-height: 44px;
  padding: 0 18px;
}
.controls .pill:hover { background: var(--on-ink); color: var(--ink); }
.controls .pill svg { width: 14px; height: 14px; }
.controls__scrub {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  padding: 0 var(--s1);
}
.controls__scrub label { color: var(--on-ink-rest); font-size: var(--t-pill); white-space: nowrap; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 44px;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--on-ink-rest); border-radius: 4px; }
input[type="range"]::-moz-range-track { height: 4px; background: var(--on-ink-rest); border-radius: 4px; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px; margin-top: -10px;
  border-radius: 50%;
  background: var(--ember);
  border: 3px solid var(--on-ink);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ember);
  border: 3px solid var(--on-ink);
}
input[type="range"]:focus-visible { outline-offset: 0; }

.no-js .controls { display: none; }

/* ---------- Leuchtende Liste: Ruhe grau, eine Zeile schwarz ---------- */

.lit { margin-top: var(--s3); }
.lit li { padding: 0.18em 0; transition: color 220ms var(--ease-out); }
.lit li + li { margin-top: 0; }
.js .lit li { color: var(--rest); }
.js .lit li.is-on { color: var(--ink); }
.lit .cursor {
  display: inline-block;
  width: 0.08em;
  height: 1em;
  margin-left: 1px;
  vertical-align: -0.12em;
  background: var(--ember);
  opacity: 0;
}
.lit li.is-typing .cursor { opacity: 1; }
.lit .ch { opacity: 1; }
.lit .ch.is-hidden { opacity: 0; }

.aside { display: none; }
.aside__frame { position: relative; }
@media (min-width: 960px) {
  .aside { display: block; }
  .aside__frame {
    position: sticky;
    top: calc(50vh - 160px);
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 12px;
    overflow: hidden;
    background: var(--tile);
    margin-top: var(--s3);
  }
  .aside__frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 280ms var(--ease-out);
  }
  .aside__frame img.is-on { opacity: 1; }
  .no-js .aside__frame img:first-child { opacity: 1; }
}

/* kleines Bild in der Spalte auf schmalen Bildschirmen */
.inline-figure {
  width: min(256px, 64%);
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  overflow: hidden;
  background: var(--tile);
}
.inline-figure img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 960px) { .inline-figure { display: none; } }

/* ---------- Pillenwand (Partner, Seiten) ---------- */

.pills { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s3); }
.pills li { margin: 0; }

/* ---------- Tabellen und Datenreihen ---------- */

.facts { display: grid; gap: 0.15em 1.2em; grid-template-columns: max-content minmax(0, 1fr); }
.facts dt { color: var(--rest); }
.facts dd { margin: 0; }
@media (max-width: 559.98px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dd + dt { margin-top: 0.5em; }
}

.table-wrap { overflow-x: auto; margin-top: var(--s3); }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: var(--t-pill); }
caption { text-align: left; color: var(--rest); padding-bottom: var(--s1); font-size: var(--t-pill); }
th, td { text-align: left; padding: 10px 12px 10px 0; vertical-align: top; }
thead th { font-weight: 600; }
tbody tr + tr th, tbody tr + tr td { border-top: 2px solid var(--hush); }
td.on { font-weight: 600; }
td.off { color: var(--rest); }

/* ---------- Vorbestellrechner ---------- */

.order { margin-top: var(--s4); }
.order fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.order legend { padding: 0; font-weight: 600; margin-bottom: var(--s2); }
.order .demo-note { margin-bottom: var(--s4); }
.no-js .ticket dl, .no-js .ticket [type=submit] { display: none; }
.ticket__nojs { display: none; }
.no-js .ticket__nojs { display: block; }
.order fieldset + fieldset { margin-top: var(--s6); }

.loaf {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s1) var(--s2);
  padding: 10px 0;
}
.loaf + .loaf { border-top: 2px solid var(--hush); }
.loaf__name span { display: block; color: var(--rest); font-size: var(--t-pill); }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper button {
  width: 48px; height: 48px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  display: grid; place-items: center;
}
.stepper button:hover { background: var(--ink); color: var(--canvas); }
.stepper button[aria-disabled="true"], .stepper button[aria-disabled="true"]:hover { border-color: var(--hush); color: var(--rest); background: var(--canvas); cursor: not-allowed; }
.stepper button svg { width: 14px; height: 14px; }
.stepper input {
  width: 3ch;
  text-align: center;
  font: inherit;
  border: 0;
  background: transparent;
  color: var(--ink);
  -moz-appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.days { display: flex; flex-wrap: wrap; gap: var(--s1); }
.days input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.days label { cursor: pointer; }
.days input:checked + label { background: var(--ink); color: var(--canvas); }
.days input:focus-visible + label { outline: 3px solid var(--signal); outline-offset: 3px; }

.field { display: grid; gap: 6px; margin-top: var(--s2); }
.field label { font-size: var(--t-pill); }
.field input {
  font: inherit;
  min-height: 52px;
  padding: 8px 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--ink);
  width: 100%;
}
.field input::placeholder { color: var(--rest); }
.field input[aria-invalid="true"] { border-color: var(--ember); }
.field__error { color: #a8394a; font-size: var(--t-pill); }

.ticket {
  margin-top: var(--s6);
  padding: var(--s4);
  border-radius: 16px;
  background: var(--ink);
  color: var(--on-ink);
}
.ticket p + p, .ticket p + dl, .ticket dl + p { margin-top: 0.8em; }
.ticket .dim { color: var(--on-ink-rest); }
.ticket .facts dt { color: var(--on-ink-rest); }
.ticket .pill { background: transparent; color: var(--on-ink); border-color: var(--on-ink); margin-top: var(--s3); }
.ticket .pill:hover { background: var(--on-ink); color: var(--ink); }

/* ---------- Ende: Schleife und Fußzeile ---------- */

.coda { padding-block: var(--s15) var(--s6); }
.coda .pills { margin-top: var(--s3); }

.foot {
  padding: var(--s6) var(--gutter) var(--s4);
  color: var(--rest);
  font-size: var(--t-pill);
}
.foot__inner { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); justify-content: space-between; align-items: center; }
.foot a { color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.foot ul { display: flex; flex-wrap: wrap; gap: 0 var(--s3); }

.demo-note { color: var(--rest); }

/* ---------- Bewegung reduziert ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
  html { scroll-behavior: auto; }
  .oven { height: auto; }
  .oven__stick { position: relative; height: 100vh; height: 100svh; }
  .plate { transform: none; }
  .lit .cursor { display: none; }
}

@media print {
  .bar, .controls, .skip, .coda .pills { display: none; }
  .oven { height: auto; }
  .oven__stick { position: static; height: auto; }
  .js .lit li { color: var(--ink); }
}

/* Textlinks, die allein stehen, bekommen volle Tippfläche */
.tap { display: inline-flex; align-items: center; min-height: 44px; }
.stepper input { width: 48px; height: 48px; }

/* Ziffern gleich breit nur, wo Zahlen untereinander stehen */
table td, .stepper input { font-variant-numeric: tabular-nums; }
.plate__now h1 { color: var(--on-ink); margin-bottom: 0.9em; }

/* Schmale Bildschirme: Platte hochkant, Ring kleiner, nur das Nötigste */
@media (max-width: 959.98px) {
  .oven { height: 135vh; height: 135svh; }
  .oven__stick { padding-top: 76px; }
  .ring { width: min(60vw, 30svh, 340px); }
  .plate__stage { gap: var(--s2); padding-top: var(--s3); }
  .plate__now h1 { margin-bottom: 0.5em; }
}
@media (max-width: 559.98px) {
  .plate__now [data-next] { display: none; }
}
@media (max-height: 700px) and (max-width: 959.98px) {
  .plate__now [data-crew] { display: none; }
}

/* Auch auf der geschrumpften Platte bleiben die Knöpfe mindestens 44 px hoch */
@media (min-width: 960px) {
  .controls .pill { min-height: 56px; padding: 0 24px; }
  .controls input[type="range"] { height: 56px; }
}
