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

:root {
  --orange:  #ff6a31;
  --cream:   #faf7f2;
  --dark:    #212121;
  --font:    'Plus Jakarta Sans', sans-serif;
  --nav-h:   72px;
  --gutter:  48px;
  --grid:    1440px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--orange);
  color: var(--cream);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a   { text-decoration: none; color: inherit; }

/* ============================================================
   NAVBAR
   Fixed, orange bar. Hides on scroll-down, shows on scroll-up.
============================================================ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  z-index: 1000;
  transition: transform 0.35s ease;
}
#navbar.hidden { transform: translateY(-100%); }

.nav-logo img {
  width: 40px;
  height: 34px;
  display: block;
}

.nav-links {
  display: flex;
  gap: 40px;
  align-items: center;
}
.nav-links a {
  font-size: clamp(18px, 2.2vw, 32px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--cream);
  transition: opacity 0.2s;
}
.nav-links a:hover { opacity: 0.7; }

/* ============================================================
   01 — HERO
   Fixed behind scroll-content. Hero SVG is 1343×377.
   Frame in Figma is 1440×900. SVG sits at left:48, top:~432.
   "let's get to know each other" sits at bottom of frame.
============================================================ */
#hero {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--cream);
  z-index: 0;
}

#hero-text-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: max(53px, calc(20px + env(safe-area-inset-bottom)));
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Hero SVG: natural ratio 1343:377 = 3.56:1
   We scale it to fill available width minus gutters,
   but cap it so it never overflows vertically.
   On a 1440px screen it should sit in the lower half of the viewport. */
#hero-text {
  width: min(calc(100% - 0px), calc((100vh - var(--nav-h) - 180px) * 3.56));
  height: auto;
  display: block;
  margin-bottom: 40px; /* gap between SVG bottom and subline */
}

.hero-sub {
  font-size: clamp(14px, 1.4vw, 20px);
  font-weight: 400;
  letter-spacing: -0.07em;
  color: var(--orange);
  white-space: nowrap;
}

/* ============================================================
   SCROLL CONTENT
   Pushes down by 100vh so it starts below the fixed hero.
============================================================ */
#scroll-content {
  position: relative;
  z-index: 1;
  margin-top: 100vh;
  margin-top: 100dvh;
  background: var(--orange);
}

/* ============================================================
   SECTION LABELS  (02 Projects, 04 About)
============================================================ */
.section-projects-header,
.section-about-header {
  background: var(--dark);
  padding: 0 0 0 31px;
  overflow: hidden;
  line-height: 1;
  display: flex;
  align-items: flex-end;
  min-height: clamp(52px, 6vw, 87px);
}

.section-label {
  font-size: clamp(52px, 6vw, 87px);
  font-weight: 400;
  letter-spacing: -0.04em;
  color: var(--cream);
  line-height: 1;
  white-space: nowrap;
  display: flex;
  align-items: baseline;
  gap: 0.2em;
}
.section-arrow { height: clamp(30px, 3.5vw, 54px); width: auto; display: block; flex-shrink: 0; }

.section-label span {
  font-size: clamp(36px, 4.4vw, 64px);
  font-weight: 600;
  letter-spacing: -0.04em;
}

/* ============================================================
   03 — PROJECTS GRID
============================================================ */
.section-projects {
  background: var(--dark);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Thumbnail */
.thumb-wrap {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--dark);
  display: block;
}

/* Hover ticker */
.thumb-ticker {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 100%;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  height: clamp(50px, 7vw, 90px);
  display: flex;
  align-items: center;
}
@media (hover: hover) {
  .thumb-wrap:hover .thumb-ticker { opacity: 1; }
}
@media (hover: none) {
  .thumb-ticker { opacity: 1; }
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.thumb-ticker-inner {
  display: flex;
  white-space: nowrap;
  will-change: transform;
  animation: ticker-scroll var(--ticker-dur, 15s) linear infinite;
}
.ticker-sep { padding: 0 0.5em; }

.thumb-ticker-text {
  font-size: clamp(40px, 5vw, 70px);
  font-weight: 500;
  color: var(--orange);
  white-space: nowrap;
  flex-shrink: 0;
}

.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.thumb-wrap:hover .thumb-img { transform: scale(1.03); }

/* Layout rows — square thumbs on stacked rows, consistent 20px gaps */
.thumb-wrap.proj-row-1 {
  height: clamp(280px, 48.6vw, 700px);
  width: 100%;
}
.proj-row-block1 {
  display: flex;
  gap: 20px;
  height: clamp(280px, 48.6vw, 700px);
}
.proj-row-block1 .thumb-wrap:first-child { flex: 0 0 61.8%; }
.proj-row-block1 .thumb-wrap:last-child  { flex: 1; }

.thumb-wrap.proj-row-4 {
  height: clamp(240px, 41.7vw, 600px);
  width: 100%;
}
.proj-row-block2 {
  display: flex;
  gap: 20px;
  height: clamp(220px, 38.2vw, 550px);
}
.proj-row-block2 .thumb-wrap:first-child { flex: 0 0 40.97%; }
.proj-row-block2 .thumb-wrap:last-child  { flex: 1; }

/* ============================================================
   04 — ABOUT HEADER  (same as 02)
============================================================ */
/* handled by .section-about-header above */

/* ============================================================
   05 — INTRODUCTION
============================================================ */
.section-intro {
  background: var(--dark);
  padding: clamp(40px, 5vw, 80px) var(--gutter);
  min-height: clamp(400px, 50vw, 700px);
  display: flex;
  align-items: center;
}
.intro-text {
  font-size: clamp(28px, 4.4vw, 64px);
  line-height: 1.25;
  color: var(--cream);
  max-width: 1350px;
  font-weight: 600;
}

/* ============================================================
   06 — SKILLS
   Figma: cream background, two columns side by side.
   Left col starts at x≈49, right col starts at x≈760.
   Headings: "stuff i do well." / "stuff i suck at." — bold.
   Lists: regular weight, each item on its own line.
   Gap between last real list item and the CTA line.
============================================================ */
.section-skills {
  background: var(--cream);
  color: var(--dark);
  padding: clamp(40px, 4vw, 58px) var(--gutter);
}

.skills-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 clamp(40px, 5vw, 80px);
  max-width: var(--grid);
}

.skills-block {
  display: flex;
  flex-direction: column;
}

.skills-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  padding-bottom: 16px;
  border-bottom: 1.5px solid var(--dark);
}
.skills-heading h3 {
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 800;
  line-height: 1.2;
  color: var(--dark);
}
.skills-toggle {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 800;
  color: var(--dark);
  cursor: pointer;
  line-height: 1;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
  width: 0.7em;
  height: 0.7em;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center;
}
.skills-toggle[aria-expanded="true"] {
  transform: rotate(45deg);
  transition: transform 0.35s ease-out;
}
.skills-toggle svg { width: 100%; height: 100%; display: block; }

/* List — collapsed by default */
.skills-list {
  list-style: none;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1), padding-top 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  padding-top: 0;
}
.skills-list.open {
  max-height: 600px;
  padding-top: 20px;
}

.skills-list li {
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 400;
  line-height: 1.3;
  color: var(--dark);
  padding: 8px 0;
  border-bottom: none;
}
.skills-list li:last-child {
  border-bottom: none;
  margin-top: 0;
  padding-top: 8px;
}

.skills-cta {
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 400;
  color: var(--dark);
  line-height: 1.1;
}
.skills-underline {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.skills-underline:hover { opacity: 0.6; }

/* ============================================================
   07 — CONTACT
============================================================ */
.section-contact {
  background: var(--orange);
  padding: clamp(40px, 4.4vw, 63px) var(--gutter) clamp(32px, 3vw, 48px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  align-items: start;
  align-content: start;
  gap: 0;
}

.contact-left {
  grid-column: 1;
  grid-row: 1;
  font-size: clamp(28px, 3.8vw, 55px);
  line-height: 0.95;
  color: var(--cream);
  max-width: 440px;
  align-self: start;
}
.contact-light  { font-weight: 300; }
.contact-italic { font-style: italic; font-weight: 800; }

.contact-email {
  grid-column: 2;
  grid-row: 1;
  font-size: clamp(28px, 4.4vw, 64px);
  font-weight: 800;
  color: var(--cream);
  text-decoration: underline;
  text-underline-offset: 4px;
  align-self: end;
  text-align: right;
  display: block;
  transition: opacity 0.2s;
  line-height: 1;
}
.contact-email:hover { opacity: 0.8; }

.contact-impressum {
  grid-column: 2;
  grid-row: 2;
  font-size: clamp(13px, 1.2vw, 18px);
  font-weight: 400;
  color: #fff;
  text-align: right;
  align-self: end;
  margin-top: clamp(24px, 3vw, 48px);
  display: block;
  transition: opacity 0.2s;
}
.contact-impressum:hover { opacity: 0.7; }

/* ============================================================
   LIGHTBOX
============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.93);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}
.lightbox-close {
  position: absolute;
  top: 24px; right: 32px;
  background: none;
  border: none;
  color: #fff;
  font-size: 48px;
  cursor: pointer;
  line-height: 1;
  transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 0.6; }

/* ============================================================
   PROJECT PAGE
============================================================ */
body.project-page {
  background: var(--dark);
  color: var(--cream);
}

.proj-hero {
  background: var(--dark);
  padding: calc(var(--nav-h) + clamp(32px, 4vw, 64px)) var(--gutter) clamp(32px, 3vw, 48px);
}
.proj-category {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.65px;
  color: var(--orange);
  text-transform: uppercase;
  margin-bottom: 24px;
}
.proj-title {
  font-size: clamp(48px, 9vw, 130px);
  font-weight: 800;
  color: var(--cream);
  line-height: 1;
  white-space: nowrap;
}

.proj-main-media {
  background: var(--dark);
  padding: clamp(24px, 4vw, 60px) var(--gutter);
}
.proj-media-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #ddd;
}

/* Local video player */
.local-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.local-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.local-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  opacity: 0;
  transition: opacity 0.25s ease;
}
.local-player-wrap:hover .local-controls { opacity: 1; }
.local-btn {
  background: none;
  border: none;
  color: var(--orange);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}
.local-btn:hover { opacity: 0.7; }
.local-btn svg { width: 20px; height: 20px; display: block; }

.local-timeline {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(to right, var(--orange) var(--pct, 0%), rgba(255,255,255,0.35) var(--pct, 0%));
}
.local-timeline::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 0; height: 0;
}
.local-timeline::-moz-range-thumb {
  width: 0; height: 0;
  border: none;
}

.yt-sound-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 10;
  background: rgba(0,0,0,0.55);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s;
}
.yt-sound-btn:hover { background: rgba(0,0,0,0.8); }
.yt-sound-btn svg { width: 18px; height: 18px; display: block; }
.yt-sound-btn .icon-unmuted { display: none; }
.yt-sound-btn.is-unmuted .icon-muted   { display: none; }
.yt-sound-btn.is-unmuted .icon-unmuted { display: block; }
.proj-media-wrap img {
  width: 100%;
  height: clamp(260px, 40vw, 580px);
  object-fit: cover;
  display: block;
  border: none;
}
.proj-media-wrap iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: none;
}

.proj-description {
  background: var(--dark);
  padding: clamp(40px, 5.6vw, 80px) var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.proj-brief-title {
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 800;
  color: var(--cream);
  line-height: 1;
}
.proj-brief-text {
  font-size: clamp(15px, 1.4vw, 20px);
  font-weight: 400;
  line-height: 1.65;
  color: var(--cream);
}

/* Adaptive image grid */
.proj-image-grid {
  background: var(--dark);
  padding: clamp(20px, 3.3vw, 48px);
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  grid-auto-rows: clamp(200px, 22vw, 320px);
  grid-auto-flow: dense;
}
.proj-grid-item:first-child {
  grid-column: span 2;
  grid-row: span 2;
}
.proj-grid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.4s ease, opacity 0.3s;
  display: block;
}
.proj-grid-img:hover { transform: scale(1.02); opacity: 0.92; }

.proj-next {
  background: var(--dark);
  padding: clamp(40px, 4vw, 60px) var(--gutter) clamp(48px, 5.6vw, 80px);
  border-top: 1px solid #3a3a3a;
}
.proj-next-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2.2px;
  color: var(--orange);
  text-transform: uppercase;
  margin-bottom: clamp(24px, 2.8vw, 40px);
}
.proj-next-title {
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 800;
  color: var(--cream);
  transition: color 0.2s;
  display: inline-block;
}
.proj-next-title:hover { color: var(--orange); }

/* ============================================================
   MOBILE  ≤ 768px
============================================================ */
@media (max-width: 768px) {

  :root { --gutter: 20px; }

  /* Nav */
  #navbar { padding: 0 20px; }
  .nav-links { gap: 20px; }
  .nav-links a { font-size: 16px; }

  /* Hero */
  #hero-text {
    width: calc(100% - 0px);
    margin-bottom: 28px;
  }
  .hero-sub { font-size: 13px; white-space: normal; }

  /* Section labels */
  .section-projects-header,
  .section-about-header { padding: 0 0 0 16px; }

  /* Projects grid — all full width stacked, all square, equal gaps */
  .section-projects { padding: 20px; gap: 20px; }
  .thumb-wrap.proj-row-1 { aspect-ratio: 1 / 1; height: auto; }
  .thumb-wrap.proj-row-4 { aspect-ratio: 1 / 1; height: auto; }
  .proj-row-block1,
  .proj-row-block2 { flex-direction: column; height: auto; gap: 20px; }
  .proj-row-block1 .thumb-wrap,
  .proj-row-block2 .thumb-wrap { flex: none !important; width: 100%; aspect-ratio: 1 / 1; height: auto; }

  /* Intro */
  .section-intro { padding: 40px 20px; min-height: auto; }

  /* Skills */
  .skills-inner {
    grid-template-columns: 1fr;
    gap: 32px 0;
  }

  /* Contact */
  .section-contact {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .contact-email {
    grid-column: 1;
    grid-row: 2;
    margin-top: 24px;
    text-align: left;
  }
  .contact-impressum {
    grid-column: 1;
    grid-row: 3;
    text-align: left;
  }

  /* Project page */
  .proj-description { grid-template-columns: 1fr; }
  .proj-image-grid  {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 44vw;
  }
  .proj-grid-item:first-child { grid-column: span 2; grid-row: span 1; }
}

/* ============================================================
   TABLET  769px–1100px
============================================================ */
@media (min-width: 769px) and (max-width: 1100px) {
  .proj-row-block1 .thumb-wrap:first-child { flex: 0 0 58%; }
  .proj-row-block2 .thumb-wrap:first-child { flex: 0 0 42%; }
  .nav-links a { font-size: 22px; }
}
