/* ===== Preloader ===== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.preloader-cube {
  width: 40px;
  height: 40px;
  position: relative;
  animation: preloaderSpin 1.2s ease-in-out infinite;
}

.preloader-face {
  position: absolute;
  width: 18px;
  height: 18px;
  background: #111827;
  border-radius: 3px;
}

.preloader-face:nth-child(1) { top: 0; left: 0; animation: preloaderPulse 1.2s ease-in-out 0s infinite; }
.preloader-face:nth-child(2) { top: 0; right: 0; animation: preloaderPulse 1.2s ease-in-out 0.1s infinite; }
.preloader-face:nth-child(3) { bottom: 0; right: 0; animation: preloaderPulse 1.2s ease-in-out 0.2s infinite; }
.preloader-face:nth-child(4) { bottom: 0; left: 0; animation: preloaderPulse 1.2s ease-in-out 0.3s infinite; }

@keyframes preloaderSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(90deg); }
}

@keyframes preloaderPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.preloader-text {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
}

.preloader-text .dot {
  color: #6b7280;
}

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

:root {
  --white: #ffffff;
  --bg: #fafafa;
  --bg-alt: #f3f4f6;
  --text: #111827;
  --text-secondary: #6b7280;
  --accent: #111827;
  --accent-light: #e5e7eb;
  --border: #e5e7eb;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.08);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* ===== Container ===== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.navbar.scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.nav-logo .dot {
  color: var(--text-secondary);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--text);
  transition: width var(--transition);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #f1f3f5 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(17, 24, 39, 0.04) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 32px;
}

.hero-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--white);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform var(--transition), box-shadow var(--transition);
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-dot {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  background: #22c55e;
  border-radius: 50%;
  border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero-name {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 8px;
}

.hero-bio {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-style: italic;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-secondary);
  animation: bounce 2s ease-in-out infinite;
  opacity: 0.4;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: #374151;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--text);
  transform: translateY(-1px);
}

/* ===== Sections ===== */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg);
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 48px;
}

/* ===== MC Renders ===== */
.mc-render {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0.22;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
  transition: opacity 0.6s ease;
}

.mc-allay-hero {
  width: 180px;
  bottom: 60px;
  right: 5%;
  transform: rotate(10deg);
  animation: mcFloat 6s ease-in-out infinite;
}

.mc-warden-about {
  width: 220px;
  top: 40px;
  right: -20px;
  transform: rotate(-5deg);
  animation: mcFloat 8s ease-in-out infinite 1s;
}

.mc-allay-projekte {
  width: 160px;
  bottom: 80px;
  left: 2%;
  transform: rotate(8deg) scaleX(-1);
  animation: mcFloat 7s ease-in-out infinite 0.5s;
}

@keyframes mcFloat {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-18px) rotate(var(--r, 0deg)); }
}

.mc-allay-hero { --r: 10deg; }
.mc-warden-about { --r: -5deg; }
.mc-allay-projekte { --r: 8deg; }

/* ===== About Section ===== */
.about-section {
  position: relative;
  overflow: hidden;
}

.about-intro {
  max-width: 600px;
  margin-bottom: 40px;
}

.about-intro p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.about-intro strong {
  color: var(--text);
}

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

.about-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px 28px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.about-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-card:hover::before {
  transform: scaleX(1);
}

.about-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  border-color: transparent;
}

.about-card-number {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--card-accent, var(--text-secondary));
  opacity: 0.4;
  margin-bottom: 16px;
  letter-spacing: 0.1em;
}

.about-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--text);
  transition: all var(--transition);
}

.about-card:hover .about-icon {
  background: var(--card-accent, var(--accent));
  color: var(--white);
}

.about-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.about-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== Skills Section ===== */
.skills-section {
  position: relative;
  overflow: hidden;
}

/* ===== Projekte Section ===== */
.projekte-section {
  position: relative;
  overflow: hidden;
}

/* ===== Skills ===== */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-pill {
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--white);
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: default;
}

.skill-pill:hover {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ===== Projects ===== */
.projects-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.project-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 36px 32px;
  overflow: hidden;
  transition: all var(--transition);
}

.project-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.accent-dark {
  background: linear-gradient(90deg, #111827, #6b7280);
}

.accent-blue {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.accent-gradient {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

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

.project-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.project-icon-img {
  padding: 6px;
  overflow: hidden;
}

.project-icon-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--bg);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 100px;
}

.badge-company {
  background: #fef3c7;
  color: #92400e;
}

.project-card h3 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.project-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 12px;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 600px;
}

.buildoria-stats {
  display: flex;
  gap: 40px;
  margin-bottom: 24px;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* ===== Contact ===== */
.contact-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 480px;
}

.contact-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
}

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.contact-card svg,
.contact-card i {
  flex-shrink: 0;
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--text);
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg);
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.modal h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.modal-body h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 20px;
  margin-bottom: 8px;
}

.modal-body p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.modal-body a {
  color: #2563eb;
  text-decoration: underline;
}

/* ===== Language Switch ===== */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  user-select: none;
}

.lang-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.lang-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.lang-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  transition: background 0.3s ease;
}

.lang-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.lang-toggle input:checked + .lang-slider {
  background: #2563eb;
}

.lang-toggle input:checked + .lang-slider::before {
  transform: translateX(18px);
}

/* ===== Cookie Banner ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: var(--white);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
  padding: 20px 24px;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-banner.dismissed {
  transform: translateY(100%);
}

.cookie-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex: 1;
  min-width: 200px;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.8rem;
}

/* ===== Fade In Animation ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero-name {
    font-size: 2.2rem;
  }

  .section {
    padding: 64px 0;
  }

  .section-title {
    font-size: 1.6rem;
    margin-bottom: 32px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .mc-render {
    opacity: 0.15;
  }

  .mc-allay-hero {
    width: 120px;
  }

  .mc-warden-about {
    width: 150px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .cookie-content {
    flex-direction: column;
    text-align: center;
  }

  .modal {
    padding: 28px 20px;
  }

  .project-card {
    padding: 28px 20px;
  }

  .buildoria-stats {
    gap: 24px;
    flex-wrap: wrap;
  }

  .project-card h3 {
    font-size: 1.25rem;
  }

  .contact-links {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 100px 20px 60px;
  }

  .hero-name {
    font-size: 1.8rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}
