/* 04 — Das Diorama · Mit Ruhe zur Kraft
   Palette: umbra #1B1815 · paper #F1EDE3 · ink #23221E · gold #C9A96A · clay #B08968 · pine #5C6E54 */

:root {
  --umbra: #1B1815;
  --paper: #F1EDE3;
  --paper-soft: #C9C3B4;
  --ink: #1F1E1A;
  --gold: #C9A96A;
  --gold-soft: rgba(201, 169, 106, 0.55);
  --hairline: rgba(241, 237, 227, 0.14);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-ui: "Inter", system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  background: var(--umbra);
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: 15.5px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- fixed scene layers ---------- */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.dof {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
}
.dof-top {
  top: 0;
  height: 15vh;
  mask-image: linear-gradient(to bottom, black 15%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, black 15%, transparent);
}
.dof-bottom {
  bottom: 0;
  height: 17vh;
  mask-image: linear-gradient(to top, black 15%, transparent);
  -webkit-mask-image: linear-gradient(to top, black 15%, transparent);
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 118% 96% at 50% 44%, transparent 58%, rgba(14, 12, 9, 0.55) 100%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 260px 260px;
}

/* ---------- loader ---------- */

#loader {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 26px;
  background: var(--umbra);
  transition: opacity 1.4s ease 0.15s, visibility 0s linear 1.6s;
}
#loader.is-done { opacity: 0; visibility: hidden; }

.loader-enso { animation: breathe 5.2s ease-in-out infinite; transform-origin: center; }
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.75; }
  50% { transform: scale(1.07); opacity: 1; }
}
.loader-word {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  color: var(--paper-soft);
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 20px clamp(20px, 4vw, 56px);
  background: linear-gradient(to bottom, rgba(20, 17, 14, 0.6), transparent);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  text-decoration: none;
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.06rem;
  letter-spacing: 0.05em;
  margin-right: auto;
}
.nav-links { display: flex; gap: 6px; }
.nav-links button {
  appearance: none;
  background: none;
  border: 0;
  min-height: 44px;
  padding: 0 14px;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-soft);
  cursor: pointer;
  transition: color 0.3s ease;
}
.nav-links button:hover, .nav-links button:focus-visible { color: var(--paper); }
.nav-cta {
  appearance: none;
  border: 1px solid var(--gold-soft);
  background: none;
  color: var(--gold);
  min-height: 44px;
  padding: 0 22px;
  border-radius: 2px;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}
.nav-cta:hover, .nav-cta:focus-visible { background: var(--gold); color: var(--ink); }

/* ---------- panels ---------- */

.panel {
  position: fixed;
  top: 50%;
  transform: translateY(calc(-50% + 30px));
  z-index: 10;
  width: min(430px, 42vw);
  padding: 42px 44px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.85s var(--ease-out),
    transform 0.85s var(--ease-out),
    visibility 0s linear 0.85s;
  background: linear-gradient(100deg, rgba(18, 15, 12, 0.82) 0%, rgba(18, 15, 12, 0.55) 55%, rgba(18, 15, 12, 0) 96%);
  border-left: 1px solid rgba(201, 169, 106, 0.28);
}
.panel--right {
  right: clamp(20px, 5vw, 84px);
  border-left: 0;
  border-right: 1px solid rgba(201, 169, 106, 0.28);
  background: linear-gradient(260deg, rgba(18, 15, 12, 0.82) 0%, rgba(18, 15, 12, 0.55) 55%, rgba(18, 15, 12, 0) 96%);
}
.panel--left { left: clamp(20px, 5vw, 84px); }
.panel--center {
  left: 50%;
  width: min(680px, 88vw);
  padding: 64px 100px;
  transform: translate(-50%, calc(-50% + 30px));
  text-align: center;
  border-left: 0;
  background: radial-gradient(ellipse 58% 62% at 50% 50%, rgba(18, 15, 12, 0.82), rgba(18, 15, 12, 0.5) 52%, rgba(18, 15, 12, 0) 76%);
}

.panel.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%);
  transition:
    opacity 1.1s var(--ease-out) 0.12s,
    transform 1.1s var(--ease-out) 0.12s,
    visibility 0s;
}
.panel--center.is-active { transform: translate(-50%, -50%); }

.panel--hero { width: min(560px, 48vw); }

/* ---------- typography ---------- */

.eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}

h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.7rem, 4.6vw, 4.3rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
}
h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin-bottom: 18px;
}
.panel h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.22rem;
  line-height: 1.25;
  margin-bottom: 4px;
}
.panel p { color: var(--paper-soft); }
.panel > p + p { margin-top: 12px; }

.lead {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--paper-soft);
  max-width: 46ch;
}
.lead--center { margin: 0 auto; }
.meta {
  margin-top: 16px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: rgba(201, 195, 180, 0.75);
}

.points, .cards { list-style: none; margin-top: 26px; }
.points li, .cards li {
  padding: 16px 0;
  border-top: 1px solid var(--hairline);
}
.points p, .cards p { font-size: 0.88rem; line-height: 1.6; }
.cards .textlink { margin-top: 8px; }

.steps {
  list-style: none;
  counter-reset: step;
  margin-top: 24px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 13px 0 13px 52px;
  border-top: 1px solid var(--hairline);
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 14px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--gold);
}
.steps p { font-size: 0.86rem; line-height: 1.55; }

.disclaimer {
  margin-top: 18px;
  font-size: 0.72rem;
  line-height: 1.6;
  color: rgba(201, 195, 180, 0.62);
}

blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.32rem;
  line-height: 1.4;
  color: var(--paper);
  margin: 22px 0;
  padding-left: 18px;
  border-left: 2px solid var(--gold-soft);
}

.creds { list-style: none; }
.creds li {
  font-size: 0.82rem;
  color: var(--paper-soft);
  padding: 6px 0 6px 18px;
  position: relative;
}
.creds li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-soft);
}

.note {
  margin-top: 18px;
  font-size: 0.78rem;
  color: rgba(201, 195, 180, 0.7);
}
.alt { margin-top: 18px; font-size: 0.85rem; }
.alt a { color: var(--gold); text-decoration: none; border-bottom: 1px solid var(--gold-soft); }

/* ---------- buttons & links ---------- */

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.cta-row--center { justify-content: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 28px;
  border-radius: 2px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}
.btn--primary { background: var(--gold); color: var(--ink); }
.btn--primary:hover, .btn--primary:focus-visible { background: #D8BC80; }
.btn--ghost { border: 1px solid rgba(241, 237, 227, 0.32); color: var(--paper); }
.btn--ghost:hover, .btn--ghost:focus-visible { border-color: var(--paper); }

.textlink {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid var(--gold-soft);
  transition: border-color 0.3s ease;
}
.textlink:hover, .textlink:focus-visible { border-color: var(--gold); }

.mini-footer {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: center;
  gap: 22px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: rgba(201, 195, 180, 0.55);
}
.mini-footer a { color: inherit; text-decoration: none; }
.mini-footer a:hover { color: var(--paper-soft); }

/* ---------- hud & hint ---------- */

.hud {
  position: fixed;
  left: clamp(20px, 4vw, 56px);
  bottom: 26px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(201, 195, 180, 0.8);
}
.hud-num { color: var(--gold); }
.hud-sep { width: 26px; height: 1px; background: var(--hairline); }

.scroll-hint {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(201, 195, 180, 0.75);
  transition: opacity 0.8s ease;
}
.scroll-hint .hint-line {
  width: 1px;
  height: 54px;
  background: linear-gradient(to bottom, var(--gold-soft), transparent);
  animation: hint 2.8s ease-in-out infinite;
  transform-origin: top;
}
@keyframes hint {
  0%, 100% { transform: scaleY(0.45); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}
.scroll-hint.is-hidden { opacity: 0; }

#spacer { height: 940vh; }

/* ---------- mobile ---------- */

@media (max-width: 760px) {
  .nav { gap: 12px; padding: 12px 16px; }
  .nav-links { display: none; }
  .brand span { font-size: 0.95rem; }

  .panel, .panel--left, .panel--right, .panel--center, .panel--hero {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 62vh;
    overflow-y: auto;
    transform: translateY(26px);
    padding: 26px 22px calc(30px + env(safe-area-inset-bottom));
    border-left: 0;
    border-right: 0;
    border-top: 1px solid rgba(201, 169, 106, 0.28);
    background: linear-gradient(to top, rgba(18, 15, 12, 0.92) 55%, rgba(18, 15, 12, 0.72));
    text-align: left;
  }
  .panel.is-active, .panel--center.is-active { transform: translateY(0); }

  h1 { font-size: 2.35rem; }
  h2 { font-size: 1.7rem; }
  .lead { font-size: 0.94rem; }
  .hud { display: none; }
  .scroll-hint { display: none; }
  .dof-bottom { display: none; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .loader-enso, .scroll-hint .hint-line { animation: none; }
  #loader { transition: opacity 0.4s ease, visibility 0s linear 0.5s; }
  .panel { transition: none; }
}

html.reduced #spacer, html.reduced .dof, html.reduced .scroll-hint, html.reduced .hud { display: none; }
html.reduced #scene { opacity: 0.42; }
html.reduced body { overflow-y: auto; }
html.reduced #panels {
  position: relative;
  z-index: 10;
  max-width: 680px;
  margin: 0 auto;
  padding: 18vh 22px 10vh;
  display: flex;
  flex-direction: column;
  gap: 8vh;
}
html.reduced .panel, html.reduced .panel--center, html.reduced .panel--hero {
  position: static;
  width: 100%;
  max-height: none;
  overflow: visible;
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(18, 15, 12, 0.78);
  border: 1px solid var(--hairline);
  border-left: 2px solid rgba(201, 169, 106, 0.4);
}
