/* ================= Schriften (selbst gehostet) ================= */
@font-face { font-family: "Cormorant SC"; src: url("../fonts/cormorant-sc-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant SC"; src: url("../fonts/cormorant-sc-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Pinyon Script"; src: url("../fonts/pinyon-script-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
/* Nur das Et-Zeichen aus Great Vibes (Copperplate-Stil), Rest bleibt Pinyon Script */
@font-face { font-family: "Amp Script"; src: url("../fonts/ampersand-great-vibes.woff2") format("woff2"); unicode-range: U+0026; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("../fonts/courier-prime-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

/* ================= Tokens ================= */
:root {
  color-scheme: light;
  --paper: #fffaf4;
  --ink: #322f14;
  --olive: #767044;
  --olive-light: #8a834f;
  --env: #5d552f;
  --burgundy: #75252a;
  --cream: #fffaf4;
  --tile: #f1ece0;
  --tile-on: #e6dfca;
  --submit: #d0cab2;
  --field-border: #b8af8f;
  --error: #8e2b33;

  --serif: "Cormorant SC", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --script: "Amp Script", "Pinyon Script", "Snell Roundhand", "Apple Chancery", cursive;
  --mono: "Courier New", "Courier Prime", Courier, monospace;
  --ease: cubic-bezier(.22, .8, .26, 1);

  /* 1 Referenz-Pixel bei 1440 px Breite */
  --u: calc(min(100vw, 1600px) / 1440);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}
body[data-route="gate"], body[data-route="umschlag"] { background: var(--env); }

p { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
img, svg, video { max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px; }
[tabindex="-1"]:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.noscript { padding: 40px 20px; text-align: center; color: var(--cream); }

/* Inline-SVG-Container */
[data-svg] > svg { display: block; width: 100%; height: auto; overflow: visible; }

/* ================= Ansichten ================= */
.view { position: relative; }
.view.is-leaving { animation: view-out .28s ease both; }
.view.is-in { animation: view-in .45s ease both; }
@keyframes view-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes view-out { from { opacity: 1; } to { opacity: 0; } }

/* ================= Sprachumschalter ================= */
.lang {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 15px;
  letter-spacing: .08em;
  color: var(--ink);
}
body[data-route="gate"] .lang, body[data-route="umschlag"] .lang { color: var(--cream); }
.lang-btn {
  background: none; border: 0; padding: 8px 6px; cursor: pointer;
  opacity: .6; text-transform: lowercase;
  min-width: 36px; min-height: 36px;
}
.lang-btn[aria-pressed="true"] { opacity: 1; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.lang-btn:hover { opacity: 1; }
.lang-sep { opacity: .5; }

/* ================= Zugangscode ================= */
.view-gate {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 72px 20px 48px;
  background: var(--env) url("../assets/svg/texture-felt.svg");
  color: var(--cream);
}
.gate {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.gate-seal { width: 118px; margin-bottom: 10px; }
.gate-title { margin: 0; font-family: var(--script); font-weight: 400; font-size: clamp(40px, 9vw, 58px); line-height: 1.15; }
.gate-prompt { font-size: 19px; max-width: 30ch; }
.gate-input {
  width: 100%;
  margin-top: 8px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 250, 244, .55);
  padding: 10px 4px;
  text-align: center;
  font-size: 22px;
  letter-spacing: .18em;
  color: var(--cream);
  border-radius: 0;
}
.gate-input::placeholder { color: rgba(255, 250, 244, .6); letter-spacing: .08em; }
.gate-input:focus { outline: none; border-bottom-color: var(--cream); }
.gate-error { font-size: 16px; color: #f3d9c9; }
.gate-button {
  margin-top: 10px;
  min-height: 48px;
  padding: 10px 40px;
  border: 1px solid rgba(255, 250, 244, .7);
  border-radius: 999px;
  background: transparent;
  color: var(--cream);
  font-size: 20px;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.gate-button:hover { background: var(--cream); color: var(--env); }
.gate.is-shaking { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}
