/* ─────────────────────────────────────────────────────────
   JONDAL Energiegesellschaft mbH — One-Pager
   ───────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Bernoru Condensed';
  src: url('fonts/BernoruCondensed.woff2') format('woff2'),
       url('fonts/BernoruCondensed.otf') format('opentype');
  font-weight: 800;
  font-display: swap;
}

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

:root {
  --pill-fill: #9a9a9a;
  --knob-fill: #ffffff;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  background: #fff;
  color: #000;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ─── PAGE / BACKGROUND ───────────────────────────────── */

.page {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
  color: #fff;
}

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0;
  transition: opacity 2.4s var(--ease-out);
}

.page.phase-photo .hero-photo { opacity: 1; }

.content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1rem, 4vh, 2.5rem) clamp(1rem, 4vw, 2.5rem);
}

/* ─── LOGO LOCKUP (exact crops from JONDALWEB.png) ─────── */

.brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 2vh, 1.25rem);
  min-height: 0;
}

.logo-assembly {
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}

.piece {
  display: block;
  height: min(clamp(2.6rem, 11vh, 6.5rem), 18vw);
  width: auto;
  opacity: 0;
  transform: translateY(0.12em) scale(0.92);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.logo-assembly.letters-in .piece {
  opacity: 1;
  transform: none;
}

.tagline-piece {
  display: block;
  height: min(clamp(0.7rem, 2.4vh, 1.35rem), 4vw);
  width: auto;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.logo-assembly.letters-in ~ .tagline-piece {
  opacity: 0.95;
  transform: none;
}

.switch-slot {
  position: relative;
  display: block;
  height: min(clamp(2.6rem, 11vh, 6.5rem), 18vw);
  aspect-ratio: 949 / 598;
  transform-origin: 50% 50%;
  transition: transform 0.6s var(--ease-out);
}

/* Frosted-glass backdrop behind the pill, matching its stadium shape. */
.switch-slot::before {
  content: '';
  position: absolute;
  inset: 0.7% 2.5%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(7px) saturate(140%);
  -webkit-backdrop-filter: blur(7px) saturate(140%);
}

.switch-slot svg,
.switch-slot img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.switch-vector .pill {
  fill: var(--pill-fill);
  fill-opacity: 0.5;
}
.switch-vector .knob {
  fill: var(--knob-fill);
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transition: transform 0.42s var(--ease-spring);
}

.switch-slot.is-on .knob {
  transform: translateX(313px);
}

/* The flattened raster is only used as a fallback; the live vector stays
   on screen so the pill keeps its glass translucency after the intro. */
.switch-slot img.switch-final { display: none; }

/* ─── MORE SWITCHES ───────────────────────────────────── */

.more-text {
  flex-shrink: 0;
  font-size: clamp(1.25rem, 3.8vh, 2rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #fff;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  margin-bottom: clamp(1rem, 4vh, 2.5rem);
}

.page.intro-done .more-text {
  opacity: 0.9;
  transform: none;
}

/* ─── FOOTER ──────────────────────────────────────────── */

.site-footer {
  flex-shrink: 0;
  width: 100%;
  max-width: 760px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: clamp(0.6rem, 2vh, 1rem) clamp(0.75rem, 2vw, 1.25rem);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px) saturate(160%);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-copy {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.65);
}

.site-footer nav {
  display: flex;
  gap: 1.25rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.8rem;
}

.site-footer a:hover { color: #fff; }

/* ─── SUBPAGES (Impressum / Kontakt) — glass window ──── */

.doc-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: #000;
}

.doc-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doc-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.5);
}

.doc-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  margin-bottom: 1.75rem;
}

.doc-logo img {
  height: clamp(1.5rem, 4vw, 2rem);
  width: auto;
  display: block;
}

.page-doc {
  position: relative;
  z-index: 2;
  max-width: 620px;
  margin: clamp(2rem, 8vh, 5rem) auto;
  padding: clamp(2rem, 5vw, 3.25rem);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  color: #f2f2f2;
}

.page-doc h1 {
  font-family: 'Bernoru Condensed', 'Arial Narrow', sans-serif;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  margin-bottom: 1.75rem;
  letter-spacing: -0.01em;
  color: #fff;
  text-align: center;
}

.page-doc h2 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1.75rem 0 0.5rem;
  color: rgba(255, 255, 255, 0.55);
}

.page-doc p, .page-doc address {
  font-size: 0.98rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.88);
  font-style: normal;
}

.page-doc a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

.doc-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.doc-nav-links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.85rem;
}

.doc-nav-links a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
}

.doc-nav-links a:hover { color: #fff; }

.doc-nav-current {
  color: rgba(255, 255, 255, 0.95);
}

.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
}

.back-link:hover { color: #fff; }

/* ─── CONTACT FORM ────────────────────────────────────── */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: 0.5rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
}

.form-row input,
.form-row textarea {
  font: inherit;
  font-size: 0.95rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  resize: vertical;
}

.form-row input::placeholder,
.form-row textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
}

.contact-form button {
  align-self: flex-start;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111;
  background: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.75rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.contact-form button:hover { opacity: 0.85; }

.form-hint {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}

/* ─── SKIP INTRO (already played this session) ────────── */

.page.skip-intro,
.page.skip-intro * {
  transition-duration: 0s !important;
}

/* ─── REDUCED MOTION ──────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .hero-photo, .piece, .tagline-piece, .switch-slot, .switch-vector,
  .switch-final, .more-text {
    transition-duration: 0.25s !important;
    animation: none !important;
  }
}

/* ─── SMALL VIEWPORTS ─────────────────────────────────── */

@media (max-height: 560px) {
  .more-text { display: none; }
}
