/* ============================================================
   BonGO — Design System
   Vibe:  Soft Structuralism (premium consumer-fintech, near-white)
   Type:  Space Grotesk (display) · Plus Jakarta Sans (body) · IBM Plex Mono (technical)
   Color: ink #15171C · base #FAFAFB · accent #2E9BE6
   Motion: ease-out-expo, blur-up reveals, spring hovers
   Built applying: impeccable · high-end-visual-design · emil-design-eng
   ============================================================ */

:root {
  --ink: #15171C;
  --sub: #545962;
  --base: #FAFAFB;
  --surface: #FFFFFF;
  --line: rgba(21, 23, 28, .09);
  --line-strong: rgba(21, 23, 28, .16);
  --accent: #2E9BE6;
  --accent-deep: #1E7FC4;
  --accent-ink: #14689F; /* accessible accent for small text on white */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.32, .72, 0, 1);
  --shadow-soft: 0 1px 2px rgba(21, 23, 28, .04), 0 12px 32px -12px rgba(21, 23, 28, .12);
  --shadow-lift: 0 2px 4px rgba(21, 23, 28, .05), 0 28px 60px -24px rgba(21, 23, 28, .25);
}

* { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html { background: var(--base); scroll-behavior: smooth; }
body { background: var(--base); color: var(--sub); font-family: "Plus Jakarta Sans", system-ui, sans-serif; }

.font-display { font-family: "Space Grotesk", system-ui, sans-serif; letter-spacing: -.03em; }
.font-mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* ---------- JS gating: ohne JS bleibt alles sichtbar ---------- */
.reveal, .reveal-zoom { opacity: 1; }
html.js .reveal { opacity: 0; transform: translateY(24px); filter: blur(5px); transition: opacity .7s var(--ease), transform .7s var(--ease), filter .7s var(--ease); will-change: transform, opacity, filter; }
html.js .reveal-zoom { opacity: 0; transform: scale(1.04); filter: blur(8px); transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease); will-change: transform, opacity, filter; }
html.js .reveal.in, html.js .reveal-zoom.in { opacity: 1; transform: none; filter: none; }

/* ---------- "Ein Tap" Eingangs-Gate ---------- */
body.pre-enter { overflow: hidden; height: 100vh; }
#intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--base); transition: opacity .9s var(--ease), visibility .9s, transform 1s var(--ease), filter 1s var(--ease); }
body.entered #intro { opacity: 0; visibility: hidden; transform: scale(1.6); filter: blur(10px); pointer-events: none; }
.tap-word { position: relative; cursor: pointer; color: var(--accent-ink); display: inline-grid; place-items: center; transition: transform .4s var(--ease-spring); }
.tap-word:hover { transform: scale(1.04); }
.tap-word:active { transform: scale(.97); }
.tap-word::after { content: ""; position: absolute; left: 0; bottom: -.05em; height: .09em; width: 100%; background: var(--accent); border-radius: 99px; transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.tap-word:hover::after { transform: scaleX(1); }
.tap-ring { position: absolute; inset: -28%; border-radius: 9999px; border: 2px solid var(--accent); opacity: 0; pointer-events: none; }
@keyframes tapPulse { 0% { transform: scale(.7); opacity: .5; } 100% { transform: scale(1.5); opacity: 0; } }
.tap-word .tap-ring { animation: tapPulse 2.2s ease-out infinite; }
.tap-word .tap-ring:nth-of-type(2) { animation-delay: 1.1s; }

/* Site zoomt herein, sobald getippt wurde */
html.js #site { opacity: 0; transform: scale(.93); filter: blur(8px); transform-origin: center 38%; }
body.entered #site, html:not(.js) #site { opacity: 1; transform: none; filter: none; transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease); }

/* ---------- Scroll progress ---------- */
#progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); z-index: 80; transition: width .1s linear; }

/* ---------- Tastatur-Fokus: sichtbar und markenkonform ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Double-Bezel (Hardware-Frame-Optik) ---------- */
.bezel { background: linear-gradient(180deg, rgba(21,23,28,.06), rgba(21,23,28,.02)); border: 1px solid var(--line); border-radius: 26px; padding: 7px; box-shadow: var(--shadow-soft); }
.bezel-core { background: var(--surface); border-radius: 20px; box-shadow: inset 0 1px 1px rgba(255,255,255,.6); overflow: hidden; }
.bezel-dark { background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.03)); border: 1px solid rgba(255,255,255,.10); border-radius: 26px; padding: 7px; }
.bezel-dark .bezel-core { background: #0E0F13; box-shadow: inset 0 1px 1px rgba(255,255,255,.08); }

/* ---------- iPhone-Rahmen für echte App-Screenshots ---------- */
.phone { background: linear-gradient(160deg, #2A2D33, #0B0C0F 40%); border-radius: 3rem; padding: .5rem; box-shadow: inset 0 1px 1px rgba(255,255,255,.18), 0 2px 4px rgba(21,23,28,.08), 0 32px 64px -24px rgba(21,23,28,.4); }
.phone-screen { display: block; width: 100%; height: auto; border-radius: 2.55rem; background: #fff; }

/* ---------- Soft cards ---------- */
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-soft); transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .5s var(--ease); }
.surface-hover:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }

/* ---------- Buttons (button-in-button) ---------- */
.btn { display: inline-flex; align-items: center; gap: .55rem; border-radius: 9999px; font-weight: 600; font-family: "Plus Jakarta Sans", sans-serif; cursor: pointer; transition: transform .4s var(--ease-spring), background-color .4s var(--ease), color .4s var(--ease), box-shadow .4s var(--ease); will-change: transform; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: #fff; padding: .85rem 1rem .85rem 1.5rem; }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); padding: .85rem 1.5rem; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-ic { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 9999px; background: rgba(255,255,255,.16); transition: transform .4s var(--ease-spring); }
.btn-primary:hover .btn-ic { transform: translate(2px, -1px) scale(1.06); }

/* ---------- NFC motif ---------- */
@keyframes ripple { 0% { transform: scale(.5); opacity: .5; } 100% { transform: scale(2.3); opacity: 0; } }
.ripple-ring { animation: ripple 2.8s ease-out infinite; }
.ripple-ring:nth-child(2) { animation-delay: .9s; }
.ripple-ring:nth-child(3) { animation-delay: 1.8s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.floaty { animation: floaty 7s ease-in-out infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.nfc-arc { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 1s var(--ease) forwards; }
.nfc-arc.a2 { animation-delay: .18s; }
.nfc-arc.a3 { animation-delay: .36s; }
@keyframes flow { to { stroke-dashoffset: -14; } }
.flow { stroke-dasharray: 7 7; animation: flow 1s linear infinite; }

/* ---------- Hero-Logo: Trommel-Schlag + impulsive NFC-Wellen ---------- */
.hero-mark .drum { transform-box: fill-box; transform-origin: 50% 88%; animation: drumHit 1.5s cubic-bezier(.2, .85, .25, 1) infinite; }
@keyframes drumHit {
  0%, 58%, 100% { transform: scaleY(1) scaleX(1); }
  66% { transform: scaleY(.82) scaleX(1.07); }   /* Aufprall: stauchen */
  74% { transform: scaleY(1.07) scaleX(.97); }   /* zurückfedern */
  82% { transform: scaleY(.99) scaleX(1.01); }
  90% { transform: scaleY(1); }
}
.hero-mark .wv { transform-box: fill-box; transform-origin: 0% 100%; opacity: .35; animation: waveHit 1.5s ease-out infinite; }
.hero-mark .w2 { animation-delay: .07s; }
.hero-mark .w3 { animation-delay: .14s; }
@keyframes waveHit {
  0%, 52%, 100% { opacity: .3; transform: scale(.82); }
  64% { opacity: 1; transform: scale(1.1); }     /* synchron zum Trommel-Aufprall */
  80% { opacity: .5; transform: scale(1); }
}

/* ---------- Hero-Gerät: LED wechselt weich Weiß -> Grün ---------- */
.led-green { opacity: 0; animation: ledShift 4s ease-in-out infinite; will-change: opacity; }
@keyframes ledShift {
  0%, 30% { opacity: 0; }    /* Weiß */
  48%, 78% { opacity: 1; }   /* Grün */
  96%, 100% { opacity: 0; }  /* zurück zu Weiß */
}

/* ---------- Hinweis-Pfeil: zeichnet sich langsam ---------- */
.arrow-path { stroke-dasharray: 240; stroke-dashoffset: 240; }
.arrow-head { stroke-dasharray: 70; stroke-dashoffset: 70; }
.arrow-draw.in .arrow-path { animation: drawArrow 1.1s ease-out .25s forwards; }
.arrow-draw.in .arrow-head { animation: drawArrow .4s ease-out 1.2s forwards; }
@keyframes drawArrow { to { stroke-dashoffset: 0; } }
.arrow-bob { animation: arrowBob 2.4s ease-in-out 1.9s infinite; }
@keyframes arrowBob { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-2px, 2px); } }

/* ---------- Hardware-Detailseite: interaktive Hotspots ---------- */
#hwZoom { transition: transform 1s var(--ease); will-change: transform; }
#hwStage.hw-active #hwHotspots .hw-tag { opacity: 0; }
.hw-dot { position: absolute; transform: translate(-50%, -50%); cursor: pointer; background: none; border: 0; padding: 0; transition: opacity .4s var(--ease); }
.hw-dot.is-dim { opacity: 0; pointer-events: none; }
.hw-core { display: block; width: 16px; height: 16px; border-radius: 9999px; background: var(--c); box-shadow: 0 0 0 4px rgba(255,255,255,.9), 0 2px 8px rgba(0,0,0,.4); position: relative; z-index: 2; }
.hw-pulse { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; border-radius: 9999px; background: var(--c); transform: translate(-50%, -50%); animation: hwPulse 2s ease-out infinite; }
@keyframes hwPulse { 0% { opacity: .6; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(3.4); } }
.hw-tag { position: absolute; left: 50%; top: -10px; transform: translate(-50%, -100%); white-space: nowrap; font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 600; color: #fff; background: var(--c); padding: 4px 9px; border-radius: 9999px; box-shadow: 0 4px 12px rgba(0,0,0,.3); transition: opacity .3s var(--ease); }
.hw-tag::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; background: var(--c); transform: translateX(-50%) rotate(45deg); }
.hw-dot.is-active .hw-core { box-shadow: 0 0 0 5px rgba(255,255,255,1), 0 0 0 9px var(--c), 0 2px 10px rgba(0,0,0,.5); }

@media (prefers-reduced-motion: reduce) {
  #hwZoom { transition: none; }
  .hw-pulse { animation: none; }
}

/* scroll cue */
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(6px); opacity: 1; } }
.cue { animation: cue 2s ease-in-out infinite; }

/* ---------- Marquee ---------- */
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-track { animation: marquee 36s linear infinite; }

/* ---------- Mobile menu ---------- */
#mobileMenu { transition: opacity .5s var(--ease), visibility .5s; }
#mobileMenu.hidden-menu { opacity: 0; visibility: hidden; pointer-events: none; }
#mobileMenu a { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
#mobileMenu:not(.hidden-menu) a { opacity: 1; transform: none; }
#mobileMenu:not(.hidden-menu) a:nth-child(1) { transition-delay: .08s; }
#mobileMenu:not(.hidden-menu) a:nth-child(2) { transition-delay: .14s; }
#mobileMenu:not(.hidden-menu) a:nth-child(3) { transition-delay: .20s; }
#mobileMenu:not(.hidden-menu) a:nth-child(4) { transition-delay: .26s; }
#mobileMenu:not(.hidden-menu) a:nth-child(5) { transition-delay: .32s; }
#mobileMenu:not(.hidden-menu) a:nth-child(6) { transition-delay: .38s; }
.burger span { transition: transform .4s var(--ease-spring), opacity .3s var(--ease); }
.burger.open span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ---------- Ausgaben-Chart: Balken wachsen + Akzent atmet ---------- */
.chartbars .bar { transform: scaleY(0); transform-origin: bottom; }
.chartbars.play .bar { animation: barGrow .7s var(--ease) forwards; }
.chartbars.play .bar:nth-child(1) { animation-delay: .05s; }
.chartbars.play .bar:nth-child(2) { animation-delay: .14s; }
.chartbars.play .bar:nth-child(3) { animation-delay: .23s; }
.chartbars.play .bar:nth-child(4) { animation-delay: .32s; }
.chartbars.play .bar:nth-child(5) { animation-delay: .41s; }
.chartbars.play .bar-accent { animation: barGrow .7s var(--ease) .32s forwards, barBreathe 2.6s ease-in-out 1.1s infinite; }
@keyframes barGrow { to { transform: scaleY(1); } }
@keyframes barBreathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.14); } }

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  html.js .reveal, html.js .reveal-zoom { opacity: 1; transform: none; filter: none; transition: none; }
  html.js #site { opacity: 1; transform: none; filter: none; }
  body.pre-enter { overflow: auto; height: auto; }
  .ripple-ring, .floaty, .nfc-arc, .flow, .marquee-track, .cue, .tap-word .tap-ring,
  .chartbars .bar, .hero-mark .drum, .hero-mark .wv, .led-green { animation: none !important; }
  .arrow-path, .arrow-head { stroke-dashoffset: 0 !important; animation: none !important; }
  .arrow-bob { animation: none !important; }
  .hero-mark .wv { opacity: .8; }
  .led-green { opacity: 0; }
  .chartbars .bar { transform: none; }
  .surface-hover:hover { transform: none; }
  html { scroll-behavior: auto; }
  #intro { transition: none; }
}
