/* =========================================================
   Dawid Herrmann — Portfolio
   Desktop first. Breakpoints: 1100px, 760px
   ========================================================= */

@view-transition { navigation: auto; }

:root {
  --bg: #f2f0eb;
  --bg-2: #e9e6df;
  --ink: #121212;
  --ink-2: #2a2a2a;
  --muted: #77736b;
  --line: rgba(18, 18, 18, 0.12);
  --accent: #ff4f2b;
  --accent-soft: #ffd9cf;
  --edit: #2b6bff;

  --sans: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;

  --gutter: clamp(16px, 3.2vw, 56px);
  --maxw: 1440px;
  --radius: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }

/* subtle grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  transition: background .3s, padding .3s, box-shadow .3s;
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding-top: 14px; padding-bottom: 14px;
  box-shadow: 0 1px 0 var(--line);
}
.brand {
  font-weight: 600; letter-spacing: -0.02em; font-size: 17px;
  display: inline-flex; align-items: baseline; gap: 1px;
}
.brand .dot { color: var(--accent); display: inline-block; transform-origin: 25% 80%; /* wächst nach rechts oben, überdeckt das „n“ nicht */ transition: transform .35s var(--ease); }
/* Mouse-over: Name wird etwas kleiner, Punkt wächst */
.brand .brand-name { display: inline-block; transform-origin: 0 80%; transition: transform .35s var(--ease); }
.brand:hover .brand-name { transform: scale(.9); }              /* Name: .9 = 90 % */
.brand:hover .dot { transform: translateX(-.75em) scale(3.2); } /* Punkt rückt nach (-.75em = 10 % der Namensbreite) und wächst */
/* Logo wie in der Start-Animation: „Dawid“ dünn, „Herrmann“ Serif kursiv */
.brand .brand-light { font-weight: 250; }
.brand .brand-serif {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 1.18em; letter-spacing: -0.01em; margin-left: .28em;
}
.nav { display: flex; gap: 6px; }
.nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--ink-2);
  transition: background .3s var(--ease), color .3s var(--ease);
}
.nav a:hover { background: rgba(18,18,18,.06); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.nav-num { font-size: 10px; vertical-align: super; opacity: .5; margin-left: 2px; }
.nav a[aria-current="page"] .nav-num { color: var(--accent); opacity: 1; } /* aktive Seite: Zahl orange */

.burger {
  display: none;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg);
  position: relative;
}
.burger span {
  position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--ink);
  transition: transform .35s var(--ease), top .35s var(--ease);
}
.burger span:nth-child(1) { top: 17px; }
.burger span:nth-child(2) { top: 25px; }
body.nav-open .burger span:nth-child(1) { top: 21px; transform: rotate(45deg); }
body.nav-open .burger span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

/* ---------- Layout helpers ---------- */
main { flex: 1; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.serif { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -0.01em; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px var(--gutter);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}
.site-footer a:hover { color: var(--ink); }
/* Footer-Pfeil neigt sich beim Mouse-over 45° nach oben (wie bei den anderen Buttons) */
.site-footer .arr { display: inline-block; transition: transform .35s var(--ease); }
.site-footer a:hover .arr { transform: translateX(3px) rotate(-45deg); }
.site-footer a:hover .arr.back { transform: translateX(3px) rotate(45deg); } /* zurück-Link: Pfeil nach unten */

/* page enter */
.reveal { opacity: 0; transform: translateY(14px); animation: reveal .9s var(--ease) forwards; }
.reveal.d1 { animation-delay: .1s; } .reveal.d2 { animation-delay: .2s; }
.reveal.d3 { animation-delay: .3s; } .reveal.d4 { animation-delay: .45s; }
@keyframes reveal { to { opacity: 1; transform: none; } }

/* =========================================================
   HOME
   ========================================================= */
.home main { display: flex; }
.hero {
  position: relative;
  flex: 1;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 110px var(--gutter) 32px;
}
.hero { grid-template-columns: minmax(0, 1fr); }
.hero-stage {
  display: flex; align-items: center; justify-content: center;
  position: relative; min-width: 0;
}
.hero-title {
  margin: 0;
  font-size: clamp(40px, 7.5vw, 125px); /* Größe der Start-Animation */
  line-height: .95;
  letter-spacing: -0.055em;
  font-weight: 600;
  white-space: nowrap;
  display: flex; align-items: baseline;
  user-select: none;
  cursor: default;
}
.hero-word { display: inline-flex; align-items: baseline; }
.hero-word .ch {
  display: inline-block;
  will-change: transform, opacity, filter;
  transition: font-weight .25s linear;
}
.hero-word .sp { width: .26em; }
.hero-word .ch.is-serif {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  letter-spacing: -0.02em;
}
.hero-word .ch.is-light { font-weight: 250; }
.hero-dot {
  display: inline-block;
  color: var(--accent);
  will-change: transform;
}
/* Titel + Claim als Einheit. ✦ HIER ANPASSEN: --claim-gap = Abstand Claim ↔ „Portfolio“ */
.hero-lockup { position: relative; --claim-gap: 26px; }
.hero-sub {
  /* hängt direkt unter dem Titel, ohne ihn aus der Mitte zu schieben */
  position: absolute; left: 50%; top: 100%;
  transform: translateX(-50%);
  margin: var(--claim-gap) 0 0;
  width: max-content; max-width: calc(100vw - 2 * var(--gutter));
  font-size: 15px; color: var(--muted); text-align: center;
  /* Einblenden mit „Easy Ease“ (wie in After Effects): Dauer hier anpassen */
  opacity: 0; transition: opacity 1.6s cubic-bezier(.33, 0, .67, 1);
}
.hero.is-done .hero-sub { opacity: 1; }
/* auch im Bearbeiten-Modus weich einblenden (sonst überschreibt die Edit-Umrandung die Überblendung) */
body.is-edit .hero .hero-sub { transition: opacity 1.6s cubic-bezier(.33, 0, .67, 1), outline-color .2s; }

/* Hinweis „Scroll“ unten in der Mitte – blendet nach dem Claim ein (✦ Verzögerung: transition-delay) */
.hero-scroll {
  position: absolute; left: 50%; bottom: 0;
  transform: translate(-50%, 8px);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  pointer-events: none;
  opacity: 0; transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.hero-scroll-line {
  width: 1px; height: 40px; background: linear-gradient(var(--ink), transparent);
  transform-origin: top; animation: hint 2.4s var(--ease) infinite;
}
.hero.is-done .hero-scroll { opacity: 1; transform: translate(-50%, 0); transition-delay: 1.4s; }
.hero.mx-gone .hero-scroll, .hero.mx-busy .hero-scroll { opacity: 0 !important; transition: opacity .2s !important; }
body.is-edit .hero-scroll { display: none; }

.hero-bottom {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 24px;
  font-size: 14px;
}
.hero-bottom .meta { color: var(--muted); max-width: 320px; }
.hero-links { display: flex; gap: 10px; justify-content: flex-end; }
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--ink);
  font-size: 15px;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.pill .arr { display: inline-block; transition: transform .35s var(--ease); }
.pill:hover { background: var(--ink); color: var(--bg); }
.pill:hover .arr { transform: translateX(4px) rotate(-45deg) scale(1.4); } /* wie beim großen CTA auf About */
.pill.solid { background: var(--ink); color: var(--bg); }
.pill.solid:hover { background: var(--accent); border-color: var(--accent); }
.scroll-hint { display: flex; justify-content: center; }
.scroll-hint span {
  width: 1px; height: 46px; background: linear-gradient(var(--ink), transparent);
  animation: hint 2.4s var(--ease) infinite;
  transform-origin: top;
}
@keyframes hint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* GIF slots positioned on home */
.gif-slot.home-slot-a { position: absolute; left: 0; top: 4%; }
.gif-slot.home-slot-b { position: absolute; right: 0; bottom: 4%; }

/* =========================================================
   ABOUT
   ========================================================= */
.about {
  padding: 120px 0 80px;
}
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 110px);
  align-items: center;
}
.photo-stage {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 82vh;
  width: 100%;
  border-radius: 28px;
  background: var(--bg-2);
  overflow: hidden;
  isolation: isolate;
}
.photo-stage .layer { position: absolute; inset: 0; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(40px); opacity: .75;
  animation: blob 16s ease-in-out infinite alternate;
}
.blob.b1 { width: 55%; height: 55%; left: 8%; top: 18%; background: var(--accent-soft); }
.blob.b2 { width: 45%; height: 45%; right: 4%; top: 6%; background: #d9e2ff; animation-duration: 19s; animation-delay: -4s; }
.blob.b3 { width: 40%; height: 40%; left: 30%; bottom: 2%; background: #fff3c9; animation-duration: 22s; animation-delay: -8s; }
@keyframes blob {
  0% { transform: translate(0, 0) scale(1); border-radius: 50% 45% 55% 50%; }
  50% { transform: translate(8%, -6%) scale(1.12); border-radius: 40% 60% 45% 55%; }
  100% { transform: translate(-6%, 8%) scale(.92); border-radius: 55% 45% 60% 40%; }
}
.grid-lines {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 45%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 20%, transparent 70%);
  opacity: .7;
  animation: gridmove 30s linear infinite;
}
@keyframes gridmove { to { background-position: 48px 48px, 48px 48px; } }
.ring {
  position: absolute; left: 50%; top: 42%;
  width: 78%; aspect-ratio: 1; transform: translate(-50%, -50%);
}
.ring svg { width: 100%; height: 100%; animation: spin 40s linear infinite; }
.ring text { font: 600 8.4px var(--sans); letter-spacing: .38em; text-transform: uppercase; fill: var(--ink); opacity: .55; }
@keyframes spin { to { transform: rotate(360deg); } }
.orbit {
  position: absolute; left: 38%; top: 42%; width: 62%; aspect-ratio: 1; /* left = Position links/rechts */
  translate: -50% -50%; /* als eigene Eigenschaft, damit die Drehung um die Mitte läuft */
  border: 1px dashed rgba(18,18,18,.18); border-radius: 50%;
  /* eigene Dreh-Animation über „rotate“ – „spin“ würde die Zentrierung (translate) überschreiben */
  animation: orbit-spin 24s linear infinite reverse;
}
@keyframes orbit-spin { from { rotate: 0deg; } to { rotate: 360deg; } }
.orbit i {
  position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--accent);
  top: -6px; left: calc(50% - 6px);
}
.orbit i:nth-child(2) { top: auto; bottom: 14%; left: 2%; width: 8px; height: 8px; background: var(--ink); }
.spark {
  position: absolute; font-size: 22px; color: var(--accent);
  animation: float 6s ease-in-out infinite;
}
.spark.s1 { left: 12%; top: 14%; }
.spark.s2 { right: 14%; top: 54%; animation-delay: -2s; font-size: 16px; color: var(--ink); }
.spark.s3 { left: 18%; bottom: 22%; animation-delay: -4s; font-size: 14px; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-14px) rotate(25deg); } }

.photo-parallax { position: absolute; inset: 0; transition: transform .6s var(--ease); }
.photo-cutout {
  position: absolute; left: 50%; bottom: 0;
  height: 92%; width: auto; max-width: 100%;
  transform: translateX(-50%);
  object-fit: contain; object-position: bottom;
  z-index: 2;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,.18));
}
.photo-cutout.soft-edge {
  -webkit-mask-image: linear-gradient(to top, transparent 0, #000 14%);
  mask-image: linear-gradient(to top, transparent 0, #000 14%);
}
.photo-placeholder {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  height: 86%; z-index: 2; color: rgba(18,18,18,.82);
}
.about-copy h1 {
  font-size: clamp(48px, 6.4vw, 104px);
  line-height: .95; letter-spacing: -0.045em; font-weight: 600;
  margin: 18px 0 30px;
}
.about-copy h1 .serif { font-weight: 400; }
.bio { font-size: 19px; line-height: 1.6; color: var(--ink-2); max-width: 560px; }
.bio p { margin: 0 0 1em; }
.facts {
  margin-top: 36px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0;
  border-top: 1px solid var(--line);
}
.facts > div { padding: 16px 16px 0 0; }
.facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.facts dd { margin: 6px 0 0; font-size: 15px; }
.slot-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin-top: 36px; }

/* =========================================================
   PORTFOLIO
   ========================================================= */
.works { padding: 130px 0 60px; }
.works-head {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 30px;
  padding-bottom: 36px; border-bottom: 1px solid var(--line); margin-bottom: 70px;
}
.works-head h1 {
  font-size: clamp(56px, 9vw, 150px); line-height: .9; letter-spacing: -0.05em;
  font-weight: 600; margin: 16px 0 0;
}
.wh-ch { display: inline-block; transition: font-weight .25s linear; } /* js/weight-hover.js */
.works-head h1 sup { font-size: .22em; letter-spacing: 0; font-weight: 500; color: var(--accent); vertical-align: top; position: relative; top: .5em; margin-left: .2em; }
.works-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 18px; }

.project { margin-bottom: 110px; }
.project-head {
  display: grid; grid-template-columns: 90px 1fr auto; gap: 20px; align-items: baseline;
  margin-bottom: 22px;
}
.project-num { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.project-title { font-size: clamp(28px, 3vw, 44px); letter-spacing: -0.03em; font-weight: 600; margin: 0; line-height: 1.1; }
.project-meta { font-size: 14px; color: var(--muted); }
.project-body {
  display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 20px;
}
.project-text {
  margin-top: 22px;
  max-width: 720px;
  font-size: 17px; color: var(--ink-2);
}
.project-text:empty::before { content: attr(data-placeholder); color: var(--muted); }

/* Slider */
.slider { position: relative; }
.track {
  display: flex; gap: 16px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--radius);
  cursor: grab;
}
.track::-webkit-scrollbar { display: none; }
.track.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.track.is-dragging * { pointer-events: none; }
.slide {
  position: relative;
  flex: 0 0 auto;
  scroll-snap-align: start;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
}
.slider.landscape .slide { width: 100%; aspect-ratio: 16 / 9; }
.slider.portrait .slide { width: calc((100% - 32px) / 3); aspect-ratio: 4 / 5; }
.slide img, .slide video { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.slide.is-empty {
  display: grid; place-items: center; text-align: center;
  border: 1.5px dashed rgba(18,18,18,.22); background: transparent;
  color: var(--muted); font-size: 14px; padding: 20px;
}
.slide.is-empty strong { display: block; color: var(--ink); font-weight: 500; font-size: 16px; margin-bottom: 4px; }
.slider-ui {
  display: flex; align-items: center; gap: 18px; margin-top: 16px;
}
.slider-count { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 60px; }
.slider-progress { flex: 1; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.slider-progress i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); width: 0; transition: width .4s var(--ease), left .4s var(--ease); }
.slider-arrows { display: flex; gap: 8px; }
.arrow {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent;
  display: grid; place-items: center;
  transition: background .25s, color .25s, border-color .25s, opacity .25s;
}
.arrow:hover:not(:disabled) { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.arrow:disabled { opacity: .3; cursor: default; }
.sound-btn {
  position: absolute; right: 14px; bottom: 14px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: rgba(18,18,18,.6); color: #fff; backdrop-filter: blur(6px);
  display: grid; place-items: center; font-size: 15px;
}
.empty-works { text-align: center; padding: 120px 0; color: var(--muted); font-size: 18px; }
.empty-works .serif { font-size: 48px; color: var(--ink); display: block; }

/* =========================================================
   GIF SLOTS
   ========================================================= */
.gif-slot { --w: 200px; width: var(--w); position: relative; z-index: 5; transition: width .4s var(--ease); }
.gif-slot[data-size="s"] { --w: 120px; }
.gif-slot[data-size="m"] { --w: 200px; }
.gif-slot[data-size="l"] { --w: 320px; }
.gif-slot[data-size="xl"] { --w: 460px; }
.gif-slot.is-empty { display: none; }
.gif-slot .gif-media { border-radius: 12px; overflow: hidden; display: block; position: relative; }
.gif-slot .gif-media img, .gif-slot .gif-media video { width: 100%; height: auto; }
.gif-slot a.gif-media { transition: transform .35s var(--ease); }
.gif-slot a.gif-media:hover { transform: translateY(-3px) rotate(-1deg); }
.gif-slot a.gif-media::after {
  content: "↗"; position: absolute; right: 8px; top: 8px;
  width: 26px; height: 26px; border-radius: 50%; background: var(--bg); color: var(--ink);
  display: grid; place-items: center; font-size: 13px;
  opacity: 0; transform: scale(.7); transition: .3s var(--ease);
}
.gif-slot a.gif-media:hover::after { opacity: 1; transform: none; }

/* =========================================================
   EDIT MODE
   ========================================================= */
.edit-only { display: none !important; }
body.is-edit .edit-only { display: revert !important; }
body.is-edit .edit-only.flex { display: flex !important; }

body.is-edit .gif-slot.is-empty { display: block; }
body.is-edit .gif-slot .gif-ph {
  aspect-ratio: 4 / 3; border-radius: 12px;
  border: 1.5px dashed var(--edit); background: rgba(43,107,255,.05);
  display: grid; place-items: center; text-align: center; color: var(--edit);
  font-size: 12px; line-height: 1.35; padding: 8px; cursor: pointer;
  transition: background .2s;
}
body.is-edit .gif-slot .gif-ph:hover { background: rgba(43,107,255,.12); }
.gif-ph b { display: block; font-size: 13px; }
.gif-tools {
  display: none;
  position: absolute; left: 50%; top: -14px; transform: translate(-50%, -100%);
  background: var(--ink); color: #fff; border-radius: 10px; padding: 4px;
  gap: 2px; white-space: nowrap; z-index: 20; font-size: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
body.is-edit .gif-slot:hover .gif-tools, body.is-edit .gif-slot:focus-within .gif-tools { display: flex; }
.gif-tools::after { content: ""; position: absolute; left: 0; right: 0; bottom: -16px; height: 16px; }
.gif-tools button {
  border: 0; background: transparent; color: #fff; padding: 6px 8px; border-radius: 7px; font-size: 12px;
}
.gif-tools button:hover { background: rgba(255,255,255,.14); }
.gif-tools button.on { background: #fff; color: var(--ink); }
.gif-tools .sep { width: 1px; background: rgba(255,255,255,.2); margin: 4px 2px; }

body.is-edit [data-edit-key] {
  outline: 1.5px dashed rgba(43,107,255,.45); outline-offset: 6px; border-radius: 4px;
  cursor: text; transition: outline-color .2s;
}
body.is-edit [data-edit-key]:hover { outline-color: var(--edit); }
body.is-edit [data-edit-key]:focus { outline: 2px solid var(--edit); }
body.is-edit [data-edit-key]:empty::before { content: attr(data-placeholder); color: var(--muted); }

.edit-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 90;
  display: none; align-items: center; gap: 4px;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 6px;
  box-shadow: 0 16px 40px rgba(0,0,0,.25);
  font-size: 13px; white-space: nowrap;
}
body.is-edit .edit-bar { display: flex; }
.edit-bar .tag { padding: 0 12px 0 10px; display: inline-flex; align-items: center; gap: 8px; }
.edit-bar .tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3dd68c; box-shadow: 0 0 0 4px rgba(61,214,140,.2); }
.edit-bar button, .edit-bar label {
  border: 0; background: rgba(255,255,255,.1); color: #fff;
  padding: 8px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.edit-bar button:hover, .edit-bar label:hover { background: rgba(255,255,255,.2); }
.edit-bar .primary { background: #fff; color: var(--ink); }
.edit-bar .primary:hover { background: #fff; opacity: .9; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--edit); color: var(--edit); background: rgba(43,107,255,.06);
  padding: 9px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 500;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--edit); color: #fff; }
.btn.ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn.ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.danger { border-color: rgba(220,40,40,.4); color: #c62828; background: transparent; }
.btn.danger:hover { background: #c62828; color: #fff; }
.edit-row { gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.slide-tools {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  display: flex; gap: 4px;
}
.slide-tools button {
  width: 32px; height: 32px; border-radius: 8px; border: 0;
  background: rgba(18,18,18,.72); color: #fff; font-size: 14px; backdrop-filter: blur(6px);
}
.slide-tools button:hover { background: var(--ink); }
.slide-tools button.del:hover { background: #c62828; }
.slide-badge {
  position: absolute; left: 10px; top: 10px; z-index: 3;
  font-size: 11px; background: rgba(255,255,255,.85); padding: 3px 8px; border-radius: 6px;
}

/* =========================================================
   UPLOAD MODAL
   ========================================================= */
.up-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(18,18,18,.45); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 16px;
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; } }
.up-modal {
  width: min(760px, 100%); max-height: calc(100vh - 32px);
  background: #fbfaf7; border-radius: 22px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 40px 100px rgba(0,0,0,.3);
  animation: pop .35s var(--ease);
}
@keyframes pop { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.up-head { padding: 22px 26px 6px; display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.up-head h3 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.up-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.up-x { border: 0; background: transparent; font-size: 22px; line-height: 1; padding: 4px 8px; border-radius: 8px; }
.up-x:hover { background: var(--bg-2); }
.up-body { padding: 14px 26px; overflow-y: auto; }
.dropzone {
  border: 1.5px dashed rgba(18,18,18,.25); border-radius: 16px;
  padding: 34px 20px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--edit); background: rgba(43,107,255,.05); }
.dropzone.is-over { transform: scale(1.01); }
.dropzone .big { font-size: 17px; font-weight: 500; }
.dropzone .small { font-size: 13px; color: var(--muted); margin-top: 4px; }
.dropzone .ico { font-size: 28px; margin-bottom: 6px; }
.up-opts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 4px; font-size: 13.5px; color: var(--ink-2); }
.up-opts label { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.up-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.up-item {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  padding: 8px; border-radius: 12px; background: #fff; border: 1px solid var(--line);
}
.up-item.dragging { opacity: .4; }
.up-thumb { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--bg-2); position: relative; }
.up-thumb img, .up-thumb video { width: 100%; height: 100%; object-fit: cover; }
.up-info { min-width: 0; font-size: 13px; }
.up-info .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-info .meta { color: var(--muted); margin-top: 2px; }
.up-info .meta b { color: #12965a; font-weight: 500; }
.up-info .warn { color: #b8620a; margin-top: 2px; }
.chip { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--bg-2); margin-right: 4px; color: var(--ink-2); }
.chip.gif { background: #ffe8b3; } .chip.video { background: #dfe8ff; } .chip.img { background: #e3f3e9; }
.up-actions { display: flex; gap: 2px; }
.up-actions button { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 7px; color: var(--muted); }
.up-actions button:hover { background: var(--bg-2); color: var(--ink); }
.up-foot {
  padding: 16px 26px 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border-top: 1px solid var(--line); flex-wrap: wrap;
}
.up-foot .hint { font-size: 12.5px; color: var(--muted); }
.up-foot .btns { display: flex; gap: 8px; margin-left: auto; }
.btn-dark {
  border: 0; background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 12px; font-size: 14px; font-weight: 500;
}
.btn-dark:disabled { opacity: .35; cursor: default; }
.btn-light { border: 1px solid var(--line); background: transparent; padding: 11px 18px; border-radius: 12px; font-size: 14px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; position: absolute; inset: 0; margin: auto; }

.toast-host { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.2); max-width: min(560px, calc(100vw - 32px));
  animation: pop .3s var(--ease);
}
.toast.warn { background: #8a4b00; }

/* =========================================================
   RESPONSIVE (desktop first)
   ========================================================= */
@media (max-width: 1100px) {
  .about-grid { grid-template-columns: 1fr 1fr; gap: 48px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .project-head, .project-body { grid-template-columns: 60px 1fr auto; }
  .project-body { grid-template-columns: 60px minmax(0,1fr); }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .site-header { padding: 14px var(--gutter); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
  .burger { display: block; z-index: 2; }
  .nav {
    position: fixed; inset: 0; z-index: 1;
    background: var(--bg);
    flex-direction: column; justify-content: center; gap: 4px; padding: 0 var(--gutter);
    opacity: 0; pointer-events: none; transition: opacity .35s var(--ease);
  }
  .nav a { font-size: 44px; letter-spacing: -0.03em; font-weight: 600; padding: 6px 0; background: none !important; color: var(--ink) !important; border-radius: 0; transform: translateY(12px); transition: transform .5s var(--ease); }
  .nav a[aria-current="page"]::after { content: "."; color: var(--accent); }
  .nav-num { font-size: 13px; }
  body.nav-open .nav { opacity: 1; pointer-events: auto; }
  body.nav-open .nav a { transform: none; }
  body.nav-open { overflow: hidden; }

  .hero { padding: 90px var(--gutter) 24px; }
  .hero-title { font-size: clamp(30px, 9vw, 72px); }
  .hero-bottom { grid-template-columns: 1fr; text-align: left; gap: 18px; }
  .scroll-hint { display: none; }
  .hero-links { justify-content: flex-start; flex-wrap: wrap; }
  .hero-lockup { --claim-gap: 16px; }
  .gif-slot.home-slot-a, .gif-slot.home-slot-b { position: relative; left: auto; right: auto; top: auto; bottom: auto; }
  .hero-stage { flex-direction: column; gap: 28px; }
  .home-slots { order: 2; }
  .home-slots { display: flex; gap: 12px; flex-wrap: wrap; }
  .gif-slot[data-size="l"], .gif-slot[data-size="xl"] { --w: 100%; max-width: 100%; }

  .about { padding: 90px 0 50px; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .photo-stage { max-height: none; border-radius: 20px; }
  .bio { font-size: 17px; }
  .facts { grid-template-columns: 1fr 1fr; }

  .works { padding: 96px 0 40px; }
  .works-head { grid-template-columns: 1fr; margin-bottom: 44px; }
  .works-head-side { align-items: flex-start; }
  .project { margin-bottom: 72px; }
  .project-head { grid-template-columns: 1fr; gap: 4px; }
  .project-body { grid-template-columns: 1fr; gap: 0; }
  .project-num { order: -1; }
  .slider.landscape .slide { width: 100%; }
  .slider.portrait .slide { width: 78%; }
  .slider-arrows { display: none; }
  .track { gap: 10px; }

  .edit-bar { left: 12px; right: 12px; transform: none; overflow-x: auto; border-radius: 16px; }
  .gif-tools { left: 0; transform: translateY(-100%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}

/* =========================================================
   SERVER-FENSTER (Dropbox / Netlify)
   ========================================================= */
.edit-bar .publish { background: var(--accent); color: #fff; position: relative; }
.edit-bar .publish:hover { background: var(--accent); filter: brightness(1.08); }
.edit-bar .publish.has-changes::after {
  content: ""; position: absolute; top: 2px; right: 2px; width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
}
.edit-bar [hidden] { display: none !important; }

.cl-modal.is-busy .up-body { pointer-events: none; opacity: .6; transition: opacity .2s; }
.cl-live { font-variant-numeric: tabular-nums; }
.cl-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.cl-mode {
  text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 14px 16px;
  display: grid; gap: 4px; transition: border-color .2s, box-shadow .2s;
}
.cl-mode b { font-size: 15px; }
.cl-mode span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.cl-mode:hover { border-color: rgba(18,18,18,.3); }
.cl-mode.on { border-color: var(--edit); box-shadow: 0 0 0 3px rgba(43,107,255,.15); }
.cl-steps { margin: 0; padding-left: 22px; display: grid; gap: 12px; font-size: 14.5px; line-height: 1.5; }
.cl-steps li::marker { color: var(--muted); font-weight: 600; }
.cl-steps a { color: var(--edit); text-decoration: underline; text-underline-offset: 2px; }
.cl-steps code, .cl-note code { font-size: 12.5px; background: var(--bg-2); padding: 1px 6px; border-radius: 5px; }
.cl-code {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 6px 12px; min-width: 0;
}
.cl-code code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; background: none !important; padding: 0 !important; }
.cl-code .cl-k { font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--edit); white-space: nowrap; }
.cl-copy { border: 0; background: var(--bg-2); border-radius: 7px; padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.cl-copy:hover { background: var(--ink); color: #fff; }
.cl-input {
  display: block; width: 100%; margin-top: 8px; padding: 11px 14px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: 14px;
}
.cl-input:focus { outline: none; border-color: var(--edit); box-shadow: 0 0 0 3px rgba(43,107,255,.15); }
.cl-inline { display: flex; gap: 8px; align-items: center; }
.cl-inline .cl-input { margin: 0; }
.cl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cl-fine { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; display: block; }
.cl-status { display: grid; gap: 14px; }
.cl-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center; }
.cl-row b { font-size: 15px; }
.cl-sub { font-size: 13px; color: var(--muted); }
.cl-dot { width: 10px; height: 10px; border-radius: 50%; background: #c9c5bd; }
.cl-dot.ok { background: #2fbf71; box-shadow: 0 0 0 4px rgba(47,191,113,.18); }
.cl-dot.warn { background: #f0a020; box-shadow: 0 0 0 4px rgba(240,160,32,.18); }
.cl-note { margin-top: 6px; padding: 14px 16px; border-radius: 12px; background: #fff6e0; font-size: 14px; line-height: 1.5; }
details.cl-note { background: #eef3ff; }
details.cl-note summary { cursor: pointer; margin-bottom: 4px; }
details.cl-note[open] summary { margin-bottom: 12px; }
.cl-switch { margin: 18px 0 0; font-size: 13px; color: var(--muted); }
.cl-switch a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 760px) {
  .cl-modes { grid-template-columns: 1fr; }
  .cl-row { grid-template-columns: 14px 1fr; }
  .cl-row > button { grid-column: 2; justify-self: start; }
  .cl-inline { flex-direction: column; align-items: stretch; }
}
