/* ============================================================
   ap-rec.de — Dark Studio · Apple-style Motion
   ============================================================ */

:root {
  --bg:           #0a0a0a;
  --bg-elev:      #131313;
  --bg-elev-2:    #1a1a1a;
  --line:         #1f1f1f;
  --line-strong:  #2a2a2a;
  --fg:           #f3f3f3;
  --fg-muted:     #a0a0a0;
  --fg-faint:     #6a6a6a;
  --rec:          #e63946;
  --rec-bright:   #ff5060;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius:    6px;
  --radius-lg: 16px;

  --container: clamp(20rem, 92vw, 90rem);

  /* Apple-style easings */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);     /* easeOutExpo — sehr smooth */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --t-fast: 220ms;
  --t-med:  500ms;
  --t-slow: 900ms;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; transition: color var(--t-fast) var(--ease-out); }
a:hover, a:focus-visible { color: var(--rec-bright); }

img, svg { display: block; max-width: 100%; }

::selection { background: var(--rec); color: #fff; }

/* ============================================================
   TOPBAR
   ============================================================ */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(10, 10, 10, 0.5);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background-color var(--t-med) var(--ease-out),
              border-color var(--t-med) var(--ease-out);
}
.topbar.is-scrolled {
  background: rgba(10, 10, 10, 0.78);
  border-bottom-color: var(--line);
}

.logo { display: inline-flex; align-items: center; }
.logo__img {
  width: auto;
  height: 28px;
  transition: transform var(--t-med) var(--ease-out), opacity var(--t-fast);
}
.logo:hover .logo__img { transform: translateY(-1px) scale(1.02); }

.nav { display: flex; gap: 1.6rem; font-size: 0.92rem; }
.nav a {
  position: relative;
  color: var(--fg);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--rec);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-med) var(--ease-out);
}
.nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; row-gap: 0.6rem; }
  .nav { gap: 1.1rem; }
}

/* ============================================================
   HERO mit Parallax-Hintergrund
   ============================================================ */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 8rem clamp(1.5rem, 5vw, 4rem) 6rem;
  overflow: hidden;
  isolation: isolate;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.hero__bg-image {
  position: absolute;
  top: -10%;
  left: 0;
  width: 100%;
  height: 120%;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  will-change: transform;
  transition: transform 100ms linear;
  filter: brightness(0.7);
}
.hero__bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.55) 0%,
    rgba(10, 10, 10, 0.40) 30%,
    rgba(10, 10, 10, 0.55) 60%,
    rgba(10, 10, 10, 0.95) 92%,
    var(--bg) 100%
  );
}

.hero__inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  text-align: left;
}

.hero__title {
  margin: 0 0 0.6rem;
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
  opacity: 0;
  transform: translateY(20px);
  animation: hero-in var(--t-slow) var(--ease-out) 0.1s forwards;
}
.hero__name {
  background: linear-gradient(180deg, #ffffff 0%, #b8b8b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  margin: 0 0 2.2rem;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--fg-muted);
  font-weight: 400;
  letter-spacing: 0.005em;
  opacity: 0;
  transform: translateY(20px);
  animation: hero-in var(--t-slow) var(--ease-out) 0.25s forwards;
}

.hero__roles {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--fg-muted);
  opacity: 0;
  transform: translateY(20px);
  animation: hero-in var(--t-slow) var(--ease-out) 0.4s forwards;
}
.hero__roles li {
  position: relative;
  padding-left: 1.6rem;
}
.hero__roles li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--rec);
}

@keyframes hero-in {
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   TRACK SECTIONS
   ============================================================ */

.track {
  width: var(--container);
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 7rem) 0;
  scroll-margin-top: 5rem;
}
.track--contact { padding-bottom: clamp(5rem, 10vw, 9rem); }
.track__body { font-size: 1rem; color: var(--fg); }
.muted { color: var(--fg-muted); }

/* ============================================================
   GALLERY
   ============================================================ */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 1.5rem;
}

.gallery__loading {
  grid-column: 1 / -1;
  padding: 4rem 0;
  text-align: center;
  color: var(--fg-faint);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery__empty {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--fg-muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}

.gallery__item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  cursor: zoom-in;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;

  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition: transform var(--t-med) var(--ease-out),
              box-shadow var(--t-med) var(--ease-out),
              border-color var(--t-med) var(--ease-out),
              opacity var(--t-slow) var(--ease-out);
  will-change: transform, opacity;
}

/* Logo-Watermark als CSS-Overlay (kein eingebranntes Bild) */
.gallery__item::after {
  content: "";
  position: absolute;
  bottom: 18px;
  right: 18px;
  width: clamp(70px, 22%, 130px);
  aspect-ratio: 420 / 110;
  background-image: url('/assets/logo.svg');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: bottom right;
  opacity: 0.4;
  z-index: 2;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease-out);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}
@media (hover: hover) {
  .gallery__item:hover::after { opacity: 0.85; }
}
.gallery__item.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.78);
  transition: filter var(--t-med) var(--ease-out),
              transform var(--t-slow) var(--ease-out);
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

@media (hover: hover) {
  .gallery__item:hover {
    transform: translateY(-6px) scale(1.005);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  }
  .gallery__item:hover img {
    filter: brightness(1);
    transform: scale(1.04);
  }
}

.gallery__item:focus-visible {
  outline: 2px solid var(--rec);
  outline-offset: 4px;
}

/* ============================================================
   CONTACT
   ============================================================ */

.contact { text-align: left; }
.contact__primary {
  display: inline-block;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.005em;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.25rem;
  transition: border-color var(--t-med) var(--ease-out),
              color var(--t-med) var(--ease-out),
              transform var(--t-med) var(--ease-out);
}
.contact__primary:hover {
  border-color: var(--rec);
  color: var(--rec-bright);
  transform: translateX(4px);
}

/* ============================================================
   FOOTER
   ============================================================ */

.foot {
  border-top: 1px solid var(--line);
  padding: 1.6rem clamp(1rem, 4vw, 2.5rem);
  margin-top: 2rem;
}
.foot__inner {
  width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
}
.foot__links { display: inline-flex; gap: 1.2rem; }
.foot__links a { color: var(--fg-faint); }
.foot__links a:hover { color: var(--fg-muted); }

/* ============================================================
   LIGHTBOX
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease-out);
}
.lightbox[hidden] { display: none; }
.lightbox:not([hidden]) { opacity: 1; }

.lightbox__figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  animation: lightbox-in var(--t-med) var(--ease-out);
}
.lightbox__img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.lightbox__caption {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--fg-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes lightbox-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox__close, .lightbox__nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--fg);
  width: 48px; height: 48px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all var(--t-fast) var(--ease-out);
}
.lightbox__close { top: 1.2rem; right: 1.2rem; font-size: 1.4rem; }
.lightbox__nav--prev { left: 1.2rem; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 1.2rem; top: 50%; transform: translateY(-50%); }

.lightbox__close:hover, .lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--rec-bright);
  transform: scale(1.05);
}
.lightbox__nav--prev:hover { transform: translateY(-50%) scale(1.05); }
.lightbox__nav--next:hover { transform: translateY(-50%) scale(1.05); }

@media (max-width: 600px) {
  .lightbox__nav { width: 40px; height: 40px; }
  .lightbox__nav--prev { left: 0.5rem; }
  .lightbox__nav--next { right: 0.5rem; }
}

/* ============================================================
   LEGAL (Impressum)
   ============================================================ */

.legal {
  width: min(48rem, 92vw);
  margin: 0 auto;
  padding: 7rem 0 4rem;
  color: var(--fg);
}
.legal h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  margin: 0 0 2.5rem;
  letter-spacing: -0.01em;
}
.legal h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2.4rem 0 0.6rem;
  color: var(--fg);
}
.legal p {
  color: var(--fg-muted);
  margin: 0 0 0.8rem;
  line-height: 1.7;
}
.legal a { color: var(--fg); border-bottom: 1px solid var(--line-strong); }
.legal a:hover { color: var(--rec-bright); border-color: var(--rec); }

/* ============================================================
   FOCUS / A11Y
   ============================================================ */

:focus-visible {
  outline: 2px solid var(--rec);
  outline-offset: 3px;
  border-radius: var(--radius);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .hero__bg-image { transform: none !important; }
}

/* ============================================================
   MOBILE TWEAKS
   ============================================================ */

@media (max-width: 768px) {
  .hero { min-height: 90svh; padding-top: 6rem; }
  .hero__bg-image { background-attachment: scroll; }
  .gallery { gap: 1rem; }
  .gallery__item { aspect-ratio: 3 / 4; }
}
