/* Base variables and reset */
:root {
  --bg: #0b1020;        /* dark background */
  --bg-elev: #111731;   /* card background */
  --txt: #e6e6f0;       /* primary text */
  --muted: #a7b0c5;     /* secondary text */
  --brand: #38bdf8;     /* accent */
  --brand-2: #a78bfa;   /* secondary accent */

  --ring: 0 0 0 3px rgba(56,189,248,.45);
  --radius: 16px;
  --maxw: 1100px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fc;
    --bg-elev: #ffffff;
    --txt: #101322;
    --muted: #5a647a;
    --brand: #0ea5e9;
    --brand-2: #7c3aed;
  }
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(56,189,248,.25), transparent),
    radial-gradient(900px 400px at 100% 0%, rgba(167,139,250,.18), transparent),
    var(--bg);
  color: var(--txt);
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

/* Layout */
.container {
  width: min(100% - 32px, var(--maxw));
  margin-inline: auto;
}

/* Header shell */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(180%) blur(10px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
}

/* Layout */
.nav {
  display: grid;
  grid-template-columns: auto 1fr auto; /* brand | spacer | nav / toggle */
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.brand {
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--txt);
}

/* Desktop nav */
.nav-links {
  display: flex;
  gap: 8px;
  justify-self: end;
}

/* Pill links with subtle hover + gradient underline */
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 9999px;
  color: var(--txt);
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--muted) 18%, transparent);
  background: color-mix(in srgb, var(--bg-elev) 85%, transparent);
  transition: border-color .2s ease, transform .15s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
  opacity: .85;
}

.nav-link:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--txt));
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 8%, var(--bg-elev)), color-mix(in srgb, var(--bg-elev) 95%, transparent));
}

main {
  padding: 32px 0 80px;
}

section {
  padding: 48px 0;
}

h1, h2 {
  line-height: 1.2;
  margin: 0 0 16px;
}

h1 {
  font-size: clamp(32px, 3.5vw + 16px, 48px);
}

h2 {
  font-size: clamp(22px, 2vw + 16px, 32px);
}

p.lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 65ch;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 32px;
  align-items: center;
}

.hero .card {
  background: var(--bg-elev);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  border: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
}

.hero img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

/* Quick Facts */
.quickfacts {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.quickfacts-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.quickfacts-title {
  margin: 0;
  font-size: 1.25rem;
}

.quickfacts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  width: 100%;
}

.quickfacts-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: color-mix(in srgb, var(--bg-elev) 95%, transparent);
  border: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  color: var(--txt);
  transition: transform .2s ease, box-shadow .2s ease;
}

.quickfacts-list li i {
  color: var(--brand);
  min-width: 18px;
}

.quickfacts-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}


/* Base card styles */
.hero .card,
.cv .card,
.project {
  position: relative;
  background: var(--bg-elev);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Hover glow effect */
.hero .card:hover,
.cv .card:hover,
.project:hover {
  border-color: transparent;
  box-shadow: 0 0 25px 5px rgba(56,189,248,0.6), 
              0 0 35px 10px rgba(167,139,250,0.5);
}

/* Animated gradient border */
.hero .card::before,
.cv .card::before,
.project::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px; /* thickness of the glowing border */
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.hero .card:hover::before,
.cv .card:hover::before,
.project:hover::before {
  opacity: 1;
}

/* Base button */
.btn {
  --btn-bg: color-mix(in srgb, var(--bg-elev) 85%, transparent);
  --btn-border: color-mix(in srgb, var(--muted) 22%, transparent);
  --btn-hover-bg: color-mix(in srgb, var(--brand) 10%, var(--bg-elev));
  --btn-active-bg: color-mix(in srgb, var(--brand) 14%, var(--bg-elev));
  --btn-shadow: 0 6px 18px rgba(0,0,0,.25);

  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--btn-border);
  background: linear-gradient(180deg, var(--btn-bg), color-mix(in srgb, var(--bg-elev) 92%, transparent));
  color: var(--txt);
  text-decoration: none;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease, outline-offset .2s ease;
  will-change: transform;
}

/* Icon sizing */
.btn i {
  font-size: 1.05rem;
}

/* Hover / active */
.btn:hover {
  background: linear-gradient(180deg, var(--btn-hover-bg), color-mix(in srgb, var(--bg-elev) 94%, transparent));
  border-color: color-mix(in srgb, var(--brand) 35%, var(--btn-border));
  box-shadow: var(--btn-shadow);
  transform: translateY(-1px);
}

/* Variants */
.btn.btn-soft {
  --btn-bg: color-mix(in srgb, var(--brand) 10%, var(--bg-elev));
  --btn-hover-bg: color-mix(in srgb, var(--brand) 16%, var(--bg-elev));
  border-color: color-mix(in srgb, var(--brand) 35%, var(--txt));
}
/* Full-width on small screens for easier tapping */
@media (max-width: 560px) {
  #kontakt .btn { display: flex; width: 100%; justify-content: center; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* Projects */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0 24px;
}

.chip {
  padding: 6px 11px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--bg-elev) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent);
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  outline: var(--ring);
  border-color: var(--brand);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.project-links {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn.btn-sm {
  padding: 7px 12px;
  font-size: .9rem;
  border-radius: 10px;
}

/* Secondary look for GitHub link */
.btn.btn-ghost {
  background: none;
  border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent);
}
.btn.btn-ghost:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--muted));
}


.project {
  grid-column: span 4;
  background: var(--bg-elev);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.project figure {
  margin: 0;
}

.project img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 6px);
}

.project h3 {
  margin: 5px 0;
  font-size: 17px;
}

.project p {
  margin: 0;
  color: var(--muted);
}

.project .tags {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 13px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent);
  border-radius: 9999px;
}

/* Skills list layout */
.skills {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 14px;
}

.skill {
  display: grid;
  grid-template-columns: 1fr auto; /* name | % */
  gap: 10px;
  align-items: center;
}

.skill-name {
  font-weight: 600;
}

.skill-val {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* Bar track */
.skill-bar {
  grid-column: 1 / -1;        /* full width under name + % */
  height: 10px;
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--muted) 22%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 80%, #000 20%), color-mix(in srgb, var(--bg) 88%, #000 12%));
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset;
}

/* Bar fill (gradient + subtle glow) */
.skill-fill {
  display: block;
  height: 100%;
  width: 0%;                  /* start collapsed (for animation) */
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 16px rgba(56,189,248,.28);
  border-radius: inherit;
  transition: width .8s cubic-bezier(.22,.61,.36,1);
}

/* When the list is ready, expand to the set level */
.skills.animate .skill-fill { width: var(--level, 0%); }

/* Bar fill (with gradient + sheen) */
.skill-fill {
  display: block;
  height: 100%;
  width: 0%; /* start collapsed */
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 16px rgba(56,189,248,.28);
  border-radius: inherit;
  transition: width .8s cubic-bezier(.22,.61,.36,1);
  position: relative;
  overflow: hidden;
}

/* Sheen pseudo-element */
.skill-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255,255,255,.5) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  opacity: 0;
}

/* Trigger sheen on hover */
.skill:hover .skill-fill::after {
  opacity: 1;
  animation: sheen 1.5s ease forwards;
}

/* Sheen keyframes */
@keyframes sheen {
  to {
    transform: translateX(120%);
  }
}
/* Timeline container */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 18px;          /* space for the vertical line */
  position: relative;
}

/* Vertical line */
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  bottom: 2px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  opacity: .6;
}

/* Timeline item dot */
.tl-item {
  position: relative;
  padding: 10px 0 12px;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: var(--bg-elev);
  border: 2px solid var(--brand);
  box-shadow: 0 0 10px rgba(56,189,248,.35);
}

/* Header row: role + meta (dates/company) */
.tl-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
  margin-left: 20px;

}

.tl-head .role {
  font-weight: 600;
}

.tl-head .meta {
  color: var(--muted);
  font-size: .95rem;
}

/* Bullets: keep to 1–2 short lines each for neatness */
.tl-bullets {
  margin: 6px 0 0 18px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.tl-bullets li {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;       /* clamp long bullets */
}

/* Clamp the whole list initially (avoid tall card) */
.timeline.clamp {
  max-height: 320px;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to bottom, black 85%, transparent); /* fade out bottom */
}

/* Toggle button below timeline */
.tl-toggle {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--muted) 22%, transparent);
  background: color-mix(in srgb, var(--bg-elev) 90%, transparent);
  color: var(--txt);
  cursor: pointer;
  font-size: .95rem;
}

.tl-toggle:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--txt));
}

/* Small screens: give a bit more room before clamping */
@media (max-width: 600px) {
  .timeline.clamp { max-height: 380px; }
}

/* CV */
.cv {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
}

.cv .card {
  background: var(--bg-elev);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
}

.cv h3 {
  margin: 3px 0 10px;
}
button {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--txt));
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 20%, transparent), transparent);
  color: var(--txt);
  cursor: pointer;
}

/* Contact card */
/* Footer */
.site-footer {
  border-top: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
  padding: 28px 0;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 96%, transparent);
}

.footer-wrap {
  display: grid;
  grid-template-columns: 1.2fr auto;
  align-items: center;
  gap: 16px 24px;
}

.footer-brand .brand {
  color: var(--txt);
  font-weight: 700;
}
.footer-lead {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .95rem;
}

/* Actions: primary email + compact socials */
.footer-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

/* Small button variant for footer */
.btn.btn-sm {
  padding: 8px 12px;
  border-radius: 10px;
  gap: .5rem;
  font-size: .95rem;
}

/* Compact circular icon buttons (reusable) */
.icon-btn {
  --btn-border: color-mix(in srgb, var(--muted) 22%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  border: 1px solid var(--btn-border);
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  color: var(--txt);
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.icon-btn i { font-size: 1.05rem; }
.icon-btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--btn-border));
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 10%, var(--bg-elev)), color-mix(in srgb, var(--bg-elev) 95%, transparent));
}

.footer-meta {
  grid-column: 1 / -1;
  font-size: .9rem;
  color: var(--muted);
  opacity: .9;
}

/* Responsive stacking */
@media (max-width: 700px) {
  .footer-wrap {
    grid-template-columns: 1fr;
  }
  .footer-actions {
    justify-self: start;
  }
}

/* Responsiveness */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .cv {
    grid-template-columns: 1fr;
  }

  .project {
    grid-column: span 6;
  }
}

@media (max-width: 600px) {
  .project {
    grid-column: span 12;
  }
}

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