/* ============ tokens ============ */
:root {
  --bg: #0b0f1a;
  --bg-2: #131824;
  --surface: #1a1f2e;
  --surface-2: #232838;
  --fg: #f2f4f8;
  --muted: #a1a7b3;
  --heading-2: #ede9fe;
  --accent: #7c3aed;
  --accent-2: #00e0c7;
  --accent-3: #ff6b6b;
  --accent-4: #c6f32d;
  --sidebar-w: 260px;
  --max: 1200px;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .nav__logo, .hero__eyebrow, .section__num, .marquee { font-family: "Space Grotesk", system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
canvas { display: block; }

/* hide native cursor on fine-pointer devices; JS adds .custom-cursor to <body> */
body.custom-cursor, body.custom-cursor a, body.custom-cursor button { cursor: none; }

/* ============ custom cursor ============ */
.cursor, .cursor-ring { position: fixed; top: 0; left: 0; border-radius: 50%; pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); }
.cursor { width: 7px; height: 7px; background: var(--accent-2); }
.cursor-ring {
  width: 38px; height: 38px; border: 1px solid rgba(255,255,255,0.35);
  transition: width .25s var(--ease), height .25s var(--ease), background .25s, border-color .25s;
}
.cursor-ring.hover { width: 66px; height: 66px; background: rgba(124,58,237,0.18); border-color: transparent; }
.cursor-ring.hover::after {
  content: attr(data-label); position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--fg);
}
@media (hover: none) { .cursor, .cursor-ring { display: none; } }

/* ============ intro overlay ============ */
.intro {
  position: fixed; inset: 0; z-index: 9000; background: var(--bg);
  display: grid; place-items: center;
  transition: transform .9s var(--ease); will-change: transform;
}
.intro.done { transform: translateY(-100%); }
.intro__code { display: flex; align-items: center; gap: .12em;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: clamp(2.2rem, 9vw, 5rem); font-weight: 600; color: var(--fg); }
.intro__prompt { color: var(--accent-2); }
.intro__cursor { display: inline-block; width: .1em; height: .8em; background: var(--accent-2);
  animation: introBlink .9s steps(1) infinite; }
@keyframes introBlink { 50% { opacity: 0; } }

/* ============ progress ============ */
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 100;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ============ layout: sidebar + main ============ */
.layout { display: flex; min-height: 100vh; }
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column; padding: 1.8rem 1.5rem;
  background: var(--bg-2); border-right: 1px solid rgba(255,255,255,.06); }
.sidebar__logo { font-weight: 700; font-size: 1.25rem; letter-spacing: .04em; margin-bottom: 2.4rem; }
.sidebar__logo span { color: var(--accent-2); }
.sidebar__links { display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.sidebar__links a { display: flex; align-items: center; gap: .85rem; padding: .7rem .8rem; border-radius: 10px;
  color: var(--muted); font-size: .95rem; transition: background .25s, color .25s; }
.sidebar__links a svg { flex: none; opacity: .85; }
.sidebar__links a:hover { background: var(--surface); color: var(--fg); }
.sidebar__cta { margin-top: 1.6rem; padding: 1.2rem; border-radius: 14px; background: var(--surface); border: 1px solid rgba(255,255,255,.08); }
.sidebar__cta-title { font-family: "Space Grotesk"; font-weight: 600; margin: 0 0 .2rem; }
.sidebar__cta-sub { color: var(--muted); font-size: .85rem; margin-bottom: .8rem; }
.sidebar__cta-link { color: var(--accent-2); font-size: .85rem; font-weight: 600; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); }

/* mobile top bar (replaces sidebar on narrow screens) */
.topbar { display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  align-items: center; justify-content: space-between; padding: 1rem 1.2rem;
  background: rgba(11,15,26,.85); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255,255,255,.06); }
.topbar__logo { font-weight: 700; letter-spacing: .04em; }
.topbar__logo span { color: var(--accent-2); }
.topbar.scrolled { background: rgba(11,15,26,.95); }

.nav__toggle { display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 34px; height: 34px; background: none; border: none; padding: 0; cursor: pointer; z-index: 60; }
.nav__toggle span { display: block; width: 100%; height: 2px; background: var(--fg); border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s var(--ease); }
body.nav-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav__toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-overlay { position: fixed; inset: 0; z-index: 39; background: rgba(0,0,0,.55);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); display: none; }

@media (max-width: 900px) {
  .topbar { display: flex; }
  .sidebar-overlay { display: block; }
  .sidebar {
    transform: translateX(-100%); transition: transform .35s var(--ease);
    box-shadow: 20px 0 60px rgba(0,0,0,.4); top: 0;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .main { margin-left: 0; padding-top: 4.4rem; }
}

/* ============ hero ============ */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center;
  padding: 4rem clamp(1.2rem, 5vw, 3.5rem) 5.5rem; overflow: hidden; }
.hero__blobs { position: absolute; inset: 0; z-index: 0; filter: blur(60px); opacity: .8; }
.blob { position: absolute; border-radius: 50%; will-change: transform; }
.blob--1 { width: 42vw; height: 42vw; left: -6vw; top: 6vw; background: radial-gradient(circle, var(--accent), transparent 70%); animation: float1 14s var(--ease) infinite; }
.blob--2 { width: 34vw; height: 34vw; right: -4vw; top: 20vh; background: radial-gradient(circle, var(--accent-2), transparent 70%); animation: float2 18s var(--ease) infinite; }
.blob--3 { width: 26vw; height: 26vw; left: 30vw; bottom: -10vh; background: radial-gradient(circle, var(--accent-3), transparent 70%); animation: float1 20s var(--ease) infinite reverse; }
@keyframes float1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(4vw,-3vw)} }
@keyframes float2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-5vw,4vw)} }

.hero__inner { position: relative; z-index: 1; max-width: var(--max); width: 100%; margin: 0 auto; }
.hero__eyebrow { text-transform: uppercase; letter-spacing: .3em; font-size: .78rem; color: var(--accent-2); margin-bottom: 1.4rem; }
.hero__title { font-size: clamp(3.5rem, 16vw, 12rem); font-weight: 700; line-height: .9; letter-spacing: -.03em; margin-bottom: 2rem; }
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease); }
.hero__title .line:nth-child(2) > span { transition-delay: .1s; }
body.loaded .hero__title .line > span { transform: translateY(0); }
.hero__title [data-hover] { transition: color .3s; cursor: default; }
.hero__title [data-hover]:hover { color: var(--accent); }

.hero__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: center; }
@media (max-width: 780px) { .hero__grid { grid-template-columns: 1fr; } }
.hero__meta { display: flex; flex-direction: column; align-items: flex-start; gap: 1.6rem; }
.hero__sub { font-size: clamp(1rem, 1.8vw, 1.25rem); color: var(--muted); max-width: 40ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; }

.btn { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; padding: .95rem 1.7rem;
  border-radius: 100px; border: 1px solid transparent; transition: transform .3s var(--ease), background .3s var(--ease), color .3s, border-color .3s, box-shadow .3s; }
.btn svg { transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateY(3px); }
.btn--primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px rgba(124,58,237,.55); }
.btn--secondary { background: transparent; color: var(--fg); border-color: rgba(255,255,255,.22); }
.btn--secondary:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); }

/* code card */
.code-card { background: var(--surface-2); border: 1px solid rgba(255,255,255,.08); border-radius: 16px;
  overflow: hidden; box-shadow: 0 30px 60px -25px rgba(0,0,0,.6); }
.code-card__bar { display: flex; gap: .45rem; padding: .85rem 1rem; background: rgba(255,255,255,.03); border-bottom: 1px solid rgba(255,255,255,.06); }
.code-card__bar .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot--r { background: #ff5f56; } .dot--y { background: #ffbd2e; } .dot--g { background: #27c93f; }
.code-card__body { padding: 1.3rem 1.2rem; font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .85rem; line-height: 1.9; overflow-x: auto; }
.code-line { display: flex; gap: 1rem; white-space: pre; }
.code-line--indent { padding-left: 1.4rem; }
.ln { color: rgba(255,255,255,.25); width: 1.1rem; text-align: right; flex: none; user-select: none; }
.tok-kw { color: var(--accent); } .tok-str { color: var(--accent-2); } .tok-fn { color: var(--accent-4); } .tok-punc { color: var(--fg); opacity: .55; }

.scroll-hint { position: absolute; bottom: 2rem; left: clamp(1.2rem, 5vw, 3.5rem); display: flex; align-items: center; gap: .8rem;
  font-size: .72rem; letter-spacing: .25em; text-transform: uppercase; color: var(--muted); }
.scroll-hint__line { width: 60px; height: 1px; background: var(--muted); position: relative; overflow: hidden; }
.scroll-hint__line::after { content: ""; position: absolute; inset: 0; background: var(--fg); transform: translateX(-100%); animation: swipe 2s var(--ease) infinite; }
@keyframes swipe { 50%,100%{transform:translateX(100%)} }

/* ============ feature cards ============ */
.features { max-width: var(--max); margin: 0 auto; padding: 0 clamp(1.2rem, 5vw, 3.5rem) clamp(2rem, 5vw, 3rem);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 780px) { .features { grid-template-columns: 1fr; } }
.feature { padding: 1.8rem; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; background: var(--surface);
  transition: transform .4s var(--ease), border-color .3s; }
.feature:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.18); }
.feature__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 1.1rem; }
.feature__icon--purple { background: rgba(124,58,237,.18); color: var(--accent); }
.feature__icon--teal { background: rgba(0,224,199,.16); color: var(--accent-2); }
.feature__icon--coral { background: rgba(255,107,107,.16); color: var(--accent-3); }
.feature h3 { font-family: "Space Grotesk"; font-size: 1.2rem; margin-bottom: .5rem; }
.feature__icon--purple ~ h3 { color: var(--accent); }
.feature__icon--teal ~ h3 { color: var(--accent-2); }
.feature__icon--coral ~ h3 { color: var(--accent-3); }
.feature p { color: var(--muted); font-size: .92rem; }

/* ============ marquee ============ */
.marquee { overflow: hidden; border-top: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 1.1rem 0; white-space: nowrap; }
.marquee__track { display: inline-flex; animation: scroll 22s linear infinite; }
.marquee__track span { font-size: clamp(1.4rem, 4vw, 2.6rem); font-weight: 600; letter-spacing: -.01em; padding-right: 1rem;
  color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.35); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ============ sections ============ */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(2.25rem, 4.5vw, 3.5rem) clamp(1.2rem, 5vw, 3.5rem); }
.section__head { margin-bottom: 1.8rem; }
.section__num { display: block; color: var(--accent); font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .8rem; }
.section h2 { font-size: clamp(2rem, 6vw, 4rem); font-weight: 600; letter-spacing: -.03em; line-height: 1; color: var(--heading-2); }

/* experience */
.exp { display: flex; flex-direction: column; gap: 1.4rem; }
.exp__item { display: flex; gap: 1.6rem; align-items: flex-start; padding: 1.8rem; border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px; background: var(--surface); transition: border-color .3s, transform .4s var(--ease); }
.exp__item:hover { border-color: rgba(255,255,255,.18); transform: translateY(-2px); }
.exp__logo { flex: none; width: 64px; height: 64px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.exp__logo img { width: 72%; height: 72%; object-fit: contain; }
.exp__logo--text { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  font-family: "Space Grotesk", system-ui, sans-serif; font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; }
.exp__body { flex: 1; min-width: 0; }
.exp__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem .8rem; margin-bottom: .6rem; }
.exp__top h3 { font-size: 1.3rem; letter-spacing: -.01em; }
.exp__tag { color: var(--accent-2); font-size: .82rem; white-space: nowrap; }
.exp__desc { color: var(--muted); font-size: .98rem; max-width: 60ch; }
@media (max-width: 560px){ .exp__item { flex-direction: column; } }

/* featured (bigger employer) vs grid (smaller entries) */
.exp__item--featured { background: var(--surface-2); border-color: rgba(255,255,255,.14); padding: 2.2rem; }
.exp__item--featured .exp__logo { width: 88px; height: 88px; border-radius: 14px; }
.exp__item--featured .exp__top h3 { font-size: 1.7rem; }
.exp__item--featured .exp__tag { font-size: .88rem; }
.exp__item--featured .exp__desc { font-size: 1.05rem; }
.exp__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
.exp__grid .exp__item { padding: 1.5rem; }
.exp__grid .exp__logo { width: 52px; height: 52px; }
.exp__grid .exp__top h3 { font-size: 1.15rem; }
@media (max-width: 720px){ .exp__grid { grid-template-columns: 1fr; } }

/* playground */
.section--play { text-align: left; }
.play__hint { color: var(--muted); max-width: 46ch; margin-bottom: 2rem; }
.play__canvas-wrap { border: 1px solid rgba(255,255,255,.08); border-radius: 18px; overflow: hidden;
  background: radial-gradient(circle at 50% 0%, rgba(124,58,237,.08), transparent 70%); }
#field { width: 100%; height: clamp(320px, 46vw, 520px); }

/* about */
.about__statement { font-size: clamp(1.2rem, 3vw, 2.1rem); font-weight: 500; letter-spacing: -.02em; line-height: 1.3; max-width: 32ch; font-family: "Space Grotesk"; }
.about__statement .word { display: inline-block; opacity: .12; transition: opacity .4s var(--ease); }
.about__statement .word.lit { opacity: 1; }
.stats { display: flex; flex-wrap: wrap; gap: clamp(1.6rem, 5vw, 3.5rem); margin-top: 2.4rem; }
.stat__num { display: block; font-family: "Space Grotesk"; font-size: clamp(2.4rem, 6vw, 3.8rem); font-weight: 700; }
.stat__label { color: var(--muted); font-size: .9rem; }

/* contact */
.contact__lead { color: var(--muted); font-size: 1.2rem; margin-bottom: 1.4rem; }
.contact__mail { display: inline-block; font-family: "Space Grotesk"; font-weight: 700; letter-spacing: -.02em;
  font-size: clamp(1.4rem, 8vw, 5rem); line-height: 1.15; overflow-wrap: anywhere;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 6s linear infinite; }
@keyframes shine { to { background-position: 200% center; } }
.contact__socials { display: flex; gap: 1.6rem; margin-top: 2.5rem; flex-wrap: wrap; }
.contact__socials a { display: inline-flex; align-items: center; gap: .55rem; color: var(--muted); font-size: 1rem; transition: color .25s; }
.contact__socials a svg { flex: none; opacity: .9; }
.contact__socials a:hover { color: var(--fg); }

/* footer */
.footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  max-width: var(--max); margin: 0 auto; padding: 2.2rem clamp(1.2rem, 5vw, 3.5rem);
  border-top: 1px solid rgba(255,255,255,.08); color: var(--muted); font-size: .85rem; }
.to-top { background: none; border: 1px solid rgba(255,255,255,.2); color: var(--fg); border-radius: 100px; padding: .5rem 1.1rem; font: inherit; font-size: .85rem; transition: background .3s, color .3s; }
.to-top:hover { background: var(--fg); color: var(--bg); }

/* ============ scroll reveal ============ */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============ magnetic ============ */
.magnetic { will-change: transform; }

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::after, *::before { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__title .line > span { transform: none; }
  .about__statement .word { opacity: 1; }
  .intro { display: none; }
}
