/* ============================
   MARION LINKE — PORTFOLIO WEBSITE
   Mobile-First CSS
   ============================ */

/* ============================
   CUSTOM PROPERTIES
   ============================ */
:root {
  --color-bg: #ffffff;
  --color-text: #111111;
  --color-text-muted: #888888;
  --color-accent: #9b111e;
  --color-border: #e5e5e5;
  --color-footer-bg: #111111;
  --color-footer-text: #ffffff;
  --color-placeholder: #d8d5d0;
  --color-bg-2: #f7f7f7; /* alternating section background (avilus light-200) */

  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --header-height: 60px;

  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 32px;
  --space-lg: 56px;
  --space-xl: 88px;

  --page-padding: 20px;
  /* Home page: inner spacing above/below each segment (gap between segments = 2×) */
  --section-pad: clamp(2rem, 5vw, 4rem);
  --max-width: 1280px;
  --transition: 0.25s ease;

  /* Image corner radius — fluid: 8px on phones → 12px from ~1200px wide */
  --radius-image: clamp(8px, 0.5vw + 6px, 12px);
  /* Button corner radius — 2/3 of the image radius (≈5px → 8px), so small and large elements look equally rounded */
  --radius-button: calc(var(--radius-image) * 2 / 3);
}

@media (min-width: 768px) {
  :root {
    --page-padding: 48px;
    --header-height: 64px;
  }
}

@media (min-width: 1200px) {
  :root {
    --page-padding: 80px;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: clip; /* full-bleed rows (carousel) never cause sideways scrolling */
  font-family: var(--font);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  list-style: none;
}
button {
  font-family: var(--font);
}

/* ============================
   LAYOUT UTILITIES
   ============================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
}

.page-wrapper {
  padding-top: var(--header-height);
  padding-bottom: clamp(72px, 9vw, 128px);
  min-height: 100vh;
}

/* ============================
   TYPOGRAPHY
   ============================ */
h1,
h2,
h3,
h4 {
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.label {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ============================
   HARMONIOUS JUSTIFIED TEXT
   Justified + automatic hyphenation (language from <html lang>),
   so word gaps stay even; last line stays left-aligned.
   Used for: home intro, video descriptions, statement page,
   legal texts (Impressum, Datenschutz, privacy settings dialog).
   ============================ */
.artist-intro__text,
.video-item-desc,
.statement-content p,
.legal-page p:not(.legal-meta),
.legal-page li,
.privacy-dialog__text {
  text-align: justify;
  text-align-last: left;
  -webkit-hyphens: auto;
  hyphens: auto;
  hyphenate-limit-chars: 7 3 3; /* only split words ≥ 7 letters, ≥ 3 on each side */
  overflow-wrap: break-word;
  text-wrap: pretty;            /* avoids single-word last lines where supported */
}

/* ============================
   HEADER & NAVIGATION
   ============================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--header-height);
  /* Always fully transparent, also while scrolling */
  background: transparent;
}

/* Over the home page hero image: light logo, icons and links */
.site-header.is-on-hero .logo-image {
  filter: brightness(0) invert(1);
}
.site-header.is-on-hero .hamburger-line {
  background: #fff;
}
@media (min-width: 768px) {
  .site-header.is-on-hero .nav-menu a,
  .site-header.is-on-hero .theme-toggle,
  .site-header.is-on-hero .nav-menu .lang-toggle {
    color: rgba(255, 255, 255, 0.85);
    text-decoration-color: rgba(255, 255, 255, 0.85);
  }
  .site-header.is-on-hero .nav-menu a:hover,
  .site-header.is-on-hero .nav-menu a.active,
  .site-header.is-on-hero .theme-toggle:hover {
    color: #fff;
  }
}

/* Home page: hero runs up behind the transparent header */
.page-wrapper:has(> .hero:first-child) {
  padding-top: 0;
}
.page-wrapper > .hero:first-child {
  height: 100vh;
  height: 100svh;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-padding);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  line-height: 1;
  position: relative;
  overflow: hidden;
}

.logo-image {
  height: 32px;
  width: auto;
  display: block;
  transition: opacity var(--transition);
}
.site-logo:hover .logo-image {
  opacity: 0.7;
}

/* ── Logo shine ── */
.site-logo::after {
  content: "";
  position: absolute;
  inset: -20% -10%;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255, 255, 255, 0.72) 48%,
    rgba(255, 248, 220, 0.55) 52%,
    transparent 70%
  );
  transform: translateX(-130%);
  pointer-events: none;
  mix-blend-mode: screen;
}
.site-logo.play::after {
  animation: logo-shine 2.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.45s;
}
@keyframes logo-shine {
  0% {
    transform: translateX(-130%);
  }
  100% {
    transform: translateX(160%);
  }
}

/* Hamburger Button (Mobile only) */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 210;
  width: 40px;
  height: 40px;
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--color-text);
  transition:
    transform var(--transition),
    opacity var(--transition);
}

.nav-toggle.is-active .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Nav Overlay */
.nav-menu {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 190;
}

.nav-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}

.nav-menu ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.nav-menu a {
  font-size: 1.77rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  transition: color var(--transition);
}
.nav-menu a:hover,
.nav-menu a.active {
  color: var(--color-accent);
}

/* Desktop Nav */
@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }

  .nav-menu {
    position: static;
    opacity: 1;
    pointer-events: auto;
    flex-direction: row;
    background: none;
    gap: 0;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
  }

  .nav-menu ul {
    flex-direction: row;
    gap: var(--space-md);
    align-items: center;
  }

  .nav-menu a {
    font-size: 0.95rem;
    letter-spacing: 0.06em;
  }
}

/* ============================
   LANGUAGE TOGGLE
   ============================ */
.lang-toggle {
  background: none;
  border: none;
  color: var(--color-accent);
  cursor: pointer;
  font-family: var(--font);
  font-size: 1.77rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  padding: 0;
  margin-left: 0;
  line-height: 1;
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-underline-offset: 5px;
  transition:
    color var(--transition),
    text-decoration-color var(--transition);
}
.lang-toggle:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

@media (min-width: 768px) {
  .lang-toggle,
  .nav-menu .lang-toggle {
    font-size: 0.95rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }
}

/* ============================
   NAV CONTROLS (theme + lang)
   ============================ */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (min-width: 768px) {
  .nav-controls {
    margin-left: 24px;
  }
}

@media (max-width: 767px) {
  .nav-controls {
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
  }
}

/* ============================
   THEME TOGGLE BUTTON
   ============================ */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--color-text);
  display: flex;
  align-items: center;
  line-height: 1;
  transition: color var(--transition);
}
.theme-toggle:hover {
  color: var(--color-accent);
}

/* Theme icon: scale up the crescent moon so it feels optically balanced with the sun */
.theme-icon {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="dark"] .theme-icon {
  transform: scale(1.3);
}

/* Sun rays: rotate+fade out in dark mode */
.sun-rays {
  transform-origin: 12px 12px;
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}
[data-theme="dark"] .sun-rays {
  opacity: 0;
  transform: scale(0.4) rotate(25deg);
}

/* Moon cutout: an opaque circle that slides over the sun to form a crescent */
.moon-cutout {
  fill: var(--color-bg);
  stroke: none;
  transform: translate(10px, -10px); /* off-screen in light mode */
  transition:
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    fill 0s; /* fill changes instantly with theme */
}
[data-theme="dark"] .moon-cutout {
  transform: translate(4px, -4px); /* overlaps sun → crescent */
}

/* ============================
   BUTTONS
   ============================ */
.btn {
  display: inline-block;
  padding: 14px 36px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  font-family: var(--font);
  line-height: 1;
  cursor: pointer;
}

.btn,
.btn-more,
.link-arrow {
  background: transparent;
  color: #1a1a1a;
  border: 1px solid #1a1a1a;
  border-radius: var(--radius-button);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.btn:hover,
.btn-more:hover,
.link-arrow:hover {
  background: #1a1a1a;
  color: #ffffff;
}

[data-theme="dark"] .btn,
[data-theme="dark"] .btn-more,
[data-theme="dark"] .link-arrow {
  color: #f0f0f0;
  border-color: #f0f0f0;
}

[data-theme="dark"] .btn:hover,
[data-theme="dark"] .btn-more:hover,
[data-theme="dark"] .link-arrow:hover {
  background: #f0f0f0;
  color: #0e0e0e;
}

/* Contact CTA — identical red styling in light & dark mode */
.btn.btn-primary,
[data-theme="dark"] .btn.btn-primary {
  background: #8b1a1a;
  color: #f0f0f0;
  border-color: #8b1a1a;
}

/* Secondary — solid anthracite, identical in light & dark mode (e.g. on image backgrounds) */
.btn.btn-secondary,
[data-theme="dark"] .btn.btn-secondary {
  background: #1a1a1a;
  color: #f0f0f0;
  border-color: #1a1a1a;
}

.btn.btn-secondary:hover,
[data-theme="dark"] .btn.btn-secondary:hover {
  background: #f0f0f0;
  color: #1a1a1a;
  border-color: #f0f0f0;
}

/* CV & Statement pages — contact CTA matches works.html colors at rest; red fill stays on hover */
.cv-page .btn.btn-primary,
.statement-page .btn.btn-primary {
  background: transparent;
  color: #1a1a1a;
  border-color: #1a1a1a;
}

[data-theme="dark"] .cv-page .btn.btn-primary,
[data-theme="dark"] .statement-page .btn.btn-primary {
  color: #f0f0f0;
  border-color: #f0f0f0;
}

.btn.btn-primary:hover,
[data-theme="dark"] .btn.btn-primary:hover {
  background: #6b1414;
  color: #f0f0f0;
  border-color: #6b1414;
}

/* Hero CTA sits on a photo in both themes — always use light styling */
.hero .btn,
[data-theme="dark"] .hero .btn {
  color: #f0f0f0;
  border-color: #f0f0f0;
}

.hero .btn:hover,
[data-theme="dark"] .hero .btn:hover {
  background: #f0f0f0;
  color: #0e0e0e;
}

/* ============================
   HERO — LANDING PAGE
   ============================ */
.hero {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--header-height));
  height: calc(100svh - var(--header-height));
  overflow: hidden;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  /* Scaled up just enough that the drift never reveals the edges:
     at 1.02 there is a 1% margin per side; the drift needs at most
     0.6% (translate) + ~0.25% (rotation corners) = ~0.85%. */
  transform: scale(1.02);
  transform-origin: center;
  will-change: transform;
  animation: hero-camera-drift 60s ease-in-out infinite alternate;
}

/* Barely perceptible handheld "camera shake": slow, irregular drift on x and y.
   Max offset ~0.6% / 0.12deg — fits inside the 1% margin of scale(1.02). */
@keyframes hero-camera-drift {
  0%   { transform: scale(1.02) translate3d(0, 0, 0)              rotate(0deg); }
  14%  { transform: scale(1.0225) translate3d(-0.25%, 0.45%, 0)   rotate(-0.07deg); }
  31%  { transform: scale(1.02) translate3d(0.15%, -0.4%, 0)      rotate(0.05deg); }
  47%  { transform: scale(1.025) translate3d(0.35%, 0.6%, 0)      rotate(0.11deg); }
  63%  { transform: scale(1.0225) translate3d(-0.1%, -0.55%, 0)   rotate(-0.04deg); }
  82%  { transform: scale(1.02) translate3d(-0.4%, 0.3%, 0)       rotate(-0.12deg); }
  100% { transform: scale(1.025) translate3d(0.2%, -0.5%, 0)      rotate(0.06deg); }
}

/* Scroll parallax (values matched to avilus.com): over one hero height of scrolling
   the image travels 80% of that distance down, so on screen it moves at only ~20% of scroll speed.
   Uses the separate `translate` property so it stacks with the drift `transform`.
   Browsers without scroll-driven animations get the JS fallback in components.js. */
@keyframes hero-parallax {
  from { translate: 0 0; }
  to   { translate: 0 80vh; }
}

@supports (animation-timeline: scroll()) {
  .hero-img {
    animation:
      hero-camera-drift 60s ease-in-out infinite alternate,
      hero-parallax linear both;
    animation-timeline: auto, scroll(root block);
    animation-range: normal, 0 100vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-img {
    animation: none;
  }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    /* top shade so the transparent navigation stays readable */
    linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0, rgba(0, 0, 0, 0) 180px),
    linear-gradient(
    to top,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.45) 40%,
    rgba(0, 0, 0, 0.15) 100%
  );
  pointer-events: none;
}

@media (max-width: 767px) {
  .hero-overlay {
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.80) 0%,
      rgba(0, 0, 0, 0.50) 40%,
      rgba(0, 0, 0, 0.18) 100%
    );
  }
}

.hero-scroll {
  position: absolute;
  bottom: clamp(20px, 3.5vw, 40px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  padding: 10px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  animation: hero-bounce 2s ease-in-out infinite;
  transition: color var(--transition);
}
.hero-scroll:hover {
  color: #fff;
}
.hero-scroll:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: var(--radius-button);
}

@keyframes hero-bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(7px);
  }
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--space-lg) var(--page-padding);
  z-index: 1;
}

.landing-heading {
  font-size: clamp(1.6rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-sm);
  color: #fff;
  white-space: pre-line;
}

.landing-subheading {
  font-size: clamp(0.92rem, 2.2vw, 1.18rem);
  font-weight: 300;
  line-height: 1.45;
  margin-bottom: var(--space-md);
  color: rgba(255, 255, 255, 0.95);
  white-space: pre-line;
}

/* ============================
   404 ERROR PAGE
   ============================ */
/* Fill exactly the visible area below the fixed header */
.page-wrapper:has(.error-404-hero) {
  padding-bottom: 0;
}

.error-404-hero {
  position: relative;
  height: calc(100vh - var(--header-height));
  height: calc(100svh - var(--header-height));
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  background: #111;
}

/* Soft, blurred fill of the same image behind everything */
.error-404-hero::before {
  content: '';
  position: absolute;
  inset: -40px;
  z-index: 0;
  background: url('images/2007-2008-fette-beute-face-of-war.webp') center / cover no-repeat;
  filter: blur(36px) brightness(0.55);
}

/* The artwork itself: whole, centered, scaled to the viewport.
   The box has the image's own aspect ratio (340×480) so the corner radius sits on the image edges. */
.error-404-hero::after {
  content: '';
  position: absolute;
  top: clamp(24px, 7vh, 72px);
  bottom: clamp(24px, 7vh, 72px);
  left: 50%;
  transform: translateX(-50%);
  aspect-ratio: 340 / 480;
  max-width: calc(100% - 2 * var(--page-padding));
  z-index: 1;
  background: url('images/2007-2008-fette-beute-face-of-war.webp') center / cover no-repeat;
  border-radius: var(--radius-image);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.error-404-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0.25) 60%,
    rgba(0, 0, 0, 0.1) 100%
  );
}

.error-404-content {
  position: relative;
  z-index: 3;
  padding: 0 var(--page-padding);
  text-align: center;
  color: #f0f0f0;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

/* ============================
   ARTIST INTRO
   ============================ */
/* Home page segments as full-width colour bands, alternating white / light grey
   like the Werkgruppen on the works page. (Hero = 1st section; then
   intro white, exhibitions grey, video white, awards grey.) */
.page-wrapper > section:not(.hero):not(.error-404-hero) {
  background: var(--color-bg);
}
.page-wrapper > section:not(.hero):not(.error-404-hero):nth-of-type(odd) {
  background: var(--color-bg-2);
}

.artist-intro {
  padding: var(--section-pad) 0;
}

.artist-intro__inner {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0 auto;
}

.artist-intro__text {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.7;
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .artist-intro__inner {
    grid-template-columns: 1fr 1fr;
  }

  .artist-intro__text {
    max-width: 50%;
    margin: 0 auto;
  }
}

/* ============================
   CURRENT EXHIBITIONS
   ============================ */
.current-exhibitions {
  padding: var(--section-pad) 0;
}

.current-exhibitions__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .current-exhibitions__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.current-exhibitions__col-title {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.current-exhibitions__item {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.current-exhibitions__year {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.current-exhibitions__title {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--color-text);
}

.current-exhibitions__venue {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.current-exhibitions__link {
  display: inline-block;
  margin-top: var(--space-md);
  padding: 14px 36px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  font-family: var(--font);
  line-height: 1;
  background: transparent;
  color: #1a1a1a;
  border: 1px solid #1a1a1a;
  border-radius: var(--radius-button);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.current-exhibitions__link:hover {
  background: #1a1a1a;
  color: #ffffff;
}

[data-theme="dark"] .current-exhibitions__link {
  color: #f0f0f0;
  border-color: #f0f0f0;
}

[data-theme="dark"] .current-exhibitions__link:hover {
  background: #f0f0f0;
  color: #0e0e0e;
}

/* ============================
   INTRO STRIP
   ============================ */
.intro-strip {
  padding: var(--space-lg) var(--page-padding);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.intro-strip p {
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.75;
  max-width: 680px;
  color: var(--color-text-muted);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 36px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  font-family: var(--font);
  line-height: 1;
}
.link-arrow::after {
  content: "→";
}

@media (min-width: 768px) {
  .intro-strip {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
  .intro-strip p {
    flex: 1;
    margin-right: var(--space-xl);
  }
}

/* ============================
   VIDEO SECTION
   ============================ */
.video-section {
  padding: 6rem var(--page-padding);
}

.videos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: start;
}

@media (min-width: 640px) {
  .videos-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }
}

@media (min-width: 1024px) {
  .videos-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.video-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.video-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Video description (from YouTube), directly under the title */
.video-item-desc {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--color-text-muted);
  max-width: 60ch;
}
.works-list-title + .video-item-desc {
  margin-top: 6px;
}
.video-item-desc + .video-item-desc {
  margin-top: 6px;
}

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
  border-radius: var(--radius-image);
}

@media (min-width: 640px) {
  .video-wrap {
    aspect-ratio: unset;
    height: 300px;
  }
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================
   YOUTUBE — TWO-CLICK PLACEHOLDER
   Nothing loads from YouTube until "Video laden" is clicked.
   ============================ */
.yt-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  text-align: center;
  background: #000;
  color: #fff;
}

.yt-placeholder__text {
  max-width: 40ch;
  font-family: var(--font);
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
}
.yt-placeholder__text a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.yt-placeholder__load {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.yt-placeholder__always {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}
.yt-placeholder__always input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

/* ============================
   WORKS PAGE — LIST LAYOUT
   ============================ */
.works-page {
  padding: var(--space-lg) var(--page-padding);
}

.works-section-title {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

/* ---- List ---- */
.works-list {
  display: flex;
  flex-direction: column;
}

.works-list-item {
  display: grid;
  grid-template-columns: 1fr; /* mobile: single column */
  grid-template-rows: auto;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
}

/* Desktop: image | content | button */
@media (min-width: 640px) {
  .works-list-item {
    grid-template-columns: var(--ws-image-w, 220px) 1fr auto;
    grid-template-rows: 1fr;
    align-items: center;
    gap: var(--space-md);
  }
}

@media (min-width: 900px) {
  .works-list-item {
    grid-template-columns: var(--ws-image-w, 300px) 1fr auto;
  }
}

/* Image */
.works-list-image {
  width: 100%;
  aspect-ratio: 3/2; /* mobile: proportional */
  background: var(--color-placeholder);
  overflow: hidden;
  position: relative;
  border-radius: var(--radius-image);
}

@media (min-width: 640px) {
  .works-list-image {
    width: var(--ws-image-w, 220px);
    height: 155px;
    aspect-ratio: unset; /* tablet: fixed small */
    flex-shrink: 0;
  }
}

@media (min-width: 900px) {
  .works-list-image {
    width: var(--ws-image-w, 300px);
    height: 300px; /* desktop: full size */
  }
}

.works-list-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.works-list-image .work-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.35);
}

/* Content */
.works-list-content {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.works-list-byline {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1;
}

.works-list-title {
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.works-list-tags {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.works-list-tags svg {
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.5;
}

/* Pill Button */
.works-list-action {
  justify-self: end;
  align-self: center;
}

@media (max-width: 639px) {
  .works-list-action {
    justify-self: start;
  }
}

.btn-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 22px;
  font-size: 0.84rem;
  font-family: var(--font);
  white-space: nowrap;
}

/* ---- Accordion (mobile exhibition history) ---- */
.accordion-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 10px 0 0;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  cursor: pointer;
}

.accordion-chevron {
  display: inline-block;
  font-size: 0.7em;
  transition: transform 0.3s ease;
}

.accordion-toggle.is-open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  background: transparent;
  transition: max-height 0.3s ease;
}

.accordion-content.is-open {
  max-height: 500px;
}

.exhibition-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

[data-theme="dark"] .exhibition-list {
  border-top-color: #2a2a2a;
}

.exhibition-list li {
  display: flex;
  gap: 10px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.exhibition-list .year {
  flex-shrink: 0;
  min-width: 4.5em;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.exhibition-list .title {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
  color: var(--color-text);
}

@media (max-width: 768px) {
  .works-list-action .btn-more {
    display: none;
  }

  .accordion-toggle {
    display: inline-flex;
  }
}

.work-image {
  background: var(--color-placeholder);
  overflow: hidden;
  position: relative;
}
.work-image.portrait {
  aspect-ratio: 3/4;
}
.work-image.landscape {
  aspect-ratio: 4/3;
}
.work-image.square {
  aspect-ratio: 1/1;
}
.work-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.work-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.work-meta {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ============================
   CONTACT PAGE
   ============================ */
.contact-page {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-xl) var(--page-padding);
}

.contact-inner {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.contact-label {
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

/* Same type as the home page hero title (.landing-heading), in text colour */
.contact-cta {
  font-size: clamp(1.6rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  white-space: pre-line;
}

.email-link {
  display: inline-block;
  margin-bottom: var(--space-md);
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--color-accent);
  border-bottom: 1px solid var(--color-accent);
  padding-bottom: 2px;
  transition:
    color var(--transition),
    border-color var(--transition);
}
.email-link:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

.contact-location {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-top: var(--space-lg);
}

.contact-form-wrapper {
  margin-top: var(--space-xl);
  scroll-margin-top: var(--header-height);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 480px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-field label {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.form-field input,
.form-field textarea {
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  resize: vertical;
  transition: border-color var(--transition);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--color-placeholder);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.contact-form .btn {
  align-self: flex-start;
  border: none;
}

/* ============================
   CV PAGE
   ============================ */
.cv-page {
  padding: var(--space-lg) var(--page-padding);
  max-width: calc(var(--max-width) / 2 + var(--page-padding) * 2);
}

.cv-page h1 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 200;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xl);
}

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

.cv-block-title {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

.cv-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  font-size: 0.95rem;
  line-height: 1.5;
}

.cv-year {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  padding-top: 2px;
}

.cv-text strong {
  font-weight: 500;
}
.cv-text em {
  font-style: normal;
  color: var(--color-text-muted);
}

/* ============================
   STATEMENT PAGE
   ============================ */
.statement-page {
  padding: var(--space-lg) var(--page-padding);
}

.statement-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

@media (min-width: 900px) {
  .statement-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.statement-image {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--color-placeholder);
  border-radius: var(--radius-image);
}
.statement-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.statement-content h1 {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--color-text);
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.statement-content p {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.85;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

/* Quote: justified like the statement text, no side rule.
   Quotation marks are part of the text — same font, size and colour —
   and follow the page language: «…» in German (Swiss), “…” in English. */
.statement-quote {
  margin: var(--space-lg) 0;
  padding: var(--space-sm) var(--space-md);
  font-style: italic;
}

.statement-quote p {
  margin-bottom: var(--space-xs);
}
.statement-quote p::before { content: "\00AB"; } /* « */
.statement-quote p::after  { content: "\00BB"; } /* » */
:lang(en) .statement-quote p::before { content: "\201C"; } /* “ */
:lang(en) .statement-quote p::after  { content: "\201D"; } /* ” */

.statement-quote cite {
  display: block;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.statement-content .statement-bio {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.statement-contact-btn {
  font-size: 0.72rem;
}

/* ============================
   FOOTER
   ============================ */
.site-footer {
  background: transparent;
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
  /* less space below the footer than above it — sits closer to the window edge */
  padding: clamp(20px, 3vw, 36px) var(--page-padding) clamp(12px, 1.5vw, 20px);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: clamp(14px, 2vw, 22px);
  padding-bottom: clamp(10px, 1.5vw, 16px);
  border-bottom: 1px solid var(--color-border);
}

@media (min-width: 768px) {
  .footer-top {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.footer-name {
  font-size: 1.1rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.footer-tagline {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.footer-email-link {
  display: inline-block;
  font-size: 0.95rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 2px;
  margin-top: var(--space-sm);
  transition:
    color var(--transition),
    border-color var(--transition);
}
.footer-email-link:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.footer-copy {
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

/* ============================
   LIGHTBOX
   ============================ */
/* ── two-column: image left, info right ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-inner {
  display: flex;
  width: 100%;
  height: 100%;
}

.lightbox-media {
  position: relative;
  flex: 0 0 62%;
  background: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-image);
  opacity: 1;
  transition: opacity 0.15s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox-img.is-loading {
  opacity: 0;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 600;
  background: rgba(20, 20, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  line-height: 1;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}
.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.22);
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 2.2rem;
  line-height: 1;
  padding: 24px 16px;
  border-radius: var(--radius-button);
  cursor: pointer;
  transition:
    color 0.2s,
    background 0.2s;
  user-select: none;
}
.lightbox-prev {
  left: 0;
}
.lightbox-next {
  right: 0;
}
.lightbox-prev:hover,
.lightbox-next:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
}

/* Info panel */
.lightbox-info {
  flex: 0 0 38%;
  background: #fff;
  overflow-y: auto;
  padding: 56px 44px 48px;
  display: flex;
  flex-direction: column;
}

.lightbox-meta-artist {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.lightbox-meta-location {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-bottom: 32px;
}

.lightbox-title {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin-bottom: 8px;
}

.lightbox-year {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 36px;
}

.lightbox-exh-label {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

.lightbox-exh-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.lightbox-exh-list li {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--color-text);
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.lightbox-counter {
  margin-top: 32px;
  font-size: 0.68rem;
  color: var(--color-text-muted);
  letter-spacing: 0.14em;
}

.works-list-item[data-lightbox-images] .works-list-image {
  cursor: zoom-in;
}

@media (max-width: 767px) {
  .lightbox-inner {
    flex-direction: column;
    overflow-y: auto;
  }
  .lightbox-media {
    flex: 0 0 50vh;
  }
  .lightbox-info {
    flex: 1 0 auto;
    padding: 28px 24px 40px;
  }
  .lightbox-close {
    top: 12px;
    right: 12px;
  }
}

/* Legal links + privacy settings (footer, right of the name) */
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px var(--space-md);
}
.footer-legal a,
.footer-legal__settings {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--transition);
}
.footer-legal a:hover,
.footer-legal__settings:hover {
  color: var(--color-accent);
}

/* Privacy settings dialog */
.privacy-dialog {
  width: min(92vw, 420px);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-image);
  background: var(--color-bg);
  color: var(--color-text);
}
.privacy-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.privacy-dialog__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}
.privacy-dialog__switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 12px;
  border-block: 1px solid var(--color-border);
  font-size: 0.9rem;
  cursor: pointer;
}
.privacy-dialog__switch input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}
.privacy-dialog__text {
  margin-top: var(--space-sm);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}
.privacy-dialog__text a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.privacy-dialog .btn {
  margin-top: var(--space-md);
}

.footer-nav-links {
  display: flex;
  gap: var(--space-md);
}
.footer-nav-links a {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  transition: color var(--transition);
}
.footer-nav-links a:hover {
  color: var(--color-accent);
}

/* ============================
   WORKS GRUPPE (WERKGRUPPE SECTIONS)
   ============================ */
.works-gruppe {
  margin-bottom: var(--space-lg);
}

/* No double top-border: gruppe-label already acts as separator */
.works-gruppe .works-list-item:first-child {
  border-top: none;
}

.works-gruppe-label {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--color-text);
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

/* ============================
   WERKGRUPPEN (works.html)
   One main image per Werkgruppe, the group's other works in a carousel below.
   Images are never cropped — they keep their own proportions.
   ============================ */
/* Spacing system — only these values are used on the works page:
   --wg-gap      between images, between main image and carousel, below section titles
   --wg-cap-gap  between a title and its image (main image and carousel alike)
   2 × --wg-gap  between Werkgruppen */
.works-page {
  --wg-gap: clamp(20px, 3vw, 40px);
  --wg-cap-gap: 12px;
  --wg-title-size: clamp(1.6rem, 3vw, 2.4rem);
}

.works-page .works-section-title {
  margin-bottom: var(--wg-gap);
}

/* Werkgruppen as full-width bands, alternating white / light grey
   like the sections on avilus.com/solutions/bussard (no divider lines).
   The box-shadow + clip-path pair extends the background to the window
   edges without leaving the content container or causing side-scroll. */
.wg {
  --wg-bg: var(--color-bg);
  padding-block: calc(var(--wg-gap) * 2);
  background: var(--wg-bg);
  box-shadow: 0 0 0 100vmax var(--wg-bg);
  clip-path: inset(0 -100vmax);
}
.wg:nth-of-type(even) {
  --wg-bg: var(--color-bg-2);
}

/* First white band sits directly under its section title */
.works-section-title + .wg:nth-of-type(odd) {
  padding-top: 0;
}

.wg + .works-section-title {
  margin-top: var(--wg-gap);
}

/* Main image title: above the image, left-aligned */
.wg__main figcaption,
.wg__work figcaption {
  text-align: left;
  color: var(--color-text);
}
.wg__main figcaption {
  margin-bottom: var(--wg-cap-gap);
  font-size: var(--wg-title-size);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
/* Carousel titles always reserve two lines and sit on the bottom line,
   so every image starts at the same height — one-line or two-line title. */
.wg__work figcaption {
  --wg-cap-lh: 1.25;
  display: flex;
  align-items: flex-end;
  min-height: calc(2em * var(--wg-cap-lh));
  margin-bottom: var(--wg-cap-gap);
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  font-weight: 500;
  line-height: var(--wg-cap-lh);
  letter-spacing: -0.01em;
}

/* All images: original aspect ratio, never cropped or stretched */
.wg__main img,
.wg__work img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  border-radius: var(--radius-image);
  background: var(--color-placeholder);
}
.wg__main img {
  max-height: min(80vh, 860px);
}
/* Carousel images: all the same height, width follows the original aspect
   ratio. max-width: none prevents the global img rule from squeezing them. */
.wg__work img {
  height: var(--wg-car-h);
  width: auto;
  max-width: none;
}
/* Phones: narrow portrait works get long titles — smaller type,
   hyphenation and three reserved lines keep the images on one line */
@media (max-width: 767px) {
  .wg__work figcaption {
    min-height: calc(3em * var(--wg-cap-lh));
    font-size: 0.85rem;
    -webkit-hyphens: auto;
    hyphens: auto;
    overflow-wrap: anywhere;
  }
}

/* Single works that look oversized next to their neighbours (e.g. a wide
   object among tall figures): shown at 75 % of the carousel height,
   still top-aligned so the titles stay on one line */
.wg__work--small img {
  height: calc(var(--wg-car-h) * 0.75);
}

/* Carousel: the group's other works on one line, centered —
   one full work in the middle, neighbours cut off on both sides.
   Every slide is exactly as wide as its image, so the space between
   all images is always the same (--wg-gap). */
.wg__carousel {
  /* phones: tall enough that portrait works don't become too narrow,
     low enough that the widest work (3:2) still fits the screen */
  --wg-car-h: clamp(240px, 64vw, 340px);
  margin-top: var(--wg-gap);
}
@media (min-width: 768px) {
  .wg__carousel { --wg-car-h: clamp(320px, 34vw, 480px); }
}

.wg__controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: var(--wg-cap-gap);
}
/* No arrows when all works already fit */
.wg__controls:not(:has(.wg__arrow:not(:disabled))) {
  display: none;
}

/* Carousel arrows: plain arrows, no circle */
.wg__arrow {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text);
  cursor: pointer;
  transition: color var(--transition), opacity var(--transition);
}
.wg__arrow svg {
  width: 24px;
  height: 24px;
}
.wg__arrow:hover:not(:disabled) {
  color: var(--color-accent);
}
.wg__arrow:disabled {
  opacity: 0.25;
  cursor: default;
}
.wg__arrow:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-button);
}

.wg__track {
  position: relative; /* slide offsetLeft is measured from here */
  display: flex;
  flex-direction: row;   /* always one horizontal row, also on phones */
  flex-wrap: nowrap;
  align-items: flex-start;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  gap: var(--wg-gap);
  /* full bleed: the image row runs to the left and right window edges */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.wg__track::-webkit-scrollbar {
  display: none;
}

.wg__work {
  flex: 0 0 auto;
  width: min-content; /* = image width; the title wraps to it */
  scroll-snap-align: center;
}

/* Home page previews (awards section): same look as the carousel
   (title above, equal height, original aspect ratio, equal gaps) —
   but a static row that wraps instead of scrolling. */
.home-previews {
  --wg-gap: clamp(20px, 3vw, 40px);
  --wg-cap-gap: 12px;
  --wg-car-h: clamp(200px, 52vw, 340px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--wg-gap);
  /* same distance as between two home page segments */
  margin-top: calc(var(--section-pad) * 2);
}
@media (min-width: 768px) {
  .home-previews { --wg-car-h: clamp(320px, 34vw, 480px); }
}
.home-preview {
  display: block;
  color: inherit;
  text-decoration: none;
}
.home-preview:hover .wg__cap {
  color: var(--color-accent);
}
.home-preview:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: var(--radius-image);
}

/* Jump targets from the home page: don't hide under the fixed header */
.wg {
  scroll-margin-top: var(--header-height);
}

/* ============================
   LEGAL PAGES (Impressum, Datenschutz)
   ============================ */
.legal-page {
  max-width: calc(72ch + 2 * var(--page-padding));
  padding-block: var(--space-lg) var(--space-xl);
}
.legal-page h1 {
  font-size: clamp(1.6rem, 5vw, 3rem); /* same as the home page title */
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-md);
}
.legal-page h2 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  margin: var(--space-lg) 0 var(--space-xs);
  scroll-margin-top: calc(var(--header-height) + 16px);
}
.legal-page p,
.legal-page li {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text);
}
.legal-page p + p {
  margin-top: var(--space-sm);
}
.legal-page ul {
  margin: var(--space-sm) 0;
  padding-left: 1.2em;
  list-style: disc;
}
.legal-page a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-page a:hover {
  color: var(--color-accent);
}
.legal-meta {
  font-size: 0.85rem !important;
  color: var(--color-text-muted) !important;
  margin-bottom: var(--space-md);
}
.legal-table-wrap {
  margin: var(--space-md) 0;
  overflow-x: auto;
}
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  line-height: 1.5;
}
.legal-table th,
.legal-table td {
  padding: 10px 12px 10px 0;
  border-top: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}
.legal-table th {
  font-weight: 600;
  color: var(--color-text-muted);
}
.legal-table code {
  font-size: 0.95em;
}
/* Placeholders still to be filled in before going live */
mark.todo {
  background: #fff3a6;
  color: #111;
  padding: 0 3px;
  border-radius: 3px;
}

/* Technische Daten — after avilus.com "Technical Data":
   label left, value right, thin rules between rows; 2 columns on desktop */
.wg__specs {
  margin-top: calc(var(--wg-gap) * 1.5);
}
.wg__specs-title {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin-bottom: var(--wg-cap-gap);
}
.wg__specs-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: calc(var(--wg-gap) * 1.5);
  margin: 0;
}
@media (min-width: 900px) {
  .wg__specs-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.wg__specs-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--wg-cap-gap);
  padding-block: 12px;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  line-height: 1.5;
}
.wg__specs-row dt {
  flex: 0 0 38%;
  color: var(--color-text-muted);
}
.wg__specs-row dd {
  flex: 1;
  margin: 0;
  text-align: right;
  color: var(--color-text);
}
[data-theme="dark"] .wg:nth-of-type(even) .wg__specs-row {
  border-top-color: #44464f;
}

/* ============================
   SLIDESHOW (in works.html)
   ============================ */
.slideshow {
  width: 100%;
  padding-top: calc(var(--space-md) - 4px);
}

.slideshow__label {
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding-bottom: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.slideshow__viewport {
  position: relative;
  overflow: hidden;
}

.slideshow__track {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0;
}
.slideshow__track::-webkit-scrollbar {
  display: none;
}

.slideshow__slide {
  flex: 0 0 auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.slideshow__img-wrap {
  height: 300px;
  overflow: hidden;
  position: relative;
  border-radius: var(--radius-image);
  background: var(--color-placeholder);
  flex-shrink: 0;
}

.slideshow__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slideshow__slide-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: rgba(0, 0, 0, 0.28);
  text-transform: uppercase;
  user-select: none;
  pointer-events: none;
}

.slideshow__caption {
  padding: 10px 0 4px;
}

.slideshow__caption-title {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 3px;
}

.slideshow__caption-year {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.lightbox-award {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-xs);
  line-height: 1.4;
}

.slideshow__hitbox {
  position: absolute;
  top: 0;
  height: 300px;
  width: 100px;
  z-index: 2;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: opacity 0.25s ease;
}
.slideshow__hitbox--left {
  left: 0;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0.85) 35%,
    rgba(255, 255, 255, 0) 100%
  );
  justify-content: flex-start;
  padding-left: 14px;
}
.slideshow__hitbox--right {
  right: 0;
  background: linear-gradient(
    to left,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0.85) 35%,
    rgba(255, 255, 255, 0) 100%
  );
  justify-content: flex-end;
  padding-right: 14px;
}
.slideshow__hitbox--hidden {
  opacity: 0;
  pointer-events: none;
}

.slideshow__chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  opacity: 0.3;
  transition: opacity 0.18s;
  pointer-events: none;
}
.slideshow__hitbox:hover .slideshow__chevron {
  opacity: 0.75;
}

.slideshow__chevron svg {
  width: 18px;
  height: 18px;
  stroke: #1a1a1a;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 767px) {
  .slideshow__hitbox {
    width: 48px;
  }
  .slideshow__hitbox--left {
    background: linear-gradient(
      to right,
      rgba(255, 255, 255, 1) 0%,
      rgba(255, 255, 255, 0.7) 50%,
      rgba(255, 255, 255, 0) 100%
    );
  }
  .slideshow__hitbox--right {
    background: linear-gradient(
      to left,
      rgba(255, 255, 255, 1) 0%,
      rgba(255, 255, 255, 0.7) 50%,
      rgba(255, 255, 255, 0) 100%
    );
  }
  [data-theme="dark"] .slideshow__hitbox--left {
    background: linear-gradient(
      to right,
      rgba(42, 44, 51, 1) 0%,
      rgba(42, 44, 51, 0.7) 50%,
      rgba(42, 44, 51, 0) 100%
    );
  }
  [data-theme="dark"] .slideshow__hitbox--right {
    background: linear-gradient(
      to left,
      rgba(42, 44, 51, 1) 0%,
      rgba(42, 44, 51, 0.7) 50%,
      rgba(42, 44, 51, 0) 100%
    );
  }
}

/* ============================
   BACK TO TOP BUTTON
   ============================ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-button);
  background: transparent;
  border: 1px solid #1a1a1a;
  color: #1a1a1a;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, background 0.18s ease, color 0.18s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background: #1a1a1a;
  color: #ffffff;
}

.back-to-top svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

@media (max-width: 767px) {
  .back-to-top {
    bottom: 5rem;
    right: 1.25rem;
  }
}

/* ============================
   DARK MODE  (controlled via data-theme="dark" on <html>)
   ============================ */
[data-theme="dark"] .logo-image {
  filter: brightness(0) invert(94%);
}

[data-theme="dark"] {
  --color-bg: #2a2c33;
  --color-text: #f0f0f0;
  --color-text-muted: #a0a0a0;
  --color-accent: #b02a2a;
  --color-border: #3a3c44;
  --color-placeholder: #36383f;
  --color-bg-2: #31333b;
}

[data-theme="dark"] .work-placeholder {
  color: rgba(255, 255, 255, 0.35);
}

[data-theme="dark"] .lightbox-info {
  background: #36383f;
}

[data-theme="dark"] .slideshow__hitbox--left {
  background: linear-gradient(
    to right,
    rgba(42, 44, 51, 1) 0%,
    rgba(42, 44, 51, 0.85) 35%,
    rgba(42, 44, 51, 0) 100%
  );
}
[data-theme="dark"] .slideshow__hitbox--right {
  background: linear-gradient(
    to left,
    rgba(42, 44, 51, 1) 0%,
    rgba(42, 44, 51, 0.85) 35%,
    rgba(42, 44, 51, 0) 100%
  );
}

[data-theme="dark"] .slideshow__slide-label {
  color: rgba(255, 255, 255, 0.28);
}

[data-theme="dark"] .slideshow__chevron svg {
  stroke: #f0f0f0;
}

[data-theme="dark"] .back-to-top {
  border-color: #f0f0f0;
  color: #f0f0f0;
}

[data-theme="dark"] .back-to-top:hover {
  background: #f0f0f0;
  color: #0e0e0e;
}
