/* ========================================================================
   FATUM — styles.css
   Obsidian black. Hard white. Monolithic. Nothing soft, nothing slow.
   ======================================================================== */

:root {
  --obsidian: #050505;
  --bone: #f4f4f0;
}

* { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

html, body { background: var(--obsidian); }
body { overflow-x: hidden; cursor: default; }

.text-balance { text-wrap: balance; }

/* ---- Film grain: subtle moving texture, never decorative noise ---- */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 100;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.6s steps(2) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  50%     { transform: translate(-3%, 2%); }
}

/* ---- Scroll progress bar ---- */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--bone);
  z-index: 60;
  mix-blend-mode: difference;
}

/* ---- Section tags ---- */
.section-tag {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(244,244,240,0.4);
}
.section-tag-dark {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(5,5,5,0.45);
}

/* ---- Hero ---- */

/* Full-bleed video layer — covers the whole hero, including behind the header */
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #050505;   /* = Seitenfarbe, kein sichtbarer Balken zur naechsten Sektion */
}
.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Lift every hero element above the video */
.hero > *:not(.hero-media) {
  position: relative;
  z-index: 1;
}

/* Darkening scrim — keeps FATUM readable. Heavier at top/bottom edges. */
.hero-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      to bottom,
      rgba(5,5,5,0.75) 0%,
      rgba(5,5,5,0.45) 30%,
      rgba(5,5,5,0.45) 60%,
      rgba(5,5,5,0.92) 100%
    );
}
.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 38%, rgba(5,5,5,0.85) 100%);
}
.hero .word {
  will-change: transform;
  text-shadow: 0 4px 60px rgba(0,0,0,0.55);
}

/* Hero char reveal — each letter starts clipped + pushed down */
.char {
  display: inline-block;
  transform: translateY(110%) skewY(0deg);
  opacity: 0;
}

/* Scroll indicator bar with a falling pulse */
.scroll-bar {
  position: relative;
  display: block;
  width: 1px;
  height: 60px;
  background: rgba(244,244,240,0.2);
  overflow: hidden;
}
.scroll-bar::after {
  content: "";
  position: absolute;
  top: -50%;
  left: 0;
  width: 100%;
  height: 50%;
  background: var(--bone);
  animation: drop 1.6s cubic-bezier(0.7, 0, 0.3, 1) infinite;
}
@keyframes drop {
  0%   { top: -50%; }
  100% { top: 100%; }
}

/* ---- Reveal primitives (set by JS, animated by GSAP) ---- */
.reveal-line, .fade-block { opacity: 0; }

/* ---- Marquee ---- */
.marquee-track {
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
  animation: marquee 22s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ---- Ethos list ---- */
.ethos-row {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.6rem 0;
  cursor: default;
  transition: padding 0.4s cubic-bezier(0.22,1,0.36,1);
  overflow: hidden;
}
.ethos-row::before {
  content: attr(data-num);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1rem;
  color: rgba(244,244,240,0.3);
}
.ethos-word {
  font-family: 'Anton', Impact, sans-serif;
  font-size: clamp(2.5rem, 9vw, 7rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  padding-left: 3rem;
  transition: transform 0.45s cubic-bezier(0.22,1,0.36,1), color 0.45s ease;
  color: var(--bone);
}
.ethos-desc {
  max-width: 16rem;
  text-align: right;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: rgba(244,244,240,0.45);
  transition: color 0.45s ease, transform 0.45s cubic-bezier(0.22,1,0.36,1);
  flex-shrink: 0;
}
.ethos-row:hover .ethos-word { transform: translateX(0.75rem); color: #fff; }
.ethos-row:hover .ethos-desc { color: rgba(244,244,240,0.8); transform: translateX(-0.4rem); }
.ethos-row:hover { background: linear-gradient(90deg, rgba(244,244,240,0.04), transparent); }

/* ---- Destiny section ---- */
.destiny { isolation: isolate; }
.destiny-quote .char { transform: translateY(120%) skewY(0deg); opacity: 0; }
.destiny-quote .char { color: var(--bone); }

/* ---- Reduced motion: respect it ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .char, .reveal-line, .fade-block, .split-up { opacity: 1 !important; transform: none !important; }
}

/* ---- Mobile ethos layout ---- */
@media (max-width: 640px) {
  .ethos-desc { display: none; }
  .ethos-word { padding-left: 2rem; }
}

/* ---- Cinematic letterbox bars (epic widescreen look) ---- */
.hero-media::before,
.hero-media::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 9.8vh;
  height: 9.8svh;            /* stable on iPhone when the address bar shows/hides */
  background: #050505;
  z-index: 2;
  pointer-events: none;
}
.hero-media::before { top: 0; }
.hero-media::after  { bottom: 0; }
@media (max-width: 640px) {
  .hero-media::before,
  .hero-media::after { height: 6.3vh; height: 6.3svh; }
  /* Handy: Balken hoch genug, damit das Logo komplett im Schwarz sitzt */
  .hero-media::before, .hero-media::after { height: 84px; }
}

/* ---- Hero wordmark: bold condensed display face (Gravik-style) ---- */
.hero .word {
  font-family: 'Anton', Impact, sans-serif;
  font-weight: 400;
  letter-spacing: 0.03em;
}

/* ---- Ethos intro quote: soft elegant serif (Sienna-style) ---- */
.ethos-quote {
  font-family: 'Saira', 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.005em;
}


/* ---- Site body sections in Saira Condensed + Saira (hero + footer unchanged) ---- */
#word, #ethos, #destiny, #execution {
  font-family: 'Saira', 'Inter', Helvetica, Arial, sans-serif;
}
#word h2, #ethos h2, #destiny h2,
#word .font-display, #ethos .font-display, #destiny .font-display, #execution .font-display,
#word .marquee-track, .ethos-word, .destiny-quote {
  font-family: 'Saira Condensed', 'Anton', sans-serif;
  font-weight: 700;
}


/* ---- Destiny statement lines in Playfair Display (a bit heavier) ---- */
#destiny .destiny-quote,
#destiny .destiny-sub {
  font-family: 'Anton', 'Oswald', Impact, sans-serif !important;
  font-weight: 400;
  letter-spacing: -0.01em;
}


/* ---- Image that fades into the dark (no hard rectangle edges) ---- */
.emerge {
  /* longer, more gradual fade for a cleaner blend into the dark;
     top + left (hair/head) and bottom (neck). Right stays crisp. */
  -webkit-mask-image:
    linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 8%, #000 26%),
    linear-gradient(to right,  rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 8%, #000 26%),
    linear-gradient(to top,    rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 6%, #000 20%);
  -webkit-mask-composite: source-in, source-in;
  mask-image:
    linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 8%, #000 26%),
    linear-gradient(to right,  rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 8%, #000 26%),
    linear-gradient(to top,    rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 6%, #000 20%);
  mask-composite: intersect;
}

/* ---- Hide the native scrollbar (scrolling still works) ---- */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* Keine Silbentrennung irgendwo */
html, body, * { -webkit-hyphens: none; hyphens: none; }

/* Kein einzelnes Wort allein in der letzten Zeile */
p { text-wrap: pretty; }

/* Navigation im oberen Letterbox-Balken der Hero verankern */
.hero > #legend { position: absolute; z-index: 3; }

/* Hero-Navigation: beim Hover etwas vergroessern */
#legend .legend-link { display: inline-block; transition: transform .3s ease; transform-origin: center; }
#legend .legend-link:hover { transform: scale(1.15); }

/* Aufklappende Liste: gleicher Hover-Effekt wie in der Hero (links verankert, damit die Kante buendig bleibt) */
#legend-drop .legend-link { display: inline-block; transition: transform .3s ease; transform-origin: left center; }
#legend-drop .legend-link:hover { transform: scale(1.15); }

/* Saeulen links und rechts der David-Buest (Hoehe an die Buest gekoppelt) */
.pillar-wrap { --h: 334px; }
@media (min-width: 768px)  { .pillar-wrap { --h: 411px; } }
@media (min-width: 1024px) { .pillar-wrap { --h: 488px; } }
.pillar-wrap .pillar {
  position: absolute;
  top: calc(var(--h) * 0.061);   /* vertically centered on the bust */
  height: calc(var(--h) * 0.8925);
  filter: brightness(0.7);        /* 30% darker */
  width: auto;
  pointer-events: none;
}
.pillar-wrap { --o: 0.62; }
@media (min-width: 1280px) { .pillar-wrap { --o: 0.8; } }
.pillar-wrap .pillar-left  { right: calc(50% + var(--h) * var(--o)); }
.pillar-wrap .pillar-right { left:  calc(50% + var(--h) * var(--o)); }

/* David-Buest leicht in Richtung des cremefarbenen Saeulenmarmors getoent */
.bust-tint { filter: sepia(0.35) brightness(0.93); }

/* Hero: full screen height, stable on mobile Safari (small viewport height) */
.hero { min-height: 100vh; min-height: 100svh; }

/* Reload mid-page: invisible for a split second until the scroll position is restored (no visible jump) */
html.restoring body { opacity: 0; }
html.restoring { scroll-behavior: auto !important; }

/* David text, phones: per-line soft justify (see script.js) */
.david-text .sj-line { display: block; text-align: center; }
.david-text .sj-line.sj-j { text-align: justify; text-align-last: justify; }

/* Handy: Saeulen auch neben der Buest (Hoehe = Bildhoehe der Buest, naeher an der Mitte) */
@media (max-width: 767px) {
  .pillar-wrap { --h: calc((100vw - 2rem) * 0.6667); --o: 0.46; }
}

/* Handy: mehr vom Hero-Video zeigen (weniger Zoom), dafuer oben und unten mehr Schwarz */
@media (max-width: 767px) {
  .hero-video {
    height: 112.5vw;            /* doppelte 16:9-Hoehe -> zeigt ca. die halbe Videobreite statt ein Viertel */
    min-height: 0;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 25%, #000 75%, transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0%, #000 25%, #000 75%, transparent 100%);
  }
}
