/* ==========================================================================
   VorthelixNode. Algorithmische Klartext-Strategie. Skalierbare Prozessarchitekturen.
   Shared Design System & Responsive Stylesheet
   ========================================================================== */

/* --- 1. CSS RESET & ROOT VARIABLES -------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Palette */
  --bg: #eaf4ff;
  --surface: #ffffff;
  --ink: #10233f;
  --accent: #3979c9;
  --accent2: #83b7ef;
  --surface-alt: #f0f7ff;
  --border: #c8ddf5;
  --error: #d94f4f;
  --success: #2a9d8f;

  /* Typography Scale */
  --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --fs-hero: clamp(2.8rem, 6vw, 5.5rem);
  --fs-h1: clamp(2.2rem, 4.5vw, 3.8rem);
  --fs-h2: clamp(1.6rem, 3vw, 2.4rem);
  --fs-h3: clamp(1.2rem, 2vw, 1.6rem);
  --fs-body: clamp(1rem, 1.2vw, 1.15rem);
  --fs-small: 0.875rem;

  /* Spacing & Layout */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;
  --container-max: 1280px;
  --content-max: 780px;
  --gutter: clamp(1.5rem, 4vw, 3rem);

  /* Radius & Shadows */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-card: 0 12px 40px rgba(16, 35, 63, 0.08);
  --shadow-hover: 0 16px 48px rgba(57, 121, 201, 0.15);
  --shadow-focus: 0 0 0 3px rgba(57, 121, 201, 0.4);

  /* Transitions */
  --trans-fast: 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --trans-base: 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --trans-slow: 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --trans-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index Layering */
  --z-scroll: 10;
  --z-header: 100;
  --z-content: 1;
  --z-overlay: 50;
  --z-modal: 200;
  --z-cookie: 300;
}

/* --- 2. BASE TYPOGRAPHY & LAYOUT --------------------------------------- */
html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  background-color: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: var(--space-sm);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p {
  margin-bottom: var(--space-sm);
  color: rgba(16, 35, 63, 0.8);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--trans-fast);
}

a:hover {
  color: var(--accent2);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.content-wrap {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* --- 3. SCROLL PROGRESS & HEADER --------------------------------------- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  width: 0%;
  z-index: var(--z-scroll);
  transition: width 100ms linear;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(234, 244, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--trans-base), box-shadow var(--trans-base), background var(--trans-base);
  z-index: var(--z-header);
  padding: 1rem 0;
}

.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 4px 20px rgba(16, 35, 63, 0.06);
  padding: 0.75rem 0;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  padding: 0.5rem 0;
}

.brand-logo svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}

.main-nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 0.5rem 0;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--trans-fast);
}

.main-nav a:hover::after,
.main-nav a:focus::after {
  width: 100%;
}

#menu-toggle {
  display: none;
  background: none;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  cursor: pointer;
  position: absolute;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  z-index: calc(var(--z-header) + 2);
}

#menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: var(--trans-fast);
}

#menu-toggle span:nth-child(2) { opacity: 1; }

/* --- 4. HERO SECTION --------------------------------------------------- */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) 0;
  overflow: hidden;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(57, 121, 201, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(131, 183, 239, 0.2) 0%, transparent 50%),
    linear-gradient(135deg, #eaf4ff 0%, #f0f7ff 100%);
  z-index: 0;
  animation: ambientShift 20s infinite alternate ease-in-out;
}

@keyframes ambientShift {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.9; transform: scale(1.05); }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  padding: 0 var(--gutter);
}

.hero-content h1 {
  font-size: var(--fs-hero);
  margin-bottom: var(--space-md);
  min-height: 1.2em;
}

[data-typewriter] {
  display: inline;
}

.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 0.8em;
  background: var(--accent);
  margin-left: 4px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% { opacity: 0; }
}

.subtitle {
  font-size: 1.25rem;
  color: rgba(16, 35, 63, 0.75);
  margin-bottom: var(--space-lg);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--trans-base);
  text-decoration: none;
  border: 2px solid transparent;
  min-height: 52px;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(57, 121, 201, 0.3);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #2b62a8;
  box-shadow: 0 8px 24px rgba(57, 121, 201, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--border);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(57, 121, 201, 0.05);
  transform: translateY(-2px);
}

/* --- 5. STATS SECTION -------------------------------------------------- */
.stats-section {
  padding: var(--space-lg) 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  text-align: center;
}

.stat-item {
  padding: var(--space-md);
}

.stat-number {
  display: block;
  font-size: var(--fs-h2);
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.25rem;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  display: block;
  font-size: var(--fs-small);
  color: rgba(16, 35, 63, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* --- 6. ABOUT & PROCESS SECTIONS --------------------------------------- */
.about-section,
.process-section {
  padding: var(--space-xl) 0;
}

.about-visual {
  margin-bottom: var(--space-lg);
  display: flex;
  justify-content: center;
}

.about-visual svg {
  width: 100%;
  max-width: 600px;
  height: auto;
}

.about-text {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  counter-reset: step;
}

.process-step {
  background: var(--surface);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  border: 1px solid var(--border);
  transition: transform var(--trans-base), box-shadow var(--trans-base);
}

.process-step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.step-number {
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--accent);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* --- 7. FEATURES & BENEFITS -------------------------------------------- */
.features-section,
.benefits-section {
  padding: var(--space-xl) 0;
  background: var(--surface-alt);
}

.feature-cards,
.benefit-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.feature-card,
.benefit-card {
  background: var(--surface);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  transition: transform var(--trans-base);
}

.feature-card:hover,
.benefit-card:hover {
  transform: translateY(-4px);
}

.feature-icon,
.benefit-icon {
  width: 48px;
  height: 48px;
  background: rgba(57, 121, 201, 0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
}

/* --- 8. TESTIMONIALS --------------------------------------------------- */
.testimonials-section {
  padding: var(--space-xl) 0;
  background: var(--bg);
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.testimonial-card {
  background: var(--surface);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}

.stars {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-sm);
  color: #f4a261;
}

.author {
  font-weight: 700;
  color: var(--ink);
  display: block;
  margin-bottom: 0.25rem;
}

.avatar {
  width: 40px;
  height: 40px;
  background: var(--accent2);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
  margin-right: 0.75rem;
  font-size: 0.9rem;
}

.details {
  font-size: 0.85rem;
  color: rgba(16, 35, 63, 0.6);
}

/* --- 9. FAQ & CONTACT -------------------------------------------------- */
.faq-section,
.contact-section {
  padding: var(--space-xl) 0;
  background: var(--surface);
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--trans-fast);
}

.faq-item:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.faq-question {
  width: 100%;
  padding: 1.25rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 1.25rem;
  transition: max-height var(--trans-slow), padding var(--trans-slow);
}

.faq-item[aria-expanded="true"] .faq-answer {
  padding: 0 1.25rem 1.25rem;
}

.contact-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  background: var(--surface);
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.form-field.error input,
.form-field.error textarea {
  border-color: var(--error);
}

.field-error {
  color: var(--error);
  font-size: 0.85rem;
  min-height: 1.25rem;
}

#projectbrief {
  min-height: 120px;
  resize: vertical;
}

.cta-banner {
  background: var(--ink);
  padding: var(--space-xl) var(--gutter);
  text-align: center;
  color: #ffffff;
}

.cta-banner h2 { color: #ffffff; }
.cta-banner p { color: rgba(255, 255, 255, 0.8); margin-bottom: var(--space-md); }
.cta-banner .btn-primary { background: #ffffff; color: var(--ink); }
.cta-banner .btn-primary:hover { background: var(--accent2); color: #ffffff; }

/* --- 10. FOOTER & COOKIE BANNER ---------------------------------------- */
.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.8);
  padding: var(--space-lg) 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-lg);
}

.footer-col h4 {
  color: #ffffff;
  margin-bottom: var(--space-sm);
}

.footer-col a {
  color: rgba(255, 255, 255, 0.7);
  display: block;
  margin-bottom: 0.5rem;
}

.footer-col a:hover { color: var(--accent2); }

.footer-bottom {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: var(--z-cookie);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
}

.cookie-controls {
  display: flex;
  gap: 0.75rem;
}

/* --- 11. MODAL & INTERACTIVE COMPONENTS -------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 35, 63, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  z-index: var(--z-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--trans-base);
}

.modal-overlay[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--surface);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-card);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--ink);
  padding: 0.5rem;
}

/* --- 12. LEGAL & THANK-YOU PAGES --------------------------------------- */
.site-legal .hero-section {
  min-height: 60vh;
  padding: var(--space-lg) 0;
}

.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-lg) 0;
}

.legal-intro {
  margin-bottom: var(--space-lg);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
}

.legal-table th,
.legal-table td {
  padding: 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

.legal-table th {
  background: var(--surface-alt);
  font-weight: 600;
}

.site-thankyou .hero-section {
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.thank-you-section {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
}

.thank-you-card {
  background: var(--surface);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}

/* --- 13. REVEAL ANIMATIONS & STATE ------------------------------------- */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--trans-slow), transform var(--trans-slow);
}

.fade-up.visible,
.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- 14. RESPONSIVE BREAKPOINTS ---------------------------------------- */
@media (max-width: 1024px) {
  .stats-container { grid-template-columns: repeat(2, 1fr); }
  .process-steps { grid-template-columns: repeat(2, 1fr); }
  .feature-cards, .benefit-cards { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-md); }
}

@media (max-width: 768px) {
  :root {
    --space-xl: 5rem;
    --space-lg: 3rem;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 300px;
    height: 100vh;
    background: var(--surface);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right var(--trans-base);
    z-index: 101;
  }

  .main-nav.open { right: 0; }
  #menu-toggle { display: block; }

  .stats-container,
  .process-steps,
  .feature-cards,
  .benefit-cards {
    grid-template-columns: 1fr;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

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

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

  .hero-content h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
  }
}

@media (max-width: 390px) {
  :root {
    --gutter: 1rem;
  }
  .btn {
    width: 100%;
  }
  .cta-group {
    flex-direction: column;
  }
}

/* --- 15. ACCESSIBILITY & REDUCED MOTION -------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fade-up.visible,
  .fade-up.is-visible {
    opacity: 1;
    transform: none;
  }
}

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: 4px;
}

/* ==========================================================================
   End of VorthelixNode Shared Stylesheet
   ========================================================================== */