/* ==========================================================================
   Leander Klein – Portfolio
   Hell, zentriert, ein Akzent: kräftiges Orange.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --text: #141414;
  --muted: #6c6c70;
  --line: #e8e8ea;
  --surface: rgba(255, 255, 255, 0.82);
  --soft: #f5f5f6;
  --accent: #ff5a00;
  --accent-ink: #ffffff;
  --dot: #d4d6da;            /* Farbe der Punkte im Hintergrund */

  --font: "Rubik", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --radius: 22px;
  --radius-sm: 12px;
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; line-height: 1.08; }
p { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

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

/* Punkte-Welle --------------------------------------------------------- */
.dots {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

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

/* Schlüsselwörter: orange unterstrichen, Linie zeichnet sich beim Einblenden */
.kw {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 92%;
  background-size: 0% 0.11em;
  padding-bottom: 0.04em;
  transition: background-size 0.9s var(--ease) 0.25s;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.is-visible .kw,
.kw.is-visible { background-size: 100% 0.11em; }
/* große Überschriften: handgezeichneter Pinselstrich statt gerader Linie */
.kw--draw,
.is-visible .kw--draw {
  position: relative;
  isolation: isolate;
  background: none;
  white-space: nowrap;
}
.draw {
  position: absolute;
  left: -3%;
  bottom: -0.1em;
  z-index: -1;
  width: 106%;
  height: 0.4em;
  overflow: visible;
  pointer-events: none;
}
.draw__brush { fill: var(--accent); }
.draw__reveal {
  fill: none;
  stroke: #fff;
  stroke-width: 26;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.85s cubic-bezier(0.65, 0, 0.35, 1) 0.35s;
}
.is-visible .draw__reveal { stroke-dashoffset: 0; }

/* Header ----------------------------------------------------------------- */
.header {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--gutter);
  pointer-events: none;
}
.header > * { pointer-events: auto; }
/* weicher Verlauf, damit Inhalte unter dem Header nicht hart anstoßen */
.header::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 96px;
  background: linear-gradient(#fff 35%, rgba(255, 255, 255, 0));
  z-index: -1;
}

.header__name {
  justify-self: start;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.header__status {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s;
}
.header__status:hover { color: var(--text); }

.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.2s var(--ease) infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(3); opacity: 0; }
}

.nav {
  display: flex;
  gap: 6px;
}
.nav a {
  padding: 8px 14px;
  font-size: 15px;
  color: var(--muted);
  transition: color 0.2s;
}
.nav a:hover,
.nav a.is-active { color: var(--text); }
/* Hover und aktiver Abschnitt: kleiner Pinselstrich wie im Hero */
.nav .draw { bottom: -0.5em; height: 0.6em; }
.nav .draw__reveal { transition: stroke-dashoffset 0.45s cubic-bezier(0.65, 0, 0.35, 1); }
.nav a:hover .draw__reveal,
.nav a:focus-visible .draw__reveal,
.nav a.is-active .draw__reveal { stroke-dashoffset: 0; }

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 28px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 16px;
  transition: transform 0.35s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: #ff6c1a; }
.btn--ghost { border: 1px solid var(--line); background: var(--surface); }
.btn--ghost:hover { border-color: var(--text); }

/* direkt nach dem Hero weniger Abstand */
#about { padding-top: clamp(48px, 6vw, 80px); }

/* Abschnitte ------------------------------------------------------------- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(96px, 14vw, 160px) var(--gutter) 0;
}

.section__head {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.section__title { font-size: clamp(36px, 5.4vw, 60px); }

.section__lead {
  max-width: 620px;
  margin: 22px auto 0;
  font-size: clamp(17px, 1.6vw, 19px);
  font-weight: 300;
  color: var(--muted);
  text-align: center;
}
.section__lead .kw { color: var(--text); font-weight: 400; }

/* Hero ------------------------------------------------------------------- */
/* Foto links, Text rechts daneben und rechtsbündig */
.hero {
  position: relative;
  min-height: 72svh; /* etwas kürzer als der Bildschirm, damit About schon hervorschaut */
  display: grid;
  grid-template-columns: auto minmax(0, 760px);
  justify-content: center;
  align-items: center;
  gap: clamp(40px, 6vw, 88px);
  max-width: var(--max);
  margin: 0 auto;
  padding: 120px var(--gutter) 40px;
}

.avatar {
  width: clamp(220px, 24vw, 320px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid #fff;
  box-shadow: 0 0 0 2px var(--accent), 0 30px 60px -24px rgba(20, 20, 20, 0.35);
}

.hero__text { text-align: right; }

.hero__title {
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.hero__lead {
  max-width: 560px;
  margin: 28px 0 0 auto;
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 300;
  color: var(--muted);
}
.hero__lead .kw { color: var(--text); font-weight: 400; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 40px;
}

/* schmale Bildschirme: Foto über dem Text, alles mittig */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 32px;
  }
  .avatar { width: clamp(150px, 42vw, 200px); }
  .hero__text { text-align: center; }
  .hero__lead { margin: 24px auto 0; }
  .hero__actions { justify-content: center; }
}

/* Skills ----------------------------------------------------------------- */
.skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 72px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}

.skill {
  padding: 34px 30px 36px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  text-align: center;
  transition: background-color 0.3s;
}
.skill:hover { background: #fff; }
.skill__no {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.skill h3 { font-size: 21px; }
.skill p {
  max-width: 260px;
  margin: 10px auto 0;
  font-size: 15px;
  font-weight: 300;
  color: var(--muted);
}

/* Werkzeuge -------------------------------------------------------------- */
.tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}
.tools__col {
  padding: 28px 24px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  text-align: center;
}
.tools__title {
  margin-bottom: 18px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}
.tools__note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--soft);
  font-size: 14px;
}
.chips .chip--accent { background: var(--accent); color: var(--accent-ink); }

/* Filter ----------------------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 44px 0 36px;
}
.filter {
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.filter:hover { color: var(--text); border-color: #cfcfd3; }
.filter.is-active { background: var(--text); border-color: var(--text); color: #fff; }

/* Case-Karten ------------------------------------------------------------ */
.cases {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.case {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), opacity 0.4s;
}
.case:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 60px -32px rgba(20, 20, 20, 0.28);
}
.case.is-hidden { display: none; }

.case__media {
  position: relative;
  aspect-ratio: 16 / 10;
  margin: 10px 10px 0;
  border-radius: 14px;
  background: var(--soft);
  overflow: hidden;
}
.case__media img,
.case__media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease), opacity 0.4s;
}
.case:hover .case__media img { transform: scale(1.03); }
.case__media video { opacity: 0; }
.case.is-playing .case__media video { opacity: 1; }

.case__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 500;
}
.case__badge--accent { background: var(--accent); color: var(--accent-ink); }
.case__play {
  width: 0;
  height: 0;
  border-left: 7px solid currentColor;
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
}

.case__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 24px 24px;
}
.case__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.case__title {
  margin-top: 8px;
  font-size: 25px;
}
.case__teaser {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 300;
  color: var(--muted);
}
.case__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
  font-size: 15px;
  font-weight: 500;
}
.case__more::after {
  content: "→";
  color: var(--accent);
  transition: transform 0.35s var(--ease);
}
.case:hover .case__more::after { transform: translateX(4px); }

/* Platzhalter für kommende Beispiele */
.case--soon { cursor: default; }
.case--soon:hover { transform: none; box-shadow: none; }
.case--soon .case__media {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, #d9dadd 1.3px, transparent 1.6px) 0 0 / 16px 16px,
    var(--soft);
}
.case__soon-label {
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
}
.case--soon .case__more { color: var(--muted); }
.case--soon .case__more::after { content: none; }

/* Kontakt ---------------------------------------------------------------- */
.contact {
  text-align: center;
  padding-bottom: clamp(96px, 12vw, 140px);
}
.contact__title { font-size: clamp(44px, 8vw, 96px); letter-spacing: -0.035em; line-height: 1; }
.contact__mail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 40px;
}
.mail {
  font-size: clamp(22px, 3.4vw, 36px);
  font-weight: 500;
  letter-spacing: -0.02em;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 2px;
  padding-bottom: 4px;
  transition: color 0.2s;
}
.mail:hover { color: var(--accent); }
.copy {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.copy:hover { color: var(--text); border-color: #cfcfd3; }
.copy.is-done { color: var(--accent); border-color: var(--accent); }

/* Footer ----------------------------------------------------------------- */
.footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--gutter) 36px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.footer > :last-child { justify-self: end; }
.footer__links { display: flex; gap: 22px; }
.footer a:hover { color: var(--text); }

/* Case-Detail (Dialog) --------------------------------------------------- */
.modal {
  width: min(980px, calc(100% - 24px));
  max-height: calc(100% - 48px);
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 40px 120px -30px rgba(20, 20, 20, 0.4);
  overflow: auto;
  overscroll-behavior: contain;
}
.modal::backdrop {
  background: rgba(250, 250, 250, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.modal[open] { animation: modal-in 0.5s var(--ease); }
.modal[open]::backdrop { animation: fade-in 0.4s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
@keyframes fade-in { from { opacity: 0; } }

.modal__close {
  position: sticky;
  top: 16px;
  float: right;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 16px 16px -58px 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.3s var(--ease);
}
.modal__close:hover { border-color: var(--text); transform: rotate(90deg); }
.modal__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.modal__body { padding: clamp(28px, 5vw, 56px); }

.detail__head { max-width: 680px; margin: 0 auto; text-align: center; }
.detail__title { font-size: clamp(32px, 5vw, 52px); }
.detail__lead { margin-top: 16px; font-size: 18px; font-weight: 300; color: var(--muted); }

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 36px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--line);
  overflow: hidden;
}
.facts div { padding: 16px 18px; background: #fff; text-align: center; }
.facts dt { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-size: 15px; }

.detail__video {
  width: 100%;
  border-radius: 16px;
  background: #000;
}

.detail__text {
  max-width: 680px;
  margin: 40px auto 0;
  font-size: 17px;
  font-weight: 300;
}
.detail__text p + p { margin-top: 14px; }
.detail__text strong { font-weight: 500; }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 40px;
}
.gallery figure { margin: 0; }
.gallery figure:only-child,
.gallery figure.is-wide { grid-column: 1 / -1; }
.gallery img { width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.gallery figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); text-align: center; }

/* Versionsverlauf (ichbinchrist.de) */
.versions {
  position: relative;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}
.versions::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 1px;
  background: var(--line);
}
.version {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 22px 0;
}
.version::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
}
.version:nth-child(even) .version__text { order: 2; }
.version__text { text-align: right; }
.version:nth-child(even) .version__text { text-align: left; }
.version__tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--soft);
  font-size: 12px;
  font-weight: 500;
}
.version__tag--accent { background: var(--accent); color: var(--accent-ink); }
.version h4 { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.version p { margin-top: 6px; font-size: 15px; font-weight: 300; color: var(--muted); }
.version img { width: 100%; border-radius: 12px; border: 1px solid var(--line); }

/* Einblenden beim Scrollen ----------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 900px) {
  .skills { grid-template-columns: repeat(2, 1fr); }
  .tools { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .header { grid-template-columns: 1fr; justify-items: center; }
  .header__name,
  .header__status { display: none; }
  .nav a { padding: 8px 16px; }
  .cases { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .footer { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer > :last-child { justify-self: center; }

  .versions::before { left: 5px; }
  .version { grid-template-columns: 1fr; gap: 14px; padding-left: 28px; }
  .version::before { top: 30px; left: 5px; }
  .version__text,
  .version:nth-child(even) .version__text { order: 0; text-align: left; }
}

@media (max-width: 520px) {
  .skills { grid-template-columns: 1fr; }
  .case__title { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .kw { background-size: 100% 0.11em; }
  main .draw__reveal { stroke-dashoffset: 0; }
}
