/* ---------- Design Tokens ---------- */
:root {
  --accent: #c5855b;        /* warmes Karamell-Braun */
  --accent-dark: #a3613a;
  --ink: #2a2420;           /* dunkles, grau-getöntes Braun */
  --body: #564b43;
  --muted: #897e74;
  --line: #e7e1da;
  --bg: #fdfcfa;
  --bg-soft: #f5f2ee;
  --bg-hero: #f6ead9;       /* warmer Hintergrund für den Hero-Bereich */
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 10px 30px -12px rgba(74, 47, 28, 0.22);
  --maxw: 1080px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--ink); line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.5rem; }

/* ---------- Barrierefreiheit ---------- */
/* Sichtbarer Fokusrahmen für Tastatur-Nutzer:innen */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Maus-Klicks zeigen keinen Rahmen, Tastatur schon */
:focus:not(:focus-visible) { outline: none; }

/* Skip-Link: springt mit Tab als Erstes zum Inhalt */
.skip-link {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
  background: var(--accent); color: #fff; font-weight: 600; z-index: 100;
}
.skip-link:focus {
  position: fixed; top: 0; left: 1rem; width: auto; height: auto;
  overflow: visible; clip: auto;
  padding: 0.7rem 1.2rem; border-radius: 0 0 var(--radius) var(--radius);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 8px 20px -8px rgba(42, 36, 32, 0.45); }
.btn-primary:hover { background: #3c322a; }
.btn-ghost { background: rgba(197, 133, 91, 0.15); color: var(--ink); border-color: rgba(197, 133, 91, 0.3); }
.btn-ghost:hover { background: rgba(197, 133, 91, 0.25); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: inline-flex; flex-direction: column; line-height: 1.15; }
.logo-name { font-size: 1.3rem; font-weight: 600; letter-spacing: 0.14em; color: var(--ink); }
.logo-tag { font-size: 0.72rem; letter-spacing: 0.02em; color: var(--accent-dark); margin-top: 2px; }
.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  position: relative;
  color: var(--body); font-weight: 500; font-size: 0.97rem;
  transition: color 0.15s ease;
}
/* Animierte Unterstreichung beim Hover/Fokus (nicht beim CTA-Button) */
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-links a:not(.nav-cta):hover,
.nav-links a:not(.nav-cta):focus-visible { color: var(--ink); }
.nav-links a:not(.nav-cta):hover::after,
.nav-links a:not(.nav-cta):focus-visible::after { transform: scaleX(1); }

.nav-cta {
  background: var(--accent); color: #fff !important;
  padding: 0.55rem 1.2rem; border-radius: 999px;
  transition: background 0.2s ease;
}
.nav-cta:hover { background: var(--accent-dark); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; align-items: center; justify-content: center; /* WCAG-Touch-Ziel */
}
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: 0.25s 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 { background: var(--bg-hero); }
.hero .container { padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 7vw, 5.5rem); }
.hero h1 { max-width: 760px; }
.about-section { background: var(--bg-hero); }
.eyebrow {
  display: inline-block; color: var(--accent); font-weight: 600;
  font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 1rem;
}
.lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); max-width: 620px; color: var(--body); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 5rem); }
.section-head { max-width: 600px; margin-bottom: 2.5rem; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.card {
  background: #f1e1cb; border: 1px solid #e6d2b6;
  border-radius: var(--radius-lg); padding: 1.8rem;
}
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 12px;
  background: rgba(197, 133, 91, 0.15); color: var(--accent-dark);
  font-size: 1.2rem; font-weight: 700; margin-bottom: 1.1rem;
}
.card p { margin: 0; font-size: 0.97rem; }
.card .card-tech { margin: 0.9rem 0 0; font-size: 0.8rem; color: #5c3d29; font-weight: 500; }

/* ---------- Volle-Breite-Band ---------- */
.band { background: var(--bg-hero); }

/* ---------- Typische Projekte ---------- */
.project-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.9rem 2rem; list-style: none; padding: 0; margin: 0;
}
.project-list li {
  display: flex; gap: 0.75rem; align-items: baseline;
  font-size: 1rem; color: var(--body);
}
.project-list li::before { content: "→"; color: var(--accent-dark); font-weight: 700; flex: none; }

/* ---------- So arbeite ich (Prozess) ---------- */
.process {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.8rem; list-style: none; padding: 0; margin: 0; counter-reset: step;
}
.process li { counter-increment: step; }
.process li::before {
  content: counter(step); display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff;
  font-weight: 700; font-size: 1rem; margin-bottom: 0.9rem;
}
.process h3 { font-size: 1.05rem; margin: 0 0 0.3rem; }
.process p { margin: 0; font-size: 0.95rem; color: var(--body); }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.35fr 1fr; gap: 2.5rem; align-items: start; }
.about-side { display: grid; gap: 1.5rem; }
.about-card {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 0.4rem 1.6rem;
}
.stat { display: flex; flex-direction: column; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.stat:last-child { border-bottom: 0; }
.stat-num { font-size: 1.3rem; font-weight: 700; line-height: 1.25; color: var(--accent-dark); }
.stat-label { font-size: 0.92rem; color: var(--muted); }

/* ---------- Contact ---------- */
#kontakt .section-head { margin-bottom: 1.25rem; }
#kontakt .section-head p + p { margin-top: 1rem; }
.contact-direct { margin-top: 0; color: var(--muted); }
.contact-direct a { color: var(--accent-dark); font-weight: 600; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; margin-top: 0.6rem; }
.js-copy.is-copied { background: rgba(197, 133, 91, 0.25); border-color: rgba(197, 133, 91, 0.4); }

/* ---------- Rechtsseiten (Impressum / Datenschutz) ---------- */
.legal-main { padding-block: clamp(2.5rem, 6vw, 4rem); }
.legal { max-width: 760px; }
.legal h1 { margin-bottom: 1.5rem; }
.legal h2 { font-size: 1.25rem; margin-top: 2.5rem; }
.legal h3 { font-size: 1.05rem; margin-top: 1.5rem; }
.legal p, .legal li { color: var(--body); }
.legal address { font-style: normal; line-height: 1.8; }
.legal a { color: var(--accent-dark); font-weight: 500; }
.legal a:hover { text-decoration: underline; }
.legal ul { padding-left: 1.2rem; }
.legal .placeholder {
  background: var(--bg-soft); border: 1px dashed var(--accent);
  color: var(--accent-dark); padding: 0.05rem 0.4rem; border-radius: 6px;
  font-weight: 600; font-size: 0.95em;
}
.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--accent-dark); font-weight: 600; margin-bottom: 1.5rem;
}
.back-link:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); margin-top: 0; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; padding-block: 2.2rem 0; color: #c9bcab; font-size: 0.9rem;
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: #ece2d6; }
.footer-links a:hover { color: var(--accent); }
.footer-mail { color: #ece2d6; }
.footer-mail:hover { color: var(--accent); }

/* ---------- Nach-oben-Button ---------- */
.to-top {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--ink); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px -6px rgba(42, 36, 32, 0.5);
  transition: background 0.2s ease;
}
.to-top:hover { background: #3c322a; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.5rem 1.2rem; box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--line); }
  .nav-links li:last-child { border-bottom: 0; }
  /* Große, gut tappbare Menü-Einträge */
  .nav-links a { display: flex; align-items: center; min-height: 48px; }
  /* Unterstreichungs-Animation im mobilen Menü ausblenden */
  .nav-links a:not(.nav-cta)::after { display: none; }
  .nav-cta { justify-content: center; margin-top: 0.7rem; min-height: 48px; }
  .about { grid-template-columns: 1fr; }
}

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

/* ---------- Theme-Umschalter ---------- */
.theme-toggle {
  background: none; border: 0; cursor: pointer; color: var(--body);
  padding: 6px; display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { color: var(--ink); }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }

/* ---------- Code-Fenster (Signatur) ---------- */
.code-window {
  margin-top: 2rem; max-width: 420px;
  border: 1px solid #3a2e24; border-radius: var(--radius); overflow: hidden;
  background: #241d18;
}
.code-bar { display: flex; gap: 7px; padding: 11px 14px; background: #1c1611; }
.code-bar span { width: 11px; height: 11px; border-radius: 50%; background: #4a3f37; }
.code-bar span:first-child { background: #c5855b; }
.code-bar span:nth-child(2) { background: #a3613a; }
.code-body {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.82rem; line-height: 1.65; color: #e8ddd0; white-space: pre;
}
.code-body .c-kw { color: #d49a6f; }
.code-body .c-prop { color: #e8c4a0; }
.code-body .c-str { color: #a7c293; }
.code-body .c-num { color: #d6a96b; }
.stack-window .code-body { white-space: pre-wrap; }
.about-side .code-window { margin-top: 0; max-width: none; }

/* Filter-Schalter für die Stack-Box */
.stack-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.7rem; }
.stack-filter-btn {
  font: inherit; font-size: 0.8rem; font-weight: 500; cursor: pointer;
  padding: 0.3rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--body);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.stack-filter-btn:hover { border-color: var(--accent); }
.stack-filter-btn.is-active { background: var(--accent-dark); color: #fff; border-color: var(--accent-dark); }
.stack-window [data-cat] { transition: opacity 0.2s ease; }
.stack-window [data-cat].is-dimmed { opacity: 0.22; }

/* Klickbare Technologien mit Kurzinfo */
.stack-window .skill {
  font: inherit; background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; vertical-align: baseline;
}
.stack-window .skill:hover,
.stack-window .skill:focus-visible { text-decoration: underline; text-underline-offset: 2px; }
.stack-window .skill.is-selected { text-decoration: underline; text-underline-offset: 2px; }
.skill-info { margin: 0.85rem 0 0; font-size: 0.9rem; color: var(--body); min-height: 1.4em; }

/* Mini-Akkordeon: Was passiert nach Ihrer Anfrage? */
.faq { margin-top: 2.75rem; max-width: 600px; }
.faq-title { font-size: 1.05rem; margin: 0 0 0.6rem; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:first-of-type { border-top: 1px solid var(--line); }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 0.9rem 0;
  font-weight: 500; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent-dark); font-weight: 700; font-size: 1.2rem; line-height: 1; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0 0 0.9rem; color: var(--body); font-size: 0.97rem; }

/* ---------- Footer-Badge ---------- */
.footer-note { text-align: center; color: #9a8c7c; font-size: 0.8rem; margin: 1rem 0 0; padding-bottom: 2.2rem; }

/* ---------- Dark Mode ---------- */
html[data-theme="dark"] {
  --accent: #d49a6f;
  --accent-dark: #c5855b;
  --ink: #f2ebe2;
  --body: #cdbfb0;
  --muted: #9c8d7d;
  --line: #38302a;
  --bg: #1b1613;
  --bg-soft: #241d18;
  --bg-hero: #221b16;
}
html[data-theme="dark"] .site-header { background: rgba(27, 22, 19, 0.82); }
html[data-theme="dark"] .card { background: #2a211a; border-color: #3a2e24; }
html[data-theme="dark"] .card .card-tech { color: #d49a6f; }
html[data-theme="dark"] .site-footer { background: #14100d; }
html[data-theme="dark"] .btn-primary { background: var(--accent); color: #1b1613; box-shadow: none; }
html[data-theme="dark"] .btn-primary:hover { background: #e0a87e; }
html[data-theme="dark"] .nav-cta { color: #1b1613 !important; }
html[data-theme="dark"] .to-top { background: var(--accent); color: #1b1613; }
html[data-theme="dark"] .to-top:hover { background: #e0a87e; }
html[data-theme="dark"] .process li::before { background: var(--accent); color: #1b1613; }

@media (max-width: 760px) {
  html[data-theme="dark"] .nav-links { background: #1b1613; }
}
