/* ==========================================================================
   Portfolio Kevin-Alexander Grewe — Stylesheet
   Design-Tokens laut Handoff-README (pixelgenau)
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  --bg-page: #0a0f0c;
  --bg-panel: #101812;
  --accent: #8ce6aa;
  --accent-hover: #a5f0bd;
  --accent-hover-light: #b8f2cc;
  --text-primary: #e6ede8;
  --text-secondary: #9db3a6;
  --text-body: #c3d2c9;
  --text-dim: #6d8b7c; /* AA-konform: 5.19:1 auf Seite, 4.85:1 auf Karten */
  --border-soft: rgba(140, 230, 170, .15);
  --border-card: rgba(140, 230, 170, .2);
  --border-strong: rgba(140, 230, 170, .35);
  --border-btn: rgba(140, 230, 170, .4);
  --font-mono: 'JetBrains Mono', monospace;
  --font-a11y: 'Atkinson Hyperlegible', Verdana, sans-serif;
  --max-width: 1180px;
  --pad-x: 48px;
}

/* --- Basis -------------------------------------------------------------- */
html { scroll-behavior: smooth; }

/* Anker-Sprünge nicht unter dem sticky Header verstecken */
[id] { scroll-margin-top: 80px; }

::selection {
  background: var(--accent);
  color: var(--bg-page);
}

body {
  margin: 0;
  background: var(--bg-page);
  font-family: var(--font-mono);
  color: var(--text-primary);
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Keyframes ---------------------------------------------------------- */
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes glowPulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* --- Skip-Link ---------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 12px 20px;
  background: var(--accent);
  color: var(--bg-page);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  color: var(--bg-page);
}

/* --- Nur für Screenreader ----------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Header ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px var(--pad-x);
  background: rgba(10, 15, 12, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
}

.logo {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 26px;
  align-items: center;
  font-size: 13px;
}
.site-nav > a {
  color: var(--text-secondary);
  text-decoration: none;
}
.site-nav > a:hover { color: var(--accent); }

/* --- Buttons ------------------------------------------------------------ */
.btn-primary {
  padding: 13px 24px;
  background: var(--accent);
  color: var(--bg-page);
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary:hover { background: var(--accent-hover); color: var(--bg-page); }

.btn-outline {
  padding: 13px 24px;
  border: 1px solid var(--border-btn);
  border-radius: 6px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.btn-outline:hover { background: rgba(140, 230, 170, .12); color: var(--accent); }

.btn-a11y {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  font-size: 12.5px;
}

.btn-github {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.btn-mini {
  padding: 8px 13px;
  min-width: 44px;
  min-height: 40px;
  box-sizing: border-box;
  border: 1px solid var(--border-btn);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.btn-mini:hover { background: rgba(140, 230, 170, .12); }

.btn-link {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}
.btn-link:hover { color: var(--accent); }

/* --- Barrierefreiheits-Panel -------------------------------------------- */
.a11y-panel {
  position: fixed;
  top: 76px;
  right: var(--pad-x);
  z-index: 60;
  width: 300px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .6);
  animation: riseIn .25s ease both;
}
.a11y-panel[hidden] { display: none; }

.a11y-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.a11y-panel__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.a11y-panel__body {
  display: grid;
  gap: 12px;
  font-size: 13px;
}

.a11y-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 11px 14px;
  background: rgba(140, 230, 170, .06);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  box-sizing: border-box;
}
button.a11y-row:hover { border-color: rgba(140, 230, 170, .5); }

.a11y-row--static { cursor: default; }

.a11y-row__state {
  color: var(--accent);
  font-weight: 700;
}

.a11y-font-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.a11y-font-label {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 38px;
  text-align: center;
}

.a11y-reset {
  padding: 10px;
  background: transparent;
  border: 1px dashed rgba(140, 230, 170, .3);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.a11y-reset:hover { color: var(--accent); }

/* --- Hero ---------------------------------------------------------------- */
.hero {
  display: flex;
  gap: 64px;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 96px var(--pad-x) 72px;
  box-sizing: border-box;
}

.hero__text { flex: 1; min-width: 0; }

.hero__terminal {
  font-size: 13px;
  color: var(--text-dim);
}

.cursor {
  display: inline-block;
  width: 9px;
  height: 15px;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1.1s step-end infinite;
}

.hero__kicker {
  margin: 16px 0 0;
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--text-secondary);
}
.hero__kicker strong {
  color: var(--accent);
  font-weight: 700;
}

.hero__title {
  margin: 14px 0 0;
  max-width: 620px;
  font-size: 54px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.02em;
}

.hero__title-accent {
  color: var(--accent);
  text-shadow: 0 0 22px rgba(140, 230, 170, .45);
}

.hero__subtitle {
  margin: 24px 0 0;
  max-width: 620px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
}
.hero__subtitle strong {
  color: var(--accent);
  font-weight: 500;
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 0;
  padding: 9px 16px;
  border: 1px solid var(--border-card);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(140, 230, 170, .05);
}

.hero__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(140, 230, 170, .8);
  animation: glowPulse 2.5s ease-in-out infinite;
}

.hero__actions {
  display: flex;
  gap: 14px;
  margin-top: 28px;
}

/* Gestaffelte Einblendungen */
.rise { animation: riseIn .6s ease both; }
.rise--d1 { animation-delay: .15s; }
.rise--d2 { animation-delay: .3s; }
.rise--d3 { animation-delay: .45s; }

/* Portrait */
.hero__portrait {
  flex: none;
  position: relative;
}

.hero__glow {
  position: absolute;
  inset: -30px;
  background: radial-gradient(circle, rgba(140, 230, 170, .18), transparent 70%);
  animation: glowPulse 4s ease-in-out infinite;
  pointer-events: none;
}

.hero__photo {
  position: relative;
  width: 260px;
  height: 320px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  background: repeating-linear-gradient(45deg, #cfdad3 0 10px, #dde6e0 10px 20px);
}
.hero__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__photo img.img-missing { visibility: hidden; }

.hero__chip {
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  background: var(--bg-page);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 11px;
  color: var(--accent);
  white-space: nowrap;
}

/* --- Skill-Ticker -------------------------------------------------------- */
.ticker {
  overflow: hidden;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 12px 0;
}

.ticker__track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-dim);
  animation: ticker 44s linear infinite;
}

.ticker__group {
  display: flex;
  gap: 44px;
  padding-right: 44px;
}

/* --- Stats-Zeile ---------------------------------------------------------- */
.stats {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px var(--pad-x) 0;
  box-sizing: border-box;
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.stat {
  border: 1px solid var(--border-card);
  border-radius: 10px;
  background: var(--bg-panel);
  padding: 20px 24px;
}

.stat__value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
}
.stat__value--accent { color: var(--accent); }

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

.stat__label {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--text-dim);
}

/* --- Profil ---------------------------------------------------------------- */
.section-title {
  margin: 0 0 20px;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-dim);
}

.profile {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 88px var(--pad-x) 40px;
  box-sizing: border-box;
}

.profile__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: start;
}

.profile__text {
  margin: 0;
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-body);
}
.profile__text--follow { margin-top: 18px; }
.profile__text strong {
  color: var(--accent);
  font-weight: 500;
}

.a11y-note {
  border: 1px solid var(--border-card);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--bg-panel);
  padding: 22px 24px;
}
.a11y-note p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-body);
}
.a11y-note strong {
  color: var(--accent);
  font-weight: 500;
}

/* --- Erfahrung (Timeline) --------------------------------------------------- */
.experience {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px var(--pad-x) 40px;
  box-sizing: border-box;
}

.xp {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--border-soft);
}
.xp:last-of-type { border-bottom: 1px solid var(--border-soft); }

.xp__meta {
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-dim);
}

.xp__role {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.xp__org {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.xp__summary {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.xp__list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.xp__summary + .xp__list { margin-top: 12px; }
.xp__list li {
  position: relative;
  padding-left: 18px;
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-secondary);
}
.xp__list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
}
.xp__list strong {
  color: var(--text-primary);
  font-weight: 700;
}

.experience__cta {
  margin-top: 28px;
}
.experience__cta .btn-outline {
  display: inline-block;
  padding: 12px 20px;
  font-size: 13px;
}

/* --- Stack ------------------------------------------------------------------ */
.stack {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px var(--pad-x) 88px;
  box-sizing: border-box;
}

.stack__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.stack-card {
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 22px 24px;
  background: var(--bg-panel);
  transition: border-color .25s, transform .25s;
}
.stack-card:hover {
  border-color: rgba(140, 230, 170, .55);
  transform: translateY(-3px);
}

.card__tag {
  font-size: 11.5px;
  letter-spacing: .05em;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.stack-card__list {
  margin: 0;
}

.stack-card__item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(140, 230, 170, .12);
}
.stack-card__item:last-child { border-bottom: none; }

.stack-card__item dt {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}
.stack-card__item dd {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-dim);
}

.stack__brands {
  margin: 24px 0 0;
  max-width: 640px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-dim);
}
.stack__brands strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* --- Kontakt-Footer ------------------------------------------------------ */
.contact {
  border-top: 1px solid var(--border-soft);
  padding: 72px var(--pad-x);
}

.contact__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  flex-wrap: wrap;
}

.section-title--contact { margin-bottom: 14px; }

.contact__headline {
  max-width: 480px;
  font-size: 26px;
  line-height: 1.4;
  font-weight: 700;
}

.contact__text {
  margin: 16px 0 0;
  max-width: 440px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.contact__actions {
  display: flex;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.contact__actions .btn-primary,
.contact__actions .btn-outline {
  padding: 12px 20px;
  font-size: 13px;
}

.contact__meta {
  font-size: 12px;
  line-height: 1.9;
  color: var(--text-dim);
}
.contact__meta-link { color: var(--text-dim); }
.contact__meta-link:hover { color: var(--accent); }

.contact__meta-sub { color: var(--text-dim); }

/* --- Impressum ----------------------------------------------------------- */
.imprint {
  border-top: 1px solid var(--border-soft);
  padding: 64px var(--pad-x);
}

.imprint__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title--imprint { margin-bottom: 24px; }

.imprint__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  max-width: 820px;
}

.imprint-card {
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 22px 24px;
  background: var(--bg-panel);
}
.imprint-card .card__tag { margin-bottom: 10px; }

.imprint-card__text {
  margin: 0;
  font-size: 13.5px;
  font-style: normal; /* <address> würde sonst kursiv rendern */
  line-height: 2;
  color: var(--text-body);
}

.imprint__note {
  margin: 20px 0 0;
  max-width: 820px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-dim);
}

.placeholder { color: var(--text-dim); }
.placeholder--dark { color: #3f5648; }

/* --- Datenschutz-Dialog --------------------------------------------------- */
.privacy {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(4, 8, 5, .7);
  backdrop-filter: blur(3px);
}
.privacy[hidden] { display: none; }

.privacy__card {
  width: min(480px, calc(100vw - 48px));
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 30px 32px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
  animation: riseIn .25s ease both;
  box-sizing: border-box;
}

.privacy__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.privacy__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.privacy__text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-body);
}
.privacy__text strong {
  color: var(--accent);
  font-weight: 500;
}

.privacy__hint {
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.privacy__ok {
  margin-top: 22px;
  padding: 11px 22px;
  font-size: 13.5px;
}

/* ==========================================================================
   Barrierefreiheits-Modi (Klassen auf <html>, gesetzt per JS)
   ========================================================================== */

/* Mehr Zeichenabstand */
.a11y-spacing body * {
  letter-spacing: .1em !important;
  word-spacing: .2em !important;
}
.a11y-spacing p,
.a11y-spacing h1,
.a11y-spacing h2,
.a11y-spacing h3 {
  line-height: 2 !important;
}

/* Lesefreundliche Schrift */
.a11y-dysfont body,
.a11y-dysfont body * {
  font-family: var(--font-a11y) !important;
}

/* Hoher Kontrast */
.a11y-contrast body { background: #000 !important; }
.a11y-contrast [data-dim] { color: #e8f2ec !important; }
.a11y-contrast .stat,
.a11y-contrast .stack-card,
.a11y-contrast .a11y-note,
.a11y-contrast .imprint-card,
.a11y-contrast .a11y-panel,
.a11y-contrast .privacy__card {
  background: #000 !important;
  border-color: var(--accent) !important;
}

/* Animationen aus */
.a11y-animoff body *,
.a11y-animoff body {
  animation: none !important;
  transition: none !important;
}
.a11y-animoff [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
}
.a11y-animoff { scroll-behavior: auto; }

/* Fokus-Hervorhebung */
.a11y-focus a:focus,
.a11y-focus button:focus {
  outline: 4px solid var(--accent) !important;
  outline-offset: 4px !important;
  background: rgba(140, 230, 170, .15) !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  :root { --pad-x: 24px; }

  .hero {
    /* Name zuerst, Foto danach — der wichtigste Inhalt gehört über den Fold */
    flex-direction: column;
    align-items: flex-start;
    gap: 56px;
    padding-top: 64px;
    text-align: left;
  }
  .hero__title { font-size: 38px; }
  .hero__portrait { align-self: center; margin-bottom: 8px; }

  .profile__grid,
  .imprint__grid {
    grid-template-columns: 1fr;
  }
  .stats__grid { grid-template-columns: 1fr 1fr; }
  .stack__grid { grid-template-columns: 1fr; }
  .xp { grid-template-columns: 1fr; gap: 12px; }

  .a11y-panel { right: 16px; left: 16px; width: auto; }

  .site-nav { gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 480px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 24px;
  }
  .site-nav { gap: 12px; font-size: 12px; justify-content: flex-start; }
  .btn-a11y { padding: 8px 12px; font-size: 12px; }
  .hero__actions { flex-wrap: wrap; }
}

/* ==========================================================================
   Print (Recruiter drucken gern)
   ========================================================================== */
@media print {
  * {
    background: #fff !important;
    color: #000 !important;
    text-shadow: none !important;
    box-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }

  body { font-size: 12px; }

  /* Interaktives & Dekoratives ausblenden */
  .skip-link,
  .btn-a11y,
  .a11y-panel,
  .privacy,
  .ticker,
  .hero__glow,
  .hero__chip,
  .cursor,
  .hero__terminal,
  .site-nav a { display: none !important; }

  .site-header {
    position: static;
    backdrop-filter: none;
    border-bottom: 1px solid #999;
    padding: 12px 0;
  }

  .hero { padding: 24px 0; gap: 32px; }
  .hero__title { font-size: 28px; }
  .hero__title-accent { color: #000 !important; }
  .hero__status { border-color: #999; }
  .hero__status-dot { background: #000; box-shadow: none; }
  .hero__photo { border-color: #999; }

  /* Reveals sofort sichtbar */
  [data-reveal],
  .rise {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Karten & Trennlinien mit druckbaren Rahmen */
  .stat,
  .stack-card,
  .a11y-note,
  .imprint-card { border: 1px solid #999 !important; break-inside: avoid; }
  .xp { border-color: #ccc; break-inside: avoid; }
  .facts__row,
  .stack-card__item { border-color: #ccc !important; }

  /* Links: URL mit ausgeben (nur echte Ziele) */
  a[href^="http"]::after,
  a[href^="mailto"]::after {
    content: " (" attr(href) ")";
    font-size: 10px;
    color: #555 !important;
  }

  .stats, .profile, .experience, .stack, .contact, .imprint { padding-top: 20px; padding-bottom: 20px; }
}
