/* ==========================================================================
   SABLEUX — Custom styles, animations & design tokens
   Tailwind (CDN) handles utility classes; this file covers what Tailwind
   can't: keyframe animations, device mockups, gradients, custom scrollbar.
   ========================================================================== */

:root {
  --gold: #c9a45c;
  --gold-light: #e6c98a;
  --ink: #0a0a0a;
  --ink-2: #121212;
  --ink-3: #1a1a1a;
}

* { scroll-behavior: smooth; }

html, body {
  background: var(--ink);
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}

h1, h2, h3, .font-display {
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--gold), #8a6d2f); border-radius: 10px; }

/* Selection */
::selection { background: var(--gold); color: #0a0a0a; }

/* ---------------------------------------------------------------------- */
/* Gradient text helper */
/* ---------------------------------------------------------------------- */
.text-gradient-gold {
  background: linear-gradient(90deg, #f3d99a 0%, var(--gold) 50%, #a9843f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------------------------------------------------------------------- */
/* Glow / ambient background blobs */
/* ---------------------------------------------------------------------- */
.bg-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}
.bg-glow-gold { background: radial-gradient(circle, var(--gold), transparent 70%); }

@keyframes float-slow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(0.6deg); }
}
@keyframes float-slower {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}
@keyframes float-tiny {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}
.animate-float-slow { animation: float-slow 6s ease-in-out infinite; }
.animate-float-slower { animation: float-slower 7.5s ease-in-out infinite; }
.animate-float-tiny { animation: float-tiny 5s ease-in-out infinite; }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px 0 rgba(201,164,92,0.35); }
  50% { box-shadow: 0 0 40px 6px rgba(201,164,92,0.55); }
}
.animate-pulse-glow { animation: pulse-glow 2.6s ease-in-out infinite; }

@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.animate-spin-slow { animation: spin-slow 18s linear infinite; }

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.animate-gradient { background-size: 200% 200%; animation: gradient-shift 8s ease infinite; }

@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.animate-marquee { animation: marquee 28s linear infinite; }

/* ---------------------------------------------------------------------- */
/* Reveal-on-scroll (JS toggles .is-visible via IntersectionObserver) */
/* ---------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1.is-visible { transition-delay: .08s; }
.reveal-delay-2.is-visible { transition-delay: .16s; }
.reveal-delay-3.is-visible { transition-delay: .24s; }
.reveal-delay-4.is-visible { transition-delay: .32s; }
.reveal-delay-5.is-visible { transition-delay: .4s; }
.reveal-delay-6.is-visible { transition-delay: .48s; }

.reveal-scale { opacity: 0; transform: scale(0.92); transition: opacity .7s ease, transform .7s ease; }
.reveal-scale.is-visible { opacity: 1; transform: scale(1); }

.reveal-left { opacity: 0; transform: translateX(-32px); transition: opacity .7s ease, transform .7s ease; }
.reveal-left.is-visible { opacity: 1; transform: translateX(0); }

.reveal-right { opacity: 0; transform: translateX(32px); transition: opacity .7s ease, transform .7s ease; }
.reveal-right.is-visible { opacity: 1; transform: translateX(0); }

/* ---------------------------------------------------------------------- */
/* Device mockups — pure CSS, matching the layered reference:
   - Laptop: centered, back layer (largest footprint)
   - Tablet: portrait, front-right, overlapping laptop's right edge,
             extending both above AND below the laptop
   - Phone:  portrait, front-left, overlapping laptop's bottom-left,
             extending below the laptop
   - Rocket badge: sits inside the composition, right of the phone,
                   under the laptop — a discoverable detail that balances
                   the empty gap.

   NOTE: All device widths are defined here in explicit CSS (not relying
   on Tailwind arbitrary values like w-[78%]) because the laptop-screen
   is aspect-ratio + absolutely-positioned content, so it has NO intrinsic
   width. Without explicit width the laptop collapses to 0px.
   ---------------------------------------------------------------------- */
.device-stage { position: relative; width: 100%; max-width: 640px; margin: 0 auto; }

/* Hero visual column wrapper — gives devices room to breathe and overflow
   without clipping. Perspective enables optional 3D tilt on hover. */
.hero-visual-wrap {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  padding: 8px 12px;
  perspective: 1400px;
}
@media (max-width: 1023px) {
  .hero-visual-wrap { margin-top: 2.5rem; }
}
.hero-visual-wrap > .relative { overflow: visible; }

/* The stack reserves proportional room so the tablet can extend above the
   laptop and the phone can extend below it without being clipped.
   Explicit width + aspect-ratio keeps the composition stable even when
   Tailwind CDN arbitrary-value classes haven't applied yet. */
.device-stack {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 4;   /* reserves the vertical room for above/below overhang */
  padding-top: 8%;   /* room above for tablet's top edge */
  padding-bottom: 12%; /* room below for phone bottom + rocket */
}
@media (min-width: 640px) {
  .device-stack { padding-top: 9%; padding-bottom: 13%; }
}
@media (min-width: 1024px) {
  .device-stack { padding-top: 10%; padding-bottom: 14%; }
}

/* ---------------------------------------------------------------------- */
/* LAPTOP — back center layer                                             */
/* Explicit width + auto margins — do not rely on Tailwind w-[78%]        */
/* ---------------------------------------------------------------------- */
.device-laptop {
  position: relative;
  width: 78%;
  margin-left: auto;
  margin-right: auto;
  z-index: 10;
}
.device-laptop .laptop-body {
  background: linear-gradient(155deg, #2a2a2a, #0d0d0d 60%);
  border-radius: 14px 14px 4px 4px;
  padding: 10px 10px 0;
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,255,255,0.06) inset;
}
.device-laptop .laptop-notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 70px; height: 10px; background: #050505; border-radius: 0 0 8px 8px;
  z-index: 2;
}
.device-laptop .laptop-screen {
  aspect-ratio: 16/10;
  border-radius: 6px;
  overflow: hidden;
  background: #050505;
  position: relative;
}
.device-laptop .laptop-base {
  height: 14px;
  background: linear-gradient(180deg, #3a3a3a, #161616);
  border-radius: 0 0 10px 10px;
  position: relative;
}
.device-laptop .laptop-base::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 25%; height: 6px; background: #0a0a0a; border-radius: 0 0 6px 6px;
}

/* ---------------------------------------------------------------------- */
/* TABLET — front-right, portrait, overlaps laptop right edge             */
/* Extends both ABOVE the laptop's top and BELOW its base                 */
/* ---------------------------------------------------------------------- */
.device-tablet {
  position: absolute;
  background: linear-gradient(155deg, #2a2a2a, #0d0d0d 60%);
  border-radius: 26px;
  padding: 12px 10px;
  box-shadow:
    0 25px 55px -12px rgba(0,0,0,0.8),
    0 0 0 1px rgba(255,255,255,0.07) inset;
  box-sizing: border-box;
  width: 30%;
  min-width: 120px;
  right: 0;
  top: 2%;
  z-index: 20;
}
@media (min-width: 640px) {
  .device-tablet { width: 31%; min-width: 138px; right: -2%; top: 1%; }
}
@media (min-width: 1024px) {
  .device-tablet { width: 32%; min-width: 158px; right: -3%; top: 0; }
}
.device-tablet .tablet-screen {
  aspect-ratio: 3/4;
  border-radius: 12px;
  overflow: hidden;
  background: #050505;
  position: relative;
}
.device-tablet .tablet-cam {
  position: absolute; top: 5px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: #333;
  z-index: 5;
}

/* ---------------------------------------------------------------------- */
/* PHONE — front-left, portrait, overlaps laptop bottom-left              */
/* Extends BELOW the laptop's base                                        */
/* ---------------------------------------------------------------------- */
.device-phone {
  position: absolute;
  background: linear-gradient(155deg, #2c2c2c, #0d0d0d 60%);
  border-radius: 24px;
  padding: 7px 6px;
  box-shadow:
    0 20px 45px -10px rgba(0,0,0,0.85),
    0 0 0 1px rgba(255,255,255,0.08) inset;
  box-sizing: border-box;
  width: 22%;
  min-width: 90px;
  left: 4%;
  bottom: 2%;
  z-index: 25;
}
@media (min-width: 640px) {
  .device-phone { width: 23%; min-width: 102px; left: 5%; bottom: 1%; }
}
@media (min-width: 1024px) {
  .device-phone { width: 24%; min-width: 116px; left: 6%; bottom: 0; }
}
.device-phone .phone-screen {
  aspect-ratio: 9/19;
  border-radius: 18px;
  overflow: hidden;
  background: #050505;
  position: relative;
}
.device-phone .phone-notch {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 38%; height: 9px; background: #050505; border-radius: 10px;
  z-index: 5;
}

/* ---------------------------------------------------------------------- */
/* ROCKET BADGE — floats in the composition, right of the phone, below   */
/* the laptop's base, filling the natural gap between phone and tablet.   */
/* Layered above the laptop but below the phone so a corner tucks under.  */
/* ---------------------------------------------------------------------- */
.rocket-badge {
  position: absolute;
  left: 28%;
  bottom: 4%;
  max-width: 200px;
  z-index: 15;   /* above laptop (10), below phone (25) */
}
@media (min-width: 640px) {
  .rocket-badge { left: 30%; bottom: 3%; max-width: 210px; }
}
@media (min-width: 1024px) {
  .rocket-badge { left: 32%; bottom: 2%; max-width: 220px; }
}

/* ---------------------------------------------------------------------- */
/* Mini "website" content painted inside the screens with CSS only        */
/* ---------------------------------------------------------------------- */
.mini-site { position: absolute; inset: 0; background: #0a0a0a; color: #fff; overflow: hidden; }
.mini-nav { display: flex; align-items: center; justify-content: space-between; padding: 6% 8%; }
.mini-dot { width: 6px; height: 6px; border-radius: 50%; }
.mini-line { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.14); }
.mini-line.gold { background: linear-gradient(90deg, var(--gold-light), var(--gold)); }
.mini-card { border-radius: 8px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); }
.mini-wave {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(201,164,92,0.35), transparent 55%),
              radial-gradient(ellipse at 80% 70%, rgba(201,164,92,0.18), transparent 55%);
}

/* Fade/tilt hover for whole hero visual */
.hero-tilt { transition: transform .4s ease; }

/* ---------------------------------------------------------------------- */
/* Buttons */
/* ---------------------------------------------------------------------- */
.btn-gold {
  background: linear-gradient(90deg, var(--gold-light), var(--gold));
  color: #0a0a0a;
  font-weight: 600;
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -8px rgba(201,164,92,0.55); filter: brightness(1.06); }
.btn-outline {
  border: 1px solid rgba(255,255,255,0.25);
  transition: all .25s ease;
}
.btn-outline:hover { border-color: var(--gold); background: rgba(201,164,92,0.08); transform: translateY(-2px); }

.nav-link { position: relative; }
.nav-link::after {
  content: ''; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--gold); transition: width .25s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* Card hover lift */
.card-hover { transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease; }
.card-hover:hover { transform: translateY(-6px); border-color: rgba(201,164,92,0.45); box-shadow: 0 20px 40px -20px rgba(201,164,92,0.35); }

/* Loading spinner */
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.25); border-top-color: #0a0a0a;
  animation: spin-slow 0.8s linear infinite;
}
.spinner-light {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2); border-top-color: var(--gold);
  animation: spin-slow 0.8s linear infinite;
}

/* Mobile menu */
.mobile-menu { transition: max-height .35s ease, opacity .3s ease; }

/* Toast */
.toast { transform: translateY(20px); opacity: 0; transition: all .3s ease; }
.toast.show { transform: translateY(0); opacity: 1; }

/* Utility: fine grid backdrop pattern */
.bg-grid {
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
                     linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 44px 44px;
}
