// app.jsx — root, routing, styles

const { useState: useStateA, useEffect: useEffectA } = React;

function getRouteFromHash() {
  const h = (location.hash || "").replace(/^#\/?/, "").toLowerCase();
  if (h === "barsbuettel" || h === "barsbüttel") return "barsbuettel";
  if (h === "ahrensburg") return "ahrensburg";
  if (h === "kontakt") return "kontakt";
  if (h === "impressum") return "impressum";
  if (h === "datenschutz" || h === "datenschutzerklarung" || h === "datenschutzerklärung") return "datenschutz";
  return "standorte";
}

function App() {
  const [t, setTweak] = useTweaks(window.__TWEAK_DEFAULTS);
  const [route, setRoute] = useStateA(getRouteFromHash());

  useEffectA(() => {
    const onNav = () => setRoute(getRouteFromHash());
    window.addEventListener("hashchange", onNav);
    window.addEventListener("popstate", onNav);
    return () => {
      window.removeEventListener("hashchange", onNav);
      window.removeEventListener("popstate", onNav);
    };
  }, []);

  useEffectA(() => {
    document.body.classList.toggle("theme-dark", t.theme === "dark");
    document.body.dataset.accent = t.accent;
  }, [t.theme, t.accent]);

  useEffectA(() => {
    window.scrollTo({ top: 0, behavior: "instant" in window ? "instant" : "auto" });
  }, [route]);

  const navigate = (r) => {
    history.pushState(null, "", "#/" + r);
    setRoute(r);
  };

  let Page = StandortePage;
  if (route === "barsbuettel") Page = BarsbuettelPage;
  else if (route === "ahrensburg") Page = AhrensburgPage;
  else if (route === "kontakt") Page = KontaktPage;
  else if (route === "impressum") Page = ImpressumPage;
  else if (route === "datenschutz") Page = DatenschutzPage;

  return (
    <>
      <Nav route={route} onNavigate={navigate} />
      <Page onNavigate={navigate} />
      <Footer onNavigate={navigate} />

      <TweaksPanel>
        <TweakSection label="Erscheinungsbild" />
        <TweakRadio
          label="Theme"
          value={t.theme}
          options={["light", "dark"]}
          onChange={(v) => setTweak("theme", v)}
        />
        <TweakSelect
          label="Akzentfarbe"
          value={t.accent}
          options={["brass", "olive", "slate"]}
          onChange={(v) => setTweak("accent", v)}
        />
      </TweaksPanel>
    </>
  );
}

// Accent variants applied via [data-accent] selector
const ACCENT_CSS = `
  body[data-accent="olive"] { --accent: #6b6b30; --accent-ink: #4a4a1f; }
  body[data-accent="olive"].theme-dark { --accent: #b6b97a; --accent-ink: #d7d99b; }
  body[data-accent="slate"] { --accent: #3a4d5c; --accent-ink: #243743; }
  body[data-accent="slate"].theme-dark { --accent: #8aa6bc; --accent-ink: #b5c8d8; }
`;

const APP_CSS = `
  /* ─── Nav ─────────────────────────────────────────────────────────── */
  .nav {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in oklab, var(--bg) 78%, transparent);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid transparent;
    transition: border-color .2s, background .2s;
  }
  .nav.is-scrolled { border-bottom-color: var(--line); background: color-mix(in oklab, var(--bg) 92%, transparent); }
  .nav-row {
    display: flex; align-items: center; justify-content: space-between;
    height: 136px;
  }
  .logo-link { display: inline-flex; align-items: center; gap: 8px; }
  .logo-img-link .logo-img {
    display: block;
    transform: scale(var(--logo-scale, 1));
    transform-origin: left center;
    transition: transform 0.22s cubic-bezier(.22, .8, .3, 1);
    will-change: transform;
  }
  .logo-img-link .logo-dark { display: none; }
  body.theme-dark .logo-img-link .logo-light { display: none; }
  body.theme-dark .logo-img-link .logo-dark { display: block; }
  @media (max-width: 720px) {
    .nav-row { height: 100px; }
    .logo-img-link .logo-img { height: 66px !important; }
  }
  @media (max-width: 480px) {
    .logo-img-link .logo-img { height: 32px !important; }
  }
  .nav-links {
    display: flex; align-items: center; gap: 4px;
  }
  .nav-link {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--ink-2);
    transition: color .15s, background .15s;
  }
  .nav-link:hover { color: var(--ink); background: var(--bg-2); }
  .nav-link.is-active { color: var(--ink); background: var(--bg-2); }

  .nav-toggle { display: none; background: transparent; border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 40px; padding: 0; position: relative; }
  .nav-toggle span { position: absolute; left: 9px; right: 9px; height: 1.5px; background: var(--ink); transition: transform .2s, top .2s, opacity .2s; }
  .nav-toggle span:nth-child(1) { top: 14px; }
  .nav-toggle span:nth-child(2) { top: 22px; }
  .nav-toggle.is-open span:nth-child(1) { top: 18px; transform: rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { top: 18px; transform: rotate(-45deg); }

  .nav-drawer { display: none; border-top: 1px solid var(--line); background: var(--bg); padding: 8px 0 14px; }
  .nav-drawer-link {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px var(--gutter);
    font-size: 18px;
    font-family: var(--f-serif);
    color: var(--ink);
    border-bottom: 1px solid var(--line);
  }
  .nav-drawer-link:last-child { border-bottom: 0; }
  .nav-drawer-link.is-indent { padding-left: calc(var(--gutter) + 18px); font-size: 15px; color: var(--ink-2); font-family: var(--f-sans); }
  .nav-drawer-link.is-active { color: var(--accent-ink); }
  .nav-drawer-link .arr { color: var(--ink-3); }

  @media (max-width: 800px) {
    .nav-links { display: none; }
    .nav-toggle { display: block; }
    .nav-drawer { display: block; }
  }

  /* ─── Buttons ─────────────────────────────────────────────────────── */
  .btn-primary, .btn-ghost {
    display: inline-flex; align-items: center; gap: 10px;
    height: 48px; padding: 0 22px;
    border-radius: 999px;
    font-size: 14.5px; font-weight: 500; letter-spacing: 0.01em;
    border: 1px solid transparent;
    transition: transform .15s, background .15s, color .15s, border-color .15s;
    text-decoration: none;
  }
  .btn-primary {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
  }
  .btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
  .btn-primary.inverse { background: var(--bg); color: var(--ink); border-color: var(--bg); }
  .btn-primary.inverse:hover { background: var(--accent); border-color: var(--accent); color: var(--inverse); }

  .btn-ghost {
    background: transparent; color: var(--ink); border-color: var(--line-2);
  }
  .btn-ghost:hover { border-color: var(--ink); }
  .btn-ghost.inverse { color: var(--bg); border-color: color-mix(in oklab, var(--bg) 40%, transparent); }
  .btn-ghost.inverse:hover { border-color: var(--bg); }

  /* ─── Hero ─────────────────────────────────────────────────────────── */
  .hero {
    padding: clamp(40px, 8vw, 96px) 0 clamp(40px, 6vw, 80px);
    position: relative;
  }
  .hero-grid {
    display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: clamp(32px, 6vw, 80px);
    align-items: end;
  }
  .hero-title {
    font-size: clamp(40px, 7vw, 88px);
    margin: 22px 0 24px;
    max-width: 14ch;
  }
  .hero-lede {
    font-size: clamp(16px, 1.5vw, 19px);
    color: var(--ink-2);
    max-width: 48ch;
    margin: 0 0 32px;
    line-height: 1.55;
  }
  .hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

  .hero-meta {
    border-top: 1px solid var(--line);
    padding-top: 14px;
    display: flex; flex-direction: column;
  }
  .hero-meta-row {
    display: flex; align-items: baseline; justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  .hero-meta-k { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
  .hero-meta-v { font-family: var(--f-serif); font-size: clamp(20px, 2vw, 26px); color: var(--ink); }

  @media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; gap: 36px; }
    .hero-meta { margin-top: 8px; }
  }

  /* ─── Sections ────────────────────────────────────────────────────── */
  .section { padding: clamp(48px, 7vw, 96px) 0; }
  .section.quiet { background: var(--bg-2); border-block: 1px solid var(--line); }
  .section-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: clamp(28px, 4vw, 56px); }
  .section-title { font-size: clamp(32px, 4vw, 52px); max-width: 22ch; }

  .two-col {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: clamp(24px, 4vw, 64px);
    align-items: start;
  }
  .two-col-l { position: sticky; top: 100px; }
  @media (max-width: 800px) {
    .two-col { grid-template-columns: 1fr; }
    .two-col-l { position: static; }
  }

  .prose p { margin: 0 0 18px; max-width: 64ch; }
  .prose .lede { font-family: var(--f-serif); font-size: clamp(22px, 2.2vw, 28px); line-height: 1.32; color: var(--ink); margin-bottom: 24px; }
  .prose .quote-line { font-family: var(--f-serif); font-style: italic; font-size: 19px; color: var(--ink-2); border-left: 2px solid var(--accent); padding-left: 18px; }
  .prose .quote-line a { color: var(--accent-ink); border-bottom: 1px solid currentColor; }

  /* ─── Location cards ──────────────────────────────────────────────── */
  .loc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(20px, 3vw, 40px);
  }
  @media (max-width: 760px) {
    .loc-grid { grid-template-columns: 1fr; }
  }
  .loc-card {
    display: flex; flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, border-color .2s;
  }
  .loc-card:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -16px rgba(0,0,0,.15); border-color: var(--line-2); }
  .loc-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .loc-img { border-bottom: 1px solid var(--line); }
  .loc-body { padding: clamp(20px, 2.5vw, 32px); display: flex; flex-direction: column; gap: 12px; }
  .loc-kicker { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-ink); }
  .loc-name { font-size: clamp(28px, 3.5vw, 42px); margin: 0; }
  .loc-addr { color: var(--ink-2); font-size: 15px; margin-top: -4px; }
  .loc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 14px 0 18px; padding-top: 14px; border-top: 1px solid var(--line); }
  .loc-meta dt { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin: 0; }
  .loc-meta dd { font-size: 14px; color: var(--ink); margin: 0 0 4px; }
  .loc-cta { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink); margin-top: auto; }
  .loc-card:hover .loc-cta { color: var(--accent-ink); }

  /* ─── Bullet grid ─────────────────────────────────────────────────── */
  .quiet-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
  .quiet-title { font-size: clamp(28px, 3vw, 40px); max-width: 24ch; margin: 8px 0 28px; }
  .bullet-grid {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
  }
  @media (max-width: 760px) { .bullet-grid { grid-template-columns: 1fr 1fr; } }
  @media (max-width: 480px) { .bullet-grid { grid-template-columns: 1fr; } }
  .bullet-grid li { background: var(--bg-2); padding: 22px 22px 24px; display: flex; gap: 14px; align-items: flex-start; }
  .bullet-grid b { display: block; font-weight: 500; font-size: 16px; color: var(--ink); }
  .bullet-grid li > div > div { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
  .bullet-i { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border: 1px solid var(--line-2); border-radius: 999px; color: var(--accent-ink); flex: 0 0 28px; }

  /* ─── Detail hero ─────────────────────────────────────────────────── */
  .detail-hero { padding: clamp(24px, 4vw, 48px) 0 clamp(28px, 4vw, 56px); }
  .crumb { display: flex; align-items: center; gap: 10px; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 28px; }
  .crumb a { color: var(--ink-3); }
  .crumb a:hover { color: var(--ink); }
  .detail-hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: end; margin-bottom: clamp(32px, 4vw, 56px); }
  .detail-title { font-size: clamp(40px, 6vw, 76px); margin: 14px 0 0; }
  .key-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; border-top: 1px solid var(--line); padding-top: 18px; margin: 0; }
  .key-facts > div > dt { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 4px; }
  .key-facts > div > dd { font-family: var(--f-serif); font-size: clamp(20px, 2vw, 26px); color: var(--ink); margin: 0; }
  @media (max-width: 800px) { .detail-hero-grid { grid-template-columns: 1fr; } }

  /* ─── House blocks ────────────────────────────────────────────────── */
  .house { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
  .house.reverse .house-media { order: 2; }
  .house-title { font-size: clamp(36px, 4.5vw, 56px); margin: 12px 0 24px; }
  .house-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 0 0 28px; }
  .house-fact { background: var(--bg); padding: 14px 16px; }
  .house-fact dt { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 4px; }
  .house-fact dd { font-size: 17px; color: var(--ink); margin: 0; font-family: var(--f-serif); }
  @media (max-width: 800px) {
    .house { grid-template-columns: 1fr; }
    .house.reverse .house-media { order: 0; }
  }

  /* ─── Image placeholder ───────────────────────────────────────────── */
  .img-ph {
    position: relative; width: 100%;
    background: var(--bg-3);
    color: var(--ink-2);
    overflow: hidden;
    border-radius: 2px;
  }
  .img-ph.tone-render { background: linear-gradient(135deg, #d8d2c2 0%, #c5beac 100%); color: #4a4842; }
  .img-ph.tone-photo  { background: linear-gradient(135deg, #b0a89a 0%, #8a8275 100%); color: #f3efe7; }
  .img-ph.tone-plan   { background: var(--bg); color: var(--ink-3); border: 1px solid var(--line); }
  body.theme-dark .img-ph.tone-render { background: linear-gradient(135deg, #2c2820 0%, #1f1c17 100%); color: #b5ad9a; }
  body.theme-dark .img-ph.tone-photo  { background: linear-gradient(135deg, #2a261f 0%, #1a1814 100%); color: #b5ad9a; }
  .img-ph-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
  .img-real {
    position: relative; width: 100%;
    background: var(--bg-3);
    overflow: hidden;
    border-radius: 2px;
  }
  .img-real img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
  }
  .img-ph-label {
    position: absolute; left: 14px; bottom: 12px;
    font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.05em;
    padding: 4px 8px;
    background: color-mix(in oklab, var(--bg) 72%, transparent);
    color: var(--ink-2);
    backdrop-filter: blur(8px);
    border-radius: 2px;
  }

  /* ─── Forms ───────────────────────────────────────────────────────── */
  .form { display: flex; flex-direction: column; gap: 18px; max-width: 600px; }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  @media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
  .form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-family: var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
  .form label em { color: var(--accent-ink); font-style: normal; }
  .form input, .form textarea {
    font: 16px/1.5 var(--f-sans);
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 12px 14px;
    transition: border-color .15s, box-shadow .15s;
    text-transform: none; letter-spacing: 0;
  }
  .form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent); }
  .form-err { font: 12px/1.4 var(--f-sans); color: #a14a1f; text-transform: none; letter-spacing: 0; margin-top: 2px; }
  .form-actions { margin-top: 8px; }

  .form-success {
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px;
    padding: 28px; max-width: 600px;
  }
  .form-success-mark {
    width: 44px; height: 44px; border-radius: 999px;
    background: var(--ink); color: var(--bg);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px;
  }

  /* ─── Contact card ────────────────────────────────────────────────── */
  .contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 56px);
    align-items: start;
  }
  @media (max-width: 880px) {
    .contact-grid { grid-template-columns: 1fr; }
    .contact-stage-col { order: -1; }
  }

  /* ─── Location chips ──────────────────────────────────────────────── */
  .loc-pick { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
  .loc-pick legend { font: 13px/1.4 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); padding: 0; margin-bottom: 4px; }
  .loc-pick-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  @media (max-width: 600px) { .loc-pick-row { grid-template-columns: 1fr; } }

  .loc-chip {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px 10px 10px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-2);
    text-align: left;
    transition: border-color .18s, background .18s, color .18s, transform .18s;
    cursor: pointer;
  }
  .loc-chip:hover { border-color: var(--line-2); color: var(--ink); }
  .loc-chip.is-active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
  }
  .loc-chip-thumb {
    width: 32px; height: 32px;
    border-radius: 999px;
    background: var(--bg-3) center/cover no-repeat;
    flex: 0 0 32px;
    border: 1px solid color-mix(in oklab, var(--line) 70%, transparent);
    display: inline-flex; align-items: center; justify-content: center;
  }
  .loc-chip-thumb.is-neutral {
    background: var(--bg-2);
    color: var(--ink-3);
  }
  .loc-chip.is-active .loc-chip-thumb { border-color: color-mix(in oklab, var(--bg) 50%, transparent); }
  .loc-chip.is-active .loc-chip-thumb.is-neutral { background: color-mix(in oklab, var(--bg) 14%, transparent); color: var(--bg); }
  .loc-chip-name { font-size: 14px; font-weight: 500; letter-spacing: 0.005em; }

  /* ─── Stage ───────────────────────────────────────────────────────── */
  .stage {
    position: sticky; top: 96px;
    width: 100%;
  }
  @media (max-width: 880px) { .stage { position: static; } }

  .stage-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-3);
    box-shadow: 0 24px 60px -28px rgba(0,0,0,.35);
  }
  .stage-frame {
    position: absolute; inset: 0;
    opacity: 0;
    transition: opacity .9s cubic-bezier(.4, 0, .2, 1);
    will-change: opacity;
  }
  .stage-frame img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.06);
  }
  .stage-frame.is-active {
    opacity: 1;
  }
  .stage-frame.is-active img {
    animation: kenburns 14s ease-in-out infinite alternate;
  }
  .stage-frame-0.is-active img { animation-name: kenburns-a; }
  .stage-frame-1.is-active img { animation-name: kenburns-b; }
  @keyframes kenburns-a {
    0%   { transform: scale(1.05) translate(0%, 0%); }
    100% { transform: scale(1.14) translate(-3%, -2%); }
  }
  @keyframes kenburns-b {
    0%   { transform: scale(1.05) translate(0%, 0%); }
    100% { transform: scale(1.14) translate(2%, -3%); }
  }

  .stage-veil {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(24,22,19,0) 30%, rgba(24,22,19,.55) 100%);
    pointer-events: none;
  }

  .stage-caption {
    position: absolute;
    left: clamp(18px, 3vw, 28px);
    right: clamp(18px, 3vw, 28px);
    bottom: clamp(18px, 3vw, 28px);
    color: #f3efe7;
    display: flex; flex-direction: column; gap: 6px;
  }
  .stage-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(243,239,231,.85);
    margin-bottom: 4px;
  }
  .stage-dot {
    width: 7px; height: 7px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(201,163,90,.6);
    animation: stage-pulse 2.4s ease-out infinite;
  }
  @keyframes stage-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(201,163,90,.55); }
    70%  { box-shadow: 0 0 0 10px rgba(201,163,90,0); }
    100% { box-shadow: 0 0 0 0 rgba(201,163,90,0); }
  }
  .stage-title {
    font-size: clamp(36px, 4.5vw, 56px);
    color: #f3efe7;
    line-height: 1;
    animation: stage-title-in .6s cubic-bezier(.2, .8, .2, 1) both;
  }
  @keyframes stage-title-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .stage-sub {
    font-size: 14px;
    color: rgba(243,239,231,.78);
    letter-spacing: 0.005em;
  }
  .stage-pager {
    position: absolute;
    top: clamp(18px, 3vw, 24px);
    right: clamp(18px, 3vw, 24px);
    display: flex; gap: 6px;
  }
  .stage-pip {
    width: 22px; height: 2px;
    background: rgba(243,239,231,.35);
    transition: background .4s, width .4s;
  }
  .stage-pip.is-active {
    background: var(--accent);
    width: 32px;
  }

  @media (prefers-reduced-motion: reduce) {
    .stage-frame.is-active img { animation: none; transform: scale(1.05); }
    .stage-title { animation: none; }
    .stage-dot { animation: none; }
  }

  /* Split (Keine Präferenz) — both stops visible, top/bottom */
  .stage-inner.is-split .stage-frame {
    opacity: 1;
    transition: clip-path .6s cubic-bezier(.4, 0, .2, 1), opacity .6s;
  }
  .stage-inner.is-split .stage-frame-0 { clip-path: inset(0 0 50% 0); }
  .stage-inner.is-split .stage-frame-1 { clip-path: inset(50% 0 0 0); }
  .stage-inner.is-split .stage-frame img { animation-duration: 18s; }
  .stage-inner.is-split::after {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 50%;
    height: 1px;
    background: linear-gradient(90deg, rgba(243,239,231,0) 0%, rgba(243,239,231,.7) 50%, rgba(243,239,231,0) 100%);
    z-index: 2;
    pointer-events: none;
    transform: translateY(-0.5px);
  }
  .stage-inner.is-split .stage-veil {
    background:
      linear-gradient(180deg, rgba(24,22,19,0) 30%, rgba(24,22,19,.55) 49%, rgba(24,22,19,0) 50%),
      linear-gradient(180deg, rgba(24,22,19,0) 75%, rgba(24,22,19,.55) 100%);
  }
  .stage-split-labels {
    position: absolute;
    inset: 0;
    display: flex; flex-direction: column;
    justify-content: space-between;
    padding: clamp(18px, 3vw, 24px) clamp(18px, 3vw, 24px) 0;
    pointer-events: none;
    z-index: 3;
  }
  .stage-split-labels > span {
    display: inline-flex;
    align-self: flex-start;
    font-family: var(--f-mono);
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #f3efe7;
    padding: 4px 9px;
    background: rgba(24,22,19,.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 2px;
  }
  .stage-split-labels > span:last-child {
    align-self: flex-start;
    margin-top: auto;
    margin-bottom: calc(50% + 14px);
    /* sits in bottom half, just below the divider */
    align-self: flex-start;
    transform: translateY(0);
  }
  /* The bottom label needs to sit just below the divider, above the caption.
     Simpler: position absolutely. */
  .stage-split-labels { display: block; }
  .stage-split-labels > span:first-child { position: absolute; top: clamp(18px, 3vw, 24px); left: clamp(18px, 3vw, 24px); }
  .stage-split-labels > span:last-child  { position: absolute; top: calc(50% + 14px); left: clamp(18px, 3vw, 24px); margin: 0; }

  /* ─── Contact info card (existing) ────────────────────────────────── */
  .contact-card {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: clamp(20px, 2.5vw, 28px);
    display: flex; flex-direction: column; gap: 16px;
  }
  .contact-h { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .contact-block { display: flex; flex-direction: column; gap: 4px; }
  .contact-k { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
  .contact-v { font-size: 15px; color: var(--ink); line-height: 1.45; }
  .contact-v.big { font-family: var(--f-serif); font-size: clamp(22px, 2.4vw, 30px); }
  a.contact-v:hover { color: var(--accent-ink); }

  /* ─── CTA band ────────────────────────────────────────────────────── */
  .cta-band {
    background: var(--inverse);
    color: var(--inverse-ink);
    padding: clamp(48px, 7vw, 96px) 0;
  }
  .cta-band-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: end; }
  .cta-band-title { font-size: clamp(28px, 3.5vw, 48px); color: var(--inverse-ink); margin: 16px 0 0; max-width: 22ch; }
  .cta-band-title em { color: var(--accent); font-style: italic; }
  .eyebrow.inverse { color: color-mix(in oklab, var(--inverse-ink) 60%, transparent); }
  .eyebrow.inverse::before { background: color-mix(in oklab, var(--inverse-ink) 35%, transparent); }
  .cta-band-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
  @media (max-width: 760px) {
    .cta-band-grid { grid-template-columns: 1fr; }
    .cta-band-actions { justify-content: flex-start; }
  }

  /* ─── Footer ──────────────────────────────────────────────────────── */
  .footer {
    background: var(--bg-2);
    border-top: 1px solid var(--line);
    padding: clamp(40px, 6vw, 64px) 0 24px;
    font-size: 14px;
  }
  .footer-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 32px;
    padding-bottom: clamp(28px, 4vw, 48px);
  }
  @media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
  @media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }
  .footer-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  .footer-col .logo-img-link .logo-img { max-width: 100%; }
  .footer-h { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
  .footer-col a { color: var(--ink); }
  .footer-col a:hover { color: var(--accent-ink); }
  .footer-addr { color: var(--ink-2); line-height: 1.6; }
  .footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 18px; border-top: 1px solid var(--line);
    font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
    flex-wrap: wrap; gap: 14px;
  }
  .footer-bottom a:hover { color: var(--ink); }
  .legal { display: flex; gap: 12px; align-items: center; }
`;

// Inject CSS
const _s1 = document.createElement("style"); _s1.textContent = ACCENT_CSS + APP_CSS;
document.head.appendChild(_s1);

ReactDOM.createRoot(document.getElementById("root")).render(<App />);
