/* ============================================================
   GOTI Internet — Design System
   Brand: flame gradient (orange → magenta → violet) from the Goti "G" mark
   ============================================================ */

:root {
  /* Brand ramp — sampled from the Goti logo */
  --goti-flame:   #ff8a1f;
  --goti-ember:   #ff5f13;
  --goti-fire:    #f0341f;
  --goti-crimson: #c21e56;
  --goti-magenta: #9c1c5c;
  --goti-violet:  #6d1b5e;

  /* Surfaces */
  --ink-900: #0a0611;
  --ink-800: #120b1a;
  --ink-700: #1a1024;
  --ink-600: #241730;

  --gradient-flame: linear-gradient(115deg, #ff9a2e 0%, #ff5f13 28%, #f0341f 50%, #c21e56 74%, #6d1b5e 100%);
  --gradient-soft:  linear-gradient(135deg, rgba(255,138,31,.16), rgba(194,30,86,.16));

  --ring: 0 0 0 1px rgba(255,255,255,.07);
  --shadow-glow: 0 20px 60px -20px rgba(240,52,31,.55);
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--ink-900);
  color: #e9e4f0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.font-display { font-family: 'Space Grotesk', 'Inter', ui-sans-serif, system-ui, sans-serif; }
.tnum { font-variant-numeric: tabular-nums; }

/* Hide content until Alpine has booted, to avoid a flash of raw templates */
[x-cloak] { display: none !important; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-900); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--goti-ember), var(--goti-magenta));
  border-radius: 99px;
  border: 2px solid var(--ink-900);
}
::selection { background: rgba(240,52,31,.35); color: #fff; }

/* ---------- Brand surfaces ---------- */
.brand-text {
  background: var(--gradient-flame);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.glass {
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Gradient hairline border that survives rounded corners */
.border-flame {
  position: relative;
  background: linear-gradient(var(--ink-800), var(--ink-800)) padding-box,
              var(--gradient-flame) border-box;
  border: 1px solid transparent;
}

.glow-flame { box-shadow: var(--shadow-glow); }

/* Ambient blurred light blobs */
.blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(90px);
  opacity: .5;
  pointer-events: none;
  will-change: transform;
}

/* Dot / line grid backdrop */
.grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

/* ============================================================
   Animations — "internet vibe"
   ============================================================ */

/* Fiber-optic light pulse travelling down a line */
@keyframes fiber-run {
  0%   { transform: translateY(-120%); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateY(520%); opacity: 0; }
}
.fiber {
  position: absolute; top: 0; width: 1px; height: 22vh;
  background: linear-gradient(to bottom, transparent, var(--goti-ember), var(--goti-crimson), transparent);
  animation: fiber-run 5.5s cubic-bezier(.45,.05,.55,.95) infinite;
  filter: drop-shadow(0 0 6px rgba(255,95,19,.9));
}

/* Signal rings radiating from a tower / node */
@keyframes signal-ring {
  0%   { transform: scale(.35); opacity: .85; }
  100% { transform: scale(2.6);  opacity: 0; }
}
.signal-ring {
  position: absolute; inset: 0;
  border: 1.5px solid rgba(255,95,19,.5);
  border-radius: 9999px;
  animation: signal-ring 3.2s ease-out infinite;
}

/* Slow drift for ambient blobs */
@keyframes drift {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  33%      { transform: translate3d(28px,-34px,0) scale(1.08); }
  66%      { transform: translate3d(-22px,20px,0) scale(.94); }
}
.animate-drift { animation: drift 18s ease-in-out infinite; }

/* Gentle float for cards / mock devices */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
.animate-float { animation: float-y 6s ease-in-out infinite; }

/* Animated gradient wash */
@keyframes gradient-pan {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.animate-gradient {
  background-size: 250% 250%;
  animation: gradient-pan 8s ease infinite;
}

/* Marquee ticker */
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.animate-marquee { animation: marquee 32s linear infinite; }
.marquee-mask {
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

/* Radar sweep for the coverage checker */
@keyframes radar-sweep { to { transform: rotate(360deg); } }
.radar-sweep {
  background: conic-gradient(from 0deg, transparent 0deg, rgba(255,95,19,.45) 40deg, transparent 80deg);
  animation: radar-sweep 1.6s linear infinite;
}

/* Shimmer sweep across a surface */
@keyframes shimmer { 100% { transform: translateX(220%); } }
.shimmer::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.16), transparent);
  transform: translateX(-120%);
  animation: shimmer 2.8s ease-in-out infinite;
}

/* Blinking status LED */
@keyframes led { 0%,100% { opacity:1; box-shadow:0 0 10px currentColor; } 50% { opacity:.35; box-shadow:0 0 2px currentColor; } }
.animate-led { animation: led 1.6s ease-in-out infinite; }

/* Typewriter caret */
@keyframes caret { 0%,49% { opacity:1 } 50%,100% { opacity:0 } }
.caret::after { content:'|'; margin-left:2px; animation: caret 1s step-end infinite; color: var(--goti-ember); }

/* ---------- Scroll reveal (driven by the x-reveal directive) ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal='in'] { opacity: 1; transform: none; }

/* ---------- Components ---------- */
.btn-flame {
  position: relative; overflow: hidden;
  background: var(--gradient-flame);
  background-size: 200% 200%;
  transition: background-position .6s ease, transform .2s ease, box-shadow .3s ease;
}
.btn-flame:hover { background-position: 100% 0; transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.btn-flame:active { transform: translateY(0); }

/* Card hover lift + spotlight that follows the cursor */
.card-lift { transition: transform .35s cubic-bezier(.22,1,.36,1), border-color .35s ease, box-shadow .35s ease; }
.card-lift:hover { transform: translateY(-6px); border-color: rgba(255,95,19,.45); box-shadow: 0 24px 60px -28px rgba(240,52,31,.6); }

.spotlight { position: relative; }
.spotlight::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(320px circle at var(--mx,50%) var(--my,50%), rgba(255,95,19,.14), transparent 65%);
  opacity: 0; transition: opacity .3s ease;
}
.spotlight:hover::before { opacity: 1; }

/* Speed gauge arc */
.gauge-arc { transition: stroke-dashoffset 1.4s cubic-bezier(.22,1,.36,1); }

/* Nav underline */
.nav-link { position: relative; }
.nav-link::after {
  content: ''; position: absolute; left: 0; bottom: -6px; height: 2px; width: 100%;
  background: var(--gradient-flame);
  transform: scaleX(0); transform-origin: right; transition: transform .32s cubic-bezier(.22,1,.36,1);
  border-radius: 2px;
}
.nav-link:hover::after, .nav-link[data-active='true']::after { transform: scaleX(1); transform-origin: left; }

/* Range slider */
input[type='range'].flame-range { -webkit-appearance: none; appearance: none; background: transparent; }
input[type='range'].flame-range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 99px;
  background: linear-gradient(90deg, var(--goti-ember) var(--pct,50%), rgba(255,255,255,.12) var(--pct,50%));
}
input[type='range'].flame-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -8px; border-radius: 99px;
  background: #fff; border: 3px solid var(--goti-fire);
  box-shadow: 0 0 14px rgba(240,52,31,.7); cursor: pointer;
}
input[type='range'].flame-range::-moz-range-track { height: 6px; border-radius: 99px; background: rgba(255,255,255,.12); }
input[type='range'].flame-range::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--goti-ember); }
input[type='range'].flame-range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 99px; background: #fff;
  border: 3px solid var(--goti-fire); box-shadow: 0 0 14px rgba(240,52,31,.7); cursor: pointer;
}

/* Page transition */
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.page-enter { animation: page-in .5s cubic-bezier(.22,1,.36,1) both; }

/* ---------- Accessibility ---------- */
:focus-visible { outline: 2px solid var(--goti-flame); outline-offset: 3px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  .fiber, .signal-ring, .animate-drift, .animate-float, .animate-gradient,
  .animate-marquee, .radar-sweep, .shimmer::after, .animate-led, .caret::after,
  .page-enter { animation: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .gauge-arc { transition: none !important; }
}
