 :root {
  --portfolio-baseline-offset: 42px;
  --text-vinzent-offset: -12px;
  --grid-margin-top: 149px;
  --grid-margin-side: 32px;
  --grid-columns: 5;
  --grid-gutter: 32px;
  --grid-row-height: 149px;
  --grid-row-gutter: 32px;
  --grid-line-color: rgba(77, 107, 255, 0.75);
  --grid-line-width: 1px;
  --page-bg: #ffffff;
  --text-color: #000000;
  /* Capped to 1920px by viewport-scale.js; below 1920px this equals 100vw. */
  --viewport-width: 100vw;
  --grid-row-step: calc(var(--grid-row-height) + var(--grid-row-gutter));
  --project-arrow-size: 88px;
}

html,
body {
  width: 100%;
  min-height: 100%;
  background: var(--page-bg);
}

body {
  position: relative;
  overflow-x: hidden;
  font-family: "Helvetica Neue LT Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* Declared here (not :root) so it resolves against body's own
     --viewport-width, which viewport-scale.js overrides with the capped
     value above 1920px. Custom properties inherit their COMPUTED value, so
     declaring this at :root would freeze it to the real (uncapped) 100vw
     before the zoom-scaled body ever applies its cap, double-scaling
     anything positioned with it (e.g. .text-vinzent) on wide screens. */
  --grid-cell-width: calc((var(--viewport-width) - (2 * var(--grid-margin-side)) - ((var(--grid-columns) - 1) * var(--grid-gutter))) / var(--grid-columns));
}

.a0-page {
  position: relative;
  min-height: 100vh;
  background: var(--page-bg);
}

.layer {
  position: absolute;
  inset: 0;
}

/* z-index: auto (not 1) so .layer-projects does NOT create a stacking
   context. That lets the expanded .project-panel escape to the root
   stacking context and sit ABOVE the grid lines, while the collapsed
   summary bars (no z-index) stay BELOW them. */
.layer-projects {
  z-index: auto;
}

.layer-white-cover {
  z-index: 1;
  pointer-events: none;
}

.layer-grid {
  z-index: 2;
  pointer-events: none;
}

.layer-digital-bar {
  z-index: 4;
  pointer-events: none;
}

.layer-text {
  z-index: 5;
  pointer-events: none;
}

.layer-impressum-bar {
  z-index: 6;
  pointer-events: none;
}

.projects-stack {
  position: absolute;
  left: 0;
  top: calc((4 * var(--grid-row-height)) + (4 * var(--grid-row-gutter)) + var(--grid-margin-top));
  width: var(--viewport-width);
  display: flex;
  flex-direction: column;
  gap: var(--grid-row-gutter);
}

.project-dropdown {
  width: var(--viewport-width);
  min-height: var(--grid-row-height);
  margin: 0;
  padding: 0;
  border: 0;
  background: #d9d9d9;
  overflow: hidden;
}

.project-dropdown[open] {
  min-height: auto;
}

.project-summary {
  position: relative;
  display: block;
  width: 100%;
  height: var(--grid-row-height);
  margin: 0;
  padding: 0;
  list-style: none;
  cursor: pointer;
}

.project-summary::-webkit-details-marker {
  display: none;
}

.project-summary::marker {
  content: "";
}

.project-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.project-image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(217, 217, 217, 0.12);
  pointer-events: none;
}

.project-dropdown:hover .project-bg-image,
.project-dropdown[open] .project-bg-image {
  opacity: 1;
}

/* Trimming the line box to cap/baseline means translateY(-50%) centres the
   VISIBLE capitals in the bar, not the font's em box (whose ascender and
   descender space is asymmetric, which is what made the text sit slightly
   high). Font-independent, so it holds for the webfont and any fallback. */
.project-text {
  position: absolute;
  top: 50%;
  left: var(--grid-margin-side);
  transform: translateY(-50%);
  text-box: trim-both cap alphabetic;
  color: #000000;
  font-family: "neue-haas-grotesk-display", "Helvetica Neue LT Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 500;
  font-size: 50px;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
}

.project-arrow {
  position: absolute;
  top: 50%;
  right: var(--grid-margin-side);
  transform: translateY(-50%);
  width: var(--project-arrow-size);
  height: var(--project-arrow-size);
  object-fit: contain;
  pointer-events: none;
  z-index: 1;
}

.project-panel {
  position: relative;
  z-index: 3;
  width: 100%;
  height: auto;
  padding: 32px;
}

.project-content-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(4, auto);
  gap: 32px;
  width: 100%;
  height: auto;
}

.project-copy-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-copy-block:nth-child(1) {
  grid-column: 1 / 3;
  grid-row: 1 / 2;
}

.project-copy-block:nth-child(2) {
  grid-column: 1 / 3;
  grid-row: 2 / 3;
}

.project-copy-block:nth-child(3) {
  grid-column: 1 / 3;
  grid-row: 3 / 4;
}

.project-subheading {
  margin: 0;
  font-family: "neue-haas-grotesk-display", "Helvetica Neue LT Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
  color: #000000;
}

.project-body-text {
  margin: 0;
  font-family: "neue-haas-grotesk-display", "Helvetica Neue LT Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 20px;
  /* Line spacing tuned so exactly 6 lines fill one grid row (149px). */
  line-height: calc(var(--grid-row-height) / 6);
  font-weight: 400;
  color: #000000;
  text-align: left;
  word-spacing: 0;
  letter-spacing: 0;
  font-stretch: 100%;
  font-kerning: normal;
  font-feature-settings: "kern" 1;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
  overflow-wrap: normal;
  word-break: normal;
  hyphenate-limit-chars: 10 4 4;
  -webkit-hyphenate-limit-before: 4;
  -webkit-hyphenate-limit-after: 4;
}

.project-content-image,
.project-content-video {
  width: 100%;
  height: auto;
  display: block;
  background: transparent;
}

.image-one {
  grid-column: 3 / 4;
  grid-row: 1;
}

.image-two {
  grid-column: 4 / 5;
  grid-row: 1;
}

.image-three {
  grid-column: 3 / 5;
  grid-row: 2;
}

.project-content-video {
  grid-column: 5 / 6;
  grid-row: 1;
}

/* Project-D1 individual layout */
/* Text on its own row, then both 16:9 maps stacked full-width, each in its
   own auto-height row sized purely by its own content. */
#projectD1Dropdown .project-content-grid {
  grid-template-rows: auto auto auto;
}

#projectD1Dropdown .project-copy-block:nth-child(1) {
  grid-column: 1 / 6;
  grid-row: 1;
}

#projectD1Dropdown .image-one {
  grid-column: 1 / 6;
  grid-row: 2;
  height: auto;
}

#projectD1Dropdown .image-two {
  grid-column: 1 / 6;
  grid-row: 3;
  height: auto;
}

/* Project-D2 individual layout */
/* Bild1 (Plakat) and Video1 (Leporello) sit side by side on the first free
   row under Text1, both auto-height so each keeps its true aspect ratio. */
#projectD2Dropdown .project-content-grid {
  grid-template-rows: auto auto;
}

/* Text1 sits alone on row 1, so it may widen up to the full width (1-6);
   fitProjectTexts() picks the actual width to keep it within 6 lines. */
#projectD2Dropdown .project-copy-block:nth-child(1) {
  grid-column: 1 / 6;
  grid-row: 1;
}

#projectD2Dropdown .image-one {
  grid-column: 1 / 4;
  grid-row: 2;
  height: auto;
}

#projectD2Dropdown .project-content-video {
  grid-column: 4 / 6;
  grid-row: 2;
  height: auto;
}

/* Project-D3 individual layout */
/* Hero: A1_2 (16:9) fills 3 columns on the right, spanning the text and
   A1_3 rows. The wide KarteElement banner closes the panel full-width. */
#projectD3Dropdown .project-content-grid {
  grid-template-rows: auto auto auto;
}

#projectD3Dropdown .image-one {
  grid-column: 3 / 6;
  grid-row: 1 / 3;
}

#projectD3Dropdown .image-two {
  grid-column: 1 / 3;
  grid-row: 2;
}

#projectD3Dropdown .image-three {
  grid-column: 1 / 6;
  grid-row: 3;
}

/* Project-D4 individual layout */
/* Text1 gets its own full-width row (1-6) so fitProjectTexts() can widen it
   to <= 6 lines. Below it the image (left) and video (right) sit side by
   side — swapped from their previous sides. */
#projectD4Dropdown .project-content-grid {
  grid-template-rows: auto auto;
}

#projectD4Dropdown .project-copy-block:nth-child(1) {
  grid-column: 1 / 6;
  grid-row: 1;
}

#projectD4Dropdown .image-one {
  grid-column: 1 / 3;
  grid-row: 2;
}

#projectD4Dropdown .project-content-video {
  grid-column: 3 / 6;
  grid-row: 2;
}

.project-cover-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 154px;
  background: #ffffff;
}

.top-margin-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--grid-margin-top);
  background: var(--page-bg);
}

.top-margin-line {
  position: fixed;
  top: var(--grid-margin-top);
  left: 0;
  right: 0;
  height: var(--grid-line-width);
  background: var(--grid-line-color);
  filter: blur(0.22px);
  opacity: 0.9;
}

.grid-surface {
  position: relative;
  margin-top: var(--grid-margin-top);
  min-height: 8000px;
  background-color: transparent;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--grid-row-height) - var(--grid-line-width)),
      color-mix(in srgb, var(--grid-line-color) 90%, transparent) calc(var(--grid-row-height) - var(--grid-line-width)),
      color-mix(in srgb, var(--grid-line-color) 90%, transparent) var(--grid-row-height),
      transparent var(--grid-row-height),
      transparent calc(var(--grid-row-height) + var(--grid-row-gutter) - var(--grid-line-width)),
      color-mix(in srgb, var(--grid-line-color) 90%, transparent) calc(var(--grid-row-height) + var(--grid-row-gutter) - var(--grid-line-width)),
      color-mix(in srgb, var(--grid-line-color) 90%, transparent) calc(var(--grid-row-height) + var(--grid-row-gutter))
    );
  background-size: 100% calc(var(--grid-row-height) + var(--grid-row-gutter));
  background-repeat: repeat-y;
}

.grid-columns {
  position: fixed;
  top: var(--grid-margin-top);
  left: var(--grid-margin-side);
  width: calc(var(--viewport-width) - (var(--grid-margin-side) * 2));
  height: calc(100vh - var(--grid-margin-top));
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  column-gap: var(--grid-gutter);
}

.col-line {
  position: relative;
  height: 100vh;
}

.col-line::before,
.col-line::after {
  content: "";
  position: absolute;
  top: 0;
  height: 100vh;
  width: var(--grid-line-width);
  background: var(--grid-line-color);
  filter: blur(0.22px);
  opacity: 0.9;
}

.col-line::before { left: 0; }
.col-line::after { right: 0; }

.digital-bar {
  position: absolute;
  left: 0;
  top: calc((3 * var(--grid-row-height)) + (3 * var(--grid-row-gutter)) + var(--grid-margin-top));
  width: var(--viewport-width);
  height: var(--grid-row-height);
  background: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.digital-bar.is-stuck {
  position: fixed;
  top: 0;
  left: 0;
}

/* Trimmed to cap/baseline so the parent's `align-items: center` centres the
   visible capitals rather than the asymmetric em box. See .project-text. */
.digital-bar-text {
  text-box: trim-both cap alphabetic;
  color: #ffffff;
  font-family: "neue-haas-grotesk-display", "Helvetica Neue LT Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 48px;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  padding-left: var(--grid-margin-side);
}

.text-vinzent,
.text-portfolio,
.text-2026 {
  position: absolute;
  pointer-events: none;
}

/* Baseline-anchored instead of em-box-anchored.
   `text-box: trim-both cap alphabetic` trims the block to the cap height on
   top and the alphabetic baseline on the bottom, and translateY(-100%) drops
   that trimmed bottom edge onto `top`. The last line's baseline therefore
   lands exactly on the bottom line of grid row 3 -- verified identical for
   Arial/Georgia/Courier, i.e. completely independent of which font loads.
   The old approach positioned the em box and corrected with a hand-tuned px
   offset, which only ever matched the one font it was measured against. */
.text-vinzent {
  left: calc(var(--grid-margin-side) + (2 * (var(--grid-cell-width) + var(--grid-gutter))));
  top: calc(var(--grid-margin-top) + (2 * var(--grid-row-step)) + var(--grid-row-height));
  transform: translateY(-100%);
  text-box: trim-both cap alphabetic;
  width: var(--grid-cell-width);
  color: var(--text-color);
  font-family: "neue-haas-grotesk-display", "Helvetica Neue LT Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 500;
  font-size: 206px;
  line-height: 181px;
  letter-spacing: 0;
  white-space: nowrap;
}

/* Baseline-anchored, see .text-vinzent above: baseline sits exactly on the
   bottom line of grid row 1, independent of the loaded font. */
.text-portfolio {
  left: var(--grid-margin-side);
  top: calc(var(--grid-margin-top) + var(--grid-row-height));
  transform: translateY(-100%);
  text-box: trim-both cap alphabetic;
  width: var(--grid-cell-width);
  color: var(--text-color);
  font-family: "neue-haas-grotesk-display", "Helvetica Neue LT Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 500;
  font-size: 50px;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

/* Baseline-anchored, matching .text-portfolio on the same grid line. */
.text-2026 {
  right: var(--grid-margin-side);
  top: calc(var(--grid-margin-top) + var(--grid-row-height));
  transform: translateY(-100%);
  text-box: trim-both cap alphabetic;
  width: var(--grid-cell-width);
  color: var(--text-color);
  font-family: "neue-haas-grotesk-display", "Helvetica Neue LT Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 500;
  font-size: 50px;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.lightbox-trigger {
  cursor: pointer;
}

.media-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 48px;
}

.media-lightbox.is-open {
  display: flex;
}

.media-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.media-lightbox-dialog {
  position: relative;
  width: min(1100px, calc(var(--viewport-width) - 96px));
  max-height: calc(100vh - 96px);
  overflow: visible;
}

.media-lightbox-close {
  position: absolute;
  top: -40px;
  right: -4px;
  display: block;
  width: auto;
  height: auto;
  font-family: Arial, sans-serif;
  font-size: 36px;
  line-height: 1;
  color: #000000;
  cursor: pointer;
  z-index: 1;
  padding: 0;
  background: none;
  border: 0;
}

.media-lightbox-content {
  width: 100%;
  line-height: 0;
}

.media-lightbox-content img,
.media-lightbox-content video {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 96px);
  object-fit: contain;
  background: transparent;
}


.project-content-video {
  display: block;
}

.project-content-video[poster] {
  background-color: #d9d9d9;
}


.impressum-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--viewport-width);
  height: var(--grid-row-height);
  background: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 18px var(--grid-margin-side);
}

.impressum-bar-label {
  color: #ffffff;
  font-family: "neue-haas-grotesk-display", "Helvetica Neue LT Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 50px;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

.impressum-bar-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  color: #ffffff;
  font-family: "neue-haas-grotesk-display", "Helvetica Neue LT Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.05;
  text-align: right;
  white-space: nowrap;
}


.text-vinzent-link {
  color: var(--text-color);
  text-decoration: none;
  pointer-events: auto;
  transition: font-weight 120ms ease;
}

.text-vinzent-link:hover {
  font-weight: 700;
}


.hover-grid-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--viewport-width);
  height: 665px;
  pointer-events: none;
  z-index: 30;
  opacity: 1;
}


.hover-grid-animation {
  will-change: top, transform;
  backface-visibility: hidden;
}



/* ---------------------------------------------------------------------
   MOBILE (phones)

   The desktop design is a fixed 1920px canvas: a 5-column grid, 149px row
   rhythm and display type up to 206px. None of that can reflow onto a
   ~390px screen, so below 768px the whole rhythm shrinks via the same
   variables the rest of the stylesheet (and the JS) already reads, and
   the project panels collapse from a 5-column layout to a single stack.
   --------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --grid-margin-top: 72px;
    --grid-margin-side: 16px;
    --grid-columns: 2;
    --grid-gutter: 16px;
    --grid-row-height: 72px;
    --grid-row-gutter: 16px;
    --project-arrow-size: 28px;
  }

  /* The markup ships 5 column-line elements for the 5-column desktop grid;
     only the first 2 belong to the narrowed mobile grid. */
  .col-line:nth-child(n + 3) {
    display: none;
  }

  .text-portfolio,
  .text-2026 {
    width: auto;
    font-size: 15px;
  }

  /* Anchored to the left margin instead of column 3 (which is off-screen
     at this width) and scaled to fit; the baseline stays grid-aligned
     because the CSS still positions it off --grid-row-* like on desktop. */
  .text-vinzent {
    left: var(--grid-margin-side);
    width: auto;
    font-size: 40px;
    line-height: 1.06;
  }

  .digital-bar-text {
    font-size: 19px;
  }

  .project-text {
    font-size: 17px;
  }

  .project-panel {
    padding: 16px;
  }

  /* Single-column stack. !important is needed to beat both the per-project
     #projectDn column/row placements and the inline width fitProjectTexts()
     writes on desktop. */
  .project-content-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
    gap: 16px;
  }

  .project-content-grid > * {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    width: 100% !important;
  }

  .project-body-text {
    font-size: 15px;
    /* Desktop packs exactly 6 lines into one grid row; at this size that
       would be unreadably tight, so use a normal reading leading. */
    line-height: 1.45;
  }

  .impressum-bar {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 16px var(--grid-margin-side);
  }

  .impressum-bar-label {
    font-size: 19px;
  }

  .impressum-bar-text {
    align-items: flex-start;
    font-size: 12px;
    text-align: left;
    /* The address line is wider than a phone screen, so it has to wrap
       instead of running off the right edge. */
    white-space: normal;
  }

  /* Hover-only flourish: pointless on touch and it would otherwise paint a
     large fixed canvas over the layout. */
  .hover-grid-animation {
    display: none;
  }
}
