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

@font-face {
  font-family: 'PP Radio Grotesk';
  src: url('../assets/PPRadioGrotesk-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'PP Radio Grotesk';
  src: url('../assets/PPRadioGrotesk-RegularItalic.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'PP Radio Grotesk';
  src: url('../assets/PPRadioGrotesk-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'PP Radio Grotesk';
  src: url('../assets/PPRadioGrotesk-BoldItalic.woff') format('woff');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'PP Radio Grotesk';
  src: url('../assets/PPRadioGrotesk-Black.woff') format('woff');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'PP Radio Grotesk';
  src: url('../assets/PPRadioGrotesk-BlackItalic.woff') format('woff');
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --red:       #DD4813;
  --gray:      #999;
  --black:     #0d0d0d;
  --white:     #ffffff;
  --hover-bg:  rgba(0,0,0,0.03);
  --font:      'PP Radio Grotesk', system-ui, -apple-system, sans-serif;
  --header-h:  3rem;
  --footer-h:  2.5rem;
  --px:        clamp(0.75rem, 1.82vw, 35px);
  --px-icon:   clamp(3rem, 4.2vw, 80px);
  --tab-h:     60px;
  --slide-h:   60vh;
  --title-size: clamp(0.9rem, 3.2vw, 2.6rem);
  --icon-size: clamp(18px, 2.2vw, 38px);
  --about-size: clamp(1.4rem, 3.2vw, 3rem);
}

html, body { height: 100%; overflow: hidden; }

body {
  background: #fff;
  color: var(--black);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1;
}

/* ── HEADER ── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--px);
  background: #fff;
  border-bottom: 0.5px solid var(--black);
  z-index: 100;
}
.logo {
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: lowercase;
  text-decoration: none; color: var(--red);
  transition: letter-spacing 0.2s;
}
.logo:hover { letter-spacing: 0.38em; }
.hire {
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: lowercase;
  color: var(--red); text-decoration: none;
  transition: letter-spacing 0.2s;
}
.hire:hover { letter-spacing: 0.36em; }

/* ── SCROLL AREA ── */
.scroll-area {
  position: fixed;
  top: var(--header-h);
  bottom: var(--footer-h);
  left: 0; right: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ── ACCORDION ── */
.accordion-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.project {
  border-bottom: 0.5px solid var(--black);
  flex-shrink: 0;
}

/* ── CLOSED TAB ── */
.project-tab {
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--tab-h);
  padding: 0 calc(var(--px-icon) + var(--icon-size) + 0.5rem) 0 var(--px);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
  position: relative;
  overflow: visible;
}
.project-tab:hover { background: var(--hover-bg); }

.tab-inner {
  display: flex;
  align-items: center;
  gap: 0.6em;
  flex: 1;
  min-width: 0;
}

.tab-title {
  font-size: var(--title-size);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.tab-tag {
  font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--gray);
  white-space: nowrap; flex-shrink: 0;
  padding-left: 0.3rem;
}

/* About tab special colors */
.project[data-red] .tab-title,
.project[data-red] .active-title { color: var(--red); }
.project[data-red] .project-tab { background: rgba(0,0,0,0.15); }
.project[data-red] .project-tab:hover { background: rgba(0,0,0,0.25); }
.project[data-red].is-open .active-header { background: rgba(0,0,0,0.15); }

.tab-icon {
  position: absolute;
  right: var(--px-icon);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  width: var(--icon-size);
  height: var(--icon-size);
}
.tab-icon svg {
  width: 100%; height: 100%;
  stroke: var(--black);
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
}

/* ── ACTIVE HEADER ── */
.active-header {
  display: none;
  align-items: center;
  width: 100%;
  height: var(--tab-h);
  padding: 0 calc(var(--px-icon) + var(--icon-size)*2 + 1.5rem) 0 var(--px);
  border-bottom: 0.5px solid var(--black);
  cursor: default;
  user-select: text;
  position: relative;
  overflow: visible;
}

.project.is-open .project-tab   { display: none; }
.project.is-open .active-header { display: flex; }

/* Nav arrows: < × > */
.nav-arrows {
  position: absolute;
  right: var(--px-icon);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.25em;
}

.nav-arrow {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-size);
  height: var(--icon-size);
  transition: opacity 0.15s;
}
.nav-arrow:hover { opacity: 0.45; }
.nav-arrow svg {
  width: 100%; height: 100%;
  stroke: var(--black);
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
/* Close button slightly wider viewbox for × */
.nav-arrow.close svg { stroke-width: 1.5; }

.active-left {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65em;
}

.active-title {
  font-size: var(--title-size);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.active-tag-meta {
  display: flex;
  flex-direction: column;
  /*gap: 0.18rem;*/
  flex-shrink: 0;
  align-self: center;
  padding-left: 0.3rem;
}

.active-tag-inline {
  font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--gray);
  white-space: nowrap; line-height: 1.2;
}

.meta-line {
  font-size: 0.68rem; font-weight: 500;
  color: var(--gray);
  white-space: nowrap; line-height: 1.1;
}
.meta-line.credits { font-size: 0.68rem; }

.meta-line.credits a {
  color: var(--gray);
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 2px;
  transition: opacity 0.15s;
}
.meta-line.credits a:hover { opacity: 0.6; }

/* ── FILMSTRIP ── */
.slideshow-wrap {
  overflow: hidden;
  height: 0;
  transition: height 0.38s cubic-bezier(0.4,0,0.2,1);
}
.project.is-open .slideshow-wrap { height: var(--slide-h); }

.slideshow {
  height: var(--slide-h);
  position: relative;
  background: #fff;
  overflow: hidden;
}

.filmstrip {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}
.filmstrip:active { cursor: grabbing; }
.filmstrip::-webkit-scrollbar { display: none; }

.filmstrip-item {
  flex-shrink: 0;
  height: 100%;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
}

.filmstrip-item img {
  height: 100%;
  width: auto;
  display: block;
  cursor: zoom-in;
  pointer-events: auto;
  -webkit-user-drag: none;
  user-select: none;
  transition: opacity 0.15s;
}
.filmstrip-item img:hover { opacity: 0.92; }

.filmstrip-item + .filmstrip-item {
  margin-left: 25px;
  position: relative;
}
.filmstrip-item + .filmstrip-item::before {
  content: '';
  position: absolute;
  left: -13px;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--black);
  pointer-events: none;
}

.strip-counter {
  position: absolute;
  bottom: 1rem; right: 1.25rem;
  font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.07em;
  color: rgba(13,13,13,0.45);
  z-index: 10;
  pointer-events: none;
}

/* ── LIGHTBOX ── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.96);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox-img {
  max-width: 92vw; max-height: 92vh;
  object-fit: contain; display: block;
  user-select: none; -webkit-user-drag: none;
}
.lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none; cursor: pointer;
  width: 3rem; height: 3rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.lb-btn:hover { background: rgba(255,255,255,0.22); }
.lb-btn.prev { left: 1.5rem; }
.lb-btn.next { right: 1.5rem; }
.lb-btn svg {
  width: 1rem; height: 1rem;
  stroke: #fff; stroke-width: 1.5;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.lb-close {
  position: absolute; top: 1.25rem; right: 1.5rem;
  background: none; border: none; cursor: pointer; padding: 0.5rem;
  display: flex; align-items: center; justify-content: center;
}
.lb-close svg {
  width: 1.4rem; height: 1.4rem;
  stroke: rgba(255,255,255,0.7); stroke-width: 1.5;
  fill: none; stroke-linecap: round; transition: stroke 0.15s;
}
.lb-close:hover svg { stroke: #fff; }
.lb-counter {
  position: absolute; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font);
  font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.08em; color: rgba(255,255,255,0.5);
}

/* ── ABOUT PANEL ── */
.about-panel {
  height: var(--slide-h);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  background: #f5f5f5;
  padding: clamp(2rem, 4vw, 5rem) var(--px);
  overflow-y: auto;
}
.about-panel p {
  font-size: var(--about-size);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--black); max-width: 64ch; line-height: 1.0;
}
.about-panel p + p { margin-top: 1em; }
.about-panel a {
  color: var(--black);
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 2px;
  transition: opacity 0.15s;
}
.about-panel a:hover { opacity: 0.5; }

@media (orientation: landscape) and (max-height: 600px) {
  .about-panel {
    align-items: center;
    padding: clamp(1.5rem, 3vh, 3rem) var(--px);
  }
  .about-panel p {
    font-size: clamp(1rem, 2.2vh, 1.5rem);
    max-width: 66vw; line-height: 1.6;
  }
}

/* ── FOOTER ── */
.site-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--footer-h);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 var(--px);
  background: #fff;
  border-top: 0.5px solid var(--black);
  z-index: 100;
}
.copyright {
  font-size: 0.68rem; font-weight: 400;
  letter-spacing: 0.06em; text-transform: lowercase;
  color: var(--gray);
}
.imprint {
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: lowercase;
  color: var(--gray); text-decoration: none;
  transition: letter-spacing 0.2s;
}
.imprint:hover { letter-spacing: 0.36em; }

/* ── MOBILE ── */
@media (max-width: 640px) {
  .tab-tag, .active-tag-inline, .meta-line, .about-panel p { font-weight: 600; }
  :root {
    --header-h:   2.75rem;
    --footer-h:   2.25rem;
    --px:         clamp(0.875rem, 4vw, 1.25rem);
    --px-icon:    clamp(2.5rem, 5vw, 3rem);
    --title-size: clamp(1rem, 5.5vw, 1.8rem);
    --icon-size:  clamp(22px, 5.5vw, 32px);
    --about-size: 0.95rem;
  }
  .tab-inner {
    flex-direction: column; align-items: flex-start;
    justify-content: center; gap: 0.35em;
  }
  .tab-tag { font-size: 0.52rem; }
  .active-left {
    flex-direction: column; align-items: flex-start;
    justify-content: center; gap: 0.35em;
  }
  .active-title  { max-width: 100%; }
  .active-tag-meta { align-self: flex-start; padding-top: 0; }
  .active-tag-inline { font-size: 0.52rem; }
  .meta-line { display: block; font-size: 0.52rem; }
  .meta-line.credits { font-size: 0.52rem; }
  .lb-btn.prev { left: 0.5rem; }
  .lb-btn.next { right: 0.5rem; }
}

/* ── LANDSCAPE ── */
@media (orientation: landscape) and (max-height: 600px) {
  :root { --tab-h-landscape: 2rem; }
  .project.is-open .active-header { height: var(--tab-h-landscape, 2rem); min-height: unset; }
  .project.is-open .meta-line { display: none; }
}
