/* Page sections, in document order. */

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  position: relative; min-height: 100svh; max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: 1fr auto;
  column-gap: var(--gutter); padding: calc(var(--nav-h) + 6vh) var(--gutter) 40px;
}
.hero-copy { align-self: center; display: grid; gap: 28px; }
.hero-name { display: grid; gap: 14px; font-weight: 300; line-height: 1; }
.hero-zh { font-family: var(--font-cjk); font-size: clamp(88px, 13vw, 210px); letter-spacing: 0.04em; margin-left: -0.04em; }
.hero-en { font-family: var(--font-latin); font-size: clamp(14px, 1.5vw, 20px); letter-spacing: 0.5em; font-weight: 400; }
.hero-title { font-size: clamp(20px, 1.9vw, 28px); line-height: 1.45; font-weight: 300; max-width: 22em; }
.hero-lead { color: var(--muted); max-width: 34em; font-size: 15px; }
.hero-visual { position: relative; align-self: center; justify-self: center; width: min(100%, 520px); }
.hero-mark { width: 100%; }
.hero-coord { position: absolute; right: 0; bottom: -28px; color: var(--muted); }
.hero-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: end; gap: 24px; padding-top: 32px; border-top: 1px solid var(--line); }
.scroll-cue { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.scroll-cue-line { position: relative; width: 1px; height: 44px; background: var(--line); overflow: hidden; }
.scroll-cue-line::after { content: ""; position: absolute; left: 0; top: -40%; width: 100%; height: 40%; background: var(--ink); animation: cue 2.2s var(--ease-in-out) infinite; }
@keyframes cue { to { top: 100%; } }
.hero-meta { display: flex; gap: 28px; color: var(--muted); }

.hero-in { opacity: 0; transform: translateY(36px); transition: opacity 1.1s var(--ease-out), transform 1.4s var(--ease-out); transition-delay: calc(0.35s + var(--d, 0) * 0.12s); }
.hero-visual.hero-in { transform: scale(0.94); }
body.is-loaded .hero-in { opacity: 1; transform: none; }

/* ── Story ─────────────────────────────────────────────── */
.story { position: relative; }
.story-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.story-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Veil behind the caption column (desktop) and studio vignette. stage.js only
   sets their opacity; keep the 36% in sync with stageRect() in stage.js. */
.story-veil, .story-vignette { position: absolute; inset: 0; pointer-events: none; will-change: opacity; }
.story-veil { background: linear-gradient(90deg, var(--bg) 0, rgb(238 235 230 / 0.94) 32%, rgb(238 235 230 / 0) 41%); }
.story-veil--dark { background: linear-gradient(90deg, var(--dark) 0, rgb(27 27 26 / 0.94) 32%, rgb(27 27 26 / 0) 41%); opacity: 0; }
.story-vignette { background: radial-gradient(ellipse 80% 90% at 60% 50%, rgb(0 0 0 / 0) 35%, rgb(0 0 0 / 0.45) 100%); opacity: 0; }
@media (max-width: 899px) { .story-veil { display: none; } }
.story-hud {
  position: absolute; top: calc(var(--nav-h) + 18px); right: var(--gutter); display: flex; gap: 28px;
  color: var(--muted); pointer-events: none; transition: color 0.6s;
}
body.is-stage-dark .story-hud { color: var(--on-dark-muted); }

.captions { position: absolute; inset: 0; pointer-events: none; }
.caption {
  position: absolute; left: var(--gutter); top: 50%; transform: translateY(-46%);
  width: min(31vw, 460px); display: grid; gap: 22px; visibility: hidden; opacity: 0;
}
.caption.is-active { pointer-events: auto; }
.caption .ln { will-change: transform, opacity; }
.caption-no { color: var(--muted); transition: color 0.6s; }
.caption-title { font-size: clamp(30px, 3.3vw, 52px); line-height: 1.22; font-weight: 300; letter-spacing: 0.01em; }
html[data-lang="de"] .caption-title, html[data-lang="en"] .caption-title { font-size: clamp(28px, 2.8vw, 44px); line-height: 1.15; }
.caption-body { color: inherit; opacity: 0.78; font-size: 15.5px; max-width: 26em; }
.caption--final .btn { margin-top: 6px; }

.chapters {
  position: absolute; left: var(--gutter); bottom: 34px; display: flex; gap: 6px;
  width: min(31vw, 460px);
}
.chapters button {
  flex: 1; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 10px;
  text-align: left; font-size: 12.5px; color: var(--muted); transition: color 0.4s;
}
.chapters button.is-current, .chapters button:hover { color: var(--ink); }
body.is-stage-dark .chapters button { color: var(--on-dark-muted); }
body.is-stage-dark .chapters button.is-current { color: var(--on-dark); }
.chapters i { grid-column: 1 / -1; height: 1px; background: var(--line); position: relative; overflow: hidden; }
body.is-stage-dark .chapters i { background: var(--line-dark); }
.chapters i::after { content: ""; position: absolute; inset: 0; background: currentColor; transform-origin: left; transform: scaleX(var(--fill, 0)); }

/* ── Statement ─────────────────────────────────────────── */
.statement { max-width: var(--max); margin: 0 auto; padding: 22vh var(--gutter) 18vh; display: grid; gap: 36px; }
.statement-text { font-size: clamp(30px, 5vw, 80px); line-height: 1.28; font-weight: 300; max-width: 17em; letter-spacing: 0.01em; }
html[data-lang="en"] .statement-text, html[data-lang="de"] .statement-text { line-height: 1.12; max-width: 20em; }
.statement-text .u { transition: opacity 0.25s linear; }

/* ── Section heads ─────────────────────────────────────── */
.section-head { display: grid; gap: 22px; margin-bottom: 64px; }
.section-title { font-size: clamp(28px, 3.4vw, 52px); line-height: 1.25; font-weight: 300; max-width: 22em; }
.section-lead { color: var(--muted); max-width: 34em; }

/* ── Services ──────────────────────────────────────────── */
.services { max-width: var(--max); margin: 0 auto; padding: 10vh var(--gutter) 16vh; }
.service-list { border-top: 1px solid var(--line); }
.service {
  position: relative; display: grid; grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1.25fr) 48px;
  grid-template-areas: "no title desc arrow" "no title tags arrow";
  column-gap: 32px; row-gap: 18px; padding: 40px 0; border-bottom: 1px solid var(--line); isolation: isolate;
}
.service::before {
  content: ""; position: absolute; inset: 0 calc(var(--gutter) * -1); z-index: -1; background: var(--paper);
  transform: scaleY(0); transform-origin: bottom; transition: transform 0.7s var(--ease-out);
}
.service:hover::before { transform: scaleY(1); }
.service-no { grid-area: no; color: var(--muted); padding-top: 8px; }
.service h3 { grid-area: title; font-size: clamp(22px, 2.2vw, 32px); font-weight: 300; line-height: 1.3; transition: transform 0.7s var(--ease-out); }
.service:hover h3 { transform: translateX(10px); }
.service p { grid-area: desc; color: var(--muted); }
.service .tags { grid-area: tags; }
.service-arrow { grid-area: arrow; justify-self: end; font-family: var(--mono); font-size: 20px; transition: transform 0.7s var(--ease-out); }
.service:hover .service-arrow { transform: rotate(-45deg); }

/* ── Process ───────────────────────────────────────────── */
.process { position: relative; height: 340vh; background: var(--paper); }
.process-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: var(--nav-h) 0 48px; }
.process-head { padding: 0 var(--gutter); margin-bottom: 7vh; max-width: var(--max); }
.process-viewport { overflow: hidden; padding: 0 var(--gutter); }
.process-track { display: flex; gap: 0; width: max-content; will-change: transform; }
.step {
  width: clamp(260px, 24vw, 360px); padding: 28px 32px 36px 0; margin-right: 32px; border-top: 1px solid var(--ink);
  display: grid; gap: 16px; align-content: start; position: relative;
}
.step::before { content: ""; position: absolute; top: -4px; left: 0; width: 7px; height: 7px; background: var(--ink); }
.step--loop::before { background: var(--amber); }
.step h3 { font-size: 22px; font-weight: 400; line-height: 1.35; }
.step p { color: var(--muted); font-size: 15px; }
.process-progress { margin: 48px var(--gutter) 0; height: 1px; background: var(--line); }
.process-progress span { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; }

/* ── Why ───────────────────────────────────────────────── */
.why { max-width: var(--max); margin: 0 auto; padding: 18vh var(--gutter); }
.why-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.why-item { padding: 44px 48px 52px 0; border-bottom: 1px solid var(--line); display: grid; gap: 16px; align-content: start; }
.why-item:nth-child(odd) { border-right: 1px solid var(--line); }
.why-item:nth-child(even) { padding-left: 48px; }
.why-item .mono { color: var(--muted); }
.why-item h3 { font-size: clamp(20px, 1.9vw, 26px); font-weight: 400; }
.why-item p { color: var(--muted); max-width: 30em; }
.why-item:nth-child(2) { transition-delay: 0.1s; }
.why-item:nth-child(3) { transition-delay: 0.05s; }
.why-item:nth-child(4) { transition-delay: 0.15s; }

/* ── Contact (dark) ────────────────────────────────────── */
.contact {
  background: var(--dark); color: var(--on-dark);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--gutter);
  padding: 18vh max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))) 14vh;
}
.contact .kicker, .contact .section-lead { color: var(--on-dark-muted); }
.contact-intro { display: grid; gap: 28px; align-content: start; }
.contact-title { font-size: clamp(34px, 4.6vw, 72px); font-weight: 300; line-height: 1.18; }
.contact-mark { width: 120px; color: var(--on-dark); margin-top: 40px; opacity: 0.9; }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 32px; align-content: start; }
.contact-form label { display: grid; gap: 8px; font-size: 13px; color: var(--on-dark-muted); }
.contact-form .wide, .contact-form fieldset, .form-actions { grid-column: 1 / -1; }
.contact-form input:not([type="checkbox"]), .contact-form textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line-dark);
  padding: 10px 0; font-size: 17px; color: var(--on-dark); outline: none; resize: vertical; transition: border-color 0.4s;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--on-dark); }
.contact-form textarea::placeholder { color: rgba(242, 239, 234, 0.3); }
.contact-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.contact-form legend { font-size: 13px; color: var(--on-dark-muted); margin-bottom: 12px; padding: 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 8px 16px; border: 1px solid var(--line-dark); border-radius: 99px; color: var(--on-dark); font-size: 13px; transition: background-color 0.3s, color 0.3s, border-color 0.3s; }
.chip input:checked + span { background: var(--on-dark); color: var(--dark); border-color: var(--on-dark); }
.chip input:focus-visible + span { outline: 1.5px solid var(--amber); outline-offset: 2px; }
.form-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 8px; }
.form-note { font-size: 13px; color: var(--amber); opacity: 0; transform: translateY(6px); transition: opacity 0.5s, transform 0.5s var(--ease-out); max-width: 30em; }
.form-note.is-visible { opacity: 1; transform: none; }

/* ── Footer ────────────────────────────────────────────── */
.footer {
  background: var(--dark); color: var(--on-dark-muted); border-top: 1px solid var(--line-dark);
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 36px max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
}
.footer .brand { color: var(--on-dark); }
.footer .brand .mark-a { fill: var(--on-dark); }
.footer .brand .mark-i { fill: var(--dark-2); }
.footer-links { display: flex; gap: 24px; font-size: 13px; }
.footer-links a:hover { color: var(--on-dark); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 899px) {
  .nav-links { display: none; }
  /* Hero on phones: may be taller than one screen — air beats cramming. */
  .hero {
    grid-template-columns: 1fr; grid-template-rows: auto auto auto; min-height: auto; row-gap: 0;
    padding: calc(var(--nav-h) + 28px) var(--gutter) 40px;
  }
  .hero-visual { order: -1; justify-self: end; width: 38vw; max-width: 200px; margin: 0 0 40px; }
  .hero-coord { display: none; }
  .hero-copy { gap: 22px; }
  html[data-lang] .hero-copy .kicker { font-size: 10.5px; letter-spacing: 0.1em; line-height: 1.6; flex-wrap: wrap; }
  .hero-name { gap: 12px; }
  .hero-zh { font-size: 27vw; }
  .hero-en { font-size: 13px; letter-spacing: 0.42em; }
  .hero-title { font-size: 19px; line-height: 1.55; }
  .hero-lead { font-size: 14.5px; line-height: 1.85; }
  .hero-foot { flex-direction: column; align-items: start; gap: 22px; margin-top: 44px; padding-top: 24px; }
  .hero-meta { flex-wrap: wrap; gap: 6px 16px; font-size: 10.5px; }

  /* Story on phones: scene in the upper ~55% (see stageRect in stage.js), text below. */
  .story-hud { top: calc(var(--nav-h) + 10px); gap: 14px; font-size: 10px; }
  .caption { top: auto; bottom: 82px; transform: none; width: auto; right: var(--gutter); gap: 12px; }
  .caption-title { font-size: clamp(26px, 7.4vw, 34px); line-height: 1.25; }
  .caption-body {
    font-size: 14px; line-height: 1.7; opacity: 0.8;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }
  .chapters { width: auto; right: var(--gutter); bottom: 22px; }
  .chapters button { font-size: 12px; }

  .service { grid-template-columns: 44px minmax(0, 1fr) 24px; grid-template-areas: "no title arrow" "no desc desc" "no tags tags"; column-gap: 16px; padding: 32px 0; }
  .process { height: auto; }
  .process-sticky { position: static; height: auto; padding: 14vh 0; }
  .process-track { width: auto; flex-direction: column; }
  .step { width: auto; margin-right: 0; margin-bottom: 8px; }
  .process-progress { display: none; }
  .why-grid { grid-template-columns: 1fr; }
  .why-item, .why-item:nth-child(even) { padding: 36px 0; border-right: 0; }
  .why-item:nth-child(odd) { border-right: 0; }
  .contact { grid-template-columns: 1fr; padding-top: 14vh; }
  .contact-form { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .brand-en { display: none; }
  .nav-right { gap: 10px; }
  .nav .btn--small { padding: 8px 14px; }
}

/* Short phones (e.g. landscape or small devices): keep captions compact. */
@media (max-width: 899px) and (max-height: 700px) {
  .caption-body { display: none; }
}

/* ── Legal pages (impressum.html, datenschutz.html) ────── */
.legal-page { background: var(--bg); }
.legal-page .nav { position: sticky; }
.legal-page .brand-mark { width: 30px; height: auto; }
.legal-back { color: var(--muted); }
.legal-back:hover { color: var(--ink); }
.legal { max-width: 760px; margin: 0 auto; padding: 10vh var(--gutter) 14vh; }
.legal h1 { font-size: clamp(36px, 5vw, 64px); font-weight: 300; line-height: 1.1; margin: 18px 0 14px; }
.legal h2 { font-size: 19px; font-weight: 500; margin: 44px 0 10px; }
.legal p { margin: 0 0 14px; color: var(--ink-2); }
.legal a { text-decoration: underline; text-underline-offset: 3px; }
.legal strong { font-weight: 500; color: var(--ink); }
.legal-note { font-size: 13px; color: var(--muted) !important; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.legal-meta { margin-top: 56px !important; color: var(--muted) !important; }
