/* ==========================================================================
   PAUL SÜSS — Editorial Dark Portfolio
   main.css — Tokens, Base, Loader, Cursor, Navbar, Hero, Buttons, Footer
   ========================================================================== */

/* ---------- Design Tokens ---------- */

:root {
  /* Typografie */
  --font-display: 'Archivo', sans-serif;
  --font-body: 'Spectral', serif;

  --text-hero: clamp(4.5rem, 17vw, 15rem);
  --text-h1: clamp(3rem, 8vw, 7rem);
  --text-h2: clamp(2.25rem, 5.5vw, 4.5rem);
  --text-h3: clamp(1.5rem, 3vw, 2.25rem);
  --text-body: clamp(1.05rem, 1.3vw, 1.2rem);
  --text-caption: clamp(0.72rem, 0.85vw, 0.82rem);

  /* Spacing */
  --space-section: clamp(7rem, 14vw, 14rem);
  --space-inner: clamp(1.5rem, 4vw, 4rem);
  --gutter: clamp(1.25rem, 3vw, 3rem);

  /* Motion */
  --ease-cinematic: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-slow: 1s;
  --duration-medium: 0.6s;
  --duration-fast: 0.35s;
}

:root,
:root[data-theme="dark"] {
  --bg-primary: #161514;
  --bg-surface: #211f1d;
  --bg-elevated: #2a2724;
  --text-primary: #f2efe9;
  --text-muted: #aba59b;
  --text-faint: #6e695f;
  --accent: #c9bba4;
  --accent-strong: #e0d2b8;
  --line: rgba(242, 239, 233, 0.12);
  --overlay: rgba(22, 21, 20, 0.55);

  /* Studio-Vignette: Lichtkegel in der Mitte, Lichtabfall an den Rändern */
  --vignette-light: rgba(242, 239, 233, 0.045);
  --vignette-dark: rgba(0, 0, 0, 0.32);
}

:root[data-theme="light"] {
  --bg-primary: #f4f1eb;
  --bg-surface: #fdfcfa;
  --bg-elevated: #ffffff;
  --text-primary: #1c1b19;
  --text-muted: #66625c;
  --text-faint: #9b958a;
  --accent: #7a6e58;
  --accent-strong: #5e5340;
  --line: rgba(28, 27, 25, 0.14);
  --overlay: rgba(244, 241, 235, 0.4);

  --vignette-light: rgba(255, 255, 255, 0.35);
  --vignette-dark: rgba(28, 27, 25, 0.12);
}

/* ---------- Reset & Base ---------- */

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

html {
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  transition: background-color 0.5s var(--ease-cinematic), color 0.5s var(--ease-cinematic);
}

/* ---------- Studio-Vignette ---------- */

/* Lichtkegel HINTER dem Content: Mitte minimal heller — wie eine weiche
   Studioleuchte auf den Hintergrund gerichtet. Nur auf transparenten
   Sektionen sichtbar, Fotos bleiben unangetastet. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 90% 70% at 50% 38%, var(--vignette-light), transparent 70%);
}

/* Lichtabfall ÜBER allem (unterhalb Navbar z-1000): Ränder fallen sanft ab —
   wie die natürliche Vignettierung eines Objektivs, auch über den Fotos. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  background: radial-gradient(ellipse 130% 130% at 50% 50%, transparent 55%, var(--vignette-dark) 100%);
}

::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* ---------- Typografie-Klassen ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 115%;
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.section-num {
  font-family: var(--font-display);
  font-size: var(--text-caption);
  font-weight: 500;
  letter-spacing: 0.35em;
  color: var(--accent);
  display: block;
  margin-bottom: 1.5rem;
}

.section-label {
  font-family: var(--font-display);
  font-size: var(--text-caption);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--text-muted);
}

/* ---------- Page Loader ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}

.loader.is-done {
  pointer-events: none;
}

.loader-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 115%;
  font-size: clamp(3rem, 8vw, 6rem);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  overflow: hidden;
  display: flex;
}

.loader-mark span {
  display: inline-block;
  transform: translateY(110%);
}

.loader-line {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(8rem, 20vw, 16rem);
  height: 1px;
  background: var(--line);
  overflow: hidden;
}

.loader-line-fill {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- Custom Cursor ---------- */

.cursor,
.cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  display: none;
}

.cursor {
  width: 8px;
  height: 8px;
  background: var(--accent);
  transform: translate(-50%, -50%);
}

.cursor-follower {
  width: 40px;
  height: 40px;
  border: 1px solid var(--accent);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.4s var(--ease-cinematic), height 0.4s var(--ease-cinematic),
              background-color 0.4s var(--ease-cinematic);
}

.cursor-follower .cursor-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--bg-primary);
  opacity: 0;
  transition: opacity 0.3s;
}

.cursor-follower.is-view {
  width: 90px;
  height: 90px;
  background: var(--accent);
  border-color: var(--accent);
}

.cursor-follower.is-view .cursor-label {
  opacity: 1;
}

.cursor-follower.is-link {
  width: 56px;
  height: 56px;
  background: rgba(201, 187, 164, 0.15);
}

@media (pointer: fine) {
  .cursor,
  .cursor-follower {
    display: flex;
  }
}

/* Nativen Cursor ausblenden, sobald der Custom-Cursor aktiv ist (Klasse per JS).
   Nur dann — Touch-/Reduced-Motion-Nutzer behalten ihren normalen Cursor. */
html.has-cursor,
html.has-cursor * {
  cursor: none !important;
}

/* ---------- Scroll Progress ---------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 1001;
  pointer-events: none;
}

.scroll-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- Navbar ---------- */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem var(--space-inner);
  transition: padding 0.5s var(--ease-cinematic), background-color 0.5s var(--ease-cinematic),
              backdrop-filter 0.5s;
}

.navbar.is-scrolled {
  padding: 0.85rem var(--space-inner);
  background: color-mix(in srgb, var(--bg-primary) 75%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 115%;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.25rem;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  position: relative;
  padding: 0.25rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease-cinematic);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-link.active {
  color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.theme-toggle,
.lang-switch {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.3s;
}

.theme-toggle:hover,
.lang-switch:hover {
  color: var(--accent);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Burger (Mobile) */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 0.5rem;
  z-index: 1002;
}

.nav-burger span {
  display: block;
  width: 26px;
  height: 1.5px;
  background: var(--text-primary);
  transition: transform 0.4s var(--ease-cinematic), opacity 0.3s;
}

.nav-burger.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Mobile Overlay Menu */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-inner);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.7s var(--ease-out-expo);
}

.nav-overlay.is-open {
  clip-path: inset(0 0 0 0);
}

.nav-overlay .overlay-link {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 115%;
  font-size: clamp(2.5rem, 10vw, 5rem);
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--text-primary);
  transition: color 0.3s;
}

.nav-overlay .overlay-link:hover,
.nav-overlay .overlay-link.active {
  color: var(--accent);
}

.nav-overlay .overlay-meta {
  margin-top: 3rem;
  display: flex;
  gap: 2rem;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 1.1rem 2.4rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  position: relative;
  overflow: hidden;
  transition: color 0.45s var(--ease-cinematic), border-color 0.45s var(--ease-cinematic);
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform 0.5s var(--ease-out-expo);
  z-index: -1;
}

.btn:hover::before {
  transform: translateY(0);
}

.btn:hover {
  color: var(--bg-primary);
  border-color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
}

.btn-primary::before {
  background: var(--accent-strong);
  transform: translateY(101%);
}

.btn-primary:hover {
  border-color: var(--accent-strong);
}

.btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Text-Link mit Unterstreichung */
.text-link {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.4rem;
}

.text-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform 0.5s var(--ease-cinematic);
}

.text-link:hover::after {
  transform: scaleX(1);
}

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

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: -10% 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transform: scale(1.1);
}

/* Hero-Overlay: bewusst FESTE dunkle Farben (kein var) —
   der Hero sieht in Dark UND Light Mode exakt gleich aus */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, #161514 2%, transparent 45%),
    linear-gradient(to bottom, rgba(22, 21, 20, 0.5) 0%, transparent 30%),
    radial-gradient(ellipse at center, transparent 40%, rgba(22, 21, 20, 0.55) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 0 var(--space-inner) clamp(2rem, 6vh, 5rem);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: var(--text-hero);
  line-height: 0.74;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--text-primary);
}

/* ---------- Light Mode: Hero sieht exakt aus wie im Dark Mode ---------- */
/* Das Hero-Bild ist dunkel — alle Inhalte darüber bleiben hell, egal welches Theme */

:root[data-theme="light"] .hero-title,
:root[data-theme="light"] .hero-statement,
:root[data-theme="light"] .hero-meta,
:root[data-theme="light"] .hero-scroll {
  color: #f2efe9;
}

/* Hero-Buttons: helle Schrift + Sand-Akzent wie im Dark Mode */
:root[data-theme="light"] .hero .btn {
  color: #f2efe9;
  border-color: rgba(242, 239, 233, 0.3);
}

:root[data-theme="light"] .hero .btn::before {
  background: #c9bba4;
}

:root[data-theme="light"] .hero .btn:hover {
  color: #161514;
  border-color: #c9bba4;
}

:root[data-theme="light"] .hero .btn-primary {
  background: #c9bba4;
  border-color: #c9bba4;
  color: #161514;
}

:root[data-theme="light"] .hero .btn-primary::before {
  background: #e0d2b8;
}

:root[data-theme="light"] .hero .btn-primary:hover {
  border-color: #e0d2b8;
}

:root[data-theme="light"] .hero-scroll::after {
  background: #c9bba4;
}

/* Light Mode: Navbar IMMER hell hinterlegt — dunkle Schrift bleibt lesbar */
:root[data-theme="light"] .navbar {
  background: color-mix(in srgb, var(--bg-primary) 85%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.hero-title .line {
  display: block;
  /* Platz oben für Umlaut-Punkte (Ü) — sonst schneidet overflow:hidden
     die Diärese durch die enge line-height (0.85) ab. */
  overflow: hidden;
  padding-top: 0.2em;
}

/* Nur die erste Zeile nach oben ausgleichen, damit der Titel oben bündig
   bleibt. Folgezeilen behalten den Platz → Umlaut-Punkte sitzen knapp
   unter der Zeile darüber, ohne sie zu überschneiden. */
.hero-title .line:first-child {
  margin-top: -0.2em;
}

.hero-title .line span {
  display: block;
}

.hero-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-top: clamp(1.5rem, 4vh, 3rem);
}

.hero-statement {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 200;
  font-size: clamp(1.4rem, 2.8vw, 2.4rem);
  line-height: 1.3;
  max-width: 18ch;
  color: var(--text-primary);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-meta {
  position: absolute;
  top: 50%;
  right: var(--space-inner);
  transform: rotate(90deg) translateX(50%);
  transform-origin: right center;
  font-family: var(--font-display);
  font-size: var(--text-caption);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.hero-scroll {
  position: absolute;
  bottom: clamp(2rem, 6vh, 5rem);
  right: var(--space-inner);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-scroll::after {
  content: '';
  width: 1px;
  height: 48px;
  background: var(--accent);
  animation: scrollPulse 2s var(--ease-cinematic) infinite;
}

@keyframes scrollPulse {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: var(--space-inner);
  padding-top: clamp(3rem, 6vw, 6rem);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 3rem;
  margin-bottom: clamp(3rem, 6vw, 6rem);
}

.footer-brand .nav-logo {
  font-size: 1.4rem;
}

.footer-brand p {
  margin-top: 1rem;
  color: var(--text-muted);
  font-style: italic;
  max-width: 28ch;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: var(--text-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--text-faint);
  margin-bottom: 1.25rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.footer-col a {
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  transition: color 0.3s;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.footer-bottom .legal {
  display: flex;
  gap: 2rem;
  justify-self: end;
}

/* Dezenter Agentur-Credit, exakt in der Mitte */
.footer-credit {
  text-align: center;
  opacity: 0.65;
  white-space: nowrap;
}

.footer-credit a {
  color: inherit;
}

.footer-bottom a:hover,
.footer-credit a:hover {
  color: var(--accent);
}

@media (max-width: 680px) {
  .footer-bottom {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .footer-bottom .legal {
    justify-self: center;
  }
}
