/* ============================================================
   Niko Mang — Portfolio
   Eigenständige statische Site. Minimal, typografisch, responsiv.
   Breakpoints: ≥1200 Desktop · 810–1199 Tablet · ≤809 Phone
   ============================================================ */

@font-face { font-family: 'Switzer'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/Switzer-400.woff2') format('woff2'); }
@font-face { font-family: 'Switzer'; font-style: normal; font-weight: 500; font-display: swap; src: url('../assets/fonts/Switzer-500.woff2') format('woff2'); }
@font-face { font-family: 'Switzer'; font-style: normal; font-weight: 600; font-display: swap; src: url('../assets/fonts/Switzer-600.woff2') format('woff2'); }
@font-face { font-family: 'Fragment Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/FragmentMono-400.woff2') format('woff2'); }

:root {
  --font-sans: 'Switzer', system-ui, sans-serif;
  --font-mono: 'Fragment Mono', ui-monospace, monospace;
  --bg: #fafafa;
  --fg: #121212;
  --muted: rgba(18, 18, 18, 0.55);
  --faint: rgba(18, 18, 18, 0.35);
  --line: rgba(18, 18, 18, 0.12);
  --img-bg: rgba(18, 18, 18, 0.04);
  --bar-bg: #121212;
  --bar-fg: #fafafa;
  --bar-muted: rgba(250, 250, 250, 0.45);
  --sel: rgba(0, 153, 255, 0.25);
  --pad: 24px;
  --col: 352px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
html[data-theme="dark"] {
  --bg: #121212;
  --fg: #fafafa;
  --muted: rgba(250, 250, 250, 0.55);
  --faint: rgba(250, 250, 250, 0.35);
  --line: rgba(250, 250, 250, 0.14);
  --img-bg: rgba(250, 250, 250, 0.05);
  --bar-bg: #000000;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: var(--sel); }

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
  overflow-x: clip;
}

h1, h2, h3 { font-size: 14px; font-weight: 600; line-height: 1.55; }
p { max-width: 62ch; }
p + p { margin-top: 1em; }
a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: opacity 0.2s ease; }
a:hover { opacity: 0.55; }
a:focus-visible, button:focus-visible { outline: 1.5px solid var(--fg); outline-offset: 3px; border-radius: 1px; }
img, video { display: block; max-width: 100%; }

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

/* ---------- Appear-Animationen ---------- */
[data-appear] { opacity: 0.001; transform: translateY(14px); }
[data-appear="fade"] { transform: none; }
[data-appear-hero] { opacity: 0.001; transform: translateY(160px); }
.appeared[data-appear], .appeared[data-appear-hero] {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--appear-delay, 0s);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-appear], [data-appear-hero] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .slides { transition: none !important; }
}

/* ---------- Sprachumschalter ---------- */
.lang-switch { text-decoration: none; }
.bio-head .lang-switch { margin-left: auto; color: var(--muted); }
.topbar .lang-switch { color: var(--bar-muted); }
.topbar .lang-switch:hover { color: var(--bar-fg); opacity: 1; }

/* ---------- Theme-Toggle ---------- */
.theme-toggle {
  background: none; border: 0; cursor: pointer; color: var(--fg);
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  transition: opacity 0.2s ease, transform 0.35s var(--ease);
}
.theme-toggle:hover { opacity: 0.55; transform: rotate(-12deg); }
.theme-toggle svg { width: 15px; height: 15px; fill: currentColor; }
.theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: block; }

/* ============================================================
   Startseite
   ============================================================ */
.home-layout { display: grid; grid-template-columns: var(--col) minmax(0, 1fr); }

.bio {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  padding: var(--pad);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.bio-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.bio-head h1 { font-weight: 600; }
.bio p { color: var(--fg); margin-bottom: 1em; max-width: 300px; }
.bio-links { margin-top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.bio-foot { margin-top: auto; color: var(--faint); }

.projects { padding: 0 var(--pad) 0 0; }

.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--col);
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.project:first-of-type { border-top: 0; }

.project-info { padding-top: 2px; }
 .project-subline { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; column-gap: 16px; row-gap: 4px; margin: 5px 0 24px; color: var(--muted); }
.project-subline .category { font-size: 14px; line-height: 1.5; }
.project-year { flex-shrink: 0; margin-left: auto; font-family: var(--font-mono); font-size: 12px; line-height: 1.5; letter-spacing: .035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.project-info p { margin-bottom: 1em; }
.project-meta { margin: 20px 0; }
.project-meta div { color: var(--muted); }
.project-meta span { color: var(--fg); }
.view-case { display: inline-block; margin-top: 4px; font-weight: 500; }

/* ---------- Carousel ---------- */
.carousel {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--img-bg);
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.carousel.dragging { cursor: grabbing; }
.slides {
  display: flex; height: 100%;
  transition: transform 0.55s var(--ease);
  will-change: transform;
}
.slide { flex: 0 0 100%; height: 100%; }
.slide img, .slide video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.slide.fit img { object-fit: contain; }
.slide.alpha video { object-fit: contain; }
.dots { position: absolute; top: 14px; left: 14px; display: flex; gap: 7px; z-index: 2; }
.dots { mix-blend-mode: exclusion; }
.dots button {
  width: 6px; height: 6px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: #fff; opacity: 0.4; transition: opacity 0.25s ease;
}
.dots button:hover { opacity: 0.7; }
.dots button.active { opacity: 1; }

.home-foot {
  border-top: 1px solid var(--line);
  padding: 14px 0 20px;
  display: flex; justify-content: space-between; gap: 16px;
  color: var(--muted);
}

/* ============================================================
   Case-Study-Seiten
   ============================================================ */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: 44px; z-index: 50;
  background: var(--bar-bg); color: var(--bar-fg);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  font-family: var(--font-sans);
  font-size: 13px; letter-spacing: 0; text-transform: none;
}
.topbar a { color: var(--bar-fg); }
.topbar .key { color: var(--bar-muted); text-decoration: none; margin: 0 4px; }
.topbar .nav { display: flex; align-items: center; gap: 6px; }

.case-layout {
  display: grid; grid-template-columns: var(--col) minmax(0, 1fr);
  padding-top: 44px;
}
.case-intro {
  position: sticky; top: 44px; height: calc(100vh - 44px);
  padding: var(--pad);
  overflow: hidden;
}
.case-intro .category { color: var(--muted); margin-bottom: 20px; }
.case-intro p { max-width: 300px; margin-bottom: 1em; }
.case-meta { margin-top: 20px; }
.case-meta div { color: var(--muted); }
.case-meta span { color: var(--fg); }

.case-content { padding: 16px var(--pad) 0 0; }

.case-content figure { margin: 0; padding: 16px 0; }
.case-content figure img, .case-content figure video { width: 100%; }
.case-content figcaption {
  margin-top: 10px; color: var(--muted);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em;
}
figure.fig-narrow img, figure.fig-narrow video { max-width: min(460px, 100%); margin: 0 auto; }
.fig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.fig-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.fig-grid img { width: 100%; height: 100%; object-fit: cover; }
.fig-grid.fit { align-items: start; }
.fig-grid.fit img { height: auto; object-fit: contain; }
.fig-embed { position: relative; aspect-ratio: 16 / 9; }
.fig-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.case-section {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px;
  padding: 22px 0;
  border-top: 1px dashed var(--line);
}
.case-section .label { color: var(--muted); }
.case-section .body { max-width: 640px; }
.case-section .body h2 { margin-bottom: 0.4em; }
.case-section .stat {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em;
}
.case-section .cta {
  display: inline-block; margin-top: 0.8em; font-weight: 500;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
}
.credits div { color: var(--muted); max-width: 640px; }
.credits span { color: var(--fg); }
blockquote.voices { font-style: italic; color: var(--muted); max-width: 640px; }
blockquote.voices em { font-style: normal; }

.case-foot {
  border-top: 1px solid var(--line);
  margin-top: 8px; padding: 16px 0 90px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
}

/* ---------- Sektions-Navigation unten links ---------- */
.section-nav {
  position: fixed; left: var(--pad); bottom: 20px; z-index: 40;
  display: flex; flex-direction: column; gap: 3px;
}
.section-nav a {
  text-decoration: none; color: var(--muted); display: flex; align-items: baseline; gap: 8px;
  transition: color 0.25s ease, opacity 0.2s ease;
}
.section-nav a::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--fg);
  align-self: center; opacity: 0; transition: opacity 0.25s ease;
}
.section-nav a.active { color: var(--fg); }
.section-nav a.active::before { opacity: 1; }
.section-nav .pct {
  font-family: var(--font-mono); font-size: 10px; color: var(--muted);
  visibility: hidden;
}
.section-nav a.active .pct { visibility: visible; }

/* ============================================================
   About-Seite
   ============================================================ */
.about-hero {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px; padding: 10vh var(--pad) 14vh;
  align-items: start;
}
.about-portrait {
  position: sticky; top: 18vh;
  display: flex; justify-content: center;
}
.about-portrait img { max-height: 64vh; width: auto; }
.about-text {
  font-size: 27px; line-height: 1.45; font-weight: 500;
  letter-spacing: -0.01em; max-width: 24em;
  padding: 18vh 0;
}
.about-text p { max-width: none; }
.about-text p + p { margin-top: 1.1em; }
.about-text .w { color: var(--faint); transition: color 0.3s ease; }
.about-text .w.read { color: var(--muted); }
.about-text .w.active { color: var(--fg); }

.about-sections { padding: 0 var(--pad); max-width: 1160px; }
.about-sections > h2 {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); font-weight: 400;
  padding: 48px 0 10px;
}
.station {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px;
  padding: 26px 0; border-top: 1px dashed var(--line);
}
.station .when { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.station .org {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em;
  text-transform: uppercase; margin-top: 6px; color: var(--fg);
}
.station .role { font-weight: 600; }
.station .body { max-width: 620px; }
.station .body .sub { color: var(--muted); margin-bottom: 8px; }
.station .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.station .tags span {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.03em;
  color: var(--muted); border: 1px solid var(--line); border-radius: 2px;
  padding: 3px 7px;
}
.about-contact { padding: 40px var(--pad) 80px; border-top: 1px solid var(--line); margin-top: 48px; }
.about-contact p { max-width: 46ch; }

/* ============================================================
   Tablet · 810 – 1199
   ============================================================ */
@media (max-width: 1199.98px) {
  :root { --col: 300px; --pad: 20px; }
  .about-text { font-size: 23px; }
  .station { grid-template-columns: 170px minmax(0, 1fr); }
  .project { grid-template-columns: minmax(0, 1fr); }
  .project-info { max-width: 560px; }
  .case-section { grid-template-columns: 170px minmax(0, 1fr); }
  .section-nav { display: none; }
}

/* ============================================================
   Phone · ≤ 809
   ============================================================ */
@media (max-width: 809.98px) {
  :root { --pad: 16px; }
  .home-layout, .case-layout { grid-template-columns: minmax(0, 1fr); }
  .bio, .case-intro { position: static; height: auto; padding-bottom: 8px; overflow: visible; }
  .bio-foot { display: none; }
  .projects { padding: 0 var(--pad); }
  .project { padding: 20px 0; }
  .carousel { margin: 0 calc(-1 * var(--pad)); aspect-ratio: 4 / 3; }
  .case-content { padding: 0 var(--pad); }
  .case-intro { padding-top: 16px; }
  .case-section { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 18px 0; }
  .case-content figure { margin: 0 calc(-1 * var(--pad)); padding: 12px 0; }
  .case-content figcaption { padding: 0 var(--pad); }
  .topbar .key { display: none; }
  .case-foot { padding-bottom: 40px; }
  .about-hero { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 32px var(--pad) 10vh; }
  .about-portrait { position: static; transform: none; }
  .about-portrait img { max-height: 48vh; }
  .about-text { font-size: 20px; padding: 10vh 0 6vh; }
  .station { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 20px 0; }
}

/* Captis: film opening and scroll-led anonymous voices. */
.case-content .captis-film { padding-top: 0; }
.captis-film video { aspect-ratio: 16 / 9; background: #000; object-fit: contain; }
.captis-voices { padding: clamp(64px, 12vh, 140px) clamp(0px, 3vw, 48px) clamp(72px, 14vh, 160px); }
.captis-voices blockquote, .captis-voices .quote-source { font-family: var(--font-sans); font-size: clamp(30px, 3.7vw, 66px); font-weight: 600; line-height: 1.13; letter-spacing: -.045em; margin: 0; text-wrap: pretty; }
.captis-voices blockquote + blockquote { margin-top: 1.2em; }
.captis-voices blockquote p { max-width: 24ch; }
.captis-voices .quote-word { opacity: var(--word-opacity, 1); }
.captis-voices .quote-source { margin-top: 36px; color: var(--muted); }
@media (max-width: 809px) { .captis-voices { padding-left: 0; padding-right: 0; } .captis-voices blockquote, .captis-voices .quote-source { font-size: clamp(30px, 7.6vw, 48px); } }
@media (prefers-reduced-motion: reduce) { .captis-voices .quote-word { opacity: 1; } }

/* Captis: separate the narrative with whitespace instead of rules. */
.case-captis .case-section {
  border: 0;
  padding: clamp(40px, 5vw, 72px) 0;
}
.case-captis .case-content > figure:not(.captis-film) {
  padding-top: clamp(24px, 3vw, 40px);
  padding-bottom: clamp(32px, 4vw, 56px);
}
.case-captis .captis-voices,
.case-captis .captis-voices blockquote {
  border: 0;
  outline: 0;
  box-shadow: none;
}
.case-captis .case-foot {
  border-top: 0;
  margin-top: 40px;
  padding-top: 32px;
}
@media (max-width: 809.98px) {
  .case-captis .case-section { gap: 14px; }
}

/* Captis design-system showcase: overview first, paired details below. */
.case-captis .captis-system-details .fig-grid { gap: clamp(12px, 2vw, 24px); }
.case-captis .captis-system-overview img,
.case-captis .captis-system-details img { display: block; aspect-ratio: 4 / 3; height: auto; object-fit: contain; }
@media (max-width: 809.98px) {
  .case-captis .captis-system-details .fig-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Contact anchored above the imprint, mirroring the 24px header gap. */
.bio { overflow-y: auto; }
.bio-summary p:last-of-type { margin-bottom: 6px; }
.bio-contact { margin-top: auto; padding-top: 32px; flex-shrink: 0; }
.bio-contact h2 { font-weight: 400; }
.bio-contact .bio-links { margin-top: 12px; gap: 10px; }
.bio .bio-foot { margin-top: 24px; flex-shrink: 0; }
.copy-email { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.copy-email svg { width: 15px; height: 15px; flex: none; }
.copy-email:hover > svg, .copy-email:hover > span:not(.copy-status) { opacity: .65; }
.copy-email:focus-visible { outline: 1.5px solid var(--fg); outline-offset: 4px; }
 .copy-status { position: fixed; z-index: 1000; display: flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 8px; font: 11px/1.4 var(--font-mono); background: var(--fg); color: var(--bg); white-space: nowrap; pointer-events: none; visibility: hidden; opacity: 0; }
.copy-status.is-visible { visibility: visible; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .copy-status { transform: none; } }
@media (max-width: 809.98px) { .bio-contact { margin-top: 24px; padding-top: 0; margin-bottom: 24px; } }
