/* ============================================================
   KANTORO — theme tokens, liquid glass, motion layer
   ============================================================ */

:root {
  --background: 222 47% 5%;
  --surface: 217 40% 9%;
  --foreground: 210 20% 97%;
  --muted: 215 16% 68%;
  --accent-primary: 217 91% 60%;
  --accent-cyan: 199 89% 64%;
  --accent-violet: 256 70% 66%;
  --positive: 152 60% 52%;
  --negative: 0 72% 60%;
  --border: 217 30% 15%;

  --bg: hsl(var(--background));
  --surf: hsl(var(--surface));
  --fg: hsl(var(--foreground));
  --mut: hsl(var(--muted));
  --acc: hsl(var(--accent-primary));
  --cyan: hsl(var(--accent-cyan));
  --violet: hsl(var(--accent-violet));
  --pos: hsl(var(--positive));
  --neg: hsl(var(--negative));
  --bd: hsl(var(--border));

  --maxw: 1152px;

  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Geist", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  font-family: var(--font-body);
  background: hsl(222 47% 4%);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ===== big faded watermark text behind sections ===== */
.ghost-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(96px, 19vw, 340px);
  line-height: 1;
  letter-spacing: -0.05em;
  white-space: nowrap;
  user-select: none;
  background: linear-gradient(180deg, hsl(var(--foreground) / 0.055), hsl(var(--foreground) / 0.012) 70%, hsl(var(--foreground) / 0));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ===== giant glowing brand wordmark ===== */
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.9;
  font-size: clamp(56px, 11.5vw, 184px);
  display: block;
}
.wordmark .lead { color: hsl(var(--foreground)); }
.wordmark .tail {
  background-image: linear-gradient(110deg, hsl(var(--accent-primary)), hsl(var(--accent-cyan)) 55%, hsl(var(--accent-violet)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 34px hsl(var(--accent-primary) / 0.55)) drop-shadow(0 0 70px hsl(var(--accent-cyan) / 0.3));
}

/* drop-shadow glow that works on gradient (transparent-fill) text */
.glow-text { filter: drop-shadow(0 0 22px hsl(var(--accent-primary) / 0.45)); }

/* page-wide ambient gradient field that lives behind everything */
.page-aura {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 18% 8%, hsl(var(--accent-primary) / 0.16), transparent 70%),
    radial-gradient(55% 45% at 85% 22%, hsl(var(--accent-violet) / 0.13), transparent 72%),
    radial-gradient(70% 60% at 50% 120%, hsl(var(--accent-cyan) / 0.10), transparent 70%);
  filter: saturate(1.05);
}

/* faint technical grid overlay */
.page-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(hsl(var(--foreground) / 0.025) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--foreground) / 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 35%, transparent 80%);
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 35%, transparent 80%);
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

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

/* ============================================================
   LIQUID GLASS
   ============================================================ */
.liquid-glass {
  background: rgba(255, 255, 255, calc(0.015 + var(--glass-boost, 0)));
  background-blend-mode: luminosity;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}
.liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.4px;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0.12) 20%,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0.12) 80%,
    rgba(255, 255, 255, 0.4) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* glass that also reacts to pointer with a moving sheen (cards) */
.glass-card {
  --mx: 50%;
  --my: 0%;
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}
.glass-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(240px 200px at var(--mx) var(--my),
    hsl(var(--accent-cyan) / 0.16), hsl(var(--accent-primary) / 0.08) 36%, transparent 70%);
  opacity: 0.45;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.glass-card:hover { transform: translateY(-3px); }
.glass-card:hover::after { opacity: 1; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { font-family: var(--font-body); cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 8px; font-size: 15px; line-height: 1; transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.3s ease; text-decoration: none; white-space: nowrap; }

.btn-primary {
  background: var(--acc);
  color: hsl(var(--background));
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 24px hsl(var(--accent-primary) / 0.35);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 12px 34px hsl(var(--accent-primary) / 0.5); }
.btn-primary:active { transform: translateY(1px); }

.btn-glass { color: var(--fg); font-weight: 500; }
.btn-glass:hover { filter: brightness(1.15); }

.btn-ghost { background: transparent; color: hsl(var(--foreground) / 0.8); font-weight: 500; padding: 10px 14px; border-radius: 999px; }
.btn-ghost:hover { color: var(--fg); background: hsl(var(--foreground) / 0.05); }

/* ============================================================
   GRADIENT TEXT
   ============================================================ */
.grad-text {
  background-image: linear-gradient(110deg, hsl(var(--accent-primary)), hsl(var(--accent-cyan)) 55%, hsl(var(--accent-violet)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.grad-animate {
  background-size: 220% 100%;
  animation: gradPan 7s ease-in-out infinite;
}
@keyframes gradPan { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ============================================================
   KICKER / SECTION HEADERS
   ============================================================ */
.kicker { color: var(--cyan); font-size: 12px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; }
.section-head h2 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; line-height: 1.08; }

/* ============================================================
   MOTION — entrance + ambient
   ============================================================ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }
.reveal[data-d="4"] { transition-delay: 0.32s; }
.reveal[data-d="5"] { transition-delay: 0.40s; }

@keyframes revealIn {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 hsl(var(--accent-primary) / 0.55); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 6px hsl(var(--accent-primary) / 0); }
}
.pulse-dot { animation: pulseDot 2.4s ease-in-out infinite; }

@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* shimmering hairline used under nav + section dividers */
.hairline { height: 1px; background: linear-gradient(90deg, transparent, hsl(var(--border)), transparent); }

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee-mask {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 42s linear infinite; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-track:hover { animation-play-state: paused; }

/* ============================================================
   ACCORDION
   ============================================================ */
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.acc-body.open { grid-template-rows: 1fr; }
.acc-body > div { overflow: hidden; }
.chev { transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.chev.open { transform: rotate(180deg); }

/* ============================================================
   CUSTOM CURSOR
   ============================================================ */
.cursor-dot, .cursor-ring, .cursor-glow { position: fixed; top: 0; left: 0; pointer-events: none; will-change: transform; }
.cursor-dot {
  width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; z-index: 9998;
  background: hsl(var(--accent-primary)); box-shadow: 0 0 12px hsl(var(--accent-primary));
}
.cursor-ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; z-index: 9998;
  border: 1.5px solid hsl(var(--foreground) / 0.5);
  transition: width .22s ease, height .22s ease, margin .22s ease, border-color .22s ease, background .22s ease;
}
.cursor-ring.hover { width: 60px; height: 60px; margin: -30px 0 0 -30px; border-color: hsl(var(--accent-primary) / 0.85); background: hsl(var(--accent-primary) / 0.08); }
.cursor-ring.down { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
.cursor-glow {
  width: 540px; height: 540px; margin: -270px 0 0 -270px; border-radius: 50%; z-index: 0;
  background: radial-gradient(circle, hsl(var(--accent-cyan) / 0.12), hsl(var(--accent-primary) / 0.05) 38%, transparent 62%);
}
body.custom-cursor, body.custom-cursor * { cursor: none !important; }
@media (pointer: coarse) { .cursor-dot, .cursor-ring, .cursor-glow { display: none !important; } }

/* sound toggle */
.sound-toggle {
  position: fixed; left: 20px; bottom: 20px; z-index: 60;
  width: 46px; height: 46px; border-radius: 999px;
  display: grid; place-items: center; cursor: pointer;
  background: hsl(222 47% 7% / 0.6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform .25s cubic-bezier(.22,1,.36,1), color .25s ease;
}
.sound-toggle:hover { transform: translateY(-2px) scale(1.05); }

/* ============================================================
   POINTER PARALLAX + IDLE FLOAT
   ============================================================ */
.parallax {
  transform: translate3d(calc(var(--px, 0) * var(--pd, 8px)), calc(var(--py, 0) * var(--pd, 8px)), 0);
  transition: transform .3s cubic-bezier(.22,1,.36,1);
  will-change: transform;
}
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.floaty { animation: floaty 6.5s ease-in-out infinite; }

/* ============================================================
   PRELOADER
   ============================================================ */
.preloader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  background: hsl(222 47% 4%);
  transition: opacity .6s ease, visibility .6s ease;
}
.preloader.hide { opacity: 0; visibility: hidden; }
.pre-mark {
  width: 66px; height: 66px; border-radius: 17px; display: grid; place-items: center;
  background: linear-gradient(135deg, hsl(var(--accent-primary)), hsl(var(--accent-cyan)));
  box-shadow: 0 0 55px hsl(var(--accent-primary) / 0.6), inset 0 1px 0 rgba(255,255,255,.4);
  animation: prePulse 1.5s ease-in-out infinite;
}
@keyframes prePulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 40px hsl(var(--accent-primary) / 0.5); } 50% { transform: scale(1.08); box-shadow: 0 0 70px hsl(var(--accent-primary) / 0.75); } }
.pre-word { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.34em; text-indent: 0.34em; font-size: 17px; color: hsl(var(--foreground) / 0.92); }
.pre-bar { width: 190px; height: 2px; border-radius: 2px; background: hsl(var(--foreground) / 0.12); overflow: hidden; }
.pre-bar > i { display: block; height: 100%; width: 42%; border-radius: 2px; background: linear-gradient(90deg, transparent, hsl(var(--accent-primary)), hsl(var(--accent-cyan))); animation: preBar 1.25s ease-in-out infinite; }
@keyframes preBar { 0% { transform: translateX(-130%); } 100% { transform: translateX(360%); } }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track, .pulse-dot, .grad-animate, .floaty, .pre-mark, .pre-bar > i { animation: none !important; }
  .parallax { transform: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  [style*="revealIn"] { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: hsl(var(--background)); }
::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: hsl(var(--accent-primary) / 0.5); }
