/* ── Variables ───────────────────────────────────────── */
:root {
  --bg:  #091a10;
  --bg1: #0d2016;
  --bg2: #112918;

  --p:   #3ddc9a;
  --p2:  #2ab882;
  --pl:  #5fffc0;
  --c:   #5fd4ff;
  --c2:  #3ab8e0;
  --acc: #7b5fff;

  --text:   #f0fff6;
  --text-s: rgba(240,255,246,0.62);
  --muted:  rgba(240,255,246,0.32);

  --border:   rgba(61,220,154,0.10);
  --border-s: rgba(61,220,154,0.20);
  --border-p: rgba(61,220,154,0.32);

  --glow-p: rgba(61,220,154,0.25);
  --glow-c: rgba(95,212,255,0.18);

  --sans:   'Inter', system-ui, sans-serif;
  --disp:   'Bricolage Grotesque', 'Inter', sans-serif;
  --mono:   'JetBrains Mono', ui-monospace, monospace;

  --ease:   cubic-bezier(.22,1,.36,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
}

/* ── Reset ───────────────────────────────────────────── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { scroll-behavior:smooth; color-scheme:dark; }
::selection { background:rgba(61,220,154,.22); color:#f0fff6; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  cursor: none;
}

/* Atmospheric top glow */
body::before {
  content: '';
  position: fixed;
  inset: -10% -10% auto -10%;
  height: 80vh;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(61,220,154,.09) 0%, transparent 60%),
    radial-gradient(ellipse 40% 35% at 18% 18%, rgba(95,212,255,.07) 0%, transparent 70%),
    radial-gradient(ellipse 38% 35% at 85% 22%, rgba(123,95,255,.06) 0%, transparent 70%);
  mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
}

main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

/* ── Skip link ───────────────────────────────────────── */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  padding: .5rem 1.2rem;
  background: var(--p);
  color: #091a10;
  border-radius: .5rem;
  z-index: 10000;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  transition: top .2s;
}
.skip-link:focus { top: 1rem; }

/* ── Grid background ─────────────────────────────────── */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(61,220,154,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61,220,154,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 25%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 50% at 50% 25%, #000 20%, transparent 70%);
}

/* ── Runic background canvas ─────────────────────────── */
#runic-shader {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Tubes cursor canvas ─────────────────────────────── */
#tubes-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
#tubes-canvas.ready { opacity: 1; }

/* ── Noise grain ─────────────────────────────────────── */
.noise-grain {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .028;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.6 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
}

/* ── Custom cursor ───────────────────────────────────── */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 6px; height: 6px;
  background: var(--p);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .18s var(--ease), height .18s var(--ease), opacity .2s;
  mix-blend-mode: screen;
  box-shadow: 0 0 10px var(--p), 0 0 20px rgba(61,220,154,.4);
}
.cursor-dot.hovering {
  width: 20px; height: 20px;
  opacity: .5;
}
/* Soft ambient orb that follows cursor */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 600px; height: 600px;
  margin: -300px 0 0 -300px;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle,
    rgba(61,220,154,.09) 0%,
    rgba(95,212,255,.05) 30%,
    transparent 60%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity .4s var(--ease);
  will-change: transform;
  transform: translate3d(50vw, 50vh, 0);
}
.cursor-glow.active { opacity: 1; }

@media (hover:none),(pointer:coarse) {
  .cursor-dot,.cursor-glow { display: none; }
  body { cursor: auto; }
}

/* ── Hero layout ─────────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  max-width: 1300px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 6.5rem 4rem;
  gap: 4rem;
  z-index: 2;
  min-height: 90vh;
}

/* ── Badge ───────────────────────────────────────────── */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem 1rem .4rem .75rem;
  border: 1px solid rgba(61,220,154,.25);
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(61,220,154,.10),
    rgba(91,124,255,.045));
  margin-bottom: 2rem;
  width: fit-content;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 22px rgba(61,220,154,.06), inset 0 1px 0 rgba(255,255,255,.04);
  animation: badgeFloat 5s ease-in-out infinite;
}
@keyframes badgeFloat {
  0%,100% { transform: translateY(0);    box-shadow: 0 0 22px rgba(61,220,154,.06), inset 0 1px 0 rgba(255,255,255,.04); }
  50%      { transform: translateY(-3px); box-shadow: 0 6px 28px rgba(61,220,154,.18), inset 0 1px 0 rgba(255,255,255,.06); }
}
.badge-pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--pl);
  box-shadow: 0 0 8px var(--pl);
  flex-shrink: 0;
  animation: pulse 2.2s ease infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; box-shadow:0 0 8px var(--pl); }
  50%      { opacity:.5; box-shadow:0 0 22px var(--pl), 0 0 36px rgba(95,255,192,.25); }
}
.badge-handle {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--p);
  letter-spacing: .06em;
}

/* ── Name ────────────────────────────────────────────── */
.hero-name {
  font-family: var(--disp);
  font-size: clamp(3.2rem, 8vw, 7.5rem);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -.045em;
  color: #fff;
  margin-bottom: 1.5rem;
  text-wrap: balance;
  text-shadow:
    0 0 80px rgba(61,220,154,.10),
    0 2px 40px rgba(0,0,0,.5);
}
.scramble-char { color: var(--pl); }

/* ── Typewriter — large secondary headline like Sebin ── */
.hero-typewriter {
  display: flex;
  align-items: baseline;
  gap: .45rem;
  margin-bottom: 2.2rem;
  font-family: var(--disp);
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
}
.tw-prefix {
  color: var(--p);
  font-family: var(--mono);
  font-size: 0.45em;
  font-weight: 500;
  user-select: none;
  opacity: .6;
  align-self: center;
}
#tw-output {
  color: var(--p);
  background: linear-gradient(135deg, var(--p) 0%, var(--c) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tw-cursor {
  display: inline-block;
  width: 3px; height: .85em;
  background: var(--p);
  border-radius: 2px;
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%,100% { opacity:1; }
  50%      { opacity:0; }
}

/* ── Roles line (static, replaces typewriter role) ───── */
.hero-roles {
  font-size: clamp(.82rem, 1.1vw, .98rem);
  color: var(--text-s);
  letter-spacing: .02em;
  margin-bottom: 2rem;
  font-weight: 400;
}
.hero-roles span { color: var(--p); opacity: .6; margin: 0 .4em; }

/* ── Bio ─────────────────────────────────────────────── */
.hero-bio {
  max-width: 500px;
  margin-bottom: 2.8rem;
}
.hero-bio p {
  font-size: 1.05rem;
  color: var(--text-s);
  line-height: 1.78;
  margin-bottom: 1rem;
}
.hero-bio p:last-child { margin-bottom: 0; }

/* ── Social buttons ──────────────────────────────────── */
.hero-socials { display: flex; gap: .8rem; }

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-s);
  background: rgba(61,220,154,.05);
  color: var(--text-s);
  text-decoration: none;
  --mag-x: 0px;
  --mag-y: 0px;
  transform: translate(var(--mag-x), var(--mag-y));
  transition:
    color .25s,
    border-color .25s,
    background .25s,
    box-shadow .25s,
    transform .1s linear;
  backdrop-filter: blur(8px);
}
.social-btn:hover {
  color: var(--p);
  border-color: rgba(61,220,154,.45);
  background: rgba(61,220,154,.10);
  box-shadow:
    0 0 24px rgba(61,220,154,.20),
    inset 0 1px 0 rgba(61,220,154,.15);
}
.social-btn:focus-visible {
  outline: 2px solid var(--pl);
  outline-offset: 3px;
}

/* ── Globe wrapper ───────────────────────────────────── */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.globe-halo {
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(61,220,154,.12) 0%,
    rgba(95,212,255,.06) 40%,
    transparent 70%);
  pointer-events: none;
  animation: haloBreath 5s ease-in-out infinite;
}
@keyframes haloBreath {
  0%,100% { opacity:.6; transform:scale(1); }
  50%      { opacity:1; transform:scale(1.06); }
}
#globe-canvas {
  display: block;
  position: relative;
  z-index: 2;
  filter:
    drop-shadow(0 0 32px rgba(61,220,154,.35))
    drop-shadow(0 0 64px rgba(95,212,255,.15));
}

/* ── Embers — slow drifting sparks ──────────────────────── */
.embers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.embers span {
  position: absolute;
  bottom: -12px;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--p);
  box-shadow: 0 0 8px var(--p), 0 0 14px rgba(95,212,255,.4);
  opacity: 0;
  animation: emberDrift 16s linear infinite;
  will-change: transform, opacity;
}
.embers span:nth-child(1) { left:  8%; animation-delay:  0s;   animation-duration: 16s; }
.embers span:nth-child(2) { left: 22%; animation-delay:  3.2s; animation-duration: 18s; width:2px; height:2px; }
.embers span:nth-child(3) { left: 41%; animation-delay:  6.5s; animation-duration: 14s; }
.embers span:nth-child(4) { left: 58%; animation-delay:  1.8s; animation-duration: 20s; width:2px; height:2px; }
.embers span:nth-child(5) { left: 73%; animation-delay:  9.4s; animation-duration: 17s; }
.embers span:nth-child(6) { left: 88%; animation-delay:  4.7s; animation-duration: 15s; width:4px; height:4px; }
@keyframes emberDrift {
  0%   { transform: translate3d(0, 0, 0) scale(.6); opacity: 0; }
  10%  { opacity: .85; }
  40%  { transform: translate3d(14px, -42vh, 0) scale(1); opacity: .55; }
  75%  { transform: translate3d(-10px, -78vh, 0) scale(.85); opacity: .25; }
  100% { transform: translate3d(8px, -110vh, 0) scale(.5); opacity: 0; }
}

/* ── Reveal animations — blur + scale + slide ────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px) scale(.96);
  filter: blur(8px);
  transition:
    opacity .9s cubic-bezier(.22,1,.36,1),
    transform .9s cubic-bezier(.22,1,.36,1),
    filter .7s cubic-bezier(.22,1,.36,1);
  will-change: transform, opacity;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  will-change: auto;
}
.reveal-d1 { transition-delay:.08s; }
.reveal-d2 { transition-delay:.16s; }
.reveal-d3 { transition-delay:.24s; }
.reveal-d4 { transition-delay:.32s; }
.reveal-d5 { transition-delay:.40s; }

/* ── Cat ─────────────────────────────────────────────── */
#cat-neko { position: absolute; pointer-events: none; z-index: 9990; }
.hero-content { position: relative; }
@keyframes catZzz {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(4px, -24px) scale(.55); }
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 5rem 1.75rem 3rem;
    text-align: center;
    gap: 0;
    min-height: auto;
  }
  .hero-badge      { margin: 0 auto 1.6rem; }
  .hero-typewriter { justify-content: center; font-size: clamp(1.5rem, 7vw, 2.4rem); }
  .hero-bio        { margin: 0 auto 2.5rem; text-align: left; }
  .hero-socials    { justify-content: center; }
  .hero-visual     { display: none; }
}
@media (max-width: 480px) {
  .hero-name        { letter-spacing: -.03em; }
  .hero-typewriter  { font-size: clamp(1.3rem, 8vw, 2rem); }
}
@media (max-width: 480px) {
  .hero-name { letter-spacing: -.02em; }
}
