/* =========================================================================
   JASCHU – Jan Schulz, Art & Creative Director
   Ein Stylesheet für alle Seiten. Referenz: Figma „WEBSITE PORTFOLIO 7“
   (Desktop 1920 px, Mobile – Optimized 390 px). Werte skalieren fließend
   zwischen 390 und 1920 px.
   ========================================================================= */

/* ---------- Schrift (lokal, General Sans, Fontshare Free License) ---------- */
@font-face { font-family: "General Sans"; src: url("../fonts/GeneralSans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("../fonts/GeneralSans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("../fonts/GeneralSans-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("../fonts/GeneralSans-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ---------- Design-Tokens ---------- */
:root {
  /* Farben – Light (Figma) */
  --bg: #ffffff;
  --fg: #000000;
  --surface: #f8f8f8;          /* Footer-Fläche */
  --button-bg: #f7f7f7;        /* Outline-Button-Fläche */
  --band-bg: #000000;          /* Kennzahlen-Band (Mobile) */
  --band-fg: #ffffff;
  --line: rgba(0, 51, 255, 0.2); /* Tabellenlinien */
  --focus: currentColor;

  /* Raster */
  --pad: 24px;                 /* Seitenrand Mobile */
  --maxw: 1600px;

  /* Typografie (390 px → 1920 px) */
  --fs-title: clamp(44px, 29.7px + 3.66vw, 100px);
  --fs-h2: clamp(32px, 27.9px + 1.046vw, 48px);
  --fs-h3: clamp(22px, 19.45px + 0.654vw, 32px);
  --fs-kpi: clamp(40px, 2.9vw, 56px);
  --fs-kpi-label: clamp(17px, 16.24px + 0.196vw, 20px);
  --fs-contact-links: clamp(20px, 16.9px + 0.784vw, 32px);
  --fs-body: 16px;
  --fs-nav: 18px;
  --fs-button: 18px;

  /* Abstände (8er-System Mobile → Desktop) */
  --space-section: clamp(72px, 49.7px + 5.72vw, 160px);
  --space-block: clamp(72px, 62px + 2.5vw, 97px);
  --gap-head-text: clamp(16px, 14.5px + 0.39vw, 22px);
  --gap-text-media: clamp(24px, 19.9px + 1.046vw, 40px);
  --gap-media: clamp(12px, 4.86px + 1.83vw, 40px);
  --gap-col: clamp(40px, 30px + 2.5vw, 80px);

  color-scheme: light;
}

@media (min-width: 768px) {
  :root { --pad: clamp(40px, 8.333vw, 160px); }
}
@media (min-width: 1921px) {
  :root { --pad: calc((100vw - var(--maxw)) / 2); }
}
@media (max-width: 360px) {
  :root { --fs-nav: 16px; }
}

/* Dark Mode – nur Benutzeroberfläche, Bilder und Videos bleiben unverändert */
html[data-theme="dark"] {
  --bg: #101010;
  --fg: #ffffff;
  --surface: #1b1b1b;
  --button-bg: #1b1b1b;
  --band-bg: #1b1b1b;
  --band-fg: #ffffff;
  --line: #404040;
  color-scheme: dark;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "General Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 700; text-wrap: balance; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--pad); top: -100px; background: var(--fg); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { top: 8px; }

.wrap { padding-inline: var(--pad); }
.prewrap { white-space: pre-line; }
.lang-de { hyphens: manual; -webkit-hyphens: manual; }

/* ---------- Navigation ---------- */
.nav {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0 48px;
  padding-top: clamp(24px, 13.3px + 2.75vw, 81px);
  font-size: var(--fs-nav); line-height: 1.3;
}
.nav__name { padding-block: 10px; margin-block: -10px; }
.nav__links { display: flex; align-items: center; gap: clamp(16px, 8px + 2.1vw, 48px); }
.nav__links a, .nav__name { display: inline-block; }
.nav__links a { padding-block: 10px; margin-block: -10px; }
.nav__links a:hover, .nav__name:hover, .footer a:hover, .contact a:hover { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.nav__links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

.theme-toggle {
  appearance: none; border: 0; background: none; color: inherit; cursor: pointer;
  width: 44px; height: 44px; margin: -10px -12px -10px 0; padding: 12px;
  display: inline-grid; place-items: center;
}
.theme-toggle svg { width: 20px; height: 20px; display: block; }
.theme-toggle [data-icon] { display: none; }
html[data-theme-choice="auto"] .theme-toggle [data-icon="auto"],
html[data-theme-choice="light"] .theme-toggle [data-icon="light"],
html[data-theme-choice="dark"] .theme-toggle [data-icon="dark"] { display: block; }

@media (max-width: 767px) {
  .nav { flex-direction: column; align-items: flex-start; gap: 16px; }
  .nav__links { gap: 16px; }
}

/* ---------- Schriftzug JASCHU (nur auf / ) ---------- */
.wordmark {
  margin: clamp(40px, 40px + 0vw, 40px) 0 0;
  font-weight: 700;
  font-size: calc((100vw - 2 * var(--pad)) / 4.26);
  line-height: 1.07;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

/* ---------- Seitentitel ---------- */
.title { padding-top: clamp(28px, 0px + 7.3vw, 138px); }
.title h1 { font-size: var(--fs-title); line-height: 1.07; letter-spacing: -0.02em; }
.title .role { margin-top: 8px; line-height: 1.5; }
.role b { font-weight: 500; }

/* ---------- Home: Intro ---------- */
.intro {
  display: grid; gap: 16px;
  padding-top: clamp(40px, 33px + 1.8vw, 68px);
  align-items: start;
}
.intro__lead { display: flex; flex-direction: column; gap: 16px; }
.intro__portrait { width: 80px; aspect-ratio: 80 / 88; object-fit: cover; }
.intro h1 { font-size: var(--fs-title); line-height: 1.07; letter-spacing: -0.02em; }
.intro p { line-height: 1.5; max-width: 510px; }
.intro b { font-weight: 700; }
@media (min-width: 1024px) {
  .intro { grid-template-columns: 68.125% 31.875%; gap: 0; }
  .intro__lead { flex-direction: row; align-items: center; gap: clamp(16px, 2vw, 33px); }
  .intro__portrait { width: 65px; aspect-ratio: 65 / 72; }
  .intro p { padding-top: 17px; }
}

/* ---------- Home: Projekte ---------- */
.projects { padding-top: var(--space-block); display: grid; gap: 72px; }
.project { display: grid; gap: 16px; }
.project__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface); }
.project__media img { width: 100%; height: 100%; object-fit: cover; }
.project__text { display: grid; gap: 24px; justify-items: start; }
.project__meta { display: grid; gap: 8px; }
.kicker { font-weight: 500; line-height: 1.5; letter-spacing: 0; }
.project h2 { font-size: var(--fs-h2); line-height: 1.12; letter-spacing: -0.01em; }
@media (min-width: 1024px) {
  .projects { gap: var(--space-section); padding-inline: max(var(--pad), (100% - 1393px) / 2); }
  .project { grid-template-columns: 68.2% 31.8%; gap: 0; align-items: start; }
  .project__media { aspect-ratio: 950 / 535; }
  .project__text { padding-left: 34px; padding-top: 30px; }
  .project:nth-child(even) .project__media { order: 2; }
  .project:nth-child(even) { grid-template-columns: 31.8% 68.2%; }
  .project:nth-child(even) .project__text { padding-left: 3px; padding-right: 34px; }
  .project h2 { font-size: 48px; line-height: 1.1; }
}

/* ---------- Outline-Button ---------- */
.button {
  display: inline-flex; align-items: center; gap: 16px;
  min-height: 48px; padding: 8px 16px 8px 19px;
  border: 3px solid currentColor; border-radius: 14px;
  background: var(--button-bg); color: var(--fg);
  font-size: var(--fs-button); font-weight: 600; line-height: 1.3; letter-spacing: 0;
}
.button svg { width: 8px; height: 14px; flex: none; }
.button:hover { background: var(--fg); color: var(--bg); }

/* ---------- Case: Aufbau ---------- */
.case { display: flex; flex-direction: column; }
.block { padding-top: var(--space-block); }
.block--intro { padding-top: clamp(40px, 30px + 2.5vw, 95px); }
.block--hero { padding-top: var(--space-section); }

.columns { display: grid; gap: 40px; }
.columns h2 { font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -0.01em; hyphens: manual; }
.columns p { margin-top: 8px; }
@media (min-width: 1024px) {
  .columns { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(40px, 4.2vw, 80px); }
  .columns p { margin-top: clamp(8px, 1.5vw, 29px); }
}

.chapter h2 { font-size: var(--fs-h2); line-height: 1.12; letter-spacing: -0.01em; max-width: 1300px; }
.chapter p { margin-top: var(--gap-head-text); max-width: 1055px; }
.chapter .media { margin-top: var(--gap-text-media); }

/* Medien */
.media { display: grid; gap: var(--gap-media); }
.media--pair { grid-template-columns: 1fr; }
@media (min-width: 768px) { .media--pair { grid-template-columns: 1fr 1fr; } }
.media img { width: 100%; }
.ratio-16x9 { aspect-ratio: 16 / 9; }
.ratio-1x1 { aspect-ratio: 1 / 1; }
.ratio-wide { aspect-ratio: 16 / 9; }
.ratio-teaser { aspect-ratio: 4 / 3; }
@media (min-width: 768px) {
  .ratio-wide { aspect-ratio: 1600 / 763; }
  .ratio-teaser { aspect-ratio: 1600 / 640; }
}
.cover { width: 100%; height: 100%; object-fit: cover; }
.ar { aspect-ratio: 16 / 9; }
@media (min-width: 768px) { .ar { aspect-ratio: var(--ar); } }
.frame { position: relative; overflow: hidden; background: var(--surface); }

/* Galerie 2 × 2 (Allianz) */
.gallery { display: grid; gap: var(--gap-media); grid-template-columns: 1fr; }
@media (min-width: 768px) { .gallery { grid-template-columns: 1fr 1fr; } }
.gallery .frame { aspect-ratio: 16 / 9; }

/* Slider im Anschnitt */
.slider { position: relative; min-width: 0; }
.media > *, .case > * { min-width: 0; }
.slider__track {
  display: grid; grid-auto-flow: column; gap: 12px;
  grid-auto-columns: 82%;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  margin-inline: calc(-1 * var(--pad)); padding-inline: var(--pad);
  scroll-padding-inline: var(--pad);
}
.slider__track::-webkit-scrollbar { display: none; }
.slider__item { scroll-snap-align: start; aspect-ratio: 510 / 317; }
.slider--tall .slider__item { aspect-ratio: 510 / 761; }
@media (min-width: 768px) {
  .slider__track { grid-auto-columns: calc((100% - 2 * 35px) / 3 * 1); gap: 35px; margin-inline: 0; padding-inline: 0; scroll-padding-inline: 0; }
  .slider--tall .slider__track { gap: var(--gap-media); }
}
.slider__nav { display: flex; gap: 16px; margin-top: 24px; font-size: 24px; line-height: 1; }
.slider__nav button {
  appearance: none; border: 0; background: none; padding: 10px 0; min-width: 44px; min-height: 44px;
  font: inherit; color: var(--fg); cursor: pointer; text-align: left;
}
.slider__nav button[disabled] { color: #999999; cursor: default; }

/* Hero / Key Visual: Mobile randlos */
@media (max-width: 767px) {
  .block--hero .frame, .block--hero .video { margin-inline: calc(-1 * var(--pad)); }
  .case .block--hero { order: -1; padding-top: 32px; }
  .case .block--intro { padding-top: 36px; }
}

/* ---------- Video mit eigenem Poster ---------- */
.video { position: relative; overflow: hidden; background: #000; }
.video img { width: 100%; height: 100%; object-fit: cover; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__play {
  position: absolute; left: 24px; bottom: 16px;
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid #ffffff; background: rgba(255, 255, 255, 0.2);
  display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: background-color 0.2s ease;
}
.video__play svg { width: 24px; height: 28px; margin-left: 5px; fill: #ffffff; }
.video:not(.is-playing) { cursor: pointer; }
.video__play:hover, .video:not(.is-playing):hover .video__play { background: rgba(255, 255, 255, 0.35); }
@media (min-width: 768px) {
  .video__play { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: clamp(72px, 7.3vw, 140px); height: clamp(72px, 7.3vw, 140px); }
  .video__play svg { width: 42%; height: auto; margin-left: 8%; }
}
.video.is-playing .video__play, .video.is-playing img { display: none; }

/* ---------- Kennzahlen ---------- */
.results h2 { font-size: var(--fs-h3); line-height: 1.2; }
.results ul { display: grid; gap: 24px; margin-top: 24px; }
.results .n { display: block; white-space: nowrap; font-size: var(--fs-kpi); font-weight: 700; line-height: 1.07; letter-spacing: -0.01em; }
.results .l { display: block; margin-top: 4px; font-size: var(--fs-kpi-label); font-weight: 500; line-height: 1.3; }
@media (max-width: 767px) {
  .results--band { background: var(--band-bg); color: var(--band-fg); padding-bottom: 40px; margin-top: var(--space-block); }
  .block.results--band { padding-top: 40px; }
}
@media (min-width: 768px) {
  .results ul { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 20px; margin-top: clamp(24px, 3vw, 56px); }
  .results .l { margin-top: 12px; padding-right: 8px; }
}

@media (min-width: 1280px) { .results ul { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ---------- Nächstes Projekt ---------- */
.next { padding-top: var(--space-section); display: grid; gap: 16px; }
.next__meta { display: grid; gap: 8px; }
.next h2 { font-size: var(--fs-h2); line-height: 1.12; }
.next .button { margin-top: 8px; justify-self: start; }
@media (min-width: 768px) {
  .next { gap: 24px; }
  .next .button { display: none; }
  .next__media { order: 2; }
  .next__meta { order: 1; }
  .next h2 { order: 3; }
}

/* ---------- Über mich ---------- */
.skills ul { margin-top: 8px; }
.stations-table { width: 100%; border-collapse: collapse; margin-top: var(--gap-text-media); }
.stations-table th, .stations-table td { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); line-height: 1.5; }
.stations-table th { font-weight: 700; padding-top: 0; }
.stations-table td:first-child { font-weight: 700; white-space: nowrap; }
@media (min-width: 768px) {
  .stations-table col.c1 { width: 18.75%; }
  .stations-table col.c2 { width: 43.75%; }
}
@media (max-width: 767px) {
  .stations-table thead th:nth-child(3) { display: none; }
  .stations-table thead th:nth-child(2)::after { content: " / Unternehmen"; }
  .stations-table tr { display: grid; grid-template-columns: 96px 1fr; column-gap: 12px; border-bottom: 1px solid var(--line); padding-block: 12px; }
  .stations-table th, .stations-table td { border: 0; padding: 0; }
  .stations-table td:nth-child(3) { grid-column: 2; opacity: 0.7; }
  .stations-table thead tr { padding-top: 0; }
}
.two-col { display: grid; gap: var(--space-block); }
@media (min-width: 1024px) { .two-col { grid-template-columns: 45% 47.5%; column-gap: 7.5%; } }
.two-col p { margin-top: var(--gap-head-text); }
.quote { font-size: var(--fs-h2); line-height: 1.12; max-width: 1300px; }

/* ---------- Rechtliches ---------- */
.legal { padding-top: clamp(40px, 30px + 2.5vw, 95px); display: grid; gap: 40px; max-width: 1055px; }
.legal h2 { font-size: var(--fs-h3); line-height: 1.2; }
.legal p { margin-top: 8px; }
.back { display: inline-block; font-size: clamp(24px, 20px + 1vw, 32px); line-height: 1; padding: 10px 0; margin-bottom: 8px; }

/* ---------- Kontakt & Footer ---------- */
.contact { padding-top: var(--space-section); display: grid; gap: 16px; justify-items: start; }
.contact__mail { font-size: clamp(30px, 9.2vw, 36px); font-weight: 700; line-height: 1.07; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.contact__links { display: flex; flex-wrap: wrap; gap: 8px 40px; font-size: var(--fs-contact-links); font-weight: 700; line-height: 1.2; }
.contact__links a { padding-block: 10px; margin-block: -10px; }
@media (min-width: 768px) {
  .contact__mail { font-size: clamp(36px, 6.7px + 3.82vw, 80px); }
  .contact__links { margin-top: 32px; gap: 8px 60px; }
}
.footer { padding-block: clamp(56px, 40px + 4vw, 157px) clamp(24px, 15px + 2.3vw, 160px); }
.footer__box {
  background: var(--surface);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 24px; line-height: 1.4;
}
@media (min-width: 768px) { .footer__box { padding: 56px clamp(24px, 5.6vw, 108px); } }
.footer a { display: inline-block; padding-block: 4px; }
.footer__legal { display: grid; text-align: left; }
@media (min-width: 768px) { .footer__legal { text-align: right; } }

/* ---------- Scroll-Reveal (Schalter: <html data-reveal="on|off">) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Nur Elemente unterhalb des ersten Bildschirms werden vorbereitet (.is-pending), alles andere bleibt sofort sichtbar */
  html[data-reveal="on"] .reveal.is-pending { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease-out, transform 0.5s ease-out; }
  html[data-reveal="on"] .reveal.is-pending.is-in { opacity: 1; transform: none; }
}

.frame picture { display: contents; }
