:root {
  --bg: #111010;
  --fg: #fff;
  --accent: #36bac6;
  --accent-2: #8ff3fb;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* animated accent line on top */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  z-index: 10;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), var(--accent), transparent);
  background-size: 200% 100%;
  animation: line 6s linear infinite;
}
@keyframes line { to { background-position: -200% 0; } }

/* interactive dot field */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* soft light that follows the cursor */
.glow {
  position: fixed;
  left: 0; top: 0;
  width: 700px; height: 700px;
  margin: -350px 0 0 -350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(54,186,198,.16), rgba(54,186,198,0) 60%);
  pointer-events: none;
  z-index: 1;
  transform: translate3d(var(--gx, 50vw), var(--gy, 40vh), 0);
  transition: opacity .6s;
}

main {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ---------- NINJACODE wordmark ---------- */
.wordmark {
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin: 0 0 2.8rem;
  font-size: clamp(2.6rem, 11vw, 7rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: .01em;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 0 40px rgba(54,186,198,.25);
}
.wordmark .code { display: inline-flex; align-items: baseline; color: var(--accent); }

.ch {
  display: inline-block;
  opacity: 0;
  animation: ch-in .8s cubic-bezier(.2,.8,.2,1) forwards;
  animation-delay: calc(var(--i) * 70ms);
}
@keyframes ch-in {
  from { opacity: 0; transform: translateY(.3em); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* the O = ninja mask */
.ninja {
  width: .74em;
  height: .74em;
  margin: 0 .035em;
  overflow: visible;
  filter: drop-shadow(0 0 18px rgba(54,186,198,.45));
  opacity: 0;
  animation: roll 1.1s cubic-bezier(.2,.8,.2,1) .5s forwards;
}
@keyframes roll {
  from { opacity: 0; transform: translateX(-1.4em) rotate(-360deg) scale(.4); }
  to   { opacity: 1; transform: none; }
}
.ninja .head  { fill: var(--accent); }
.ninja .tails { fill: var(--accent); transform-origin: 86px 36px; animation: flutter 1.4s ease-in-out infinite alternate; }
.ninja .band  { fill: var(--bg); }
.ninja .white { fill: #fff; }
.ninja .pupil { fill: var(--bg); }
.ninja .eyes  { transform-box: fill-box; transform-origin: center; animation: blink 5s 2.5s infinite; }

@keyframes flutter {
  from { transform: rotate(-10deg); }
  to   { transform: rotate(8deg); }
}
@keyframes blink {
  0%, 93%, 100% { transform: scaleY(1); }
  96%           { transform: scaleY(.08); }
}

.reveal {
  margin: 0 auto 1.6rem;
  max-width: 820px;
  font-size: clamp(1.15rem, 2.6vw, 1.65rem);
  font-weight: 300;
  line-height: 1.55;
  color: rgba(255,255,255,.88);
}

/* word-by-word reveal (spans are created in main.js) */
.w {
  display: inline-block;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(.4em);
  animation: word .8s cubic-bezier(.2,.8,.2,1) forwards;
  animation-delay: calc(var(--i) * 45ms + 700ms);
}
@keyframes word { to { opacity: 1; filter: none; transform: none; } }

.reveal em {
  font-style: normal;
  font-weight: 500;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 4s linear infinite;
}
.reveal em .w { color: transparent; background: inherit; -webkit-background-clip: text; background-clip: text; }
@keyframes shimmer { to { background-position: -200% 0; } }

.contact {
  position: relative;
  margin-top: 1.4rem;
  padding: .9rem 1.8rem;
  border: 1px solid rgba(54,186,198,.45);
  border-radius: 999px;
  color: var(--accent);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 300;
  letter-spacing: .02em;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  opacity: 0;
  animation: fade-in 1s ease 2.4s forwards;
  transition: color .3s, border-color .3s, box-shadow .3s;
}
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
.contact:hover,
.contact:focus-visible {
  color: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 0 40px rgba(54,186,198,.45);
  outline: none;
}
.contact:hover::before,
.contact:focus-visible::before { transform: scaleX(1); }

@keyframes fade-in { to { opacity: 1; } }

@media (hover: none) { .glow { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .w, .contact { opacity: 1; filter: none; transform: none; }
}
