/* ==========================================================================
   it.nikomax.de — Stylesheet
   Farbschema folgt der Systemeinstellung und laesst sich manuell umschalten.
   Reihenfolge: Tokens · Reset · Layout · Navigation · Hero · Sektionen ·
                Karten · Technologien · Projekte · Ueber mich · Kontakt · Footer
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */
:root {
  --bg:        #f7f8fa;
  --bg-alt:    #eef1f5;
  --card:      #ffffff;
  --fg:        #0f172a;
  --fg-muted:  #5a6678;
  --line:      #e2e8f0;
  --accent:    #1d00ff;
  --accent-fg: #ffffff;
  --accent-bg: rgba(29, 0, 255, .09);
  --ok:        #15803d;
  --err:       #b91c1c;
  --err-bg:    rgba(185, 28, 28, .08);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow:    0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --radius:    14px;
  --radius-sm: 9px;
  --wrap:      1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0b0f17;
    --bg-alt:    #0f141d;
    --card:      #141b26;
    --fg:        #e6edf7;
    --fg-muted:  #93a2b8;
    --line:      #1f2937;
    --accent:    #8170fa;
    --accent-fg: #0a0620;
    --accent-bg: rgba(129, 112, 250, .16);
    --ok:        #4ade80;
    --err:       #fca5a5;
    --err-bg:    rgba(252, 165, 165, .10);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow:    0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .32);
  }
}

/* Manuelle Umschaltung gewinnt in beide Richtungen. */
:root[data-theme="dark"] {
  --bg: #0b0f17; --bg-alt: #0f141d; --card: #141b26; --fg: #e6edf7; --fg-muted: #93a2b8;
  --line: #1f2937; --accent: #8170fa; --accent-fg: #0a0620; --accent-bg: rgba(129, 112, 250, .16);
  --ok: #4ade80; --err: #fca5a5; --err-bg: rgba(252,165,165,.10);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.32);
}
:root[data-theme="light"] {
  --bg: #f7f8fa; --bg-alt: #eef1f5; --card: #fff; --fg: #0f172a; --fg-muted: #5a6678;
  --line: #e2e8f0; --accent: #1d00ff; --accent-fg: #fff; --accent-bg: rgba(29, 0, 255, .09);
  --ok: #15803d; --err: #b91c1c; --err-bg: rgba(185,28,28,.08);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.06);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 92px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul { list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-fg);
  padding: 10px 18px; border-radius: 0 0 var(--radius-sm) 0; text-decoration: none;
}
.skip:focus { left: 0; }

/* --- Layout --------------------------------------------------------------- */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }

.section { padding: 84px 0; }
.section-alt { background: var(--bg-alt); }

.section-head { max-width: 62ch; margin: 0 auto 46px; text-align: center; }
.section-head h2 {
  font-size: clamp(28px, 3.6vw, 34px);
  letter-spacing: -.028em;
  font-weight: 680;
  line-height: 1.2;
}
.section-head p { color: var(--fg-muted); margin-top: 12px; font-size: 17px; }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 550;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-fg); box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow); }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--fg); }
.btn-ghost:hover { border-color: var(--fg-muted); }
.btn-block { width: 100%; }

/* --- Navigation ----------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; gap: 28px; height: 76px; }

.brand {
  display: flex; align-items: center;
  margin-right: auto;
  text-decoration: none;
}
/* Das Logo bringt eigenen Weissraum mit — der negative Rand holt ihn zurueck,
   damit die Wortmarke optisch buendig mit dem Seitenrand sitzt. */
.brand-logo {
  height: 54px; width: auto;
  margin-left: -14px;
}
.brand:hover .brand-logo { opacity: .8; }

/* Umschaltung hell/dunkel: helle Fassung ist die Vorgabe. */
.brand-logo--dark { display: none; }
@media (prefers-color-scheme: dark) {
  .brand-logo--light { display: none; }
  .brand-logo--dark  { display: block; }
}
:root[data-theme="dark"]  .brand-logo--light { display: none; }
:root[data-theme="dark"]  .brand-logo--dark  { display: block; }
:root[data-theme="light"] .brand-logo--light { display: block; }
:root[data-theme="light"] .brand-logo--dark  { display: none; }

.nav-links { display: flex; gap: 26px; }
.nav-links a { font-size: 14.5px; color: var(--fg-muted); text-decoration: none; }
.nav-links a:hover { color: var(--fg); }

.nav-tools { display: flex; align-items: center; gap: 10px; }
.lang-switch {
  font-size: 12.5px; color: var(--fg-muted); text-decoration: none;
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px;
}
.lang-switch b { color: var(--fg); }
.lang-switch:hover { border-color: var(--fg-muted); }

.theme-toggle {
  background: var(--card); border: 1px solid var(--line); color: var(--fg-muted);
  border-radius: 7px; padding: 5px 11px; font-size: 14px; cursor: pointer; line-height: 1.4;
}
.theme-toggle:hover { color: var(--fg); border-color: var(--fg-muted); }

.btn-nav {
  background: var(--fg); color: var(--bg);
  padding: 8px 16px; border-radius: 8px;
  font-size: 13.5px; font-weight: 540; text-decoration: none;
}

/* --- Hero ----------------------------------------------------------------- */
.hero { padding: 92px 0 72px; text-align: center; }

.badge {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 99px; padding: 7px 16px;
  font-size: 13.5px; color: var(--fg-muted);
  box-shadow: var(--shadow-sm); margin-bottom: 30px;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 {
  font-size: clamp(34px, 5.6vw, 58px);
  line-height: 1.07;
  letter-spacing: -.036em;
  font-weight: 720;
  max-width: 17ch;
  margin-inline: auto;
  text-wrap: balance;
}
.lead {
  color: var(--fg-muted);
  font-size: clamp(17px, 2vw, 19px);
  max-width: 58ch;
  margin: 22px auto 0;
  text-wrap: pretty;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }

.chips { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin-top: 54px; }
.chips li {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 14px;
  font-family: var(--mono); font-size: 12.5px; color: var(--fg-muted);
}

/* --- Karten (Leistungen) -------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .16s ease, border-color .16s ease;
}
.card:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }

.card-icon {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--accent-bg);
  display: grid; place-items: center;
  font-size: 19px; margin-bottom: 17px;
}
.card h3 { font-size: 17.5px; letter-spacing: -.012em; font-weight: 630; margin-bottom: 7px; }
.card > p { color: var(--fg-muted); font-size: 15px; }

.ticks { margin-top: 16px; font-size: 13.8px; color: var(--fg-muted); }
.ticks li { display: flex; gap: 9px; padding: 3.5px 0; }
.ticks li::before { content: "✓"; color: var(--ok); font-weight: 700; flex: none; }

/* --- Technologien --------------------------------------------------------- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px 34px;
}
.skill-group h3 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent); font-weight: 640; margin-bottom: 14px;
}
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags li {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 10px; color: var(--fg-muted);
}
.tags-sm li { font-size: 11.5px; padding: 4px 9px; }

/* --- Projekte ------------------------------------------------------------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 16px;
}
.project {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.project-tag {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 11px;
}
.project h3 { font-size: 19px; letter-spacing: -.018em; font-weight: 640; margin-bottom: 10px; }
.project-text { color: var(--fg-muted); font-size: 15px; }
.project-result {
  font-size: 14.5px; color: var(--fg-muted);
  background: var(--bg-alt); border-radius: var(--radius-sm);
  padding: 12px 15px; margin-top: 16px;
}
.project-result b { color: var(--fg); font-weight: 580; }
.project .tags { margin-top: 15px; }

.project-quote {
  margin-top: auto; padding-top: 20px;
  border-top: 1px dashed var(--line);
}
.project-quote blockquote { font-size: 15px; color: var(--fg-muted); font-style: italic; }
.project-quote figcaption { font-size: 13px; color: var(--fg-muted); margin-top: 9px; opacity: .8; }

/* Platzhalter sichtbar markieren, damit nichts versehentlich live geht. */
.is-placeholder {
  position: relative;
  border-top-style: solid;
  border-top-color: color-mix(in srgb, var(--err) 40%, var(--line));
}
.is-placeholder::after {
  content: "Platzhalter";
  position: absolute; top: 12px; right: 0;
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--err); background: var(--err-bg);
  padding: 2px 7px; border-radius: 4px;
}

/* --- Leerzustand (noch keine Projekte freigeschaltet) --------------------- */
.empty-state {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 56px 32px;
  text-align: center;
  max-width: 620px;
  margin-inline: auto;
  box-shadow: var(--shadow-sm);
}
.empty-icon {
  width: 58px; height: 58px;
  margin: 0 auto 22px;
  border-radius: 16px;
  background: var(--accent-bg);
  display: grid; place-items: center;
}
.empty-icon svg {
  width: 27px; height: 27px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.empty-state h3 {
  font-size: 21px;
  letter-spacing: -.018em;
  font-weight: 640;
  margin-bottom: 12px;
}
.empty-state p {
  color: var(--fg-muted);
  font-size: 15.5px;
  max-width: 46ch;
  margin: 0 auto 26px;
  text-wrap: pretty;
}

/* --- Ueber mich ----------------------------------------------------------- */
.about {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 44px;
  align-items: start;
}
.photo-placeholder {
  aspect-ratio: 4 / 5;
  background: var(--card); border: 1px dashed var(--line);
  border-radius: var(--radius);
  display: grid; place-content: center; justify-items: center; gap: 10px;
  color: var(--fg-muted); font-size: 42px;
}
.photo-placeholder small { font-size: 13px; }

.about-text p { color: var(--fg-muted); margin-bottom: 16px; font-size: 16.5px; }
.pull-quote {
  border-left: 3px solid var(--accent);
  padding-left: 18px;
  font-size: 17.5px !important;
  color: var(--fg) !important;
  letter-spacing: -.012em;
  margin: 26px 0 !important;
}

.edu-title {
  font-size: 13px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent); font-weight: 640; margin: 32px 0 16px;
}
.edu li {
  display: grid; grid-template-columns: 110px 1fr; gap: 18px;
  padding: 15px 0; border-top: 1px solid var(--line);
}
.edu-period { font-family: var(--mono); font-size: 13px; color: var(--fg-muted); padding-top: 2px; }
.edu-body { display: flex; flex-direction: column; gap: 2px; }
.edu-body b { font-size: 15.5px; font-weight: 600; }
.edu-body span { font-size: 14.5px; color: var(--fg-muted); }
.edu-body small { font-size: 13px; color: var(--fg-muted); opacity: .82; }

/* --- Kontakt -------------------------------------------------------------- */
.contact-panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 46px;
  box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr 1.05fr; gap: 46px;
}
.contact-info h2 { font-size: 29px; letter-spacing: -.028em; font-weight: 680; }
.contact-info > p { color: var(--fg-muted); margin-top: 11px; }
.contact-list { margin-top: 24px; }
.contact-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; color: var(--fg-muted); font-size: 15.5px;
}
.contact-list a { text-decoration: none; }
.contact-list a:hover { color: var(--accent); }

.field { margin-bottom: 14px; }
label { display: block; font-size: 13px; color: var(--fg-muted); font-weight: 530; margin-bottom: 6px; }
input, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--fg);
  font: inherit; font-size: 15px;
}
input::placeholder, textarea::placeholder { color: var(--fg-muted); opacity: .62; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; min-height: 110px; }

/* Honeypot: unsichtbar, aber nicht display:none — manche Bots ignorieren das. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-note { font-size: 12.5px; color: var(--fg-muted); margin-top: 13px; line-height: 1.5; }
.form-note a { color: var(--accent); }

.alert { padding: 14px 17px; border-radius: var(--radius-sm); font-size: 14.5px; margin-bottom: 18px; }
.alert-ok  { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok);
             border: 1px solid color-mix(in srgb, var(--ok) 32%, transparent); }
.alert-err { background: var(--err-bg); color: var(--err);
             border: 1px solid color-mix(in srgb, var(--err) 32%, transparent); }

/* --- Footer --------------------------------------------------------------- */
.foot { border-top: 1px solid var(--line); padding: 38px 0; margin-top: 20px; }
.foot-in {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--fg-muted);
}
.foot-links { display: flex; gap: 20px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--fg); }
.foot-loc { margin-left: auto; }

/* --- Sprungleiste (nur mobil) --------------------------------------------- */
/* Ersetzt die Kopfnavigation, die auf schmalen Bildschirmen ausgeblendet wird. */
.tabbar { display: none; }

@media (max-width: 720px) {
  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    /* Platz fuer die Home-Leiste auf iPhones ohne Home-Button */
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 9px 2px 8px;
    text-decoration: none;
    color: var(--fg-muted);
    font-size: 10.5px;
    line-height: 1.2;
    letter-spacing: -.01em;
    /* Apples empfohlene Mindestgroesse fuer Tippziele */
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
  }
  .tab svg { width: 21px; height: 21px; fill: currentColor; }
  .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .tab.is-current { color: var(--accent); }
  .tab:active { background: var(--accent-bg); }

  /* Kontakt hervorheben - das ist die Handlung, die zaehlt. */
  .tab-accent svg {
    background: var(--accent);
    color: var(--accent-fg);
    fill: var(--accent-fg);
    border-radius: 7px;
    padding: 3px;
    width: 25px; height: 25px;
    margin-bottom: -2px;
  }
  .tab-accent.is-current svg { box-shadow: 0 0 0 3px var(--accent-bg); }

  /* Damit Footer und Formular nicht unter der Leiste verschwinden */
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
}

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; gap: 30px; }
  .about-photo { max-width: 260px; }
  .contact-panel { grid-template-columns: 1fr; gap: 34px; padding: 32px; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .btn-nav { display: none; }
  .nav-in { height: 64px; gap: 12px; }
  .brand-logo { height: 44px; margin-left: -11px; }
  .hero { padding: 62px 0 52px; }
  .section { padding: 60px 0; }
  .chips { margin-top: 38px; }
  .edu li { grid-template-columns: 1fr; gap: 4px; }
  .foot-loc { margin-left: 0; }
}
