/* ============================================================
   MARKUS SPITZER - PORTFOLIO
   Performance-first redesign: static backdrop, real sections,
   native anchors. Rules of the house:
   - no backdrop-filter, no animated filter:blur()
   - no scroll-driven layout reads (offsetHeight etc.)
   - animations use transform/opacity only
   ============================================================ */

:root {
  /* Brand "Paper & Glut" — dark mode of the chord (see brand/BRAND.md) */
  --bg:          #1c1b18;
  --bg-deep:     #121110;
  --surface:     #26231e;
  --surface-hi:  #2f2b25;
  --text:        #f5f1ea;
  --muted:       #a9a294;
  --muted-dim:   #7d766a;

  --accent:      #f97316;
  --accent-soft: #fdba74;
  --accent-deep: #c2410c;

  --card:        rgba(255, 255, 255, 0.04);
  --card-hi:     rgba(255, 255, 255, 0.07);
  --brd:         rgba(255, 255, 255, 0.10);
  --brd-hi:      rgba(255, 255, 255, 0.20);

  --r-card:      20px;
  --r-pill:      999px;

  --maxw:        1120px;
  --ease:        cubic-bezier(0.16, 1, 0.3, 1);
  --shadow:      0 18px 50px rgba(0, 0, 0, 0.35);
}

/* =========================================
   RESET / BASE
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
strong { color: var(--text); font-weight: 600; }
ul { list-style: none; }
::selection { background: rgba(249, 115, 22, 0.28); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

section[id] { scroll-margin-top: 96px; }

/* Inline SVG icons (sprite <use>) */
.ic { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.15em; flex-shrink: 0; }

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 0.6rem 1.1rem;
  background: var(--accent);
  color: #1a0e05;
  border-radius: 0 0 12px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* =========================================
   BACKDROP — painted once, never animated
   ========================================= */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 18% 0%, rgba(249, 115, 22, 0.16), transparent 60%),
    radial-gradient(55% 40% at 85% 10%, rgba(234, 88, 12, 0.10), transparent 60%),
    radial-gradient(50% 45% at 60% 100%, rgba(217, 119, 6, 0.07), transparent 65%),
    linear-gradient(180deg, #241f18 0%, var(--bg) 45%, var(--bg-deep) 100%);
}
.grid-veil {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(245, 241, 234, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 241, 234, 0.02) 1px, transparent 1px);
  background-size: 64px 64px;
}

/* =========================================
   LAYOUT
   ========================================= */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 2.5rem); }
.section { padding: clamp(4.5rem, 10vw, 7.5rem) 0; }

.section-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}
.section-head .ic { color: var(--accent); width: 0.85em; height: 0.85em; }
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--brd), transparent);
  margin-left: 0.8rem;
}
.section-sub { color: var(--muted); max-width: 62ch; margin-bottom: 2rem; }

.card {
  background: var(--card);
  border: 1px solid var(--brd);
  border-radius: var(--r-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow);
}

/* =========================================
   BUTTONS / TAGS
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--brd);
  font: 500 0.95rem 'Inter', sans-serif;
  white-space: nowrap;
  cursor: pointer;
  color: var(--text);
  background: var(--card-hi);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
              border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); border-color: var(--brd-hi); background: var(--surface-hi); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: transparent;
  color: #1a0e05;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.28);
}
.btn--primary:hover { background: linear-gradient(135deg, var(--accent-soft), var(--accent)); box-shadow: 0 12px 30px rgba(249, 115, 22, 0.38); }
.btn--sm { padding: 0.5rem 0.95rem; font-size: 0.82rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.tag {
  font-size: 0.85rem;
  padding: 0.42rem 0.9rem;
  border-radius: var(--r-pill);
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--brd);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.tag--link { display: inline-flex; align-items: center; gap: 0.45rem; }
.tag--link .ic { color: var(--accent); }
.tag:hover, .tag--link:hover { color: var(--accent-soft); border-color: var(--accent); background: rgba(249, 115, 22, 0.08); }

/* =========================================
   NAVIGATION (solid translucent pill, no blur)
   ========================================= */
.nav {
  position: fixed;
  top: clamp(0.7rem, 2vw, 1.25rem);
  left: 0; right: 0;
  z-index: 900;
  display: flex;
  justify-content: center;
  padding: 0 1rem;
  pointer-events: none;
}
.nav__shell {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 1.6vw, 1.2rem);
  width: 100%;
  max-width: var(--maxw);
  padding: 0.6rem 0.7rem 0.6rem 1.1rem;
  border-radius: var(--r-pill);
  background: rgba(7, 11, 20, 0.88);
  border: 1px solid var(--brd);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: padding 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.scrolled .nav__shell { background: rgba(5, 8, 15, 0.96); }
.nav__logo { margin-right: auto; }
.nav__logo-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1a0e05;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
}
.nav__links { display: flex; align-items: center; gap: 0.2rem; }
.nav__link {
  padding: 0.5rem 0.8rem;
  border-radius: var(--r-pill);
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav__link:hover { color: var(--text); background: var(--card-hi); }
.nav__link.is-active { color: var(--accent-soft); background: rgba(249, 115, 22, 0.10); }
.nav__cta { padding: 0.55rem 1.15rem; }
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 42px; height: 42px;
  align-items: center;
  justify-content: center;
  background: var(--card-hi);
  border: 1px solid var(--brd);
  border-radius: 12px;
  cursor: pointer;
}
.nav__toggle span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================
   HERO
   ========================================= */
.hero { padding: clamp(8.5rem, 18vh, 11rem) 0 clamp(4rem, 9vw, 6rem); }
.hero__inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 4.5rem);
}
.eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--accent-soft);
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: var(--r-pill);
  background: rgba(249, 115, 22, 0.06);
  margin-bottom: 1.1rem;
}
.hero__name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  background: linear-gradient(180deg, #fffaf3 30%, #d6cabb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__role {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: var(--accent-soft);
  min-height: 1.6em;
  margin-top: 0.6rem;
  display: flex;
  align-items: center;
}
.caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 3px; background: var(--accent); animation: blink 1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.8rem; }
.hero__meta { margin-top: 1.8rem; color: var(--muted); font-size: 0.9rem; display: flex; align-items: center; gap: 0.55rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }

/* Floating MS card — transform-only animation */
.hero__art { display: grid; place-items: center; }
.float-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: clamp(200px, 24vw, 280px);
  aspect-ratio: 1 / 1.12;
  border-radius: 34px;
  background: linear-gradient(160deg, #2a241d 0%, #1a1713 100%);
  border: 1px solid rgba(249, 115, 22, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(249, 115, 22, 0.12);
  animation: float 7s var(--ease) infinite alternate;
}
@keyframes float {
  from { transform: translate3d(0, -6px, 0); }
  to   { transform: translate3d(0, 10px, 0); }
}
.float-card__mark {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(3.4rem, 7vw, 5rem);
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.float-card__sub { font-family: 'Roboto Mono', monospace; font-size: 0.82rem; color: var(--muted); letter-spacing: 0.08em; }

/* =========================================
   ABOUT
   ========================================= */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.lead { color: var(--muted); font-size: 1.08rem; max-width: 56ch; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
.stat { padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: 0.1rem; }
.stat__num { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.6rem; color: var(--accent-soft); }
.stat__lbl { font-size: 0.8rem; color: var(--muted); }

/* =========================================
   SKILLS
   ========================================= */
.skill-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.skill-col { padding: 1.3rem 1.4rem; }
.skill-col__title {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.98rem; font-weight: 600;
  margin-bottom: 0.9rem;
}
.skill-col__title .ic { color: var(--accent); }

/* =========================================
   PROJECTS
   ========================================= */
.proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.proj { padding: 1.5rem 1.6rem; display: flex; flex-direction: column; gap: 0.55rem; transition: transform 0.25s var(--ease), border-color 0.25s var(--ease); }
.proj:hover { transform: translateY(-4px); border-color: rgba(249, 115, 22, 0.45); }
.proj__icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: rgba(249, 115, 22, 0.1); color: var(--accent); font-size: 1.25rem; }
.proj__title { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; font-weight: 600; }
.proj__text { color: var(--muted); font-size: 0.92rem; }
.proj__link { color: var(--accent-soft); font-size: 0.88rem; margin-top: 0.3rem; }

/* =========================================
   UTILITIES
   ========================================= */
.utils { display: flex; flex-direction: column; gap: 0.7rem; }
.util-line {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1.1rem;
}
.util-line > .ic { color: var(--accent); font-size: 1rem; }
.util-line__info { flex-shrink: 0; display: flex; flex-direction: column; gap: 0.05rem; }
.util-line__name { font-size: 0.9rem; font-weight: 500; white-space: nowrap; }
.util-line__sub { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.util-line__val {
  flex: 1;
  min-width: 0;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.74rem;
  color: var(--muted-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
  border-top: 1px solid var(--brd);
  background: rgba(4, 6, 12, 0.6);
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.4rem clamp(1.25rem, 5vw, 2.5rem);
  color: var(--muted);
  font-size: 0.88rem;
}
.footer__links { display: inline-flex; align-items: center; gap: 1.1rem; }
.footer__links a { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); transition: color 0.2s var(--ease); }
.footer__links a:hover { color: var(--accent-soft); }

/* =========================================
   REVEAL (IntersectionObserver toggles .visible;
   transform/opacity only — never filter/blur)
   ========================================= */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].visible { opacity: 1; transform: none; }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .float-card { width: clamp(160px, 40vw, 220px); }
  .about-grid { grid-template-columns: 1fr; }
  .skill-cols { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav__cta { display: none; }
  .nav__toggle { display: flex; }

  .nav__links {
    position: absolute;
    top: calc(100% + 0.7rem);
    left: 0.5rem;
    right: 0.5rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.7rem;
    border-radius: 22px;
    background: rgba(7, 11, 20, 0.98);
    border: 1px solid var(--brd);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s linear;
    pointer-events: none;
  }
  .nav__links.open { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s; }
  .nav__link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.95rem 1.05rem;
    border-radius: 14px;
    font-size: 1rem;
    color: var(--text);
  }
  .nav__link:hover, .nav__link.is-active { background: rgba(249, 115, 22, 0.12); color: var(--accent-soft); }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .util-line { flex-wrap: wrap; }
  .util-line__val { order: 5; flex-basis: 100%; white-space: normal; }
  .footer__inner { flex-direction: column; text-align: center; }
  .hero__actions .btn { flex: 1; justify-content: center; }
}

/* =========================================
   ACCESSIBILITY
   ========================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .caret { animation: none; }
}

/* =========================================
   PRINT / PDF (Lebenslauf-Export, genau eine A4-Seite)
   Eigene Schicht: warmes Papier, Nacht-Text, Glut-Akzente
   (brand/BRAND.md). CV-Fluss: Kopf -> Kontakt -> About -> Skills ->
   Projects (Reihenfolge nur hier per flex-order, Kontakt blocknah am
   Kopf). Farb-Pitfalls: color-scheme light verhindert den dunklen
   Seitenrand des Dark-Mode-Canvas; minmax(0,1fr)/min-width:0 verhindert
   Rechtsabschneider durch Grid-Min-Content; der Name verliert sein
   Screen-Gradient (sonst weiss-auf-weiss). Der Bildschirmauftritt ist
   von diesem Block nicht beruehrt.
   ========================================= */
@media print {
  @page { size: A4; margin: 12mm 13mm; }
  :root {
    color-scheme: light;
    --text: #1c1b18; --muted: #57503f; --muted-dim: #6f6754;
    --accent: #c2410c; --accent-soft: #9a3412; --accent-deep: #7c2d12;
    --brd: #d8d0bf; --brd-hi: #c9bfa9;
  }
  html, body { background: #fff !important; color: #1c1b18; font-size: 10.4pt; line-height: 1.5; width: 100%; overflow: visible; }
  .backdrop, .grid-veil, .nav, .skip-link, .hero__art, .caret, .hero__actions, #utilities { display: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after { box-shadow: none !important; text-shadow: none !important; animation: none !important; transition: none !important; min-width: 0; }

  /* CV-Reihenfolge im Druck: Kontakt direkt unter dem Kopf */
  main { display: flex; flex-direction: column; }
  #home { order: 1; } #contact { order: 2; } #about { order: 3; } #skills { order: 4; } #projects { order: 5; }

  .container, .hero__inner { max-width: none; width: 100%; padding: 0; }
  .hero { padding: 0; }
  .hero__inner { display: block; }
  .eyebrow { font-size: 8.6pt; letter-spacing: .05em; padding: .8mm 2.8mm; margin-bottom: 2.4mm; color: var(--accent); border: 1px solid rgba(194, 65, 12, .38); background: #fff; }
  .hero__name {
    font-size: 26pt; line-height: 1.06; margin: 0;
    background: none; -webkit-background-clip: border-box; background-clip: border-box;
    -webkit-text-fill-color: #1c1b18; color: #1c1b18;
  }
  .hero__role { font-size: 11.5pt; color: var(--accent); min-height: 0; margin-top: 1.2mm; }
  .hero__meta { margin-top: 1.8mm; font-size: 9pt; color: var(--muted); }
  .dot { width: 6px; height: 6px; }

  .section { padding: 6mm 0 0; }
  .section-head { font-size: 12.5pt; gap: .45rem; margin-bottom: 2.2mm; padding-bottom: 1mm; border-bottom: 1.5px solid var(--accent-deep); }
  .section-head::after { display: none; }
  .section-sub { font-size: 9.2pt; margin-bottom: 2.6mm; max-width: none; }

  .about-grid { grid-template-columns: 1fr; gap: 2.5mm; }
  .lead { font-size: 10.2pt; line-height: 1.55; max-width: none; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5mm; }
  .stat { padding: 2.6mm 3mm; gap: 0; border-radius: 12px; }
  .stat__num { font-size: 14pt; color: var(--accent); }
  .stat__lbl { font-size: 8pt; }

  .skill-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5mm; }
  .skill-col { padding: 3mm 3.4mm; border-radius: 12px; }
  .skill-col__title { font-size: 10pt; margin-bottom: 2mm; }
  .chips { gap: 1.8mm; }
  .tag { font-size: 8.7pt; padding: 1.1mm 2.9mm; }

  .proj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5mm; }
  .proj { padding: 3mm 3.4mm; gap: 1.4mm; border-radius: 12px; flex-direction: row; flex-wrap: wrap; }
  .proj__icon { width: 8mm; height: 8mm; border-radius: 9px; font-size: 1.05rem; }
  .proj__title { font-size: 10.2pt; }
  .proj__text { font-size: 9.2pt; flex-basis: 100%; }
  .proj__link { font-size: 8.8pt; margin-top: auto; }

  .tag--link { font-size: 9.2pt; padding: 1.3mm 3.4mm; }

  .card { background: #fff !important; border: 1px solid var(--brd) !important; }
  .stat, .skill-col, .proj, .section-head, .chips, .hero__text { break-inside: avoid; }
  a { color: #1c1b18; text-decoration: none; }
  .tag { border: 1px solid var(--brd); background: #fff; color: #1c1b18; }

  .footer { border-top: 1px solid var(--brd); background: #fff; margin-top: 6mm; padding-top: 2mm; }
  .footer__inner { max-width: none; padding: 0; font-size: 8.5pt; }
  .footer .ic { display: none; }
}
