/* ==========================================================================
   Seitenstile – Mobile first (390 px), ab 900 px Bento-Raster aus Web Desktop
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--color-bg-page);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

p,
h1,
h2,
ul,
figure {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

/* ---------- Fokus (WCAG 2.4.7 / 2.4.11): 3 px Außenrand ---------- */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 20;
  padding: 14px 20px;
  border-radius: var(--radius-full);
  background: var(--color-bg-inverse);
  color: var(--color-text-on-inverse);
  font-size: 15px;
  line-height: 20px;
  text-decoration: none;
}
.skip-link:focus {
  top: 16px;
}

/* ---------- Seite & Raster ---------- */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--page-pad) 120px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: var(--type-label-size);
  line-height: var(--type-label-line);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.theme-toggle:hover {
  box-shadow: inset 0 0 0 2px var(--color-text-primary);
}
/* Sprachschalter: gleiche Form wie der Darstellungs-Schalter, aber ein Link auf die Gegenseite */
a.theme-toggle {
  text-decoration: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--layout-gap);
}

.c-full { grid-column: 1 / -1; }
.c-main { grid-column: 1 / -1; }
.c-side { grid-column: 1 / -1; }
.c-third { grid-column: 1 / -1; }
.c-half { grid-column: span 1; }

@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .c-main { grid-column: span 2; }
  .c-side,
  .c-third,
  .c-half { grid-column: span 1; }
  .topbar { padding: 0 0 16px; }
}

/* ---------- Bento-Kachel (Web/Bento-Kachel) ---------- */
.tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: var(--space-tile);
  border-radius: var(--radius-lg);
  color: var(--color-text-primary);
  min-width: 0;
}

.tile--surface { background: var(--color-bg-surface); }
.tile--accent { background: var(--color-bg-accent); }
.tile--warm { background: var(--color-bg-warm); }
.tile--strong { background: var(--color-bg-strong); color: var(--color-text-on-strong); }
.tile--kobalt { background: var(--color-bg-kobalt); color: var(--color-text-on-kobalt); }

.tile--tall { min-height: 240px; }
.tile--metric { min-height: 190px; }
.tile--rows { gap: 16px; }

@media (min-width: 900px) {
  .tile--tall { min-height: 360px; }
  .tile--metric { min-height: 220px; }
  .tile--text { min-height: 240px; }
  .tile--wide { min-height: 360px; }
  .tile--short { min-height: 200px; }
}

.label {
  font-weight: 400;
  font-family: var(--font-mono);
  font-size: var(--type-label-size);
  line-height: var(--type-label-line);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.tile--strong .label { color: var(--color-text-on-strong); }
.tile--kobalt .label { color: var(--color-text-on-kobalt); }

.display {
  font-size: var(--type-display-size);
  line-height: var(--type-display-line);
  letter-spacing: var(--type-display-track);
  font-weight: 400;
  overflow-wrap: break-word;
}

.lead {
  font-size: var(--type-lead-size);
  line-height: var(--type-lead-line);
  letter-spacing: var(--type-lead-track);
}

.body {
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
}

.metric {
  font-size: var(--type-metric-size);
  line-height: var(--type-metric-line);
  letter-spacing: var(--type-metric-track);
  font-weight: 300;
}

.tile__metric-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tile--metric .body { color: var(--color-text-secondary); }
.tile--strong.tile--metric .body { color: var(--color-text-on-strong); }

/* Aufzählung: feiner Strich, Folgezeilen fluchten mit dem Text (hängender Einzug) */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45em;
}
.list li {
  position: relative;
  padding-left: 1.1em;
}
.list li::before {
  content: "–";
  position: absolute;
  left: 0;
  font-weight: 300;
  opacity: 0.45;
}

/* Deutsche Texte automatisch trennen (Video-telefonie statt Videotelefoni-e) */
:lang(de) .heading,
:lang(de) .lead,
:lang(de) .body {
  -webkit-hyphens: auto;
  hyphens: auto;
  hyphenate-limit-chars: 7 3 3;
  overflow-wrap: normal;
}

/* Große Titel nur an gesetzten Stellen trennen (&shy; im Text, z. B. Video|telefonie) */
:lang(de) .display { -webkit-hyphens: manual; hyphens: manual; }

/* Zustände der Live Activity: untereinander, ab Tablet zweispaltig */
.states {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}
@media (min-width: 700px) {
  .states { grid-template-columns: 1fr 1fr; gap: 16px; }
}
.states img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Kachel als Link: ganze Fläche klickbar ---------- */
a.tile {
  color: inherit;
  text-decoration: none;
}
@media (hover: hover) {
  a.tile:hover {
    box-shadow: inset 0 0 0 2px var(--color-text-primary); /* Hover: Form, nicht nur Farbe */
  }
}
a.tile:active {
  box-shadow: inset 0 0 0 3px var(--color-text-primary), inset 0 3px 8px rgb(0 0 0 / 0.18);
}
.arrow {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.15em;
  vertical-align: -0.08em;
}

/* ---------- Bilder ---------- */
.figure {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.shot {
  overflow: hidden;
  border-radius: var(--radius-lg); /* Exporte haben Rundung eingebrannt; CSS-Radius schneidet identisch nach */
}
.shot img {
  width: 100%;
  height: auto;
}

.code-tile {
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--color-bg-code);
}
.code-tile .shot {
  border-radius: 0;
}

@media (min-width: 900px) {
  .figure { gap: 22px; }
}

/* ---------- Navigation (Web/Navigation, schwebende Pille) ---------- */
.nav {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 10;
  display: flex;
  gap: 4px;
  padding: 6px;
  transform: translateX(-50%);
  border-radius: var(--radius-full);
  background: var(--color-bg-surface);
  box-shadow: var(--shadow-nav);
}
.nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  color: var(--color-text-primary);
  font-size: 15px;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover {
  box-shadow: inset 0 0 0 2px var(--color-text-primary);
}
.nav a[aria-current="page"] {
  background: var(--color-bg-inverse);
  color: var(--color-text-on-inverse);
}
/* Mobile: „Über mich“ und „Lebenslauf“ ausblenden */
.nav .nav__desktop { display: none; }
@media (min-width: 600px) {
  .nav .nav__desktop { display: flex; }
}

/* ---------- Referenz-Navigation (oben auf jeder Referenzseite) ---------- */
.ref-nav ul {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-padding-inline: 24px;
  padding: 3px; /* Platz für Fokusrahmen */
  margin: -3px;
  scrollbar-width: none;
}
.ref-nav ul::-webkit-scrollbar { display: none; }
.ref-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  font-size: 15px;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
}
@media (hover: hover) {
  .ref-nav a:hover { box-shadow: inset 0 0 0 2px var(--color-text-primary); }
}
.ref-nav a[aria-current="page"] {
  background: var(--color-bg-inverse);
  color: var(--color-text-on-inverse);
}
.ref-nav__num {
  font-family: var(--font-mono);
  font-size: var(--type-label-size);
  line-height: var(--type-label-line);
  letter-spacing: 0.04em;
}

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ---------- Zugangsmaske (Mobile · Geschützter Bereich – Zugang) ---------- */
.page--gate .grid { display: block; max-width: 560px; margin: 0 auto; padding-top: 56px; }
@media (min-width: 900px) { .page--gate .grid { padding-top: 120px; } }

.gate { gap: 20px; padding: 28px var(--space-tile); justify-content: flex-start; }
.heading {
  font-size: var(--type-heading-size);
  line-height: var(--type-heading-line);
  letter-spacing: var(--type-heading-track);
  font-weight: 400;
}
.gate__copy { color: var(--color-text-secondary); }

.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { font-weight: 600; font-size: 16px; line-height: 22px; }
.field__input {
  width: 100%;
  min-height: 52px;
  padding: 15px 20px;
  border: 1px solid var(--color-border-control);
  border-radius: var(--radius-full);
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 18px;
  line-height: 22px;
}
.field__input:hover { border-color: var(--color-text-primary); }
.field__input[aria-invalid="true"] { border-color: var(--color-error); box-shadow: inset 0 0 0 1px var(--color-error); }
.field__hint { font-size: 14px; line-height: 20px; color: var(--color-text-secondary); }
.field__error {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 14px; line-height: 20px; font-weight: 600; color: var(--color-error);
}
.field__error[hidden] { display: none; }
.field__error svg { flex: none; width: 20px; height: 20px; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: 48px; padding: 14px 24px;
  border: 0; border-radius: var(--radius-full);
  background: var(--color-bg-inverse); color: var(--color-text-on-inverse);
  font: inherit; font-weight: 600; font-size: 16px; line-height: 20px; cursor: pointer;
}
.button:hover { background: var(--color-bg-inverse-hover); box-shadow: inset 0 0 0 2px var(--color-text-primary); }
.button[aria-disabled="true"] { opacity: 0.6; cursor: progress; }
.gate form { display: flex; flex-direction: column; gap: 20px; }
.gate__request { font-size: 16px; line-height: 22px; }
.gate__request a {
  color: var(--color-text-primary); font-weight: 600;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.gate__request a:hover { text-decoration-thickness: 2px; }

/* ---------- Referenz-Seiten: Handy-Bild-Kachel, Stapel, Textspalte ---------- */
.stack { display: flex; flex-direction: column; gap: 12px; }
.body--secondary { color: var(--color-text-secondary); }
.c-text2 { grid-column: 1 / -1; }

.phone { align-items: center; justify-content: flex-start; gap: 12px; }
.phone__img {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: var(--radius-lg);
}
.phone .label { align-self: stretch; }

.arrow--back { margin-left: 0; margin-right: 0.15em; }

@media (min-width: 900px) {
  .phone { grid-row: span 3; justify-content: flex-start; gap: 22px; }
  .phone__img { max-width: none; }
  .c-text2 { grid-column: 2 / span 2; }
}

/* Programmatisch fokussierte Überschrift (nach dem Entsperren) ohne Rahmen */
h1[tabindex="-1"]:focus { outline: none; }

/* ---------- Bildpaare (Vorher/Nachher, Light/Dark) und Abschnittslabels ---------- */
.duo { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--layout-gap); }
.duo > .tile { min-height: 0; }
.section-label { padding-top: 16px; }
@media (min-width: 600px) {
  .duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .duo--editor { grid-template-columns: minmax(0, 498fr) minmax(0, 868fr); }
}
@media (min-width: 900px) {
  .duo--compare { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .section-label { padding-top: 24px; }
}

/* ---------- Referenz 05 · Banking: Hero, Screen-Reihen, Logowand ---------- */
.hero-shot { width: 100%; height: auto; }

.screens {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  justify-items: center;
  padding: 20px;
  border-radius: var(--radius-lg);
}
.screens--accent { background: var(--color-bg-accent); }
.screens--warm { background: var(--color-bg-warm); }
.screens img { width: 100%; max-width: 262px; height: auto; }

/* Logos sind dunkel: Fläche bleibt auch im Dunkelmodus hell (wie in Figma) */
.logo-wall {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 12px;
  align-items: center;
  justify-items: center;
  margin: 0;
  padding: 32px 20px;
  list-style: none;
  border-radius: var(--radius-lg);
  background: light-dark(#ffffff, #f6f5f1);
}
.logo-wall img { max-width: 100%; height: auto; } /* Breite aus dem width-Attribut (halbe Exportgröße, 2x scharf) */

@media (min-width: 900px) {
  .screens { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; padding: 64px 48px; }
  .logo-wall { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 48px 32px; padding: 56px 48px; }
}

/* Blättern: einheitlich Zurück (links) und Weiter (rechts) am Ende jeder Referenz */
.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--layout-gap);
}
.pager .tile { min-height: 160px; }
.pager__num { white-space: nowrap; }
@media (max-width: 599px) {
  .pager .lead { font-size: 18px; line-height: 24px; hyphens: auto; }
}
@media (min-width: 900px) {
  .pager .tile { min-height: 200px; }
}
