/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  --bg-primary:         #faf7f4;
  --bg-surface:         #ffffff;
  --bg-surface-2:       #f5f0eb;
  --accent:             #0d9488;
  --accent-glow:        rgba(13, 148, 136, 0.12);
  --accent-glow-strong: rgba(13, 148, 136, 0.25);
  --secondary:          #f59e0b;
  --secondary-glow:     rgba(245, 158, 11, 0.12);
  --text-primary:       #292524;
  --text-muted:         #5c5550;
  --border:             rgba(13, 148, 136, 0.18);
  --radius:             12px;
  --radius-lg:          20px;
  --transition:         0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}

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

ul { list-style: none; }

/* ============================================================
   Lang Toggle (floating)
   ============================================================ */
#lang-toggle {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(250, 250, 248, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(41, 37, 36, 0.1);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

#lang-toggle:hover {
  border-color: var(--accent);
  background: rgba(250, 250, 248, 0.96);
  transform: scale(1.05);
}

/* ============================================================
   Hero
   ============================================================ */
#hero {
  position: relative;
  min-height: 41vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 1.5rem;
  margin-top: 0;
  max-width: 700px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  margin-bottom: 1rem;
  animation: fade-in-up 0.6s ease both;
}

.hero-tagline {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  animation: fade-in-up 0.6s 0.2s ease both;
}

/* Scroll Arrow */
.scroll-arrow {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  animation: bounce 2s ease-in-out infinite;
  cursor: pointer;
}

.scroll-arrow span {
  display: block;
  width: 22px;
  height: 22px;
  border-right: 2px solid rgba(255, 255, 255, 0.7);
  border-bottom: 2px solid rgba(255, 255, 255, 0.7);
  transform: rotate(45deg);
}

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

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding: 5rem 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2.5rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 3px;
}

/* ============================================================
   Projects Grid
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 2px 16px rgba(41, 37, 36, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.project-card:hover:not(.expanded) {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(13, 148, 136, 0.18);
  border-color: var(--accent);
  cursor: pointer;
}

.project-card:not(.expanded)::after {
  content: '';
  position: absolute;
  bottom: 0.9rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 10px solid var(--accent);
  opacity: 0.4;
  pointer-events: none;
}

.project-card:hover:not(.expanded)::after {
  opacity: 0.7;
  animation: bounce-hint 1.2s ease-in-out infinite;
}

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

/* ── Hero Flash ──────────────────────────────────────────── */
#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.55) 0%, transparent 68%);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

@keyframes hero-glow {
  0%   { opacity: 0; }
  18%  { opacity: 1; }
  100% { opacity: 0; }
}

#hero.hero-flash::after {
  animation: hero-glow 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Card Expand (vertikal) ──────────────────────────── */
.project-card {
  gap: 0;
  cursor: pointer;
}

.project-card.expanded {
  cursor: default;
}

.card-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Collapsed: max-height 0, unsichtbar */
.card-story {
  display: flex;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.55s cubic-bezier(0.65, 0, 0.35, 1),
    opacity    0.4s  cubic-bezier(0.65, 0, 0.35, 1) 0.08s;
  will-change: max-height, opacity;
}

/* Expanded: nach unten aufklappen */
.project-card.expanded .card-story {
  max-height: 4000px;
  opacity: 1;
}

/* Hover-Peek: springy, schmaler Streifen */
.project-card:hover:not(.expanded) .card-story {
  max-height: 0.75rem;
  transition:
    max-height 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity    0.4s cubic-bezier(0.65, 0, 0.35, 1) 0.08s;
}

/* Visible content */
.story-content {
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
}

.story-quote {
  border-left: 3px solid var(--accent);
  margin: 1rem 0 0.35rem;
  padding: 0.5rem 1rem;
  font-size: 0.93rem;
  font-style: italic;
  color: var(--text-primary);
  background: var(--accent-glow);
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.5;
}

.story-section { margin-top: 1.1rem; }

.story-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.story-section-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.story-subsection-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 1.1rem;
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.project-icon {
  font-size: 2.2rem;
}

.project-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.project-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-tags span {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  background: var(--accent-glow);
  border: 1px solid var(--border);
  color: var(--accent);
}

/* ============================================================
   Button
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  border: none;
  align-self: flex-start;
}

.btn:hover {
  transform: translateY(-2px) scale(1.05);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 16px var(--accent-glow-strong);
}

.btn-primary:hover {
  background: #0f766e;
  box-shadow: 0 6px 24px var(--accent-glow-strong);
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(41, 37, 36, 0.08);
  background: rgba(41, 37, 36, 0.03);
}

.footer-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  transition: opacity var(--transition);
}
.footer-linkedin:hover { opacity: 0.75; }

/* ============================================================
   Animations
   ============================================================ */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Scroll Animations (AOS-Ersatz) ─────────────────────── */
[data-aos] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-aos].aos-animate {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  #hero {
    min-height: 38vh;
  }

  .section-title {
    display: block;
  }
}

/* ── Edit-Button (nur localhost, via JS-Klasse eingeblendet) ── */
#edit-btn {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: #0d9488;
  color: white;
  font-size: 1.2rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(13,148,136,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
#edit-btn.visible { display: flex; }
#edit-btn:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(13,148,136,0.5); }

