:root {
  --accent: #FF2600;
  --black: #050505;
  --white: #FFFFFF;
  --grid-line: rgba(255, 38, 0, 0.2);
  --text-muted: #888888;
  --font-sans: 'Poppins', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', 'Roboto Mono', Menlo, Courier, monospace;
  --spacing-edge: 2vw;
}

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

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

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Noise ── */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.04;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Custom Cursor ── */
.custom-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 16px; height: 16px;
  background-color: var(--accent);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cursor-arrow-svg {
  width: 8px;
  height: 8px;
}
body:hover .custom-cursor { opacity: 1; }

/* ── Editorial Frame ── */
.editorial-frame {
  position: fixed;
  top: var(--spacing-edge);
  left: var(--spacing-edge);
  right: var(--spacing-edge);
  bottom: var(--spacing-edge);
  border: 1px solid var(--grid-line);
  z-index: 100;
  pointer-events: none;
}

.crosshair {
  position: absolute;
  width: 15px; height: 15px;
}
.crosshair::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
}
.crosshair::after {
  content: '';
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 1px;
  background: var(--accent);
}
.ch-tl { top: -8px; left: -8px; }
.ch-tr { top: -8px; right: -8px; }
.ch-bl { bottom: -8px; left: -8px; }
.ch-br { bottom: -8px; right: -8px; }

/* ── Header Nav ── */
.ref-header {
  position: fixed;
  top: calc(var(--spacing-edge) + 1.5vw);
  left: calc(var(--spacing-edge) + 1.5vw);
  right: calc(var(--spacing-edge) + 1.5vw);
  z-index: 110;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* ── Site Footer ── */
.site-footer-cta {
  display: flex; align-items: center; justify-content: center;
  height: clamp(120px, 15vw, 200px); background: var(--accent);
  text-decoration: none; transition: background 0.3s ease;
}
.site-footer-cta:hover { background: #cc1f00; }
.site-footer-cta-text {
  font-family: var(--font-sans); font-size: clamp(28px, 5vw, 64px);
  font-weight: 900; text-transform: uppercase; letter-spacing: -0.03em;
  color: var(--black); display: flex; align-items: center; gap: 16px;
}
.site-footer-cta-arrow { width: clamp(24px, 3vw, 48px); height: auto; }
.site-footer {
  background: var(--black); padding: clamp(40px, 5vw, 80px) 10vw;
  border-top: 1px solid var(--grid-line);
}
.site-footer-inner {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: clamp(32px, 4vw, 64px); max-width: 1400px; margin: 0 auto;
}
.site-footer-brand {
  font-size: clamp(14px, 1.2vw, 16px); color: var(--text-muted); line-height: 1.7;
}
.site-footer-brand strong {
  display: block; font-size: clamp(20px, 2vw, 28px); font-weight: 900;
  color: var(--white); margin-bottom: 12px;
}
.site-footer-col h4 {
  font-family: var(--font-mono); font-size: 10px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 16px;
}
.site-footer-col a, .site-footer-col span {
  display: block; font-size: clamp(13px, 1.1vw, 15px); color: var(--text-muted);
  text-decoration: none; line-height: 2; transition: color 0.3s ease;
}
.site-footer-col a:hover { color: var(--white); }
.site-footer-bottom {
  max-width: 1400px; margin: 0 auto;
  padding-top: clamp(24px, 3vw, 40px); margin-top: clamp(24px, 3vw, 40px);
  border-top: 1px solid var(--grid-line); display: flex;
  justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.site-footer-bottom a { color: var(--text-muted); text-decoration: none; transition: color 0.3s ease; }
.site-footer-bottom a:hover { color: var(--accent); }
.site-footer-legal { display: flex; gap: 24px; }

/* ── Impressum Accordion ── */
.impressum-toggle {
  display: block; width: 100%; background: none; border: none; border-top: 1px solid var(--grid-line);
  padding: 20px 10vw; cursor: pointer; text-align: left;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.15em; transition: color 0.3s ease;
}
.impressum-toggle:hover { color: var(--accent); }
.impressum-toggle::after {
  content: '+'; float: right; font-size: 14px; line-height: 1; transition: transform 0.3s ease;
}
.impressum-toggle.is-open::after { transform: rotate(45deg); }
.impressum-content {
  max-height: 0; overflow: hidden; transition: max-height 0.5s ease, padding 0.3s ease;
  background: var(--black); padding: 0 10vw;
}
.impressum-content.is-open { padding-bottom: 40px; }
.impressum-inner {
  max-width: 640px; padding-top: 24px;
  font-family: var(--font-sans); font-size: clamp(12px, 1vw, 14px);
  color: var(--text-muted); line-height: 1.8;
}
.impressum-inner h3 {
  font-family: var(--font-mono); font-size: 10px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.15em; margin: 24px 0 8px 0;
}
.impressum-inner h3:first-child { margin-top: 0; }
.impressum-inner p { margin: 0 0 4px 0; }
.impressum-inner a { color: var(--text-muted); text-decoration: none; transition: color 0.3s ease; }
.impressum-inner a:hover { color: var(--white); }
.impressum-source {
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--grid-line);
  font-family: var(--font-mono); font-size: 9px; color: var(--text-muted); opacity: 0.5;
}

@media (max-width: 768px) {
  .site-footer-inner { grid-template-columns: 1fr 1fr !important; gap: 32px !important; }
  .site-footer { padding: 40px 6vw; }
}

@media (pointer: coarse) and (max-width: 1024px) {
  .ref-header {
    position: relative;
    top: auto; left: auto; right: auto;
    padding: 20px 20px 0;
  }
  .editorial-frame { display: none; }
}

.ref-header-back {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white);
  text-decoration: none;
  transition: color 0.3s ease;
}
.ref-header-back:hover { color: var(--accent); }

.ref-header-info {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: right;
}

/* ── Vertical ID ── */
.vertical-id {
  position: fixed;
  right: calc(var(--spacing-edge) + 10px);
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: right center;
  white-space: nowrap;
  z-index: 100;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ── Main Content Grid ── */
.ref-main {
  padding: calc(var(--spacing-edge) + 8vw) calc(var(--spacing-edge) + 1.5vw);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  position: relative;
  z-index: 5;
}

/* ── Case Title ── */
.ref-case-header {
  grid-column: 1 / 13;
  margin-bottom: 6vh;
}

.ref-case-title {
  font-family: var(--font-sans);
  font-size: clamp(60px, 14vw, 200px);
  font-weight: 900;
  line-height: 0.85;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: -0.04em;
}

/* ── Meta Sidebar ── */
.ref-case-meta {
  grid-column: 1 / 4;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ref-meta-item {
  border-top: 1px solid var(--grid-line);
  padding-top: 12px;
}

.ref-meta-label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ref-meta-value {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}

.ref-meta-link {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s ease;
}
.ref-meta-link:hover { color: var(--accent); }
.ref-meta-link svg { flex-shrink: 0; }

/* ── Hero Image ── */
.ref-hero-img {
  grid-column: 5 / 13;
  aspect-ratio: 16 / 9;
  background: #111;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--grid-line);
}

.ref-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.ref-hero-img video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  z-index: 2;
  transition: opacity 0.4s ease;
}

.ref-hero-img:hover img { transform: scale(1.05); }
.ref-hero-img:hover video { opacity: 1; }

.ref-img-caption {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: var(--black);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.ref-img-caption span { color: var(--accent); }

/* ── Narrative ── */
.ref-narrative {
  grid-column: 5 / 10;
  margin-top: 8vh;
}

.ref-narrative-lead {
  font-family: var(--font-sans);
  font-size: clamp(20px, 2.4vw, 32px);
  font-weight: 500;
  line-height: 1.4;
  color: var(--white);
  margin-bottom: 32px;
}

.ref-narrative-body {
  font-family: var(--font-sans);
  font-size: clamp(14px, 1.2vw, 16px);
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 480px;
}

/* ── Secondary Images ── */
.ref-gallery {
  grid-column: 1 / 13;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 8vh;
}

.ref-gallery-item {
  aspect-ratio: 16 / 9;
  background: #111;
  border: 1px solid var(--grid-line);
  overflow: hidden;
  position: relative;
}

.ref-gallery-item img,
.ref-gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.ref-gallery-item:hover img,
.ref-gallery-item:hover video {
  transform: scale(1.03);
}

.ref-gallery-item .ref-img-caption { z-index: 2; }

/* ── Footer Nav ── */
.ref-footer {
  grid-column: 1 / 13;
  margin-top: 10vh;
  padding-top: 20px;
  border-top: 1px solid var(--grid-line);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.ref-footer-prev,
.ref-footer-next {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ref-footer-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.ref-footer-title {
  font-family: var(--font-sans);
  font-size: clamp(24px, 3vw, 48px);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--white);
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
}

.ref-footer-next { align-items: flex-end; text-align: right; }

.ref-footer-prev:hover .ref-footer-title,
.ref-footer-next:hover .ref-footer-title {
  color: var(--accent);
}

/* ── Back to overview bar ── */
.ref-back-bar {
  grid-column: 1 / 13;
  margin-top: 6vh;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  background: #7a1400;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: clamp(16px, 2vw, 24px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease;
}

.ref-back-bar:hover {
  background: var(--accent);
  color: var(--black);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .ref-case-meta { grid-column: 1 / 5; }
  .ref-hero-img { grid-column: 5 / 13; }
  .ref-narrative { grid-column: 4 / 11; }
  .vertical-id { display: none; }
}

@media (pointer: coarse) {
  *, *::before, *::after { cursor: auto; }
  .custom-cursor { display: none !important; }
}

.ref-hero-touch-btn {
  display: none;
}
@media (pointer: coarse) {
  .ref-hero-touch-btn {
    display: block;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    background: rgba(255, 38, 0, 0.75);
    color: var(--black);
    border: none;
    padding: 10px 24px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: opacity 0.3s ease;
  }
}

@media (max-width: 768px) {
  .ref-main {
    padding: calc(var(--spacing-edge) + 16vw) 5vw;
    grid-template-columns: 1fr;
  }
  .ref-case-header,
  .ref-case-meta,
  .ref-hero-img,
  .ref-narrative,
  .ref-gallery,
  .ref-footer,
  .ref-back-bar {
    grid-column: 1 / -1;
  }
  .ref-gallery { grid-template-columns: 1fr; }
  .ref-case-title { font-size: clamp(48px, 16vw, 120px); }
  .vertical-id { display: none; }
  .ref-header-info { display: none; }
  .ref-header { top: 24px; left: 20px; right: 20px; }
  .ref-footer { flex-direction: column; gap: 40px; align-items: stretch; }
  .ref-footer-prev { align-items: flex-start; text-align: left; }
}

@media (max-width: 480px) {
  .ref-main { padding: calc(var(--spacing-edge) + 20vw) 6vw; }
  .ref-meta-item { padding-left: 4px; }
  .ref-case-title { padding-left: 4px; font-size: 40px; }
  .ref-header { top: 4vw; left: 4vw; right: 4vw; }
  .ref-narrative-lead { font-size: 18px; }
  .ref-narrative-body { font-size: 13px; }
  .ref-meta-label { font-size: 9px; }
  .ref-meta-value { font-size: 12px; }
  .ref-footer-title { font-size: 24px; }
  .ref-back-bar { height: 60px; font-size: 14px; }
  .editorial-frame { margin: 8px; }
}

/* ── Lightbox ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(5, 5, 5, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 24px; right: 24px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 32px;
  cursor: pointer;
  font-family: var(--font-mono);
  line-height: 1;
  transition: color 0.3s ease;
}
.lightbox-close:hover { color: var(--accent); }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--white);
  font-size: 36px;
  cursor: pointer;
  padding: 20px;
  font-family: var(--font-mono);
  transition: color 0.3s ease;
}
.lightbox-nav:hover { color: var(--accent); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* ── Page Transition ── */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.page-transition.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Scroll Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Gallery clickable ── */
.ref-gallery-item { cursor: pointer; }
.ref-gallery-item img { transition: transform 0.4s ease; }
.ref-gallery-item:hover img { transform: scale(1.03); }
