/* =========================================================================
   Nikolas Hanß – Persönliche Website
   Design: an Apples Designsprache angelehnt (Weißraum, klare Typografie,
   dezente Tiefe, ruhige Bewegung). Auto Light/Dark + manueller Umschalter.
   ========================================================================= */

/* ---------- Design Tokens ------------------------------------------------ */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, sans-serif;

  /* Farben – Light (Default) */
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --bg-subtle: #f5f5f7;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --hairline: rgba(0, 0, 0, 0.10);
  --hairline-strong: rgba(0, 0, 0, 0.16);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.10);
  --nav-bg: rgba(251, 251, 253, 0.72);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 28px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 2px 6px rgba(0, 0, 0, 0.08), 0 18px 44px rgba(0, 0, 0, 0.10);

  /* Layout */
  --maxw: 1040px;
  --maxw-narrow: 720px;
  --radius: 20px;
  --radius-sm: 14px;
  --gutter: clamp(20px, 5vw, 40px);

  color-scheme: light dark;
}

/* Dark – automatisch nach Systemeinstellung ... */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-elevated: #1d1d1f;
    --bg-subtle: #161617;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #86868b;
    --hairline: rgba(255, 255, 255, 0.12);
    --hairline-strong: rgba(255, 255, 255, 0.20);
    --accent: #2997ff;
    --accent-hover: #47a6ff;
    --accent-soft: rgba(41, 151, 255, 0.14);
    --nav-bg: rgba(22, 22, 23, 0.72);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.5), 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-card-hover: 0 2px 6px rgba(0, 0, 0, 0.55), 0 18px 44px rgba(0, 0, 0, 0.55);
  }
}

/* ... und manuell erzwungen (Umschalter) */
:root[data-theme="dark"] {
  --bg: #000000;
  --bg-elevated: #1d1d1f;
  --bg-subtle: #161617;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #86868b;
  --hairline: rgba(255, 255, 255, 0.12);
  --hairline-strong: rgba(255, 255, 255, 0.20);
  --accent: #2997ff;
  --accent-hover: #47a6ff;
  --accent-soft: rgba(41, 151, 255, 0.14);
  --nav-bg: rgba(22, 22, 23, 0.72);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.5), 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-card-hover: 0 2px 6px rgba(0, 0, 0, 0.55), 0 18px 44px rgba(0, 0, 0, 0.55);
}

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

* { margin: 0; }

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* Sichtbarer Fokusring für Tastaturnutzung */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Sprach-Sichtbarkeit: gesteuert über <html data-lang="..."> */
html[data-lang="de"] [data-t="en"] { display: none; }
html[data-lang="en"] [data-t="de"] { display: none; }

/* ---------- Layout Helpers ---------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(64px, 11vw, 132px);
  border-top: 1px solid var(--hairline);
}

.section--plain { border-top: none; }

.section__eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.section__title {
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  line-height: 1.08;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.section__lead {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 60ch;
}

/* ---------- Navigation --------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}

.nav__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav__brand {
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
  list-style: none;
  padding: 0;
}

.nav__links a {
  font-size: 0.92rem;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}
.nav__links a:hover { color: var(--text); }

.nav__tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Kleine, runde Steuer-Buttons (Sprache / Theme) */
.pill {
  height: 34px;
  min-width: 34px;
  padding-inline: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}
.pill:hover { background: var(--bg-subtle); }
.pill:active { transform: scale(0.96); }
.pill__icon { width: 17px; height: 17px; display: block; }
.pill .icon-moon { display: none; }
:root[data-theme="dark"] .pill .icon-sun,
html:not([data-theme]) .pill .icon-sun { display: block; }

/* Hamburger (nur mobil sichtbar) */
.nav__burger {
  display: none;
  width: 34px; height: 34px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: transparent;
  position: relative;
}
.nav__burger span,
.nav__burger span::before,
.nav__burger span::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 15px; height: 1.5px;
  background: var(--text);
  transform: translateX(-50%);
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav__burger span { top: 50%; margin-top: -0.75px; }
.nav__burger span::before { top: -5px; }
.nav__burger span::after { top: 5px; }
.nav[data-open="true"] .nav__burger span { background: transparent; }
.nav[data-open="true"] .nav__burger span::before { transform: translateX(-50%) translateY(5px) rotate(45deg); }
.nav[data-open="true"] .nav__burger span::after { transform: translateX(-50%) translateY(-5px) rotate(-45deg); }

/* ---------- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
  min-height: 44px;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--hairline-strong);
}
.btn--ghost:hover { background: var(--accent-soft); border-color: var(--accent); }

/* ---------- Hero --------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(72px, 13vw, 150px) clamp(56px, 9vw, 104px);
  text-align: center;
  overflow: hidden;
}
.hero::before { /* dezenter Lichtschein */
  content: "";
  position: absolute;
  inset: -20% 0 auto 0;
  height: 520px;
  background: radial-gradient(ellipse 60% 60% at 50% 0%, var(--accent-soft), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }

.hero__avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  margin: 0 auto 30px;
  object-fit: cover;
  background: var(--bg-subtle);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-card);
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

/* Porträtfoto als fokussierter Ausschnitt: der Kopf sitzt vollständig
   und mittig im Kreis (Zoom über background-size, Lage über -position). */
.hero__avatar--photo {
  background-image: url("../img/portrait.jpg");
  background-size: 127%;
  background-position: 40% 0%;
  background-repeat: no-repeat;
  color: transparent;
}

.hero__title {
  font-size: clamp(2.5rem, 7vw, 4.6rem);
  line-height: 1.04;
  font-weight: 680;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
}
.hero__title .accent {
  background: linear-gradient(120deg, var(--accent), #6ab7ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  font-size: clamp(1.12rem, 2.6vw, 1.5rem);
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 40ch;
  margin: 0 auto 14px;
}
.hero__role {
  font-size: 0.98rem;
  color: var(--text-tertiary);
  margin-bottom: 34px;
}
.hero__cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Kennzahlen unter dem Hero */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: clamp(48px, 8vw, 80px);
}
.stat { text-align: center; }
.stat__num {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 660;
  letter-spacing: -0.02em;
  color: var(--text);
}
.stat__label {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---------- Über mich ---------------------------------------------------- */
.about__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.about__text p { color: var(--text-secondary); font-size: 1.06rem; margin-top: 16px; }
.about__text p:first-child { margin-top: 0; }
.about__text strong { color: var(--text); font-weight: 600; }

.valuecard {
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-card);
}
.valuecard h3 { font-size: 1.05rem; font-weight: 620; margin-bottom: 14px; }
.valuecard ul { list-style: none; padding: 0; display: grid; gap: 12px; }
.valuecard li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 0.97rem;
  color: var(--text-secondary);
}
.valuecard li::before {
  content: "";
  flex: none;
  width: 18px; height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--accent-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230071e3' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* ---------- Timeline / Werdegang ---------------------------------------- */
.timeline {
  position: relative;
  margin-top: 46px;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--hairline-strong);
}
.tl-item { position: relative; padding-bottom: 40px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -28px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.tl-item__period {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.01em;
}
.tl-item__role { font-size: 1.2rem; font-weight: 620; margin: 6px 0 2px; }
.tl-item__org { font-size: 0.98rem; color: var(--text-secondary); margin-bottom: 12px; }
.tl-item__list { list-style: none; padding: 0; display: grid; gap: 8px; }
.tl-item__list li {
  position: relative;
  padding-left: 18px;
  font-size: 0.98rem;
  color: var(--text-secondary);
}
.tl-item__list li::before {
  content: "";
  position: absolute;
  left: 2px; top: 9px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

/* ---------- Kompetenzen -------------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-top: 46px;
}
.skillcard {
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.skillcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }
.skillcard__icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.skillcard__icon svg { width: 22px; height: 22px; }
.skillcard h3 { font-size: 1.08rem; font-weight: 620; margin-bottom: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.83rem;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 5px 12px;
}

/* ---------- Zitat / Referenz -------------------------------------------- */
.quote {
  max-width: var(--maxw-narrow);
  margin-inline: auto;
  text-align: center;
}
.quote__mark {
  font-size: 3.4rem;
  line-height: 1;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 8px;
}
.quote blockquote {
  font-size: clamp(1.3rem, 3.2vw, 1.9rem);
  line-height: 1.34;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.quote figcaption {
  margin-top: 22px;
  font-size: 0.92rem;
  color: var(--text-tertiary);
}

/* ---------- Kontakt ------------------------------------------------------ */
.contact { text-align: center; }
.contact__box {
  max-width: var(--maxw-narrow);
  margin: 40px auto 0;
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: clamp(30px, 6vw, 52px);
  box-shadow: var(--shadow-card);
}
.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
}

/* ---------- Footer ------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--hairline);
  padding-block: 34px;
  background: var(--bg-subtle);
}
.footer__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  color: var(--text-tertiary);
}
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__links a { color: var(--text-secondary); }
.footer__links a:hover { color: var(--text); }

/* ---------- Rechtstext-Seiten (Impressum / Datenschutz) ----------------- */
.legal { max-width: var(--maxw-narrow); }
.legal h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 660;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.legal h2 {
  font-size: 1.2rem;
  font-weight: 620;
  margin: 36px 0 10px;
}
.legal p, .legal address, .legal li {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 10px;
  font-style: normal;
}
.legal a { color: var(--accent); }
.backlink { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; margin-bottom: 30px; }

/* ---------- Scroll-Reveal ------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive --------------------------------------------------- */
@media (max-width: 820px) {
  .about__grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }

  .nav__links {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--nav-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--hairline);
    padding: 8px var(--gutter) 16px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
  }
  .nav[data-open="true"] .nav__links {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .nav__links a { width: 100%; padding-block: 12px; font-size: 1rem; border-bottom: 1px solid var(--hairline); }
  .nav__links li:last-child a { border-bottom: none; }
  .nav__burger { display: block; }
}

@media (max-width: 480px) {
  .hero__cta { flex-direction: column; }
  .hero__cta .btn { width: 100%; }
  .nav__brand { font-size: 0.96rem; }
}

/* ---------- Reduced Motion ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; opacity: 1; transform: none; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
