/* ============================================================
   Genizi · Redesign Layer
   Layered on top of /css/styles.css (Tailwind+DaisyUI build).
   Scoped to new sections that opt in via the .redesign root or
   utility classes documented below.

   Design tokens (Apple/Stripe minimal dark):
     surface-0  #080808   page background
     surface-1  #0d0d0d   section background
     accent     #3b82f6   electric blue
     accent-d   #2563eb   electric blue (darker)
     ink-0      #ffffff   primary text on dark
     ink-1      #d4d4d8   body text
     ink-2      #a1a1aa   secondary text
     line       rgba(255,255,255,0.08)  hairlines
   ============================================================ */

/*@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=DM+Sans:wght@400;500;600;700;800&display=swap');*/

:root {
  --rd-surface-0: #080808;
  --rd-surface-1: #0d0d0d;
  --rd-accent:    #3b82f6;
  --rd-accent-d:  #2563eb;
  --rd-ink-0:     #ffffff;
  --rd-ink-1:     #d4d4d8;
  --rd-ink-2:     #a1a1aa;
  --rd-line:      rgba(255, 255, 255, 0.08);
  --rd-ease:      cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Typography on redesign sections ---------- */
.rd-display,
#hero .hero-headline,
#services h2,
#about-new h2,
#advantages h2 {
  /*font-family: 'DM Sans', 'Geist', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;*/
  font-feature-settings: 'ss01', 'cv01';
  letter-spacing: -0.02em;
  font-weight: 600;
}

#hero,
#services,
#about-new,
#advantages {
  /*font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;*/
  color: var(--rd-ink-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Hero ---------- */
#hero {
  background: var(--rd-surface-0);
}
#hero #hero3d {
  display: block;
  width: 100%;
  height: 100%;
}
.hero-headline {
  /* Pre-animation state for letters set by JS; ensure no FOUC */
  perspective: 800px;
}
.hero-headline .reveal-letters {
  display: inline-block;
}
.hero-subline,
.hero-ctas,
.hero-scroll {
  /* JS will fade these in; reduced-motion users will still see them via fallback */
}
@media (prefers-reduced-motion: reduce) {
  .hero-subline,
  .hero-ctas,
  .hero-scroll { opacity: 1 !important; }
}

/* ---------- Glass cards ---------- */
.rd-glass {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 1.25rem;
  transition: border-color 0.5s var(--rd-ease),
              box-shadow   0.5s var(--rd-ease),
              transform    0.5s var(--rd-ease);
  will-change: transform;
}
.rd-glass:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 60px rgba(59, 130, 246, 0.15),
              inset 0 0 0 1px rgba(59, 130, 246, 0.08);
}
.rd-glass:hover .rd-card-icon {
  transform: scale(1.1) rotate(-4deg);
  color: var(--rd-accent);
}
.rd-card-icon {
  transition: transform 0.5s var(--rd-ease), color 0.4s var(--rd-ease);
}

/* ---------- Buttons ---------- */
.rd-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.75rem;
  border-radius: 9999px;
  background: var(--rd-accent);
  color: #fff !important;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.3s var(--rd-ease),
              box-shadow 0.3s var(--rd-ease),
              transform  0.2s var(--rd-ease);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.35);
}
.rd-btn-primary:hover {
  background: var(--rd-accent-d);
  box-shadow: 0 0 50px rgba(59, 130, 246, 0.55);
  transform: translateY(-1px);
}
.rd-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--rd-ink-0) !important;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(8px);
  transition: border-color 0.3s var(--rd-ease),
              background   0.3s var(--rd-ease),
              transform    0.2s var(--rd-ease);
}
.rd-btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

/* Touch targets — keep >=44px on mobile */
@media (max-width: 640px) {
  .rd-btn-primary,
  .rd-btn-ghost { padding: 0.95rem 1.5rem; min-height: 44px; }
}

/* ---------- Eyebrow / section label ---------- */
.rd-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--rd-accent);
  font-weight: 500;
}

/* ---------- Headings on dark ---------- */
.rd-h2 {
  color: var(--rd-ink-0);
  font-size: clamp(2rem, 4.5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

/* ---------- Background helpers ---------- */
.rd-bg-surface-0 { background: var(--rd-surface-0); }
.rd-bg-surface-1 { background: var(--rd-surface-1); }
.rd-bg-radial {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.10) 0%, transparent 55%);
}
.rd-bg-grid {
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 30%, transparent 80%);
}

/* Hairlines */
.rd-hairline {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.12), transparent);
}

/* Counter stat */
.rd-stat-num {
  /*font-family: 'DM Sans', system-ui, sans-serif;*/
  font-weight: 600;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Reveal default state so non-JS users still see content (no FOUC stuck-hidden) */
.no-js .reveal-up,
.no-js .reveal-left,
.no-js .reveal-right { opacity: 1 !important; transform: none !important; }

/* Focus rings on redesign buttons (a11y) */
.rd-btn-primary:focus-visible,
.rd-btn-ghost:focus-visible {
  outline: 2px solid var(--rd-accent);
  outline-offset: 3px;
}

/* ---------- FAQ accordion ---------- */
.rd-faq summary::-webkit-details-marker { display: none; }
.rd-faq summary::marker { content: ''; }
.rd-faq summary { user-select: none; }
.rd-faq[open] summary span.rd-faq-chevron {
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--rd-accent);
}
.rd-faq-body {
  height: 0;
  opacity: 0;
  will-change: height, opacity;
}
.rd-faq[open] .rd-faq-body {
  /* JS sets concrete height; this is the fallback for no-JS */
  height: auto;
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .rd-faq-body { transition: none; }
}

/* ---------- Marquee (trust bar) ---------- */
.rd-marquee-track {
  animation: rd-marquee 32s linear infinite;
}
.rd-marquee:hover .rd-marquee-track {
  animation-play-state: paused;
}
@keyframes rd-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .rd-marquee-track { animation: none; }
}

/* ---------- Terminal-style form cursor ---------- */
.rd-cursor {
  display: inline-block;
  margin-left: 4px;
  color: var(--rd-accent);
  animation: rd-blink 1s steps(2, end) infinite;
}
@keyframes rd-blink {
  50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .rd-cursor { animation: none; }
}

/* ---------- Form submit states ---------- */
.rd-btn-primary[disabled],
.rd-btn-ghost[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}
.rd-btn-spinner.animate-spin {
  animation: rd-spin 0.9s linear infinite;
}
@keyframes rd-spin {
  to { transform: rotate(360deg); }
}

/* ---------- Process timeline ---------- */
@media (min-width: 1024px) {
  .rd-process ol > li::before { content: none; }
}

/* ---------- Portfolio card baseline ---------- */
.rd-portfolio { isolation: isolate; }
.rd-portfolio:hover { border-color: rgba(59, 130, 246, 0.45); }

/* ---------- Make sure section IDs that exist twice don't both display ---------- */
/* The legacy includes/about.php and includes/portfolio.php may also use id="about"/id="portfolio".
   Since we wire only the new includes in index.php, this is just a safety net. */
section#about + section#about,
section#portfolio + section#portfolio { display: none; }

/* ===========================================================
   FULLSCREEN MENU OVERLAY
   =========================================================== */

/* Burger button */
.rd-menu-burger { position: relative; }
.rd-burger-icon {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 18px;
  margin-right: 0.5rem;
}
.rd-burger-icon span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.4s var(--rd-ease), top 0.3s var(--rd-ease), opacity 0.2s ease;
}
.rd-burger-icon span:nth-child(1) { top: 4px;  }
.rd-burger-icon span:nth-child(2) { top: 12px; }
.rd-menu-burger.is-active .rd-burger-icon span:nth-child(1) {
  top: 8px;
  transform: rotate(45deg);
}
.rd-menu-burger.is-active .rd-burger-icon span:nth-child(2) {
  top: 8px;
  transform: rotate(-45deg);
}

/* Overlay container */
.rd-menu-overlay {
  display: block;
}
.rd-menu-overlay[aria-hidden="true"] {
  pointer-events: none;
}
.rd-menu-overlay .rd-menu-curtain,
.rd-menu-overlay .rd-menu-curtain-2 {
  will-change: transform;
  transform-origin: top;
}

/* Content baseline (hidden until JS opens) */
.rd-menu-content {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--rd-ink-1);
  background: transparent;
}
.rd-menu-item {
  will-change: transform, opacity;
}

/* Hover underline on big nav links — Apple-style "draw" from left */
.rd-menu-link {
  text-decoration: none;
  position: relative;
}
.rd-menu-text {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.1em;
}
.rd-menu-underline {
  position: absolute;
  left: 0;
  right: auto;
  bottom: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--rd-accent), #60a5fa);
  transition: width 0.5s var(--rd-ease);
}
.rd-menu-link:hover .rd-menu-underline,
.rd-menu-link:focus-visible .rd-menu-underline {
  width: 100%;
}
.rd-menu-link:hover .rd-menu-num {
  color: var(--rd-accent);
}
.rd-menu-num {
  transition: color 0.3s var(--rd-ease);
}

/* Lock body when menu open (also handled inline by JS, but CSS as safety) */
body.rd-menu-locked {
  overflow: hidden;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .rd-burger-icon span,
  .rd-menu-underline { transition: none; }
}

/* Responsive: scale down giant link type on small screens */
@media (max-width: 480px) {
  .rd-menu-link .rd-menu-text {
    font-size: 2rem !important;
    line-height: 1.08;
  }
}

/* Z-index priority: overlay sits above navbar */
.rd-menu-overlay { z-index: 100; }
nav#navbar-position { z-index: 50; }

/* ===========================================================
   FLOATING NAVBAR — LIQUID GLASS
   Reskin of nav#navbar-position only. Leaves .rd-burger-icon
   and #rd-menu-overlay rules untouched (set above).
   =========================================================== */
nav#navbar-position {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0.55rem clamp(0.5rem, 2vw, 1.25rem);
  isolation: isolate;
}

/* The actual glass surface — inset from the edges so it floats.
   HIDDEN AT TOP, fades in smoothly once user starts scrolling
   (JS toggles .is-scrolled on #navbar-position past ~20px). */
nav#navbar-position::before {
  content: "";
  position: absolute;
  inset: 0.55rem clamp(0.5rem, 2vw, 1.25rem);
  z-index: -1;
  border-radius: 9999px;
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.085) 0%,
      rgba(255, 255, 255, 0.020) 45%,
      rgba(255, 255, 255, 0.045) 100%),
    rgba(10, 11, 14, 0.55);
  backdrop-filter: blur(0px) saturate(100%);
  -webkit-backdrop-filter: blur(0px) saturate(100%);
  border: 1px solid rgba(255, 255, 255, 0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0),
    inset 0 -1px 0 rgba(0, 0, 0, 0),
    0 14px 40px -14px rgba(0, 0, 0, 0),
    0 2px 8px rgba(0, 0, 0, 0);
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity         0.55s var(--rd-ease),
    transform       0.55s var(--rd-ease),
    backdrop-filter 0.55s var(--rd-ease),
    -webkit-backdrop-filter 0.55s var(--rd-ease),
    border-color    0.55s var(--rd-ease),
    box-shadow      0.55s var(--rd-ease);
}

nav#navbar-position.is-scrolled::before {
  opacity: 1;
  transform: translateY(0);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 14px 40px -14px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Soft accent breath that fades down — gives the "glass over light" feel.
   Same scroll-gated fade-in pattern as the main glass layer. */
nav#navbar-position::after {
  content: "";
  position: absolute;
  inset: 0.55rem clamp(0.5rem, 2vw, 1.25rem);
  z-index: -1;
  border-radius: 9999px;
  background:
    radial-gradient(70% 130% at 50% -20%, rgba(59, 130, 246, 0.22), transparent 65%),
    radial-gradient(40% 100% at 100% 0%,  rgba(255, 255, 255, 0.06), transparent 70%);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  transform: translateY(-6px);
  transition: opacity 0.7s var(--rd-ease), transform 0.55s var(--rd-ease);
}

nav#navbar-position.is-scrolled::after {
  opacity: 0.7;
  transform: translateY(0);
}

/* Browsers without backdrop-filter: keep it readable once scrolled */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  nav#navbar-position.is-scrolled::before {
    background:
      linear-gradient(180deg, rgba(20, 22, 28, 0.92), rgba(10, 11, 14, 0.92));
  }
}

/* Inner button refinements (NOT touching .rd-burger-icon — only .btn wrapper) */
nav#navbar-position .btn-ghost {
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.92);
  transition:
    background-color 0.25s var(--rd-ease),
    color 0.25s var(--rd-ease),
    transform 0.25s var(--rd-ease);
}
nav#navbar-position .btn-ghost:hover,
nav#navbar-position .btn-ghost:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}
nav#navbar-position .btn-ghost:active {
  transform: scale(0.97);
}

/* Tighten the center logo so it sits cleanly on the pill */
nav#navbar-position .navbar-logo .btn {
  padding: 0.15rem 0.6rem;
  background: transparent;
}
nav#navbar-position .navbar-logo .btn:hover {
  background: transparent;
}


/* Mail icon in navbar-end picks up the accent on hover */
nav#navbar-position .navbar-end svg { transition: color 0.25s var(--rd-ease); }
nav#navbar-position .navbar-end a:hover svg { color: var(--rd-accent); }

/* On very small screens the pill goes near-edge-to-edge */
@media (max-width: 480px) {
  nav#navbar-position { padding: 0.4rem 0.4rem; }
  nav#navbar-position::before,
  nav#navbar-position::after {
    inset: 0.4rem 0.4rem;
    border-radius: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  nav#navbar-position::before,
  nav#navbar-position .btn-ghost { transition: none; }
}

/* ===========================================================
   SUBPAGE ARTICLE FRAME — wraps legacy CMS HTML and harmonizes
   the old teal/#5df9c0 references with the new accent system.
   =========================================================== */
.rd-article {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--rd-ink-1);
}
.rd-article h2, .rd-article h3, .rd-article h4 {
  font-family: 'DM Sans', 'Geist', system-ui, sans-serif;
  color: var(--rd-ink-0);
  letter-spacing: -0.02em;
  font-weight: 600;
}
.rd-article h2 { font-size: clamp(1.6rem, 2.4vw, 2.25rem); margin-top: 2.5rem; margin-bottom: 1rem; line-height: 1.15; }
.rd-article h3 { font-size: clamp(1.25rem, 1.8vw, 1.5rem); margin-top: 2rem;   margin-bottom: 0.75rem; line-height: 1.25; }
.rd-article p, .rd-article li { color: #d4d4d8; line-height: 1.7; }
.rd-article a {
  color: var(--rd-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(59, 130, 246, 0.3);
  transition: border-color 0.3s ease, color 0.3s ease;
}
.rd-article a:hover {
  color: #60a5fa;
  border-bottom-color: var(--rd-accent);
}
.rd-article ul, .rd-article ol { padding-left: 1.25rem; margin: 1rem 0; }
.rd-article li { margin: 0.4rem 0; }
.rd-article img { border-radius: 1rem; border: 1px solid var(--rd-line); }
.rd-article hr  { border-color: var(--rd-line); margin: 2.5rem 0; }

/* Override the legacy teal inline color used heavily in lang/de.php */
.rd-article [style*="#5df9c0"],
.rd-article [style*="5df9c0"],
.rd-article span[style*="color"]  {
  color: var(--rd-accent) !important;
}
.rd-article [style*="background"][style*="5df9c0"] {
  background: rgba(59, 130, 246, 0.10) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
}
/* Old "btn" boxes that referenced teal */
.rd-article .btn,
.rd-article a.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 9999px;
  background: var(--rd-accent);
  color: #fff !important;
  border: 0 !important;
  font-weight: 500;
}
.rd-article .btn:hover { background: var(--rd-accent-d); }
