/* 42 Berlin AI Club — shared design system v2 */

:root {
  /* Brand primitives (from DESIGN.md) */
  --rose-50: #fff1f2;
  --rose-100: #ffe4e6;
  --rose-200: #fecdd3;
  --rose-300: #fda4af;
  --rose-400: #fb7185;
  --rose-500: #f43f5e;
  --rose-600: #e11d48;
  --rose-700: #be123c;

  --terracotta: #c65d3b;
  --terracotta-light: #e07a5f;
  --terracotta-dark: #9c4a2f;

  --gold: #f2cc8f;
  --sage: #7a9e7e;

  --cream: #faf8f7;
  --cream-2: #f5f0ee;
  --warm-white: #ffffff;

  --text: #2d2424;
  --text-muted: #6b5e5e;
  --text-subtle: #9b8b8b;

  --border: #e8dedb;
  --border-strong: #d6c8c4;

  /* Semantic tokens */
  --color-bg: var(--cream);
  --color-surface: var(--warm-white);
  --color-surface-2: var(--cream-2);
  --color-surface-hover: var(--rose-50);

  --color-accent: var(--rose-500);
  --color-accent-light: var(--rose-400);
  --color-accent-dark: var(--rose-600);
  --color-secondary: var(--terracotta);
  --color-secondary-light: var(--terracotta-light);
  --color-tertiary: var(--gold);

  --color-success: #2a7a4a;
  --color-success-bg: rgba(42, 122, 74, 0.08);
  --color-error: #c92a2a;
  --color-error-bg: rgba(201, 42, 42, 0.08);

  --shadow-color: 45 36 36;
  --shadow-sm: 0 2px 8px rgba(var(--shadow-color), 0.06);
  --shadow: 0 8px 30px rgba(var(--shadow-color), 0.08);
  --shadow-lg: 0 20px 60px rgba(var(--shadow-color), 0.12);
  --shadow-glow: 0 10px 40px rgba(244, 63, 94, 0.18);

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;

  --font-heading: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}


/* Background layers */
.gradient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -2;
  pointer-events: none;
  will-change: transform;
}

.orb-1 {
  width: clamp(360px, 50vw, 620px);
  height: clamp(360px, 50vw, 620px);
  background: radial-gradient(circle, var(--color-accent-light), transparent 70%);
  top: -12%;
  right: -10%;
  opacity: 0.28;
  animation: orbFloat 22s ease-in-out infinite;
}

.orb-2 {
  width: clamp(420px, 55vw, 720px);
  height: clamp(420px, 55vw, 720px);
  background: radial-gradient(circle, var(--color-secondary), transparent 70%);
  bottom: -16%;
  left: -12%;
  opacity: 0.22;
  animation: orbFloat 26s ease-in-out infinite reverse;
}

.orb-3 {
  width: clamp(280px, 35vw, 420px);
  height: clamp(280px, 35vw, 420px);
  background: radial-gradient(circle, var(--color-tertiary), transparent 70%);
  top: 48%;
  left: 30%;
  opacity: 0.16;
  animation: orbFloat 20s ease-in-out infinite;
  animation-delay: -8s;
}

#canvas-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.7;
  pointer-events: none;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -34px) scale(1.04); }
  66% { transform: translate(-20px, 24px) scale(0.98); }
}

/* Header & nav */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(250, 248, 247, 0.86);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, box-shadow 0.3s;
}

header.scrolled {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 20px rgba(var(--shadow-color), 0.06);
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 24px rgba(244, 63, 94, 0.32);
  animation: logoFloat 3s ease-in-out infinite, logoGlow 2.5s ease-in-out infinite alternate;
}

.logo-icon svg { width: 26px; height: 26px; }

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}

@keyframes logoGlow {
  0% { box-shadow: 0 6px 24px rgba(244, 63, 94, 0.32); }
  100% { box-shadow: 0 8px 32px rgba(242, 204, 143, 0.42), 0 0 24px rgba(244, 63, 94, 0.22); }
}

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

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-secondary));
  border-radius: 2px;
  transition: width 0.25s var(--ease-out);
}

.nav-links a:hover { color: var(--color-accent); }
.nav-links a:hover::after { width: 100%; }

.nav-links a.nav-cta::after { display: none; }

.nav-cta {
  background: linear-gradient(135deg, var(--color-accent), var(--color-secondary));
  color: #fff !important;
  padding: 10px 20px;
  border-radius: 100px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.32);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.42);
}

.mobile-menu-toggle {
  display: none;
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 10px;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
}

@media (max-width: 768px) {
  .mobile-menu-toggle { display: block; }
  .nav-links {
    position: fixed;
    top: 82px;
    left: 12px;
    right: 12px;
    bottom: auto;
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 36px 24px;
    gap: 22px;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out), visibility 0.3s;
    z-index: 100;
    box-shadow: 0 24px 60px rgba(var(--shadow-color), 0.18);
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-links a { font-size: 1.15rem; font-weight: 600; color: var(--text); }
  .nav-links a.nav-cta { font-size: 1rem; }
}

/* Typography helpers */
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 48px;
  font-size: 1.05rem;
}

.text-gradient {
  background: linear-gradient(135deg, var(--color-accent), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s;
  border: none;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-120%);
  transition: transform 0.6s;
}

.btn:hover::after { transform: translateX(120%); }

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent), var(--color-secondary));
  color: #fff;
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.32);
}

.btn-primary:hover { transform: translateY(-3px) scale(1.02); box-shadow: var(--shadow-glow); }

.btn-secondary {
  background: var(--color-surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--color-surface-hover); transform: translateY(-2px); }

button:disabled, .btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}

.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.95rem; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  background: var(--color-bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.12);
}

.form-group textarea { min-height: 120px; resize: vertical; }

.form-status {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  display: none;
}

.form-status.visible { display: block; }
.form-status.success { background: var(--color-success-bg); color: var(--color-success); border: 1px solid rgba(42, 122, 74, 0.2); }
.form-status.error { background: var(--color-error-bg); color: var(--color-error); border: 1px solid rgba(201, 42, 42, 0.2); }

/* Footer */
footer {
  background: var(--text);
  color: #d8c8c4;
  padding: 60px 24px 30px;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

footer h4 { color: #fff; margin-bottom: 16px; font-family: var(--font-heading); }
footer a { color: #d8c8c4; text-decoration: none; display: block; margin-bottom: 10px; transition: color 0.2s; }
footer a:hover { color: var(--color-accent-light); }

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 30px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.9rem;
  color: #a89894;
}

@media (max-width: 900px) {
  .footer-content { grid-template-columns: 1fr; gap: 32px; }
}

/* Toast */
.toast-container {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  max-width: 320px;
  animation: slideIn 0.3s var(--ease-out);
  pointer-events: auto;
}

.toast.hiding { animation: slideOut 0.3s var(--ease-out) forwards; }
.toast.success { border-left: 4px solid var(--color-success); }
.toast.error { border-left: 4px solid var(--color-error); }

@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }

/* Scroll animations */
.animate-on-scroll {
  opacity: 1;
  transform: none;
}

.js-animations .animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.js-animations .animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-1 { transition-delay: 0.08s; }
.stagger-2 { transition-delay: 0.16s; }
.stagger-3 { transition-delay: 0.24s; }
.stagger-4 { transition-delay: 0.32s; }

/* Hero specific utilities */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 150px 24px 100px;
  position: relative;
}

.hero-content {
  max-width: 880px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}

.hero p {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Decorative rings */
.revolve-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(280px, 45vw, 460px);
  height: clamp(280px, 45vw, 460px);
  border: 1px dashed rgba(244, 63, 94, 0.2);
  border-radius: 50%;
  animation: revolve 28s linear infinite;
  pointer-events: none;
  z-index: -1;
}

.revolve-ring::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  background: var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--color-accent);
}

.revolve-ring-2 {
  width: clamp(220px, 35vw, 360px);
  height: clamp(220px, 35vw, 360px);
  border-color: rgba(198, 93, 59, 0.18);
  animation-direction: reverse;
  animation-duration: 20s;
}

.revolve-ring-2::before {
  background: var(--color-secondary);
  box-shadow: 0 0 20px var(--color-secondary);
  top: auto;
  bottom: -6px;
}

@keyframes revolve {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 100px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}

.stat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }

/* Page sections */
section { padding: 90px 24px; }

.section-alt { background: var(--color-surface-2); }

.container-narrow { max-width: 820px; margin: 0 auto; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-4 { grid-template-columns: 1fr; }
}

/* About / principles */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}

.about-text h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 14px;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 14px;
  font-size: 0.98rem;
}

.principles-list { list-style: none; }
.principles-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.principles-list li::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  margin-top: 8px;
  flex-shrink: 0;
}

/* Activities */
.activities { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 1000px; margin: 0 auto; }
.activities h2 { grid-column: 1 / -1; }
.activity-card h3 { font-family: var(--font-heading); font-size: 1.15rem; margin-bottom: 8px; }
.activity-card p { color: var(--text-muted); font-size: 0.92rem; }

/* CTA */
.cta-section {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 70px 40px;
  box-shadow: var(--shadow-lg);
}

.cta-section h2 { font-family: var(--font-heading); font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 14px; }
.cta-section p { color: var(--text-muted); margin-bottom: 28px; }

/* Forms page wrappers */
.form-section { padding: 40px 24px 100px; }
.form-wrapper {
  max-width: 640px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.form-intro {
  background: linear-gradient(135deg, rgba(244,63,94,0.06), rgba(198,93,59,0.05));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin-bottom: 26px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .gradient-orb, #canvas-bg, .revolve-ring { animation: none; opacity: 0.12; }
  .logo-icon { animation: none; }
  .btn::after { display: none; }
  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Mobile-first overrides */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .activities { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hero { padding: 130px 20px 80px; min-height: auto; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .stats { grid-template-columns: 1fr; padding-bottom: 70px; }
  section { padding: 70px 20px; }
  .cta-section { padding: 48px 24px; }
  .contact-form, .form-wrapper { padding: 26px; }
  .form-row { grid-template-columns: 1fr; }
  .toast-container { right: 16px; left: 16px; }
  .toast { max-width: none; }
}


.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent);
  color: white;
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.2s;
  border-radius: 0 0 4px 0;
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}
