@font-face {
  font-family: "Martian Mono";
  src: url("/lib/fonts/martian-mono-latin-wght.woff2") format("woff2");
  font-weight: 200 500;
  font-style: normal;
  font-display: swap;
}

/* Palette "graphit"; css/palettes.css holds the alternatives for the ?palette preview */
:root {
  --bg: #F5F4F1;
  --ink: #2B2B2B;
  --soft: #2B2B2B;
  --muted: #5C5C5C;
  --accent: #3E5C9A;
  --mark: #4C6CB0;
  --band: #EAE9E5;
  --rule: #DAD8D3;
  --bubble: #E6E4DE;
  --field: #F1F0EC;
  --stack: #D5D3CD;
  --submit-bg: #2B2B2B;
  --submit-ink: #F5F4F1;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --foot-bg: #2B2B2B;
  --foot-ink: #F5F4F1;
  --foot-muted: #B3B3B3;
  --foot-accent: #8FA6DA;
  --foot-rule: #3F3F3F;

  --panel-anapana: #BDBDBD;
  --panel-ks: #D6CFC2;
  --panel-melina: #C8CEDC;
  --panel-klartext: #D2D0C9;
  --art-1: #AEB9D3;
  --art-2: #4C6CB0;
  --art-3: #D9D4C8;

  --text: 0.875rem;
  --small: 0.75rem;
  --page: min(1120px, 100% - 32px);
  --gap: clamp(88px, 12vw, 136px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1F1F1F;
    --ink: #F0EFEC;
    --soft: #DAD9D5;
    --muted: #A8A8A8;
    --accent: #8FA6DA;
    --band: #282828;
    --rule: #363636;
    --bubble: #2A2A2A;
    --field: #181818;
    --stack: #181818;
    --submit-bg: #8FA6DA;
    --submit-ink: #1F1F1F;
    --foot-bg: #161616;
    --foot-rule: #282828;

    --panel-anapana: #363636;
    --panel-ks: #3A3833;
    --panel-melina: #2C3445;
    --panel-klartext: #333333;
    --art-1: #3D4C6E;
    --art-2: #4C6CB0;
    --art-3: #5C574D;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
html:has(dialog[open]) { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: var(--text);
  line-height: 1.8;
  font-weight: 350;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, figure, blockquote, dl, dd { margin: 0; }
img { display: block; max-width: 100%; height: auto; }

a, .zoom { color: inherit; text-decoration: none; transition: opacity 150ms; }
a:hover, .zoom:hover { opacity: 0.7; }

.zoom {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::backdrop { transition: none !important; animation: none !important; }
}

.wrap { width: var(--page); margin-inline: auto; }

.section-label {
  border-top: 1px solid var(--ink);
  padding-top: 12px;
  font-size: var(--small);
  font-weight: 300;
  color: var(--muted);
}

.kind { font-size: var(--small); font-weight: inherit; color: var(--muted); }
.more {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: var(--small);
  color: var(--accent);
  transition: background-color 150ms, color 150ms;
}
.row:hover .more { background: var(--accent); color: var(--bg); }

/* Header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
  padding-top: 40px;
  font-size: var(--small);
  color: var(--muted);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 400;
}

.brand::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mark);
}

.site-nav { display: flex; gap: 24px; }

main {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  margin-block: clamp(32px, 5vw, 56px) var(--gap);
  overflow-x: clip;
}

/* Hero */

/* The hero is organised by the golden ratio φ = 1.618:
   - a type and spacing scale from the 14px body in half φ-steps (×√φ ≈ 1.272):
     14 · 17.8 · 22.6 · 28.8 · 36.7 · 46.6 · 59.3 · 96 (≈ 14·φ⁴), the headline a quarter step above 46.6;
   - from 900px two columns in φ proportion (1.618fr : 1fr), the headline on the left, the stack graphic
     flush right and vertically centred on the headline. */
.hero {
  --h1: clamp(28px, 5.2vw, 46.6px);
  display: flex;
  flex-direction: column;
  gap: 23px;
  padding-top: 0;
  position: relative;
  isolation: isolate;
}

.hero-figure { touch-action: pan-y; }

/* The stack svg is 1.6 times as tall as wide; it sits flush right in its figure, centred vertically */
.hero-stack {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: 0;
  width: var(--size);
  transform: translateY(-50%);
  overflow: visible;
  isolation: isolate;
}

/* On narrow screens the stack sits at the height of the headline, half outside the screen on the right
   (16px is the page gutter); site.js sets --headline-middle */
@media (max-width: 899px) {
  .hero { --stack-size: clamp(120px, 36vw, 240px); }

  .hero-figure {
    --size: var(--stack-size);
    position: absolute;
    top: var(--headline-middle, 50%);
    right: calc(var(--size) * -0.5 - 16px);
    width: var(--size);
    height: var(--size);
    transform: translateY(-50%);
  }

  /* Headline and lead wrap before the visible half of the stack (minus the gutter, plus 12px air) */
  .hero h1,
  .hero .lead { padding-right: calc(var(--stack-size) * 0.5 - 4px); }

  /* On very narrow screens the headline shrinks so "komplizierter." (10.1em wide) fits the remaining width */
  .hero h1 { font-size: min(var(--h1), (100vw - 28px - var(--stack-size) * 0.5) / 10.1); }
}

@media (min-width: 900px) {
  .hero {
    /* 15.4em is the width of the longest headline line; the font shrinks so it stays inside the left column
       plus the free margin before the graphic, which sits flush right */
    --h1: min(52.6px, 0.0428 * (100vw - 32px));
    display: grid;
    grid-template-columns: minmax(0, 1.618fr) minmax(0, 1fr);
    gap: 0;
    padding-top: 37px;
  }

  .hero > * { grid-column: 1; }
  .hero-meta { margin-bottom: 37px; }
  .hero .lead { margin-top: 37px; }
  .hero .principles { grid-column: 1 / -1; margin-top: 59px; }

  /* Shares the headline's grid row, so the graphic is centred on the middle line */
  .hero-figure {
    --size: 200px;
    grid-column: 2;
    grid-row: 2;
    position: relative;
  }
}

/* From here the lead fits on one line across both columns, ending before the stack */
@media (min-width: 1000px) {
  .hero .lead { grid-column: 1 / -1; }
}

/* Three circles, each 30% of the diameter below the previous one, so all three meet in the middle; site.js
   unfolds them on load and slides them together as a pointer approaches. Palette tokens keep them in step
   with the preview palettes. */

/* site.js lowers --stack-opacity while the circles lie on one another, so their overlap doesn't turn muddy */
.hero-stack circle {
  opacity: var(--stack-opacity, 0.66);
  mix-blend-mode: multiply;
  transform-box: fill-box;
  transform-origin: center;
}
.hero-stack circle:nth-child(1) { fill: var(--art-1); }
.hero-stack circle:nth-child(2) { fill: var(--art-2); }
.hero-stack circle:nth-child(3) { fill: var(--art-3); }

@media (prefers-color-scheme: dark) {
  .hero-stack circle { opacity: calc(var(--stack-opacity, 0.66) * 1.1); mix-blend-mode: screen; }
}

.hero-meta { font-size: var(--small); line-height: 1.7; color: var(--muted); }
.hero-meta span { display: block; }

@media (min-width: 900px) {
  .hero-meta span { display: inline; }
  .hero-meta span + span::before { content: " · "; }
}

.hero h1 {
  font-size: var(--h1);
  font-weight: 250;
  line-height: 1.15;
  letter-spacing: -0.03em;
  /* Fixed to 24ch so the three lines break the same way in both columns layouts; it may reach into the
     right column's free margin beside the circumpunct */
  width: 24ch;
  max-width: 100%;
}

@media (min-width: 900px) {
  .hero h1 { max-width: none; }
}

@media (max-width: 699px) {
  .hero h1 { font-weight: 350; }
}

.hero h1 em { color: var(--accent); font-style: normal; font-weight: 400; }

@media (max-width: 699px) {
  .hero h1 em { font-weight: 500; }
}

.lead { color: var(--muted); max-width: 82ch; text-wrap: balance; }

.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px 48px;
  margin-top: 14px;
}

.principles div { position: relative; padding-top: 18px; border-top: 2px solid var(--rule); }

/* A copper line moves through the principles one after another: it fades in, stays, fades out and the next
   one takes over. Without motion the first one simply stays marked. */
.principles div::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--mark);
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .principles div:first-child::before { opacity: 1; }
}
.principles dt { font-size: 16px; font-weight: 500; }
.principles dd { margin-top: 8px; font-size: var(--small); line-height: 1.7; color: var(--muted); }

/* Featured project */

.feature { display: flex; flex-direction: column; gap: 40px; }

/* On phones the whole INViTO section becomes a full-width tinted band; inside it the stage and the quote
   bubble switch to the page colour so they still stand out */
@media (max-width: 699px) {
  .feature {
    --bubble: var(--bg);
    width: 100%;
    padding: 48px 16px 56px;
    background: var(--band);
  }

  .feature .stage { background: var(--bg); }
}

.feature-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 40px;
}

.feature-head h2 { font-size: clamp(22.6px, 2.4vw, 28.8px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.feature-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.feature-meta p { font-size: var(--small); color: var(--muted); }

.button-outline {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: var(--small);
  cursor: pointer;
  transition: background-color 150ms, color 150ms;
}

.button-outline:hover { opacity: 1; background: var(--accent); color: var(--bg); }

.stage {
  background: var(--band);
  border-radius: 16px;
  padding: clamp(44px, 6vw, 72px) clamp(16px, 4vw, 56px) 0;
  overflow: hidden;
}

.teaser {
  position: relative;
  display: block;
  width: min(100%, 780px);
  margin-inline: auto;
  /* Hangs below the panel edge so the hover lift never opens a gap at the bottom */
  margin-bottom: -8px;
}

.teaser:hover { opacity: 1; }

.screen {
  position: relative;
  display: block;
  width: 100%;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: 0 0 0 1px rgba(53, 25, 46, 0.08), 0 30px 60px -30px rgba(0, 0, 0, 0.5);
}

.stack {
  position: absolute;
  inset: 0;
  border-radius: 8px 8px 0 0;
  background: var(--stack);
  transform: translate(8px, -8px);
}

.teaser-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(36, 16, 31, 0.72);
  color: #F1E4DA;
  transition: background-color 150ms;
}

.teaser:hover .teaser-badge { background: rgba(36, 16, 31, 0.9); }

@media (min-width: 700px) {
  .stack { transform: translate(12px, -12px); }
  .teaser-badge { right: 16px; bottom: 16px; }
}

.screen-bar {
  height: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: #F1E9E3;
  border-bottom: 1px solid #E3D6CC;
}

.screen-bar i { width: 6px; height: 6px; border-radius: 50%; background: #D3C3B8; }

.screen img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }

.feature-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px 56px;
}

.feature-cols > * { display: flex; flex-direction: column; gap: 8px; }

.quote figcaption { font-size: var(--small); color: var(--muted); }

.bubble { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }

.bubble blockquote {
  position: relative;
  max-width: 62ch;
  padding: clamp(22px, 3vw, 34px);
  border-radius: 16px 16px 16px 6px;
  background: var(--bubble);
  font-size: clamp(16px, 1.7vw, 19px);
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: -0.01em;
}

.bubble blockquote::after {
  content: "";
  position: absolute;
  left: 28px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: var(--bubble);
  transform: rotate(45deg);
}

.bubble figcaption { padding-left: 24px; }

.quote-feature { margin-top: 16px; }

/* More work */

.works { display: flex; flex-direction: column; gap: clamp(64px, 9vw, 96px); }

.row { display: grid; align-items: center; gap: 32px 64px; }

@media (min-width: 860px) {
  .row { grid-template-columns: 3fr 2fr; }
  .row-flip { grid-template-columns: 2fr 3fr; }
  .row-flip img { order: 2; }
}

.row img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 14px; background: var(--band); }
.row-text { display: flex; flex-direction: column; gap: 12px; }
.row-text h3 { font-size: 30px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.2; }
.row-text p { color: var(--soft); max-width: 46ch; }

.cards { display: grid; gap: 48px 28px; }

@media (min-width: 700px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card { display: flex; flex-direction: column; gap: 16px; width: 100%; }

.panel {
  display: block;
  border-radius: 14px;
  padding: clamp(24px, 4vw, 36px) clamp(24px, 4vw, 36px) 0;
  overflow: hidden;
}

.panel img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  border-radius: 6px 6px 0 0;
  box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.5);
  /* Reaches below the panel edge, so lifting it on hover leaves no gap */
  margin-bottom: -10px;
}

/* Phone frame, sized relative to the stage width (cqw) so it scales with the card */
.phone-stage {
  display: flex;
  justify-content: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  container-type: inline-size;
}

.phone {
  position: relative;
  flex: none;
  width: 34cqw;
  height: max-content;
  margin-top: 2cqw;
  padding: 1.4cqw;
  border-radius: 5.4cqw;
  background: #1A0D17;
  box-shadow: 0 0 0 1px rgba(241, 228, 218, 0.14), 0 30px 50px -30px rgba(0, 0, 0, 0.6);
}

.phone:first-child { z-index: 1; box-shadow: 0 0 0 1px rgba(241, 228, 218, 0.14), 12px 0 32px -12px rgba(0, 0, 0, 0.6); }
.phone + .phone { margin-top: 9cqw; margin-left: -3cqw; }

.phone::before {
  content: "";
  position: absolute;
  top: 2.8cqw;
  left: 50%;
  width: 9.5cqw;
  height: 2.8cqw;
  border-radius: 999px;
  background: #1A0D17;
  transform: translateX(-50%);
}

.panel .phone img {
  aspect-ratio: auto;
  padding-top: 5.4cqw;
  border-radius: 4cqw;
  background: #F3E8DF;
  box-shadow: none;
  margin-bottom: 0;
}

.panel-anapana { background: var(--panel-anapana); }
.panel-ks { background: var(--panel-ks); }
.panel-melina { background: var(--panel-melina); }
.panel-klartext { background: var(--panel-klartext); }

.caption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; }
.caption strong { font-weight: 500; }
.card .desc { margin-top: -8px; max-width: 48ch; font-size: var(--small); line-height: 1.7; color: var(--muted); text-align: left; }
.caption .kind { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }

/* Quote */

.quote-large { padding-left: clamp(0px, 8vw, 96px); }

/* Footer */

.site-footer {
  --ink: var(--foot-ink);
  --muted: var(--foot-muted);
  --accent: var(--foot-accent);
  --rule: var(--foot-rule);
  background: var(--foot-bg);
  color: var(--ink);
  padding: clamp(56px, 9vw, 120px) 0 40px;
}

.site-footer .wrap { display: flex; flex-direction: column; gap: 72px; }
.contact { display: grid; justify-items: start; align-items: end; gap: 28px 40px; }
.contact h2 { font-size: var(--small); font-weight: 300; color: var(--muted); }
.contact p { margin-top: 20px; font-size: clamp(18px, 2.6vw, 24px); line-height: 1.5; max-width: 40ch; }

@media (min-width: 700px) {
  .contact { grid-template-columns: 1fr auto; }
}

.button-primary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--foot-accent);
  color: #24101F;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: opacity 150ms;
}

.button-primary:hover { opacity: 0.85; }
.button-primary:disabled { opacity: 0.6; cursor: progress; }

/* Contact form */

.contact-dialog {
  width: min(620px, 100% - 32px);
  max-height: calc(100dvh - 32px);
  padding: 24px;
  border: 0;
  border-radius: 20px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 24px 64px -24px rgba(36, 16, 31, 0.45);
  overflow-y: auto;
}

@media (min-width: 640px) {
  .contact-dialog { padding: 40px; }
}

.contact-dialog:focus { outline: none; }

.contact-dialog::backdrop {
  background: rgba(36, 16, 31, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.contact-dialog form, .form-thanks { display: flex; flex-direction: column; gap: 20px; }
.form-thanks { align-items: flex-start; }
.dialog-head { display: flex; flex-direction: column; gap: 6px; padding-right: 44px; margin-bottom: 4px; }
.contact-dialog h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 300; letter-spacing: -0.02em; line-height: 1.3; }
.dialog-head p, .form-thanks p { color: var(--muted); }

.form-row { display: grid; gap: 20px; }

@media (min-width: 640px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}

.contact-dialog label { display: flex; flex-direction: column; gap: 6px; }
.contact-dialog label span { font-size: var(--small); font-weight: 400; color: var(--muted); }

.contact-dialog input,
.contact-dialog textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  transition: background-color 150ms;
}

.contact-dialog textarea { min-height: 140px; resize: vertical; }

.contact-dialog input:focus-visible,
.contact-dialog textarea:focus-visible { outline-offset: 2px; background: var(--bg); }

.form-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 24px; }
.form-hint { flex: 1 1 240px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.form-error { font-size: var(--small); color: var(--accent); }
.form-hint a, .form-error a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.button-submit {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--submit-bg);
  color: var(--submit-ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 150ms, transform 150ms;
}

.button-submit:hover { opacity: 0.88; }
.button-submit:disabled { opacity: 0.6; cursor: progress; }

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 150ms;
}

.dialog-close:hover { background: var(--band); }

.contact-dialog [hidden] { display: none; }
.trap { position: absolute; left: -9999px; }

.legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  font-size: var(--small);
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 16px;
}

.legal-links { display: flex; flex-wrap: wrap; gap: 12px 24px; }

/* Long-form text (Impressum etc.) */

.prose { max-width: 64ch; }
.prose > * + * { margin-top: 1em; }
.prose h1 { font-size: clamp(22px, 3.2vw, 30px); font-weight: 300; line-height: 1.5; }
.prose h2 { font-size: 17px; font-weight: 500; margin-top: 2.5em; }
.prose h3 { font-size: var(--text); font-weight: 500; margin-top: 2em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.5em; }

/* Lightbox */

.lightbox {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 56px 16px;
  border: 0;
  background: rgba(36, 16, 31, 0.9);
  overflow-y: auto;
  cursor: zoom-out;
}

.lightbox::backdrop { background: transparent; }

.lightbox img {
  max-width: min(1200px, 100%);
  margin-inline: auto;
  border-radius: 8px;
}

.lightbox.fit img { width: auto; max-height: calc(100vh - 112px); }

.lightbox-close {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: #F1E4DA;
  cursor: pointer;
}

.lightbox-close:focus-visible,
.lightbox-nav:focus-visible { outline-color: #F1E4DA; }

.lightbox-info {
  position: fixed;
  top: 22px;
  left: 16px;
  right: 64px;
  color: #F1E4DA;
  font-size: var(--small);
  line-height: 1.5;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  width: 44px;
  height: 44px;
  display: none;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(36, 16, 31, 0.7);
  color: #F1E4DA;
  cursor: pointer;
  transform: translateY(-50%);
}

.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }
.lightbox.gallery .lightbox-nav { display: grid; }

@media (min-width: 700px) {
  .lightbox.gallery { padding-inline: 64px; }
}

/* Motion: everything below is skipped under prefers-reduced-motion by the rule at the top */

@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.98); } }
@keyframes ink { from { color: var(--ink); font-weight: inherit; } }
@keyframes principle {
  0%, 33.3%, 100% { opacity: 0; }
  5%, 28% { opacity: 1; }
}

.principles div::before { animation: principle 12s linear 1s infinite; }
.principles div:nth-child(2)::before { animation-delay: 5s; }
.principles div:nth-child(3)::before { animation-delay: 9s; }

/* When the principles stack in one column, site.js marks the one closest to the middle of the screen instead */
.principles.is-stacked div::before { animation: none; opacity: 0; transition: opacity 400ms var(--ease); }
.principles.is-stacked div.is-active::before { opacity: 1; }

/* "einfacher" takes on its colour together with the outer stack circles, in the second half of the unfolding
   (see site.js) */
.hero h1 em { animation: ink 900ms 1650ms cubic-bezier(0.65, 0, 0.35, 1) both; }

.hero-meta, .hero h1, .lead, .principles { animation: rise 700ms var(--ease) both; }
.hero h1 { animation-delay: 100ms; }
.lead { animation-delay: 200ms; }
.principles { animation-delay: 300ms; }

/* site.js adds .reveal only to elements still below the fold, so nothing stays hidden without JS */
.reveal { opacity: 0; transform: translateY(12px); }
.reveal.is-visible { opacity: 1; transform: none; transition: opacity 700ms var(--ease) var(--delay, 0ms), transform 700ms var(--ease) var(--delay, 0ms); }

.screen, .stack, .phone, .panel img, .row img { transition: transform 400ms var(--ease), box-shadow 400ms var(--ease); }
.teaser:hover .screen { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(53, 25, 46, 0.08), 0 40px 70px -30px rgba(0, 0, 0, 0.55); }
.teaser:hover .stack { transform: translate(14px, -14px); }

@media (min-width: 700px) {
  .teaser:hover .stack { transform: translate(18px, -18px); }
}

.row:hover, .card:hover { opacity: 1; }
.row:hover img { transform: scale(1.02); }

/* Cards: the screenshot lifts out of its panel, the name takes the accent colour and links show an arrow */
.panel { transition: filter 400ms var(--ease); }
.card:hover .panel { filter: brightness(0.97) saturate(1.08); }
.card:hover .panel > img { transform: translateY(-8px); box-shadow: 0 44px 60px -30px rgba(0, 0, 0, 0.55); }
.card:hover .phone:first-child { transform: translateY(-8px); }
.card:hover .phone + .phone { transform: translate(4px, -3px); }
.card .caption strong { transition: color 200ms var(--ease); }
.card:hover .caption strong { color: var(--accent); }
a.card .caption strong::after {
  content: "→";
  display: inline-block;
  margin-left: 0.5em;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
a.card:hover .caption strong::after { opacity: 1; transform: none; }

@media (prefers-color-scheme: dark) {
  .card:hover .panel { filter: brightness(1.08) saturate(1.05); }
}

.button-primary, .button-submit { transition: opacity 150ms, transform 150ms var(--ease); }
.button-primary:hover, .button-submit:hover { transform: translateY(-1px); }

.contact-dialog[open] { animation: pop 200ms var(--ease); }
.contact-dialog[open]::backdrop { animation: fade 200ms var(--ease); }
.lightbox[open] { animation: fade 180ms var(--ease); }
.lightbox[open] img { animation: pop 200ms var(--ease); }
