/* =============================================
   NIELS HOFFMANN — Portfolio
   styles.css
   =============================================
   Table of Contents
   1. Custom Properties (design tokens)
   2. Reset & Base
   3. Typography
   4. Layout Utilities
   5. Navigation
   6. Hero Section
   7. Section Shared Styles
   8. About Section
   9. Work Section / Cards
   10. Contact Section
   11. Footer
   12. Scroll Reveal Animation
   13. Responsive Breakpoints
   ============================================= */


/* ─────────────────────────────────────────────
   1. CUSTOM PROPERTIES
───────────────────────────────────────────── */
:root {
  /* Colour palette */
  --color-black:       #0a0a0a;
  --color-white:       #fafafa;
  --color-gray-100:    #f4f4f4;
  --color-gray-200:    #e8e8e8;
  --color-gray-400:    #999;
  --color-gray-600:    #555;
  --color-overlay:     rgba(0, 0, 0, 0.45);

  /* Placeholder card gradients (rotate through tones) */
  --card-grad-01: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  --card-grad-02: linear-gradient(135deg, #1e1e1e 0%, #3a3a3a 100%);
  --card-grad-03: linear-gradient(135deg, #141414 0%, #282828 100%);
  --card-grad-04: linear-gradient(135deg, #222222 0%, #383838 100%);
  --card-grad-05: linear-gradient(135deg, #181818 0%, #303030 100%);
  --card-grad-06: linear-gradient(135deg, #1c1c1c 0%, #343434 100%);

  /* Typography */
  --font-display:  'Montserrat', system-ui, sans-serif;
  --font-body:     'Inter', system-ui, sans-serif;

  /* Spacing scale */
  --space-xs:   0.5rem;
  --space-sm:   1rem;
  --space-md:   2rem;
  --space-lg:   4rem;
  --space-xl:   8rem;
  --space-2xl: 12rem;

  /* Layout */
  --container-max: 1200px;
  --container-pad: clamp(1.5rem, 5vw, 5rem);

  /* Motion */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast:   200ms;
  --duration-base:   400ms;
  --duration-slow:   700ms;
  --duration-reveal: 900ms;
}


/* ─────────────────────────────────────────────
   2. RESET & BASE
───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* Native smooth scroll — JS handles cross-browser fallback */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-white);
  color: var(--color-black);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden;
}

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

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

ul { list-style: none; }


/* ─────────────────────────────────────────────
   3. TYPOGRAPHY
───────────────────────────────────────────── */

/* Display headings use the serif */
@keyframes heroName {
  from {
    opacity: 0;
    transform: translateY(20px);
    letter-spacing: 0.15em;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    letter-spacing: -0.02em;
  }
}

@keyframes heroSub {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3rem, 10vw, 9rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-white);
  animation: heroName 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.hero__subtitle {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-top: 1.25rem;
  animation: heroSub 1s cubic-bezier(0.16, 1, 0.3, 1) 0.9s both;
}

.hero__cross,
.hero__dot {
  opacity: 0.5;
  margin-inline: 0.4em;
}

.section__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.section__label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-gray-400);
  margin-bottom: 0.75rem;
}

.about__lead {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 300;
  line-height: 1.4;
}

.about__text {
  font-size: 0.95rem;
  color: var(--color-gray-600);
  line-height: 1.8;
}

.card__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
}

.card__category {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-gray-400);
}

.contact__cta {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.75rem, 5vw, 4rem);
  line-height: 1.15;
  max-width: 14ch;
}

.contact__link-label {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-gray-400);
  display: block;
  margin-bottom: 0.15rem;
}

.contact__link-value {
  font-size: 1rem;
  font-weight: 400;
}


/* ─────────────────────────────────────────────
   4. LAYOUT UTILITIES
───────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}


/* ─────────────────────────────────────────────
   5. NAVIGATION
───────────────────────────────────────────── */
.nav {
  position: fixed;
  top: var(--space-md);
  left: var(--container-pad);
  z-index: 100;
  mix-blend-mode: difference; /* inverts colour on dark/light backgrounds */
}

.nav__list {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav__link {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-white);
  position: relative;
  padding-bottom: 2px;
  transition: opacity var(--duration-base) var(--ease-out);
}

/* Underline on hover */
.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width var(--duration-base) var(--ease-out);
}

.nav__link:hover::after { width: 100%; }
.nav__link:hover { opacity: 0.65; }


/* ─────────────────────────────────────────────
   6. HERO SECTION
───────────────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  height: 100dvh; /* dynamic viewport height */
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Video wrapper fills the hero */
.hero__video-wrap {
  position: absolute;
  inset: 0;
  background: var(--color-black); /* shown while video loads */
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Dark overlay for text legibility */
.hero__overlay {
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
}

/* Hero copy */
.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-inline: var(--container-pad);
}

/* Scroll cue — animated line */
.hero__scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.hero__scroll-hint span {
  display: block;
  width: 1px;
  height: 60px;
  background: rgba(255,255,255,0.3);
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.hero__scroll-hint span::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.85);
  animation: scrollLine 2s var(--ease-in-out) infinite;
}

@keyframes scrollLine {
  0%   { top: -100%; }
  50%  { top: 0%; }
  100% { top: 100%; }
}


/* ─────────────────────────────────────────────
   7. SECTION SHARED STYLES
───────────────────────────────────────────── */
.section {
  padding-block: var(--space-2xl);
}

.section__header {
  margin-bottom: var(--space-xl);
}


/* ─────────────────────────────────────────────
   8. ABOUT SECTION
───────────────────────────────────────────── */
.about {
  background: var(--color-white);
}

/* Side-by-side: text links, foto rechts — gleich breit */
.about__layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.about__photo-wrap {
  order: 2;
  position: sticky;
  top: 8rem;
  overflow: hidden;
  border-radius: 2px;
  aspect-ratio: 4 / 5;
}

.about__body {
  order: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.about__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}



/* ─────────────────────────────────────────────
   9. WORK SECTION / CARDS
───────────────────────────────────────────── */
.work {
  background: var(--color-gray-100);
}

.work__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ── Card ── */
.card {
  cursor: pointer;
}

.card__img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5; /* portrait cards feel editorial */
}

/* Placeholder background gradient per card */
.card__img {
  width: 100%;
  height: 100%;
  transition: transform 0.7s var(--ease-out);
}

.card__img--01 { background: var(--card-grad-01); }
.card__img--photo { object-fit: cover; object-position: center; }
.card__img--02 { background: var(--card-grad-02); }
.card__img--03 { background: var(--card-grad-03); }
.card__img--04 { background: var(--card-grad-04); }
.card__img--05 { background: var(--card-grad-05); }
.card__img--06 { background: var(--card-grad-06); }

/* Hover overlay with CTA */
.card__hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out);
}

.card__cta {
  color: var(--color-white);
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  transform: translateY(8px);
  transition: transform var(--duration-base) var(--ease-out);
}

/* Hover states */
.card:hover .card__img {
  transform: scale(1.04);
}

.card:hover .card__hover-overlay {
  opacity: 1;
}

.card:hover .card__cta {
  transform: translateY(0);
}

/* Card metadata below image */
.card__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--color-gray-200);
  gap: 1rem;
}


/* Wenn ein Project offen ist, andere Cards ausblenden */
.work__grid.has-open .card:not(.is-active) {
  opacity: 0.35;
  transition: opacity 0.4s ease;
}

.work__grid.has-open .card.is-active {
  opacity: 1;
}

/* ── Project Expand Panel ── */
.work__expand {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.work__expand.is-open {
  grid-template-rows: 1fr;
}

.work__expand-inner {
  min-height: 0;
  overflow: hidden;
}

.work__expand-content {
  padding: var(--space-md) 0 var(--space-lg);
}

/* ── Slider ── */
.work__slider {
  position: relative;
}

.work__slider-track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}

.work__slider-track::-webkit-scrollbar {
  display: none;
}

.work__slide {
  flex: 0 0 calc((100% - 3rem) / 3); /* 3 sichtbar auf Desktop */
  scroll-snap-align: start;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 2px;
}

.work__slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-out);
}

.work__slide-img:hover {
  transform: scale(1.03);
}

/* Pfeil-Buttons auf den Fotos */
.work__slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.85);
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--color-black);
  line-height: 1;
  z-index: 2;
  transition: background var(--duration-base) var(--ease-out), opacity var(--duration-base) var(--ease-out);
  opacity: 0.8;
  backdrop-filter: blur(4px);
}

.work__slider-btn:hover {
  background: rgba(255, 255, 255, 1);
  opacity: 1;
}

.work__slider-btn--prev {
  left: 0.75rem;
}

.work__slider-btn--next {
  right: 0.75rem;
}

.work__expand-text {
  font-size: 0.875rem;
  color: var(--color-gray-600);
  line-height: 1.75;
  padding-top: var(--space-sm);
  max-width: 50ch;
}


/* ─────────────────────────────────────────────
   10. LOGO BANNER
───────────────────────────────────────────── */
.logo-banner {
  background: var(--color-white);
  padding-block: var(--space-xl);
  border-top: 1px solid var(--color-gray-200);
  border-bottom: 1px solid var(--color-gray-200);
}

.logo-banner__label {
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-gray-400);
  margin-bottom: var(--space-md);
}

.logo-banner__img {
  display: block;
  width: 100%;
  max-width: var(--container-max);
  height: auto;
  margin: 0 auto;
  opacity: 0.5;
  filter: grayscale(1);
}


/* ─────────────────────────────────────────────
   11. CONTACT SECTION
───────────────────────────────────────────── */
.contact {
  background: var(--color-white);
}

.contact__cta {
  margin-bottom: var(--space-xl);
}

.contact__links {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.contact__link {
  display: flex;
  flex-direction: column;
  padding-block: 1.25rem;
  border-top: 1px solid var(--color-gray-200);
  position: relative;
  transition: padding-left var(--duration-base) var(--ease-out);
}

.contact__links li:last-child .contact__link {
  border-bottom: 1px solid var(--color-gray-200);
}

.contact__link:hover {
  padding-left: 0.75rem;
}

.contact__link:hover .contact__link-value {
  opacity: 0.6;
}

.contact__link-value {
  transition: opacity var(--duration-base) var(--ease-out);
}


/* ─────────────────────────────────────────────
   11. FOOTER
───────────────────────────────────────────── */
.footer {
  padding-block: var(--space-md);
  border-top: 1px solid var(--color-gray-200);
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--color-gray-400);
}


/* ─────────────────────────────────────────────
   12. SCROLL REVEAL ANIMATION
   Elements with .reveal start hidden;
   JS adds .is-visible when they enter viewport.
───────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity   var(--duration-reveal) var(--ease-out),
    transform var(--duration-reveal) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger siblings inside a parent */
.work__grid .card:nth-child(1) { transition-delay: 0ms; }
.work__grid .card:nth-child(2) { transition-delay: 80ms; }
.work__grid .card:nth-child(3) { transition-delay: 160ms; }
.work__grid .card:nth-child(4) { transition-delay: 60ms; }
.work__grid .card:nth-child(5) { transition-delay: 140ms; }
.work__grid .card:nth-child(6) { transition-delay: 220ms; }

.contact__links li:nth-child(1) .contact__link { transition-delay: 0ms; }
.contact__links li:nth-child(2) .contact__link { transition-delay: 80ms; }
.contact__links li:nth-child(3) .contact__link { transition-delay: 160ms; }


/* ─────────────────────────────────────────────
   13. RESPONSIVE BREAKPOINTS
───────────────────────────────────────────── */

/* ── Tablet: ≤ 900px ── */
@media (max-width: 900px) {
  .about__layout {
    grid-template-columns: 1fr;
  }

  .about__photo-wrap {
    position: static;
    aspect-ratio: 4 / 5;
    max-width: 60%;
    margin: 0 auto;
  }

  .work__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding-block: var(--space-xl);
  }

  .contact__cta {
    margin-bottom: var(--space-lg);
  }

}

/* ── Mobile: ≤ 600px ── */
@media (max-width: 600px) {
  :root {
    --space-2xl: 6rem;
    --space-xl:  4rem;
  }

  .nav__list {
    gap: 1.25rem;
  }

  .hero {
    height: auto;
    min-height: auto;
    aspect-ratio: 4 / 5;
  }

  .work__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .footer .container {
    flex-direction: column;
    gap: 0.4rem;
    text-align: center;
  }

  .about__body::before {
    display: none;
  }

  .work__slide {
    flex: 0 0 calc((100% - 1.5rem) / 2); /* 2 sichtbar auf Mobile */
  }

}

/* ── Reduce motion preference ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
