/* ===================== THEME VARIABLES ===================== */
:root {
  --teal: #00919f;
  --teal-dark: #007782;
  --green: #00919f;   /* Akzentfarbe für Linien, Rahmen, Mail-Button */
  --radius: 18px;
  --maxw: 1180px;

  --bg: #ffffff;
  --text: #1c2733;
  --muted: #5a6b78;
  --card: #d6d9db;
  --card-2: #92ced3;   /* innere Kästen & aufgeklappte Bereiche im Hell-Modus */
  --header-bg: #ffffff;
  --border: #b9c2c6;
  --footer-bg: #17a2a8;
  --footer-text: #ffffff;
}

:root[data-theme="dark"] {
  --bg: #1b1b1b;
  --text: #e9edf0;
  --muted: #b7c0c6;
  --card: #2a2a2a;
  --card-2: #08444a;
  --header-bg: #141414;
  --border: #3a3a3a;
  --footer-bg: #17a2a8;
  --footer-text: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1b1b; --text: #e9edf0; --muted: #b7c0c6;
    --card: #2a2a2a; --card-2: #08444a; --header-bg: #141414; --border: #3a3a3a;
  }
}

/* ===================== BASE ===================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.container { width: min(100% - 2rem, var(--maxw)); margin-inline: auto; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 2rem);
  margin-bottom: 2.5rem;
  border: 1px solid var(--teal);   /* Kontur in #00919f – hell wie dunkel */
}

/* Sprungziel des Logo-Links (#top): ganz nach oben, nicht hinter den Header */
#top { scroll-margin-top: 120px; }

/* ===================== HEADER ===================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  border-bottom: 2px solid var(--green);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 0;
}
.logo { text-decoration: none; display: grid; line-height: 1.05; }
.logo-img { height: clamp(28px, 5vw, 40px); width: auto; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
.logo-sub { font-size: .7rem; letter-spacing: .12em; color: var(--muted); margin-top: 2px; }

.main-nav { margin-left: auto; display: flex; gap: 1.5rem; }
.main-nav a { text-decoration: none; color: var(--muted); }
.main-nav a:hover { color: var(--teal); }

.header-actions { display: flex; gap: .5rem; align-items: center; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--green); background: transparent; color: var(--text);
  cursor: pointer; font-size: 1rem;
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--green); color: #fff; }

/* Hell-/Dunkel-Umschalter als Slider: Sonne links, Mond rechts,
   der farbige Knopf wandert unter das aktive Symbol. */
.theme-switch {
  width: 64px; height: 40px; padding: 0; border-radius: 999px;
  border: 2px solid var(--green); background: transparent;
  cursor: pointer; display: inline-flex; align-items: center;
  flex: 0 0 auto;
}
.ts-track { position: relative; display: block; width: 100%; height: 100%; }
.ts-ico {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px;                        /* = Knopfgröße: Icon-Mitte = Knopf-Mitte */
  display: flex; align-items: center; justify-content: center;
  z-index: 2; font-size: .9rem; line-height: 1; pointer-events: none;
  transition: color .25s ease;
}
.ts-sun  { left: 3px;  color: #fff; }              /* hell: aktiv, auf dem Knopf */
.ts-moon { right: 3px; color: var(--muted); }      /* hell: inaktiv */
:root[data-theme="dark"] .ts-sun  { color: var(--muted); }
:root[data-theme="dark"] .ts-moon { color: #fff; }
.ts-knob {
  position: absolute; top: 50%; left: 3px; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--green); z-index: 1;
  transition: left .25s ease;
}
:root[data-theme="dark"] .ts-knob { left: calc(100% - 31px); }
.theme-switch:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.burger { display: none; }

/* ===================== HERO ===================== */
.hero {
  display: grid; grid-template-columns: 5fr 6fr; gap: 1.5rem;
  align-items: start; padding-top: 2rem;
}
.hero-image { margin: 0; }
.hero-image picture { display: block; }
.hero-image img { border-radius: 6px; width: 100%; height: auto; }
/* Im Hell-Modus hebt sich das Bild per Schlagschatten vom weißen Hintergrund ab */
:root[data-theme="light"] .hero-image img {
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}
.profile-card { margin: 0; }
.profile-name { margin: 0 0 .3rem; font-size: 1.5rem; }
.profile-role { margin: 0 0 .5rem; color: var(--muted); }
.profile-tagline {
  margin: 0 0 1rem; font-family: Georgia, "Times New Roman", serif;
  font-style: italic; font-size: 1.05rem; color: var(--teal);
}
.profile-desc { font-weight: 600; margin: 0 0 1.5rem; }
.btn {
  display: inline-block; background: var(--green); color: #fff;
  text-decoration: none; padding: .7rem 1.6rem; border-radius: 10px; font-weight: 600;
}
.btn:hover { filter: brightness(1.08); }

/* Kontakt-Hinweis (handgezeichnete Nachricht + Pfeil neben dem Button) */
.profile-card { position: relative; }
/* Rechts Platz reservieren, damit der Text nicht unter den Hinweis läuft */
@media (min-width: 561px) { .profile-card { padding-right: 190px; } }
.contact-hint {
  position: absolute; right: 1rem; bottom: 1rem;
  width: 210px; max-width: 46%; height: 185px; pointer-events: none;
}
/* Nachricht: oben rechts, nach rechts gekippt */
.hint-msg-wrap { position: absolute; top: 0; right: 0; width: 82%; }
.hint-msg { width: 100%; height: auto; transform: rotate(8deg); transform-origin: center; }
/* Pfeil: unten links – diagonal zwischen Button und Nachricht (mit Abstand),
   leicht nach rechts gekippt, Spitze zeigt hoch zum Text */
.hint-arrow-wrap {
  position: absolute; left: 0; bottom: 2.5rem; width: 52%;
  transform: rotate(9deg); transform-origin: left bottom;
}
.hint-arrow { width: 100%; height: auto; }

/* Sichtbarkeit: Pfeil/Nachricht je nach Hell/Dunkel und Sprache */
.hint-msg, .hint-arrow { display: block; }
/* Höhere Spezifität (zwei Klassen), damit ein einfaches .hint-msg {display:block}
   – auch aus Media-Queries – die Hell/Dunkel-Umschaltung nicht überschreibt. */
.hint-msg.only-dark, .hint-arrow.only-dark { display: none; }
:root[data-theme="dark"] .hint-msg.only-light,
:root[data-theme="dark"] .hint-arrow.only-light { display: none; }
:root[data-theme="dark"] .hint-msg.only-dark,
:root[data-theme="dark"] .hint-arrow.only-dark { display: block; }
:root[lang="en"] .hint-msg.msg-de { display: none; }
:root[lang="de"] .hint-msg.msg-en { display: none; }

/* Auf schmalen Screens: Nachricht unter den Button, Pfeil ausblenden */
@media (max-width: 560px) {
  .profile-card { padding-right: clamp(1rem, 3vw, 2rem); }
  .contact-hint {
    position: static; width: 100%; max-width: none; height: auto;
    margin: 1.2rem 0 0;
  }
  .hint-msg-wrap { position: static; display: block; width: 175px; margin: 0 8px 0 auto; }
  .hint-msg { width: 175px; transform: rotate(5deg); }
  .hint-arrow-wrap { display: none; }
}

/* ===================== SECTION TITLES ===================== */
.section-title {
  font-size: clamp(1.3rem, 3vw, 1.7rem); margin: 1rem 0;
  display: flex; align-items: center; gap: 1rem;
}
.section-title::after {
  content: ""; flex: 1; height: 0;
  border-top: 3px dotted var(--teal);
}

/* ===================== SERVICES ===================== */
/* Mobil: 2 Kacheln nebeneinander, Desktop: 3.
   Größerer Zeilenabstand (row-gap) für mehr Luft pro Reihe, Spaltenabstand bleibt schmal.
   align-items: stretch, damit alle Kacheln einer Reihe gleich hoch sind. */
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.75rem 1rem; text-align: center; align-items: stretch; }
.service { display: flex; flex-direction: column; }
@media (min-width: 720px) { .service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.service h3 {
  margin: 0 0 .2rem; line-height: 1.2;
  hyphens: auto; overflow-wrap: break-word;
}
.service-sub {
  color: var(--muted); margin: 0 0 1rem; font-size: .9rem; line-height: 1.35;
  hyphens: auto; overflow-wrap: break-word;
}
.service-icon {
  display: block; height: 150px; width: auto; max-width: 100%;
  object-fit: contain; margin: auto auto 1rem;   /* margin-top:auto → Icon unten verankert */
  transition: filter .3s ease, transform .2s ease; cursor: pointer;
}
/* Wenn ein Bereich offen ist: andere Icons petrol-tönen, aktives bleibt farbig */
.service-grid.has-open .service-icon {
  filter: grayscale(1) sepia(1) hue-rotate(150deg) saturate(2.2) brightness(.9) opacity(.7);
}
.service-grid.has-open .service.active .service-icon { filter: none; }

/* Kurzes Wackeln des angeklickten Icons */
@keyframes icon-wobble {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(6deg); }
  60% { transform: rotate(-4deg); }
  80% { transform: rotate(2deg); }
}
.service-icon.wobble { animation: icon-wobble .5s ease; }

@media (prefers-reduced-motion: reduce) {
  .service-icon.wobble { animation: none; }
}
.more {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  align-self: center;
  color: var(--text); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
  background: none; border: 1px solid var(--border); border-radius: 999px;
  padding: .3rem .8rem; transition: color .2s, border-color .2s, background .2s;
}
.more:hover { color: var(--teal); border-color: var(--teal); }
.more[aria-expanded="true"] { color: var(--teal); border-color: var(--teal); }
/* Chevron: zeigt nach rechts, dreht beim Öffnen nach unten */
.chev {
  width: .48em; height: .48em; display: inline-block;
  border: solid currentColor; border-width: 2px 2px 0 0;
  transform: rotate(45deg); transition: transform .3s ease; margin-left: -.1em;
}
.more[aria-expanded="true"] .chev { transform: rotate(135deg); }

/* Aufklappbares Panel: volle Grid-Breite, direkt unter der Icon-Zeile.
   Standardmäßig ausgeblendet; JS setzt display + Position + Pfeil. */
.panel {
  grid-column: 1 / -1;
  display: none;                 /* JS schaltet auf display:grid */
  grid-template-rows: 0fr;
  transition: grid-template-rows .38s ease, margin .38s ease;
  margin: 0;
  position: relative;
  text-align: left;
  --arrow-x: 50%;
}
.panel.showing { display: grid; }         /* im Layout, aber noch zu */
.panel.open { grid-template-rows: 1fr; margin: 1.2rem 0 .4rem; }
.panel-inner {
  overflow: hidden;
  background: var(--card-2); border-radius: 10px;
  padding: 0 1.2rem; transition: padding .38s ease;
}
.panel.open .panel-inner { padding: 1.2rem; }
.panel-text { margin: 1rem 0 0; }
.panel-text p { margin: 0 0 .8rem; }
.panel-text p:last-child { margin-bottom: 0; }
.panel-text a { color: var(--teal); font-weight: 600; }
/* Anker-Ziele: Abstand wegen des sticky Headers */
.section-title { scroll-margin-top: 90px; }
.more[aria-expanded="true"] { color: var(--teal); }

/* Pfeil unter dem angeklickten Icon */
.panel::before {
  content: ""; position: absolute; top: -11px; left: var(--arrow-x);
  transform: translateX(-50%);
  border: 12px solid transparent; border-top: 0;
  border-bottom-color: var(--card-2);
  opacity: 0; transition: opacity .25s ease .1s;
}
.panel.open::before { opacity: 1; }

/* Horizontal scrollbare Galerie */
.gallery {
  display: flex; gap: 1rem; overflow-x: auto;
  padding-bottom: .6rem; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.gallery > * { scroll-snap-align: start; }
.gallery picture { flex: 0 0 auto; display: block; }
.gallery img { height: 180px; width: auto; border-radius: 4px; display: block; }

/* Bild-Platzhalter (bis echte Bilder da sind) */
.ph {
  flex: 0 0 auto; width: 240px; height: 180px; border-radius: 4px;
  background: repeating-linear-gradient(45deg, var(--card), var(--card) 12px, var(--border) 12px, var(--border) 24px);
  display: grid; place-items: center; color: var(--muted);
  font-size: .85rem; border: 1px solid var(--border);
}

/* ===================== LIGHTBOX ===================== */
.gallery img { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, .85); padding: 2rem;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
}
.lightbox.open { opacity: 1; visibility: visible; pointer-events: auto; }
.lb-img {
  max-width: 90vw; max-height: 85vh; border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5); background: #fff;
  transform: scale(.94); transition: transform .25s ease;
  touch-action: pan-y;
}
.lightbox.open .lb-img { transform: scale(1); }
@media (prefers-reduced-motion: reduce) {
  .lightbox, .lb-img { transition: none; }
}
.lb-close, .lb-nav {
  position: absolute; background: rgba(255, 255, 255, .15); border: 0;
  color: #fff; cursor: pointer; display: grid; place-items: center;
  border-radius: 50%; line-height: 1; transition: background .2s;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .35); }
.lb-close { top: 1rem; right: 1.2rem; width: 46px; height: 46px; font-size: 1.8rem; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 2rem; }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lb-counter {
  position: absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: .9rem; background: rgba(0, 0, 0, .5);
  padding: .25rem .8rem; border-radius: 999px;
}
@media (max-width: 560px) {
  .lb-nav { width: 44px; height: 44px; font-size: 1.7rem; }
  .lb-close { width: 42px; height: 42px; }
}

/* ===================== SKILLS ===================== */
.skills-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.skill-box { background: var(--card-2); border-radius: 12px; padding: 1rem 1.2rem; }
:root[data-theme="dark"] .skill-box { background: #08444a; }
.skill-box h3 { margin: 0 0 .5rem; }
.skill-box ul { margin: 0; padding-left: 1.1rem; }
.skill-box li { margin: .15rem 0; }

/* ===================== ÜBER MICH ===================== */
/* Bild rechts floaten – der Text umfließt es, sodass keine Lücke entsteht */
.about-grid::after { content: ""; display: block; clear: both; }
.about-image {
  float: right; width: 40%; max-width: 320px;
  margin: 0 0 1rem 2rem;
}
.about-image picture { display: block; }
.about-image img { border-radius: 10px; width: 100%; height: auto; }
.about-text p { margin: 0 0 1rem; }
.about-text p:last-child { margin-bottom: 0; }
@media (max-width: 620px) {
  /* Auf schmalen Screens Bild oben, volle Breite, Text darunter */
  .about-image { float: none; width: 100%; max-width: 360px; margin: 0 auto 1.5rem; }
}

/* ===================== UND SONST SO ===================== */
.hobbies p { margin: 0 0 1rem; }
.hobbies p:last-child { margin-bottom: 0; }

/* ===================== RECHTSSEITEN (Datenschutz/Impressum) ===================== */
.legal { margin-top: 2rem; max-width: 820px; }
.legal h1 { margin: .3rem 0 1.2rem; }
.legal h2 { margin: 2rem 0 .6rem; color: var(--teal); }
.legal h3 { margin: 1.4rem 0 .4rem; }
.legal p { margin: 0 0 1rem; }
.legal a { color: var(--teal); }
.back-link { display: inline-block; margin-bottom: 1rem; text-decoration: none; color: var(--muted); }
.back-link:hover { color: var(--teal); }
.legal a.back-btn { color: #fff; margin-bottom: 1.5rem; }
.legal-note { font-size: .9rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 1rem; }

/* ===================== FOOTER ===================== */
.site-footer { background: var(--footer-bg); color: var(--footer-text); margin-top: 2rem; }
.footer-inner {
  display: grid; grid-template-columns: 2fr 1fr; gap: 2rem;
  padding: 2.5rem 0; font-size: .9rem;
}
.site-footer a { color: #fff; }

/* Social-/Link-Icons oberhalb der Footer-Infos */
.footer-social {
  display: flex; gap: .9rem; flex-wrap: wrap; justify-content: center;
  padding: 2rem 0 .5rem;
}
.footer-social a {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .15); color: #fff;
  transition: background .2s ease, transform .2s ease;
}
.footer-social a:hover { background: rgba(255, 255, 255, .32); transform: translateY(-3px); }
.footer-social svg { width: 22px; height: 22px; fill: currentColor; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Nav klappt in den Burger, sobald die 5 Punkte eng werden */
@media (max-width: 860px) {
  .main-nav {
    display: none; position: absolute; top: 100%; right: 0; left: 0;
    background: var(--header-bg); flex-direction: column; gap: 0;
    padding: .5rem 1rem; border-bottom: 2px solid var(--green);
  }
  .main-nav a { padding: .7rem 0; }
  .main-nav.open { display: flex; }
  .burger { display: grid; }
}
@media (max-width: 620px) {
  .skills-grid { grid-template-columns: 1fr; }
  /* Footer: Kontakt-Block über die Adresse legen */
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-inner > div:last-child { order: -1; }
}
