:root {
  --bg: #0c080a;
  --bg-soft: #120c0d;
  --surface: #171012;
  --surface-2: #1e1516;
  --border: #332021;
  --text: #f3ecea;
  --muted: #a59692;
  --muted-2: #6e5d58;
  --accent: #ef4444;
  --accent-strong: #dc2626;
  --accent-soft: rgba(239, 68, 68, 0.1);
  --radius: 2px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter",
    "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono",
    monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-strong);
}

::selection {
  background: var(--accent);
  color: #1c0606;
}

/* ---------- Layout ---------- */

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 8, 10, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 28px;
}

.nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
}

.nav a.active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  font-size: 1rem;
  cursor: pointer;
  border-radius: var(--radius);
}

@media (max-width: 720px) {
  .nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    display: none;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
  }

  .nav-toggle {
    display: block;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 120px 0 96px;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: "";
  position: absolute;
  top: -220px;
  right: -180px;
  width: 560px;
  height: 560px;
  background: radial-gradient(
    closest-side,
    rgba(239, 68, 68, 0.14),
    transparent 70%
  );
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -260px;
  left: -200px;
  width: 520px;
  height: 520px;
  background: radial-gradient(
    closest-side,
    rgba(220, 38, 38, 0.08),
    transparent 70%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 760px;
}

.overline {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero p.lede {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 12px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1c0606;
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #1c0606;
}

.btn-ghost {
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- Sections ---------- */

.section {
  padding: 84px 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 40px;
}

.section-index {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
}

.section-title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-sub {
  color: var(--muted);
  margin-top: 8px;
  max-width: 640px;
}

/* ---------- Highlights ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
}

.stat-value {
  font-family: var(--mono);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- Card list (projects) ---------- */

.card-list {
  display: grid;
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--accent-strong);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.card-sub {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 14px;
}

.card p {
  color: var(--muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  font-size: 0.78rem;
  font-family: var(--mono);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius);
}

/* ---------- Project detail ---------- */

.project-detail {
  max-width: 760px;
}

.project-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 0 0 40px;
}

.project-detail h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--text);
}

.project-detail p {
  color: var(--muted);
  margin-bottom: 14px;
}

.project-detail ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.project-detail li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.project-detail li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  background: var(--accent);
}

.detail-link {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}

.detail-link:hover {
  color: var(--accent-strong);
  border-color: var(--accent-strong);
}

/* ---------- Timeline (CV) ---------- */

.timeline {
  margin: 0 0 56px 0;
}

.timeline-group {
  margin-bottom: 44px;
}

.timeline-group:last-child {
  margin-bottom: 0;
}

.group-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.group-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 24px;
  padding-bottom: 30px;
  border-left: 1px solid var(--border);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 6px;
  width: 9px;
  height: 9px;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.tl-meta {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 6px;
}

.tl-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.tl-org {
  color: var(--muted);
  margin-bottom: 12px;
}

.timeline-item ul {
  list-style: none;
}

.timeline-item li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.timeline-item li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  background: var(--accent);
}

/* ---------- Contact / Info lists ---------- */

.info-list,
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.info-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
}

.info-card:hover {
  border-color: var(--accent-strong);
}

.info-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
}

.info-value {
  font-size: 1rem;
  color: var(--text);
  word-break: break-word;
}

.info-value a {
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.info-value a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Skills ---------- */

.skill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 48px 0 40px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-brand {
  font-weight: 700;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-meta {
  width: 100%;
  color: var(--muted-2);
  font-size: 0.82rem;
  text-align: center;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ---------- Page hero (subpages) ---------- */

.page-hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.breadcrumb {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted-2);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--muted-2);
}

.breadcrumb a:hover {
  color: var(--accent);
}

/* ---------- Impressum ---------- */

.legal {
  max-width: 720px;
}

.legal h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 28px 0 8px;
  color: var(--accent);
}

.legal p,
.legal li {
  color: var(--muted);
  font-size: 0.95rem;
}

.legal ul {
  list-style: none;
  padding: 0;
}

.legal li {
  padding-left: 18px;
  position: relative;
}

.legal li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  background: var(--accent);
}

/* ---------- CV: Profilkarte ---------- */

.profile-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), rgba(239, 68, 68, 0.15), transparent);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.profile-avatar {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
}

.profile-intro .card-title {
  font-size: 1.55rem;
  margin-bottom: 2px;
}

.profile-role {
  color: var(--accent);
}

/* ---------- CV: Timeline ---------- */

.timeline {
  margin: 0 0 56px 0;
}

.timeline-item {
  padding-left: 28px;
  transition: border-color 0.2s ease;
}

.timeline-item:hover {
  border-left-color: var(--accent);
}

.timeline-item::before {
  left: -6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 3px var(--surface);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.timeline-item:hover::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.tl-meta {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: var(--radius);
  letter-spacing: 0.06em;
}

.timeline-item ul {
  margin-top: 14px;
  padding: 18px 0 0;
  border-top: 1px dashed var(--border);
}

.timeline-item li {
  padding-left: 20px;
}

.timeline-item li::before {
  left: 2px;
  border-radius: 50%;
}

/* ---------- CV: Skill-Tags ---------- */

.skill-grid .tag {
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.skill-grid .tag:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- Utilities ---------- */

.muted {
  color: var(--muted);
}

.accent {
  color: var(--accent);
}

/* ---------- CV: Reveal animations ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 0.84, 0.34, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.group-label.reveal {
  transform: translateX(-16px);
}

.group-label.reveal.is-visible {
  transform: none;
}

.profile-card.reveal.is-visible::before {
  animation: cv-line 0.8s ease 0.15s both;
}

@keyframes cv-line {
  from { width: 0; }
  to { width: 100%; }
}

.reveal-avatar {
  transform: scale(0.55);
  transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal-avatar.is-visible {
  opacity: 1;
  transform: scale(1);
}

.timeline-item.reveal.is-visible::before {
  animation: cv-dot 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

@keyframes cv-dot {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.skill-grid .tag.reveal {
  transform: translateY(14px) scale(0.9);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
    color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.skill-grid .tag.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.is-visible,
  .group-label.reveal,
  .group-label.reveal.is-visible,
  .reveal-avatar,
  .reveal-avatar.is-visible,
  .skill-grid .tag.reveal,
  .skill-grid .tag.reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }

  .timeline-item.reveal.is-visible::before,
  .profile-card.reveal.is-visible::before {
    animation: none;
  }
}