/* 4054.studio — Startseite */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  color-scheme: light;
  --paper: #f3f1ec;
  --ink: #141413;
  --muted: #5f5d58;
  --line: rgba(20, 20, 19, 0.12);
  --grid: rgba(20, 20, 19, 0.045);
  --dot: rgba(20, 20, 19, 0.16);
  --accent: #c4472b;

  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --pad: clamp(16px, 3.2vw, 48px);
  --gutter: clamp(12px, 1.6vw, 24px);
  --max: 1520px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0e0e0d;
    --ink: #ecebe6;
    --muted: #9b998f;
    --line: rgba(236, 235, 230, 0.13);
    --grid: rgba(236, 235, 230, 0.04);
    --dot: rgba(236, 235, 230, 0.18);
    --accent: #e0694a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0e0e0d;
  --ink: #ecebe6;
  --muted: #9b998f;
  --line: rgba(236, 235, 230, 0.13);
  --grid: rgba(236, 235, 230, 0.04);
  --dot: rgba(236, 235, 230, 0.18);
  --accent: #e0694a;
}

/* Nichts darf die Seite seitlich verschiebbar machen (auch nicht auf iOS).
   html: hidden geht an den Viewport, body: clip ist kein Scroll-Container,
   darum funktioniert position: sticky weiterhin. */
html { scroll-behavior: smooth; overflow-x: hidden; }
body { overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }   /* Ziel eines Ankers: kein Rahmen um die ganze Sektion */

.skip {
  position: absolute; left: var(--pad); top: -100px;
  background: var(--ink); color: var(--paper);
  padding: .6em 1em; z-index: 100; text-decoration: none;
}
.skip:focus { top: 12px; }

em, .serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Raster ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}
.cols {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
}

.gridlines {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
}
.gridlines .wrap { height: 100%; }
.gridlines .cols { height: 100%; }
.gridlines span {
  border-left: 1px solid var(--grid);
  border-right: 1px solid var(--grid);
  transition: background .5s var(--ease), border-color .5s var(--ease);
}
body.show-grid .gridlines span {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Rasterspalte unter dem Zeiger leuchtet kurz auf (nur mit Maus) */
.gridlines span { position: relative; }
.gridlines span::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -1px; right: -1px;
  border-left: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent calc(var(--gy, 50vh) - 280px), #000 var(--gy, 50vh), transparent calc(var(--gy, 50vh) + 280px));
  mask-image: linear-gradient(to bottom, transparent calc(var(--gy, 50vh) - 280px), #000 var(--gy, 50vh), transparent calc(var(--gy, 50vh) + 280px));
  opacity: 0; transition: opacity 1.2s var(--ease);
}
.gridlines span.hot::after { opacity: 1; transition-duration: .16s; }

main, header, footer { position: relative; z-index: 1; }

/* ---------- Kopfzeile ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .cols { align-items: center; height: 60px; }
.brand {
  grid-column: span 3;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand b { color: var(--accent); font-weight: 500; }
.nav {
  grid-column: 5 / span 5;
  display: flex; gap: clamp(16px, 2.2vw, 36px);
  list-style: none;
  font-size: 14px;
}
.nav a {
  text-decoration: none;
  color: var(--muted);
  transition: color .3s var(--ease);
}
.nav a:hover { color: var(--ink); }
.tools { grid-column: 10 / span 3; display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.clock { white-space: nowrap; }
.clock .t { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Hero ---------- */
.hero-pin { display: flex; flex-direction: column; padding: clamp(28px, 6vh, 72px) 0 clamp(20px, 4vh, 48px); }
.hero-meta { align-items: baseline; }
.hero-meta .l { grid-column: span 6; }
.hero-meta .r { grid-column: 7 / span 6; text-align: right; }
.hero-mid {
  position: relative; flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: clamp(28px, 6vh, 64px); padding-bottom: clamp(28px, 6vh, 64px);
}
.matrix {
  position: relative;
  width: min(100%, calc((100svh - 300px) * var(--ratio, 3.5)));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(var(--cols, 25), minmax(0, 1fr));
  gap: clamp(2px, .45vw, 7px);
  touch-action: pan-y;
  user-select: none;
}
.c { aspect-ratio: 1; position: relative; --t: 0; }
.c.on {
  background: color-mix(in oklab, var(--accent) calc(var(--t) * 100%), var(--ink));
  border-radius: calc(var(--t) * 50%);
}
.c.off::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 2px; height: 2px; margin: -1px 0 0 -1px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--accent) calc(var(--t) * 100%), var(--dot));
  transform: scale(calc(1 + var(--t) * 4));
}
.c.pt { background: var(--accent); }

.js .c { opacity: 0; animation: rise 1.1s var(--ease) forwards; animation-delay: var(--d, 0s); }
.js .matrix.settled .c { animation: none; opacity: 1; }
@keyframes rise { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }

.hero-statement {
  margin-top: clamp(36px, 7vh, 80px);
  font-size: clamp(2rem, 5.4vw, 5.2rem);
  font-weight: 300; line-height: 1.02; letter-spacing: -0.035em;
  max-width: 17ch; text-wrap: balance;
}
.hero-statement em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; color: var(--accent); }
.hero-foot { align-items: end; }
.hero-foot .status { grid-column: span 6; display: inline-flex; align-items: center; gap: 10px; }
.hero-foot .cue { grid-column: 7 / span 6; text-align: right; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* Mit Bewegung: Hero bleibt stehen, «4054.» fliegt auseinander, der Satz erscheint */
.motion .hero-stage { height: 215svh; }
.motion .hero-pin { position: sticky; top: 60px; height: calc(100svh - 60px); }
.motion .matrix.settled .c:not(.pt) { opacity: calc(1 - var(--e, 0) * .94); }
.motion .hero-statement {
  position: absolute; left: var(--pad); right: var(--pad); top: 50%; margin: 0;
  opacity: var(--q, 0);
  transform: translateY(calc(-50% + (1 - var(--q, 0)) * 48px));
  pointer-events: none;
}
.motion .hero-foot .cue { opacity: calc(1 - var(--e, 0) * 2.5); }

/* ---------- Abschnitte ---------- */
section { scroll-margin-top: 60px; }
.sec { padding: clamp(72px, 13vh, 160px) 0; }
.sec-head {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-bottom: clamp(40px, 8vh, 96px);
  row-gap: 20px;
}
.sec-head .mono { grid-column: span 3; }
.sec-head h2 {
  grid-column: 4 / span 9;
  font-weight: 300;
  font-size: clamp(2.2rem, 5.4vw, 5rem);
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

/* ---------- Arbeiten: Szenen ---------- */
.sec-intro { padding-bottom: clamp(40px, 8vh, 96px); }
.sec-intro .sec-head { margin-bottom: 0; }
.scenes { position: relative; z-index: 1; }
.scene {
  position: relative; overflow-x: clip;
  background: var(--bg); color: var(--fg);
  --a: 1; --b: 1; --ta: 1;
}
.scene--vusch  { --bg: #1c1916; --fg: #f3efe6; --sub: rgba(243, 239, 230, .64); }
.scene--heiter { --bg: #d8dce2; --fg: #16181c; --sub: rgba(22, 24, 28, .66); }
.scene--gut    { --bg: #d6d0c3; --fg: #171614; --sub: rgba(23, 22, 20, .66); }
.scene--voraus { --bg: #0d5a66; --fg: #eef6f6; --sub: rgba(238, 246, 246, .7); }

.scene-pin {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter);
  align-items: center; min-height: calc(100svh - 60px);
  padding-top: clamp(32px, 6vh, 64px); padding-bottom: clamp(32px, 6vh, 64px);
}
.scene-text {
  grid-column: 1 / span 4; position: relative; z-index: 4;
  opacity: var(--ta); transform: translateY(calc((1 - var(--ta)) * 40px));
}
.scene-n { display: block; color: var(--sub); margin-bottom: 18px; }
.scene-title { font-weight: 300; font-size: clamp(3.2rem, 7.6vw, 8.2rem); line-height: .92; letter-spacing: -0.05em; }
.scene-title em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.scene-kind { margin-top: 20px; font-size: clamp(1.05rem, 1.4vw, 1.25rem); }
.scene-desc { margin-top: 12px; color: var(--sub); max-width: 36ch; }
.scene-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
/* Offizielles App-Store-Badge von Apple: unverändert, mindestens 40 px hoch */
.store { display: inline-block; margin-top: 28px; border-radius: 9px; transition: transform .4s var(--ease); }
.store img { display: block; height: 46px; width: auto; }
.store:hover { transform: translateY(-2px); }
/* Hell: schwarzes Badge, Dunkel: weisses Badge */
.store .b-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .store .b-light { display: none; }
  :root:not([data-theme="light"]) .store .b-dark { display: block; }
}
:root[data-theme="dark"] .store .b-light { display: none; }
:root[data-theme="dark"] .store .b-dark { display: block; }
.scene-tags li {
  border: 1px solid currentColor; border-radius: 999px; padding: 4px 11px; color: var(--sub);
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
}

.scene-stage { grid-column: 5 / span 8; position: relative; height: min(78svh, 780px); }
.shot {
  position: absolute; left: 50%; top: 50%; display: block;
  box-shadow: 0 50px 90px -30px rgba(0, 0, 0, .5), 0 0 0 1px rgba(0, 0, 0, .08);
}
.shot.phone { height: 94%; width: auto; border-radius: 9% / 4.2%; }
.shot.tablet { width: 94%; height: auto; border-radius: 2.4% / 3.2%; }

.shot.s1 { z-index: 3; transform: translate(-50%, calc(-50% + (1 - var(--a)) * 42%)) scale(calc(.8 + var(--a) * .2)); }
.shot.phone.s2 {
  z-index: 2; opacity: min(1, calc(var(--b) * 3));
  transform: translate(calc(-50% - var(--b) * 70%), calc(-50% + var(--b) * 5%)) rotate(calc(var(--b) * -9deg)) scale(.86);
}
.shot.phone.s3 {
  z-index: 2; opacity: min(1, calc(var(--b) * 3));
  transform: translate(calc(-50% + var(--b) * 70%), calc(-50% + var(--b) * 5%)) rotate(calc(var(--b) * 9deg)) scale(.86);
}
.shot.tablet.s1 { transform: translate(calc(-50% - var(--b) * 6%), calc(-50% + (1 - var(--a)) * 42% + var(--b) * 9%)) scale(calc(.78 + var(--a) * .14)); }
.shot.tablet.s2 {
  z-index: 2; opacity: min(1, calc(var(--b) * 3));
  transform: translate(calc(-50% + var(--b) * 9%), calc(-50% - var(--b) * 24%)) rotate(calc(var(--b) * 2.5deg)) scale(.8);
}

/* Mit Bewegung: jede Szene bleibt stehen, während die Screens hereinkommen */
.motion .scene { height: 250svh; }
.motion .scene-pin { position: sticky; top: 60px; height: calc(100svh - 60px); min-height: 0; }

/* Pixel-Kanten: Die Farbfläche jeder Szene zerfällt beim Scrollen in Pixel */
.pix { position: absolute; left: 0; right: 0; z-index: 5; pointer-events: none; }
.pix--top { bottom: 100%; }
.pix--end { bottom: 0; }
.pix .px { position: absolute; display: block; background: var(--bg); will-change: transform, opacity; }
.pix--end .px { background: var(--paper); }

/* Angebot */
.services { row-gap: 48px; }
.svc { grid-column: span 4; }
.svc h3 {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  line-height: 1;
  margin: 14px 0 22px;
}
.svc p { color: var(--muted); max-width: 34ch; margin-bottom: 24px; }
.svc ul { list-style: none; border-top: 1px solid var(--line); }
.svc li {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 15px;
  display: flex; justify-content: space-between;
}
.svc li span { color: var(--muted); font-family: var(--mono); font-size: 11px; }

/* Studio */
.about-text {
  grid-column: 4 / span 8;
  font-size: clamp(1.4rem, 2.5vw, 2.3rem);
  font-weight: 300;
  line-height: 1.22;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}
.about-text p + p { margin-top: 1em; }
.about-text .soft { color: var(--muted); }

.facts { margin-top: clamp(56px, 10vh, 120px); row-gap: 36px; }
.fact { grid-column: span 3; border-top: 1px solid var(--line); padding-top: 16px; }
.fact .v {
  display: block;
  font-size: clamp(1.5rem, 2.6vw, 2.3rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  margin-top: 10px;
}

.process { margin-top: clamp(72px, 12vh, 140px); row-gap: 36px; }
.process .label { grid-column: span 3; }
.steps { grid-column: 4 / span 9; list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px var(--gutter); }
.steps li { display: grid; grid-template-columns: 3rem 1fr; }
.steps h4 { font-weight: 500; font-size: 18px; letter-spacing: -0.01em; margin-bottom: 6px; }
.steps p { color: var(--muted); font-size: 15px; max-width: 36ch; }

/* Kontakt */
.contact {
  background: var(--ink);
  color: var(--paper);
  --line: color-mix(in srgb, var(--paper) 16%, transparent);
  --muted: color-mix(in srgb, var(--paper) 62%, var(--ink));
  padding: clamp(80px, 15vh, 180px) 0 0;
}
.contact .sec-head { margin-bottom: clamp(32px, 6vh, 72px); }
.contact .mono { color: var(--muted); }
.contact h2 { font-size: clamp(2.8rem, 8.4vw, 8.2rem); line-height: .95; }
.mail-row { margin-top: clamp(32px, 6vh, 64px); align-items: center; row-gap: 20px; }
.mail {
  grid-column: 4 / span 6;
  font-size: clamp(1.4rem, 3vw, 2.6rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat,
              linear-gradient(var(--line), var(--line)) 0 100% / 100% 1px no-repeat;
  padding-bottom: 6px;
  transition: background-size .7s var(--ease);
  justify-self: start;
}
.mail:hover { background-size: 100% 1px, 100% 1px; }
.copy {
  grid-column: 10 / span 3;
  justify-self: end;
  font: inherit;
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--paper);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.copy:hover { border-color: var(--accent); }
.contact-note { grid-column: 4 / span 6; margin-top: 18px; color: var(--muted); font-size: 15px; }

.site-footer {
  margin-top: clamp(96px, 16vh, 200px);
  border-top: 1px solid var(--line);
  padding: 22px 0 28px;
}
.site-footer .cols { align-items: baseline; row-gap: 12px; }
.site-footer .a { grid-column: span 3; }
.site-footer .b { grid-column: 4 / span 5; display: flex; gap: 24px; flex-wrap: wrap; }
.site-footer .b a { text-decoration: none; }
.site-footer .b a:hover { color: var(--paper); }
.site-footer .c2 { grid-column: 10 / span 3; text-align: right; }
kbd {
  font-family: var(--mono); font-size: 11px;
  border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px;
}

/* Einblenden beim Scrollen */
.js .reveal { opacity: 0; translate: 0 18px; transition: opacity 1.1s var(--ease), translate 1.1s var(--ease); }
.js .reveal.in { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  .js .c, .js .reveal { animation: none; opacity: 1; translate: none; transition: none; }
  .pulse { animation: none; }
  .pulse { animation: none; }
}

/* ---------- Tablet & Handy ---------- */
@media (max-width: 900px) {
  .nav { display: none; }
  .brand { grid-column: span 6; }
  .tools { grid-column: 7 / span 6; }
  .svc { grid-column: 1 / -1; }
  .scene-pin { grid-template-rows: auto minmax(0, 1fr); align-items: stretch; row-gap: 20px; }
  .scene-text, .scene-stage { grid-column: 1 / -1; }
  .scene-stage { height: auto; min-height: 340px; }
  .scene-title { font-size: clamp(2.8rem, 13vw, 5rem); }
  .scene-kind { margin-top: 10px; }
  .scene-tags { margin-top: 14px; }
  .store { margin-top: 16px; }
  .store img { height: 40px; }
  .about-text { grid-column: 1 / -1; }
  .fact { grid-column: span 6; }
  .process .label { grid-column: 1 / -1; }
  .steps { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gridlines span:nth-child(n+5) { display: none; }
  .brand { grid-column: span 2; }
  .tools { grid-column: span 2; gap: 10px; }
  .clock .city { display: none; }
  .hero-meta .l, .hero-meta .r { grid-column: 1 / -1; text-align: left; }
  .hero-meta .r { display: none; }
  .hero-foot .status, .hero-foot .cue { grid-column: span 2; }
  .scene-desc { font-size: 14.5px; }
  .sec-head .mono, .sec-head h2 { grid-column: 1 / -1; }
  .fact { grid-column: span 2; }
  .steps { grid-template-columns: 1fr; }
  .mail, .copy, .contact-note { grid-column: 1 / -1; justify-self: start; }
  .site-footer .a, .site-footer .b, .site-footer .c2 { grid-column: 1 / -1; text-align: left; }
}

/* früher Inline-Stile */
.sec.flush { padding-top: 0; }
.plain { text-decoration: none; }

/* Umschalter Hell / Dunkel / System */
.theme {
  display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid var(--line); border-radius: 999px; padding: 2px;
}
.theme button {
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer;
  transition: color .3s var(--ease), background-color .3s var(--ease);
}
.theme button:hover { color: var(--ink); }
.theme button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.theme svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; }
.theme svg path[d^="M13.5"] { fill: currentColor; stroke: none; }
.theme svg .fill { fill: currentColor; stroke: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

