/* K2 "Ein Tag im Betrieb": tones of the day, story layout, clock, ruler, phone, sticky waitlist.
   Tones use only the Kontor sheet: light set in the morning, Papier in the afternoon, dark set at dusk. */

body { --bg: var(--grund); --fg: var(--tinte); --dim: var(--gedimmt); --line: var(--linie); --act: var(--blau); --act-ink: var(--grund); --act-hover: var(--blau-tief); --raise: var(--grund);
  background: var(--bg); color: var(--fg); transition: background-color 700ms var(--ease-std), color 700ms var(--ease-std); }
body[data-tone="mittag"] { --bg: var(--ruhe); --raise: var(--grund); }
body[data-tone="nachmittag"] { --bg: var(--ruhe); --raise: var(--grund); }
body[data-tone="abend"] { --bg: var(--papier); --line: #CBC8C2; --raise: var(--grund); }
body[data-tone="nacht"] { --bg: var(--flaeche-dunkel); --fg: var(--papier); --dim: var(--gedimmt-dunkel); --line: var(--linie-dunkel); --act: var(--blau-dunkel); --act-ink: var(--grund-dunkel); --act-hover: #A6D2FF; --raise: #23211B; }
body[data-tone="nacht"] { --bg: var(--grund-dunkel); }
body[data-tone="nacht"] :focus-visible { outline-color: var(--blau-dunkel); }

.nav { background: var(--bg); transition: background-color 700ms var(--ease-std), border-color var(--dur-mod) var(--ease-std); }
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__links a { color: var(--dim); }
.nav__links a:hover, .nav__links a[aria-current] { color: var(--fg); }
.brand__mark { color: var(--fg); }
.btn--blue { background: var(--act); color: var(--act-ink); }
.btn--blue:hover { background: var(--act-hover); }
.label { color: var(--dim); }
.soft { color: var(--dim); }
.seal { fill: var(--act); }

/* Day ruler docked under the nav */
.dock-ruler { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity var(--dur-out) var(--ease-out), transform var(--dur-out) var(--ease-out), background-color 700ms var(--ease-std); }
.dock-ruler.is-shown { opacity: 1; transform: none; transition: opacity var(--dur-mod) var(--ease-in), transform var(--dur-mod) var(--ease-in), background-color 700ms var(--ease-std); }
.dock-ruler__in { display: flex; align-items: center; gap: 16px; max-width: var(--wrap); height: 36px; margin-inline: auto; padding-inline: var(--pad); font-size: .8125rem; font-variant-numeric: tabular-nums; color: var(--dim); }
.dock-ruler__now { min-width: 3.2em; font-weight: 700; color: var(--fg); }
.dock-ruler__track { position: relative; flex: 1; height: 2px; background: var(--line); overflow: hidden; }
.dock-ruler__track i { position: absolute; inset: 0; background: var(--fg); transform-origin: left; transform: scaleX(0); }

/* Layout: left = hero + story, right = pinned phone */
.day { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 40px; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }
.day__right { position: relative; }
.phone-pin { position: sticky; top: calc(var(--nav-h) + 52px); display: flex; justify-content: flex-end; padding-top: 8px; }

/* Hero */
.hero { padding: clamp(32px, 6vh, 72px) 0 clamp(64px, 10vh, 112px); }
.hero__row { display: flex; align-items: center; gap: 16px 36px; margin-top: 32px; }
.hero__title { margin: 0; font-size: clamp(2.75rem, 1.4rem + 3.4vw, 4.375rem); line-height: 1; letter-spacing: -.035em; font-weight: 760; }
.hero__title span { display: block; }
.hero__soft { font-weight: 300; }
.hero__soft em { font-weight: 300; }
.hero__lead { margin: 24px 0 0; max-width: 52ch; font-size: 1.1875rem; line-height: 1.55; color: var(--fg); }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; flex: none; }
.textlink { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; }
.textlink:hover { text-decoration-thickness: 2px; }
.proof { display: flex; gap: 12px; align-items: flex-start; max-width: 50ch; margin: 0; padding: 0 0 0 28px; border-top: 0; border-left: 1px solid var(--line); font-size: .875rem; color: var(--dim); }
.proof__mark { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--fg); }

.ruler { margin-top: clamp(36px, 6vh, 64px); }
.ruler ol { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; }
.ruler li { border-top: 1px solid var(--fg); }
.ruler a { position: relative; display: grid; gap: 2px; padding: 14px 8px 8px 0; text-decoration: none; min-height: 44px; }
.ruler a::before { content: ""; position: absolute; left: 0; top: -1px; width: 1px; height: 10px; background: var(--fg); transform-origin: top; transition: transform var(--dur-fast) var(--ease-std); }
.ruler time { font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ruler span { font-size: .8125rem; color: var(--dim); }
.ruler a:hover time { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.ruler a:hover::before { transform: scaleY(1.8); }

/* Story */
.story { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr); gap: 32px; }
.clock { position: sticky; top: calc(var(--nav-h) + 76px); align-self: start; height: max-content; padding-top: 12vh; contain: layout paint; }
.clock__day { margin: 0; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.clock__time { display: flex; margin: 4px 0 0; font-size: clamp(4.5rem, 8.2vw, 7.5rem); line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; font-weight: 200; transition: font-weight var(--dur-slow) var(--ease-std); }
.clock__time .dg { position: relative; display: inline-block; width: .62em; overflow: hidden; text-align: center; }
.clock__time .dg > span { display: block; }
.clock__time .dg > span + span { position: absolute; inset: 0; }
.clock__time .colon { width: .28em; text-align: center; }
.clock__name { margin: 8px 0 0; font-size: 1.25rem; font-weight: 600; }

.chapters { list-style: none; margin: 0; padding: 0; }
.chapter { min-height: 92vh; display: flex; flex-direction: column; justify-content: center; padding: 48px 0; }
.chapter:last-child { min-height: 100vh; }
.chapter__time { margin: 0 0 14px; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.chapter__time time { margin-right: 6px; color: var(--fg); }
.chapter > h3 { margin: 0 0 14px; font-size: clamp(1.75rem, 1.2rem + 1.4vw, 2.5rem); line-height: 1.1; font-weight: 720; letter-spacing: -.02em; text-wrap: balance; max-width: 16ch; }
.chapter > p:last-of-type { margin: 0; max-width: 40ch; color: var(--dim); }
.js .story.is-live .chapter > h3, .js .story.is-live .chapter__time time { transition: color var(--dur-mod) var(--ease-std); }
.js .story.is-live .chapter:not(.is-active) > h3, .js .story.is-live .chapter:not(.is-active) .chapter__time time { color: var(--dim); }

/* Phone */
.phone { position: relative; margin: 0; width: min(100%, 368px); }
.phone .kapp { height: min(700px, calc(100vh - var(--nav-h) - 150px)); min-height: 520px; border: 9px solid var(--tinte); border-radius: 40px; box-shadow: 0 30px 60px -30px rgba(29, 26, 20, .35); transition: border-color 700ms var(--ease-std); }
body[data-tone="nacht"] .phone .kapp { border-color: #34312A; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); }
.phone__cap { margin-top: 14px; font-size: .8125rem; color: var(--dim); text-align: center; min-height: 1.5em; }

/* Sections after the day: night */
.wait, .faq, .foot { background: var(--grund-dunkel); color: var(--papier); }
.wait { padding-top: clamp(80px, 12vh, 140px); }
.wait .label { color: var(--gedimmt-dunkel); }
.wait .h2 em { color: var(--papier); }
.wait__lead { margin: 20px 0 0; max-width: 44ch; color: var(--gedimmt-dunkel); font-size: 1.125rem; }
.faq { padding-top: 0; }
.faq .soft { color: var(--gedimmt-dunkel); }
.faq__list details { border-color: var(--linie-dunkel); }
.faq__list summary::before, .faq__list summary::after { background: var(--papier); }
.faq__list summary:hover { color: var(--blau-dunkel); }
.faq__list details p { color: var(--gedimmt-dunkel); }
.faq a, .foot a { color: var(--papier); }
.faq :focus-visible, .foot :focus-visible, .wait :focus-visible { outline-color: var(--blau-dunkel); }
.foot { border-top: 1px solid var(--linie-dunkel); }
.foot .brand__mark { color: var(--papier); }
.foot .seal { fill: var(--blau-dunkel); }
.foot__brand p, .foot__col h2, .foot__base { color: var(--gedimmt-dunkel); }
.foot__col a, .foot__col span { color: var(--papier); }
.foot__base::before { border-top-color: var(--linie-dunkel); }

/* Sticky waitlist */
.sticky-wait { position: fixed; left: var(--pad); bottom: 24px; z-index: 35; display: grid; justify-items: start; gap: 12px; transform: translateY(calc(100% + 40px)); transition: transform var(--dur-out) var(--ease-out); }
.sticky-wait.is-shown { transform: none; transition: transform var(--dur-slow) var(--ease-in); }
.sticky-wait__pill { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px 0 18px; border: 0; border-radius: var(--r-pill); background: var(--act); color: var(--act-ink); font-weight: 600; cursor: pointer; box-shadow: 0 10px 24px -12px rgba(29, 26, 20, .45); transition: background-color var(--dur-fast) var(--ease-std); }
.sticky-wait__pill:hover { background: var(--act-hover); }
.sticky-wait__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sticky-wait__panel { width: min(400px, calc(100vw - 2 * var(--pad))); padding: 20px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--raise); color: var(--fg); box-shadow: 0 24px 48px -24px rgba(29, 26, 20, .35); transform-origin: 0 100%; }
.quick__title { margin: 0 0 12px; font-size: 1.125rem; font-weight: 700; }
.quick__label { display: block; font-size: var(--fs-small); font-weight: 600; margin-bottom: 8px; }
.quick__row { display: flex; gap: 6px; padding: 4px; border: 1px solid var(--dim); border-radius: var(--r-pill); }
.quick__row:focus-within { border-color: var(--act); }
.quick__row input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 12px; min-height: 44px; outline: none; color: var(--fg); }
.quick__row input::placeholder { color: var(--dim); opacity: .8; }
.quick__note { margin: 10px 2px 0; font-size: .75rem; line-height: 1.5; color: var(--dim); }
.quick .form-msg.is-error { color: #A0172B; }
body[data-tone="nacht"] .quick .form-msg.is-error { color: #F5A3AD; }
.quick .wdone { padding: 4px 0 0; border: 0; border-radius: 0; }
.quick .wdone h3 { margin: 0 0 6px; font-size: 1.25rem; }
.quick .wdone p { margin: 0; color: var(--dim); font-size: .9375rem; }
.quick .wdone__mark { width: 28px; height: 28px; margin-bottom: 10px; color: var(--fg); }
.quick .wdone__mark .seal { fill: var(--act); }
.quick.is-done .quick__row, .quick.is-done .quick__label, .quick.is-done .quick__note, .quick.is-done .quick__title { display: none; }

/* Additions to the app recreation used by the story */
.kapp--phone { font-size: 13.5px; }
.kapp--phone .kapp__tabs { display: flex; }
.kapp--phone .ktab { pointer-events: none; }
.kempty { padding: 10px 0; font-size: 12.5px; }
.kapp [data-list="anfragen"] { min-height: 0; }
.kapp--phone .ktab { display: inline-flex; align-items: center; min-height: 32px; }
.kopen { margin-top: 12px; }
.ksum { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding: 12px 14px; border-radius: var(--r-s); background: var(--k-ink); color: var(--k-panel); }
.ksum strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.kactions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.kgo--wide { flex: 1; text-align: center; padding: 10px 12px; }
.kgo.is-ok { background: var(--k-green-soft); color: var(--k-green); }
.kpaper--phone { display: block !important; padding: 16px; }
.kremind { margin-top: 10px; }
.kremind .krow { border-top: 0; padding-bottom: 2px; }
.kdone { margin-bottom: 12px; padding: 16px 14px; }
.kdone b { font-size: 15px; }
.kv .kcard + .kcard { margin-top: 10px; }
.kapp .kakte__head { margin-bottom: 4px; }

/* Kontor's own dark mode (sheet: dark Grund, Papier, Blau dunkel) */
.kapp.is-dark { --k-bg: #110F0A; --k-panel: #1A1813; --k-line: #3A3832; --k-ink: #EAE7E2; --k-dim: #A19E98; --k-blue: #76BAFE; --k-blue-soft: #16283A; --k-blue-line: #2D4C6E; --k-green: #7DD9A2; --k-green-dot: #4CC37F; --k-green-soft: #15301F; --k-red: #F5A3AD; --k-red-soft: #3A1A1F; --k-red-line: #6B2E37; --k-lila: #C6A2F0; --k-lila-soft: #2A1E3A; }
.kapp.is-dark .kapp__tabs-brand svg path { stroke: var(--k-ink); }
.kapp.is-dark .ktab.is-on { color: #A6D2FF; }
.kapp.is-dark .seal { fill: var(--blau-dunkel); }

/* Phone mini screens inside chapters (phones and narrow tablets) */
.phone--mini { width: 100%; max-width: 360px; margin: 28px auto 0; }
.phone--mini .kapp { height: 500px; min-height: 0; border-width: 7px; border-radius: 30px; }

@media (max-width: 1080px) {
  .day { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .story { grid-template-columns: 1fr; }
  .clock { display: none; }
}

@media (max-width: 860px) {
  .day { display: block; }
  .day__right { display: none; }
  .chapter { min-height: 0; padding: 56px 0; border-top: 1px solid var(--line); }
  .js .story.is-live .chapter:not(.is-active) > h3, .js .story.is-live .chapter:not(.is-active) .chapter__time time { color: inherit; }
  .dock-ruler__now { font-size: 1rem; }
}

@media (max-width: 760px) {
  .nav .nav__links { display: flex; gap: 20px; }
  .hero__title { font-size: clamp(2.5rem, 10.8vw, 3.25rem); }
  .hero__lead { font-size: 1.0625rem; }
  .hero__row { display: block; }
  .hero__row .proof { margin-top: 28px; }
  .hero__actions .btn { width: 100%; }
  .proof { padding-left: 0; border-left: 0; }
  .ruler ol { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 8px; }
  .sticky-wait { left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); justify-items: stretch; }
  .sticky-wait__pill { justify-content: center; min-height: 52px; }
  .sticky-wait__panel { width: 100%; }
  .quick__row { border-radius: var(--r-l); }
  .quick__row .btn { border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  body, .nav, .dock-ruler, .phone .kapp { transition-duration: 120ms; }
  .clock__time { transition: none; }
  .sticky-wait, .sticky-wait.is-shown { transition: opacity 120ms linear; transform: none; }
  .sticky-wait:not(.is-shown) { opacity: 0; pointer-events: none; }
  .dock-ruler, .dock-ruler.is-shown { transform: none; }
}

/* Without JS: no frozen clock next to the wrong chapter */
html:not(.js) .clock { display: none; }
html:not(.js) .story { grid-template-columns: 1fr; }
.sticky-wait .quick { margin: 0; }
