/* ===== Ayvolo — Tokens & Globals ===== */
:root {
  --bg: #091930;
  --bg-2: #0d2440;
  --bg-3: #143055;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.72);
  --text-3: rgba(255, 255, 255, 0.5);
  --accent: #DB4E5E;
  --accent-glow: rgba(219, 78, 94, 0.35);

  /* density (tweakable) */
  --pad-section: 160px;
  --pad-x: clamp(20px, 5vw, 96px);
  --gap: 24px;
  --radius: 18px;
}

@media (max-width: 900px) {
  :root { --pad-section: 90px; --pad-x: 20px; --gap: 16px; }
}
@media (max-width: 480px) {
  :root { --pad-section: 72px; --pad-x: 16px; }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  cursor: none;
  font-feature-settings: "ss01", "cv11";
}

@media (max-width: 900px) {
  body { cursor: auto; }
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: none; }
@media (max-width: 900px) { button { cursor: pointer; } }

/* ===== Background grid ===== */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 80px 80px;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(600px 400px at 80% 0%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 60%),
    radial-gradient(800px 600px at 10% 100%, rgba(60, 110, 220, 0.16), transparent 60%);
}

/* ===== Circuit animation canvas ===== */
#circuit-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}
body.no-anim #circuit-canvas { display: none; }

main { position: relative; z-index: 1; }

/* ===== Custom cursor ===== */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  transition: width .25s, height .25s, border-color .25s, background .25s;
}
.cursor-ring.hover {
  width: 56px; height: 56px;
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 10%, transparent);
}
@media (max-width: 900px) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ===== Type ===== */
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1.02; }
p { margin: 0; line-height: 1.55; color: var(--text-2); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
}

/* ===== Section frame ===== */
section {
  position: relative;
  padding: var(--pad-section) var(--pad-x);
  border-top: 1px solid var(--line);
  background: transparent;
}
.section-head {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  margin-bottom: 80px;
  align-items: end;
}
@media (max-width: 900px) {
  .section-head { grid-template-columns: 1fr; gap: 24px; margin-bottom: 40px; }
}
.section-title {
  font-size: clamp(36px, 5.5vw, 76px);
  text-wrap: balance;
}
.section-lede {
  font-size: 17px;
  max-width: 52ch;
  color: var(--text-2);
}
@media (max-width: 700px) {
  .section-lede { font-size: 15.5px; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
  position: relative;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 18px 40px -12px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: color-mix(in oklab, var(--accent) 92%, white);
}
.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.03);
}
.btn .arrow {
  width: 16px; height: 16px;
  display: inline-block;
  transition: transform .25s;
}
.btn:hover .arrow { transform: translateX(4px); }

/* ===== Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
}
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }
.reveal[data-delay="5"] { transition-delay: .40s; }

body.no-anim .reveal { opacity: 1; transform: none; transition: none; }

/* ===== Word-reveal (split-text animation) ===== */
.word-reveal { display: inline-block; overflow: hidden; vertical-align: bottom; }
.word-reveal .w {
  display: inline-block;
  transform: translateY(110%);
  transition: transform .9s cubic-bezier(.2,.7,.2,1);
}
.word-reveal.in .w { transform: none; }
.word-reveal .w:nth-child(1) { transition-delay: .00s; }
.word-reveal .w:nth-child(2) { transition-delay: .06s; }
.word-reveal .w:nth-child(3) { transition-delay: .12s; }
.word-reveal .w:nth-child(4) { transition-delay: .18s; }
.word-reveal .w:nth-child(5) { transition-delay: .24s; }
.word-reveal .w:nth-child(6) { transition-delay: .30s; }
.word-reveal .w:nth-child(7) { transition-delay: .36s; }
.word-reveal .w:nth-child(8) { transition-delay: .42s; }
.word-reveal .w:nth-child(9) { transition-delay: .48s; }
.word-reveal .w:nth-child(10) { transition-delay: .54s; }
.word-reveal .w:nth-child(11) { transition-delay: .60s; }
.word-reveal .w:nth-child(12) { transition-delay: .66s; }
body.no-anim .word-reveal .w { transform: none; transition: none; }

/* ===== Magnetic glow under cursor ===== */
.magnet {
  position: relative;
  overflow: hidden;
}
.magnet::after {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background: radial-gradient(circle 240px at var(--mx, 50%) var(--my, 50%),
    color-mix(in oklab, var(--accent) 22%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity .35s;
  border-radius: inherit;
  z-index: 0;
}
.magnet:hover::after { opacity: 1; }
.magnet > * { position: relative; z-index: 1; }

/* ===== Marquee ===== */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee {
  display: flex; overflow: hidden; gap: 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex; gap: 48px;
  animation: marquee 22s linear infinite;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 48px;
}
body.no-anim .marquee__track { animation: none; }
.marquee__item {
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.06);
  display: inline-flex; align-items: center; gap: 48px;
}
.marquee__item span { color: var(--accent); font-size: 0.5em; }

/* ===== Animated counter ===== */
.count { display: inline-block; font-variant-numeric: tabular-nums; }

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px 22px;
  background: rgba(9, 25, 48, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  width: min(960px, calc(100% - 24px));
  transition: top .3s, box-shadow .3s, background .3s;
}
.nav.scrolled {
  background: rgba(9, 25, 48, 0.92);
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.6);
}
.nav-logo {
  display: flex; align-items: center;
  margin-right: auto;
}
.nav-logo-img {
  height: 36px;
  width: auto;
  display: block;
}
.nav-links {
  display: flex; gap: 4px;
}
.nav-links a {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 999px;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-cta {
  padding: 10px 18px;
  background: var(--accent);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  transition: transform .2s;
  white-space: nowrap;
}
.nav-cta:hover { transform: translateY(-1px); }

.nav-burger {
  display: none;
  width: 40px; height: 40px;
  background: transparent;
  border: 0;
  align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text);
}
.nav-burger span {
  display: block; width: 18px; height: 1.5px;
  background: currentColor;
  position: relative;
}
.nav-burger span::before,
.nav-burger span::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 1.5px;
  background: currentColor;
  transition: transform .25s;
}
.nav-burger span::before { top: -6px; }
.nav-burger span::after { top: 6px; }
.nav-burger.is-open span { background: transparent; }
.nav-burger.is-open span::before { transform: translateY(6px) rotate(45deg); }
.nav-burger.is-open span::after { transform: translateY(-6px) rotate(-45deg); }

.nav-drawer {
  position: fixed;
  top: 76px;
  left: 12px; right: 12px;
  z-index: 199;
  background: rgba(9, 25, 48, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
  transform: translateY(-8px);
  opacity: 0;
  transition: transform .25s, opacity .25s;
}
.nav-drawer.is-open { display: flex; transform: none; opacity: 1; }
.nav-drawer a {
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}
.nav-drawer a:hover, .nav-drawer a:active { background: rgba(255,255,255,0.05); }
.nav-drawer .drawer-cta {
  margin-top: 8px;
  background: var(--accent);
  text-align: center;
  font-weight: 600;
}

@media (max-width: 760px) {
  .nav { padding: 8px 8px 8px 16px; top: 12px; }
  .nav-logo-img { height: 28px; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-burger { display: inline-flex; }
}

/* ===== Image slot styling override ===== */
image-slot {
  --slot-bg: rgba(255, 255, 255, 0.02);
  --slot-border: rgba(255, 255, 255, 0.12);
  --slot-text: rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  overflow: hidden;
}

/* ===== Density variants ===== */
body.density-compact { --pad-section: 100px; --gap: 16px; }
body.density-spacious { --pad-section: 200px; --gap: 32px; }
@media (max-width: 900px) {
  body.density-compact { --pad-section: 64px; }
  body.density-spacious { --pad-section: 120px; }
}

/* ===== Buttons mobile ===== */
@media (max-width: 600px) {
  .btn { padding: 16px 22px; font-size: 14.5px; }
}
