/* ============================================================
   anime.js clone — visual stylesheet
   Aesthetic: dark editorial / tech-elegant
   Typography: Fraunces (serif display) + JetBrains Mono (UI)
   ============================================================ */

:root {
  --bg: #0a0a0d;
  --bg-2: #111116;
  --ink: #ececf2;
  --ink-dim: #8a8a96;
  --ink-faint: #4a4a55;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);

  --accent-a: #ff4ecd;     /* pink */
  --accent-b: #42d6ff;     /* cyan */
  --accent-c: #d6ff5d;     /* lime */
  --accent-warm: #ffb347;

  --rail: 28px;
  --pad: 56px;

  --font-display: "Fraunces", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  cursor: none;
  position: relative;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; background: 0; color: inherit; cursor: none; }

/* ============================================================
   WebGL canvas
   ============================================================ */
#webgl {
  position: fixed;
  inset: 0;
  z-index: 1;
}
#webgl canvas { display: block; }

/* ============================================================
   Grid overlay + vignette + noise
   ============================================================ */
.grid {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 90%);
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.55) 100%),
    linear-gradient(180deg, rgba(10,10,13,0.4) 0%, transparent 30%, transparent 70%, rgba(10,10,13,0.6) 100%);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='1'/></svg>");
}

/* ============================================================
   Cursor (custom)
   ============================================================ */
.cursor, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor {
  width: 6px; height: 6px;
  background: var(--accent-c);
  border-radius: 50%;
  mix-blend-mode: difference;
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  transition: width .25s var(--ease-out), height .25s var(--ease-out),
              border-color .25s var(--ease-out), background .25s var(--ease-out);
}
.cursor-ring.is-hover {
  width: 56px; height: 56px;
  border-color: var(--accent-c);
  background: rgba(214,255,93,0.06);
}

/* ============================================================
   Loader
   ============================================================ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: grid;
  place-items: center;
  transition: opacity .8s var(--ease-out), visibility .8s;
}
.loader.is-done { opacity: 0; visibility: hidden; }

.loader-inner {
  width: min(420px, 70vw);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.loader-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.loader-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-c);
  box-shadow: 0 0 16px var(--accent-c);
  animation: pulse 1.2s ease-in-out infinite;
}
.loader-name em { font-style: italic; color: var(--ink-dim); }

.loader-bar {
  height: 1px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.loader-bar span {
  position: absolute; inset: 0 100% 0 0;
  background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
  transition: right .15s linear;
}

.loader-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

/* ============================================================
   Rails — top left & top right
   ============================================================ */
.rail {
  position: fixed;
  top: var(--rail);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 20px;
}
.rail--left { left: var(--pad); }
.rail--right { right: var(--pad); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 80, "SOFT" 30;
}
.brand__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-c);
  box-shadow: 0 0 14px var(--accent-c);
  animation: pulse 2s ease-in-out infinite;
}
.brand__name em {
  font-style: normal;
  color: var(--accent-c);
  margin: 0 1px;
}

.rail__meta .tag {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
}

/* nav */
.rail--right { gap: 28px; }
.nav-link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink);
  position: relative;
  padding: 6px 0;
  transition: color .25s var(--ease-out);
}
.nav-link span:first-child {
  font-size: 9px;
  color: var(--ink-faint);
  letter-spacing: 0.2em;
}
.nav-link .arrow {
  font-size: 10px;
  color: var(--ink-dim);
  transition: transform .25s var(--ease-out);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--accent-c);
  transition: right .35s var(--ease-out);
}
.nav-link:hover { color: var(--accent-c); }
.nav-link:hover::after { right: 0; }
.nav-link:hover .arrow { transform: translate(2px, -2px); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  z-index: 20;
  height: 100vh;
  padding: 0 var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
  max-width: 740px;
}
.hero > * { pointer-events: auto; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  margin-bottom: 36px;
  width: fit-content;
}
.pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-a);
  box-shadow: 0 0 12px var(--accent-a);
  animation: pulse 1.5s ease-in-out infinite;
}

.display {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(64px, 11vw, 160px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  margin-bottom: 32px;
}
.display em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent-c);
  font-variation-settings: "opsz" 144, "SOFT" 100;
}
.display .line {
  display: block;
  overflow: hidden;
}
.display .word {
  display: inline-block;
  transform: translateY(110%);
  will-change: transform;
}
.display.is-in .line:nth-child(1) .word { animation: rise .9s var(--ease-out) 0.2s forwards; }
.display.is-in .line:nth-child(2) .word { animation: rise .9s var(--ease-out) 0.35s forwards; }

@keyframes rise {
  to { transform: translateY(0); }
}

.lead {
  max-width: 520px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-dim);
  margin-bottom: 40px;
}
.lead__hl {
  color: var(--ink);
  background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  border-radius: 100px;
  transition: background .3s var(--ease-out), border-color .3s var(--ease-out),
              color .3s var(--ease-out), transform .3s var(--ease-out);
  overflow: hidden;
  white-space: nowrap;
}

.btn--code {
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
}
.btn--code .btn__prompt {
  color: var(--accent-a);
  font-weight: 500;
}
.btn--code:hover {
  background: var(--accent-c);
  border-color: var(--accent-c);
  color: var(--bg);
}
.btn--code:hover .btn__prompt { color: var(--bg); }
.btn__icon {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  opacity: 0.6;
  transition: opacity .25s;
}
.btn--code:hover .btn__icon { opacity: 1; }

.btn__feedback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--accent-c);
  color: var(--bg);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  transform: translateY(100%);
  transition: transform .35s var(--ease-out);
}
.btn--code.is-copied .btn__feedback { transform: translateY(0); }

.btn--ghost {
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn--ghost:hover {
  border-color: var(--ink);
  background: rgba(255,255,255,0.05);
}
.btn__arrow {
  display: inline-block;
  transition: transform .35s var(--ease-out);
}
.btn--ghost:hover .btn__arrow { transform: translateX(4px); }

/* ============================================================
   Footbar (bottom area)
   ============================================================ */
.footbar {
  position: fixed;
  bottom: 64px;
  left: var(--pad);
  right: var(--pad);
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 32px;
  pointer-events: none;
}
.footbar > * { pointer-events: auto; }

.footbar__shape {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footbar__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
}
.footbar__value {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color .4s var(--ease-out);
  font-variation-settings: "opsz" 60;
}

.footbar__stats {
  display: flex;
  gap: 36px;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}
.stat__num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variation-settings: "opsz" 60;
}
.stat__lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
}
.stat--inf .stat__num { color: var(--accent-c); font-style: italic; }

.footbar__hint {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-dim);
}
.footbar__hint-line {
  width: 60px;
  height: 1px;
  background: var(--line-strong);
  position: relative;
  overflow: hidden;
}
.footbar__hint-line::after {
  content: "";
  position: absolute;
  inset: 0 100% 0 0;
  background: var(--accent-c);
  animation: hintSweep 2.5s var(--ease-inout) infinite;
}
@keyframes hintSweep {
  0%   { inset: 0 100% 0 0; }
  50%  { inset: 0 0 0 0; }
  100% { inset: 0 0 0 100%; }
}

/* ============================================================
   Ticker
   ============================================================ */
.ticker {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  height: 36px;
  border-top: 1px solid var(--line);
  background: rgba(10,10,13,0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  display: flex;
  align-items: center;
}
.ticker__track {
  display: flex;
  gap: 28px;
  white-space: nowrap;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  animation: tick 50s linear infinite;
  padding-left: 28px;
}
.ticker__track .bullet { color: var(--accent-a); }
@keyframes tick {
  to { transform: translateX(-50%); }
}

/* ============================================================
   Reveal helper (eyebrow, lead, actions)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }
.eyebrow.is-in  { transition-delay: .1s; }
.lead.is-in     { transition-delay: .9s; }
.actions.is-in  { transition-delay: 1.1s; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  :root { --pad: 24px; --rail: 22px; }
  .rail--right { display: none; }
  .footbar { grid-template-columns: 1fr; gap: 18px; }
  .footbar__stats { gap: 20px; flex-wrap: wrap; }
  .footbar__hint { display: none; }
  .footbar { bottom: 56px; }
  .stat__num { font-size: 22px; }
  body { cursor: auto; }
  button, a { cursor: pointer; }
  .cursor, .cursor-ring { display: none; }
}

@media (max-width: 520px) {
  .display { font-size: 56px; }
  .eyebrow span:nth-child(2) { font-size: 10px; }
}
