:root {
  --cream: #fbf7ed;
  --ink: #28332e;
  --muted: #56605a;
  --rust: #a74427;
  --line: #d9d4c7;
  --paper-texture: url('assets/paper.jpg');
  --paper-pigment: #e86432;
  --warm-paper: linear-gradient(var(--paper-pigment), var(--paper-pigment)), var(--paper-texture);
  --serif: Georgia, 'Times New Roman', serif;
  --gutter: clamp(20px, 5vw, 84px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--cream);
  background-image: var(--warm-paper);
  background-position: center top;
  background-size: max(760px, 100vw) auto;
  background-blend-mode: screen, normal;
  color: var(--ink);
  font: 16px/1.6 system-ui, sans-serif;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #227c81; outline-offset: 5px; }
.skip { position: fixed; top: 12px; left: 12px; z-index: 8; padding: .6rem 1rem; background: white; transform: translateY(-200%); }
.skip:focus { transform: none; }
.wrap { width: min(100% - 2 * var(--gutter), 1350px); margin-inline: auto; }
.section { padding-block: clamp(58px, 8vw, 122px); }
p { margin: 0 0 1em; }
h1, h2 { margin: 0; font: 400 clamp(48px, 6vw, 100px)/.99 var(--serif); letter-spacing: -.067em; }
h2 { font-size: clamp(44px, 5.5vw, 79px); }
em { color: var(--rust); font-weight: 400; }
.kicker, .art-top { font-size: .69rem; line-height: 1.4; font-weight: 650; text-transform: uppercase; letter-spacing: .16em; }
.kicker { display: flex; align-items: center; gap: .65rem; margin: 0 0 1.5rem; }
.ink-dot { display: inline-block; flex: 0 0 8px; height: 8px; background: #5baaa8; border-radius: 50%; }
.header { display: flex; align-items: center; justify-content: space-between; min-height: 78px; gap: 16px; }
.brand { color: var(--ink); font: 400 1.48rem/1 var(--serif); letter-spacing: -.045em; white-space: nowrap; }
nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 42px); font-size: .87rem; }
.nav-text:hover { text-decoration: underline; text-underline-offset: 5px; }
.button { display: inline-flex; justify-content: space-between; align-items: center; gap: 1.2rem; background: var(--ink); border: 1px solid var(--ink); color: #fffdf5; min-height: 48px; padding: .7rem 1.2rem; border-radius: 4px; font-size: .9rem; font-weight: 600; line-height: 1.4; }
.button:hover { background: #405448; }
.button-small { min-height: 40px; padding: .52rem .9rem; }
.text-link { display: inline-flex; gap: .8em; align-items: center; border-bottom: 1px solid; padding-bottom: 3px; color: var(--rust); font-weight: 650; font-size: .88rem; }
.text-link:hover { color: var(--ink); }
/* Keep the scene pinned through the door opening and the scroll-driven film. */
.opening { --door-distance: clamp(250px, 54svh, 490px); --distance: 0px; position: relative; }
.opening::after { content: ""; display: block; height: var(--distance); }
.js-ready .opening { --distance: calc(var(--door-distance) + var(--story-seconds) * clamp(90px, 15svh, 135px)); }
.door-scroll-distance { position: absolute; height: var(--door-distance); visibility: hidden; }
.opening-pin {
  --art-width: min(100%, 145svh);
  --art-center: 44svh;
  --intro-opacity: 1;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 390px;
  isolation: isolate;
  overflow: hidden;
  background: #e9ded2;
}
.opening-pin .header { position: absolute; z-index: 5; inset: 0 0 auto; }
.portal { position: absolute; inset: 0; overflow: hidden; isolation: isolate; background: #f8efe4; }
.story-stage, .scene-plate { position: absolute; inset: 0; }
.story-poster, .film, .doors { position: absolute; inset: 0; width: 100%; height: 100%; }
.story-poster, .film { object-fit: cover; object-position: center bottom; }
.film { opacity: 0; background: transparent; }
.film.is-visible { opacity: 1; }
#safari-frames > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}
.doors { z-index: 3; pointer-events: none; }
.door {
  position: absolute;
  inset-block: 0;
  width: 50%;
  overflow: hidden;
  background-color: #f9e9dd;
  backface-visibility: hidden;
}
.door-left {
  left: 0;
  transform-origin: left center;
  transform: translateX(calc(-1 * var(--door-shift, 0px))) perspective(var(--door-perspective, 900px)) rotateY(var(--door-angle, 0deg));
}
.door-right {
  right: 0;
  transform-origin: right center;
  transform: translateX(var(--door-shift, 0px)) perspective(var(--door-perspective, 900px)) rotateY(calc(-1 * var(--door-angle, 0deg)));
}
.door-canvas {
  position: absolute;
  inset-block: 0;
  width: 200%;
  background-color: var(--cream);
  background-image: var(--warm-paper);
  background-position: center top;
  background-size: max(760px, 100vw) auto;
  background-blend-mode: screen, normal;
}
.door-left .door-canvas { left: 0; }
.door-right .door-canvas { right: 0; }
.opening-art {
  position: absolute;
  top: var(--art-center);
  left: 50%;
  width: var(--art-width);
  aspect-ratio: 1672 / 941;
  transform: translate(-50%, -50%);
}
.opening-art::before {
  content: "";
  position: absolute;
  top: 45.4%;
  left: 50%;
  width: 37.5%;
  aspect-ratio: 3 / 2;
  transform: translate(-50%, -50%);
  background: url('assets/zauberpinsel-logo.png?v=20261111k') center / contain no-repeat;
}
/* GIF crop coordinates are measured in the original 1672 × 941 Frame 01. */
.doodle {
  position: absolute;
  left: calc(var(--x) / 1672 * 100%);
  top: calc(var(--y) / 941 * 100%);
  width: calc(var(--width) / 1672 * 100%);
}
.js-ready .door { will-change: transform; }
.scene-copy {
  position: absolute;
  z-index: 2;
  inset-inline: var(--gutter);
  bottom: clamp(72px, 12svh, 118px);
  text-align: center;
  pointer-events: none;
}
.scene-copy .kicker { justify-content: center; margin: 0 0 .65rem; }
.title-copy > p:last-child { margin: .65rem 0 0; color: var(--muted); font-size: clamp(.82rem, 1.4vw, 1.04rem); }
.title-copy { bottom: max(14svh, 80px); opacity: var(--intro-opacity); }
.title-copy h1 { margin: 0; font: 400 clamp(38px, 5.2vw, 84px)/.98 var(--serif); letter-spacing: -.065em; }
.title-copy h1 em { color: #e86432; }
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .title-copy h1 em {
    display: inline-block;
    padding-inline: .04em;
    margin-inline: -.04em;
    background-image: linear-gradient(90deg, #e46763 0%, #e86432 16.7%, #f3cc46 33.3%, #85ac72 50%, #58bec5 66.7%, #6f9ed3 83.3%, #af9bcb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
@media (forced-colors: active) {
  .title-copy h1 em { background: none; color: CanvasText; }
}
.story-copy {
  top: var(--story-top, 50%);
  bottom: auto;
  left: var(--story-left, var(--gutter));
  right: var(--story-right, auto);
  width: min(36%, 580px);
  text-align: left;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 160ms ease-out;
  text-shadow: 0 1px 6px #fff8eb, 0 0 18px #fff8eb;
}
.story-copy.is-visible {
  opacity: var(--stanza-opacity, 1);
  transition: opacity 420ms ease-out 160ms;
}
@starting-style {
  .story-copy.is-visible { opacity: 0; }
}
.story-copy[data-placement^="lower"] { --story-top: 72%; }
.story-copy[data-placement$="right"] { --story-left: auto; --story-right: var(--gutter); }
.story-copy[data-placement="final-verse"] { --story-top: 65%; --story-left: auto; --story-right: var(--gutter); }
.story-copy .story-verse {
  margin: 0;
  font: 400 clamp(23px, 2.5vw, 43px)/1.27 var(--serif);
  white-space: pre-line;
}
#story-trial {
  position: absolute;
  z-index: 2;
  top: min(88%, calc(100% - 62px));
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  color: #20352c;
  border: 1px solid #ffffffbd;
  border-radius: 999px;
  background: linear-gradient(150deg, #ffffffe0, #f9f5eaa0);
  -webkit-backdrop-filter: blur(12px) saturate(1.45);
  backdrop-filter: blur(12px) saturate(1.45);
  box-shadow: inset 0 1px 2px #fff, inset 0 -1px 3px #ffffff80, 0 6px 18px #3d52452e;
}
#story-trial:hover { background: #ffffffe8; }
#story-trial:not([data-state="complete"]) {
  top: auto;
  bottom: max(10px, 2svh, env(safe-area-inset-bottom));
}
button#story-trial {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  inline-size: 52px;
  min-height: 48px;
  padding: 0;
  overflow: hidden;
  transition: inline-size 360ms cubic-bezier(.2,.7,.3,1), background 180ms ease;
}
button#story-trial[data-state="complete"] { inline-size: min(248px, calc(100% - 32px)); }
.story-play-icon, .story-trial-label {
  grid-area: 1 / 1;
  transition: opacity 180ms ease, transform 250ms ease;
}
.story-play-icon {
  width: 16px;
  height: 16px;
  background: currentColor;
  clip-path: polygon(24% 0, 100% 50%, 24% 100%);
}
#story-trial[data-state="playing"] .story-play-icon {
  clip-path: polygon(12% 0, 40% 0, 40% 100%, 12% 100%, 12% 0, 60% 0, 88% 0, 88% 100%, 60% 100%, 60% 0);
}
.story-trial-label { opacity: 0; transform: translateY(5px); }
#story-trial[data-state="complete"] .story-play-icon { opacity: 0; transform: scale(.7); }
#story-trial[data-state="complete"] .story-trial-label { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  button#story-trial, .story-play-icon, .story-trial-label { transition: none; }
}
.facts { position: relative; }
.facts::before {
  content: "";
  position: absolute;
  inset: auto 0 100%;
  height: clamp(20px, 5dvh, 52px);
  background-color: var(--cream);
  background-image: var(--warm-paper);
  background-position: center bottom;
  background-size: max(760px, 100vw) auto;
  background-blend-mode: screen, normal;
  -webkit-mask-image: linear-gradient(transparent, #000);
  mask-image: linear-gradient(transparent, #000);
  pointer-events: none;
}
.facts-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding-block: 25px; text-align: center; font-size: .9rem; }
.facts b { color: var(--rust); font-weight: 700; }
.atelier, .course-grid, .faq, .contact-inner { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(38px, 8vw, 130px); }
.atelier-copy > p:not(.kicker), .course-copy > p:not(.kicker) { max-width: 40ch; margin-top: 1.25rem; }
.atelier-copy > p:first-child { margin-top: 0; }
.atelier-copy .text-link { margin-top: .4rem; }
.courses { background: #dce9dfb0; }
.course-card { padding: clamp(20px, 3.5vw, 48px); border-radius: 4px; background: #fffdf6ad; box-shadow: 0 12px 30px #243f3020; }
.price-row { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.price-row .kicker { margin: 0; }
.price { color: var(--rust); font: 2.3rem/1.2 var(--serif); letter-spacing: -.03em; }
.price small { color: var(--muted); font: .8rem system-ui,sans-serif; }
.timetable { margin: 1rem 0; }
.timetable div { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 10px 0; }
.timetable dd { margin: 0; text-align: right; }
.timetable dt { font-weight: 650; }
.course-card > p { font-size: .86rem; }
.course-card .fine { margin: 1rem 0 0; color: var(--muted); font-size: .75rem; }
.extras { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-bottom: 0; }
.extra { padding: clamp(24px, 4vw, 56px); min-width: 0; border-radius: 3px; }
.extra h2 { font-size: clamp(38px, 4.5vw, 66px); }
.extra p:not(.kicker) { margin-top: 1.3rem; max-width: 39ch; }
.monday { background: #f6ebccaa; }
.book { background: #f3e2deaa; }
.faq { grid-template-columns: .7fr 1.3fr; align-items: start; }
.questions { border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; list-style: none; font-weight: 600; position: relative; padding: 17px 26px 17px 0; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; position: absolute; right: 4px; font-size: 1.25rem; color: var(--rust); }
details[open] summary::after { content: '−'; }
details p { color: var(--muted); padding-right: 20px; }
.contact { background: #293e35e8; color: #fffaf0; }
.contact em { color: #f3bd9f; }
.contact .button { margin-top: 1.6rem; background: #fffaf0; color: var(--ink); }
.contact .button:hover { background: #f3dfcc; }
address { font-style: normal; line-height: 1.8; padding-left: 28px; border-left: 1px solid #769184; }
address a { display: block; width: fit-content; overflow-wrap: anywhere; }
address a:hover { text-decoration: underline; }
.footer { display: flex; justify-content: space-between; gap: 12px; padding-block: 22px; font-size: .8rem; color: var(--muted); }
@media (max-width: 820px) {
  .header { min-height: 64px; }
  .brand { font-size: 1.24rem; }
  .nav-text { display: none; }
  .opening-pin { --art-center: 37svh; }
  .scene-copy { bottom: clamp(78px, 14svh, 135px); }
  .scene-copy .kicker { font-size: .58rem; letter-spacing: .12em; }
  .title-copy h1 { max-width: 12ch; margin-inline: auto; font-size: clamp(38px, 11vw, 64px); }
  .scene-copy > p:last-child { max-width: 33ch; margin-inline: auto; }
  .facts-inner { grid-template-columns: repeat(2, 1fr); gap: 12px 9px; font-size: .81rem; padding-block: 19px; }
  .atelier, .course-grid, .faq, .contact-inner, .extras { grid-template-columns: 1fr; }
  .atelier { gap: 24px; }
  address { padding-left: 18px; }
}
@media (max-width: 820px) and (orientation: portrait) {
  .opening-art {
    top: 50%;
    width: min(100%, 56.25dvh);
    aspect-ratio: 9 / 16;
  }
  .opening-art::before {
    top: 43%;
    width: 65%;
  }
  .doodle { left: var(--phone-x); top: var(--phone-y); width: var(--phone-width); }
  .story-stage .story-copy {
    top: auto;
    bottom: 82px;
    inset-inline: var(--gutter);
    width: auto;
    max-width: 420px;
    margin-inline: auto;
    text-align: center;
    transform: none;
  }
  .story-stage .story-copy[data-phone-placement="upper"] { top: 72px; bottom: auto; }
  #story-trial { min-height: 36px; padding: .45rem .8rem; font-size: .8rem; }
  .story-copy .story-verse { font-size: clamp(18px, 5.35vw, 29px); }
}
@media (prefers-reduced-motion: reduce) {
  .js-ready .opening { --distance: 0px; }
  .opening-pin { position: relative; }
  .doodle { display: none; }
  .story-copy, .story-copy.is-visible { transition: none; }
}

@media (max-height: 540px) and (orientation: landscape) {
  .opening-pin { --art-width: min(100%, 115svh); --art-center: 37svh; }
  .opening-pin .header { min-height: 48px; }
  .scene-copy { bottom: 69px; }
  .story-copy { bottom: auto; }
  .story-copy[data-placement^="lower"], .story-copy[data-placement="final-verse"] { --story-top: 58%; }
  .scene-copy .kicker { display: none; }
  .title-copy h1 { font-size: clamp(30px, 9svh, 50px); }
  .story-copy .story-verse { font-size: clamp(16px, 4.4svh, 24px); }
  #story-trial { min-height: 36px; padding-block: .4rem; }
}
