/* ── Mobile Responsiveness ── */
@media (max-width: 768px) {
  header {
    padding: 0 1rem;
    height: 56px;
  }

  .header-left {
    gap: 0.5rem;
  }

  .menu-toggle {
    display: inline-flex;
  }

  nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(10, 10, 12, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 1rem;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, visibility 0.3s;
  }

  [data-theme="light"] nav {
    background: rgba(255, 255, 255, 0.97);
    border-bottom-color: rgba(0, 0, 0, 0.1);
  }

  nav.nav-open {
    max-height: calc(100vh - 56px);
    padding: 0.5rem 1rem 1rem;
    visibility: visible;
    overflow-y: auto;
  }

  nav a {
    display: block;
    font-size: 1rem;
    padding: 0.85rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  [data-theme="light"] nav a {
    border-bottom-color: rgba(0, 0, 0, 0.06);
  }

  nav a.nav-cta {
    display: block;
    margin-top: 0.75rem;
    padding: 0.7rem 0.95rem;
    text-align: center;
    border-bottom: none;
  }

  /* Flatten nav dropdown on mobile */
  .nav-group {
    display: block;
    width: 100%;
  }
  .nav-group-trigger {
    display: block;
  }
  .nav-group-caret { display: none; }
  .nav-submenu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0 0 0 1rem;
    min-width: 0;
    gap: 0;
  }
  .nav-submenu a {
    padding: 0.75rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: normal;
  }
  [data-theme="light"] .nav-submenu a {
    border-bottom-color: rgba(0, 0, 0, 0.06);
  }

  .logo {
    height: 32px;
  }

  .hero {
    padding: 0 1.25rem 6vh;
  }

  .hero-context {
    gap: 0.4rem;
    margin-top: 1.5rem;
  }

  .context-pill {
    padding: 0.45rem 0.85rem;
    font-size: 0.92rem;
  }

  .section {
    padding: 4rem 1.25rem;
  }

  .section-inner {
    max-width: 100%;
  }

  .chat-container {
    border-radius: 12px;
  }

  .chat-messages {
    padding: 1rem;
  }

  .chat-actions {
    padding: 0 1rem 1rem;
  }

  .chat-text-input {
    padding: 0 1rem 1rem;
  }

  footer {
    padding: 1.25rem 1rem;
  }
}

@media (max-width: 480px) {
  header {
    padding: 0 0.75rem;
  }

  .header-right {
    gap: 0.5rem;
  }

  .hero {
    min-height: 80vh;
    padding: 0 1rem 4vh;
  }

  .section {
    min-height: auto;
    padding: 3rem 1rem;
  }

  .base-layer-foundation {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem 1rem;
  }

  .base-layer-content {
    text-align: center;
  }

  .feature-card {
    padding: 1.5rem 1.25rem;
  }

  .source-card {
    padding: 1.25rem;
  }

  .chat-bubble {
    max-width: 92%;
  }

  .newsletter-row {
    flex-direction: column;
  }
}

/* ── Print-only pages: hidden on screen ── */
.print-only-pages {
  display: none !important;
}

/* ── Print: each section = one page ── */
@media print {
  @page {
    size: A4;
    margin: 1.5cm;
  }

  /* Reset animations, backgrounds, shadows for print */
  * {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
  }

  body {
    background: #0a0a0c !important;
    color: #e0e0e0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Hide non-printable elements */
  #app-loader,
  site-header,
  .site-header,
  site-footer,
  .site-footer,
  .chat-container,
  .hero-chat-demo,
  .hero-dots,
  .section-contact,
  .section-linkedin,
  .about-cta,
  nav,
  .nav {
    display: none !important;
  }

  /* Show print-only pages */
  .print-only-pages {
    display: block !important;
  }

  .print-only-pages .page-container {
    page-break-before: always;
    break-before: page;
  }

  /* Make sections visible (undo scroll-reveal) */
  .section {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Each section and hero = exactly one print page */
  .hero,
  .section {
    min-height: 0;
    height: auto;
    max-height: 100vh;
    padding: 1.5rem 0;
    page-break-after: always;
    break-after: page;
    page-break-inside: avoid;
    break-inside: avoid;
    overflow: hidden;
  }

  /* Last printed section shouldn't add a trailing blank page */
  .section:last-child,
  main > .section:last-of-type {
    page-break-after: auto;
    break-after: auto;
  }

  /* Background images: preserve dark-mode appearance */
  .section-with-bg .section-bg {
    opacity: 0.25;
  }

  .hero-bg {
    opacity: 0.25;
  }

  /* Dark backgrounds for sections */
  .section,
  .hero {
    background-color: #0a0a0c !important;
  }

  .section-bg-overlay,
  .section-with-bg .section-bg-overlay,
  .hero-overlay {
    background: rgba(10, 10, 12, 0.75) !important;
  }

  /* Prevent elements from splitting across pages */
  .feature-card,
  .source-card,
  .area-tile,
  .prop-badge,
  .base-stack {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Preserve dark-mode text colors */
  .section-title,
  .section-desc,
  .feature-title,
  .feature-desc,
  .source-title,
  .source-desc,
  .area-tile-title,
  .area-tile-desc,
  .prop-label,
  .prop-desc,
  .hero-content h1,
  .hero-intro {
    color: #e0e0e0 !important;
  }

  .section-label {
    color: #A02B93 !important;
  }

  .text-muted,
  .prop-desc,
  .feature-desc,
  .source-desc,
  .area-tile-desc {
    color: #999999 !important;
  }

  /* Cards and badges keep dark styling */
  .feature-card,
  .source-card,
  .prop-badge {
    background: #121216 !important;
    border-color: #1e1e28 !important;
    color: #e0e0e0 !important;
  }

  .area-tile {
    background: #0a0a0c !important;
  }

  .base-layer-foundation,
  .base-module {
    background: #121216 !important;
    border-color: #1e1e28 !important;
    color: #e0e0e0 !important;
  }

  /* ── About (Über uns) page ── */
  .about-page,
  .page-container {
    background: #0a0a0c !important;
    color: #e0e0e0 !important;
  }

  .about-hero {
    page-break-after: always;
    break-after: page;
  }

  .about-hero h1 {
    color: #e0e0e0 !important;
  }

  .about-hero p,
  .about-lead {
    color: #999999 !important;
  }

  .about-card {
    background: #121216 !important;
    border-color: #1e1e28 !important;
    color: #e0e0e0 !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .about-card h2 {
    color: #e0e0e0 !important;
  }

  .about-card p {
    color: #999999 !important;
  }

  .about-card-icon svg {
    stroke: #A02B93 !important;
  }

  /* ── Impressum page ── */
  .legal-content {
    background: #0a0a0c !important;
    color: #e0e0e0 !important;
  }

  .legal-content h1,
  .legal-content h2,
  .legal-content h3 {
    color: #e0e0e0 !important;
  }

  .legal-content p,
  .legal-content li {
    color: #999999 !important;
  }

  .legal-content a {
    color: #A02B93 !important;
  }

  .page-container h1,
  .page-container h2 {
    color: #e0e0e0 !important;
  }

  .page-container p {
    color: #999999 !important;
  }

  .page-container a {
    color: #A02B93 !important;
  }
}
