:root {
  --void: #05060a;
  --panel: #0c0f18;
  --text: #e8ecf4;
  --dim: #8590a6;
  --line: rgba(140, 160, 255, .13);
  --blue: #3d7bff;
  --violet: #9b5cff;
  --cyan: #2ee6d6;
  --grad: linear-gradient(100deg, var(--blue), var(--violet));
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  --gutter: clamp(16px, 5vw, 72px);
  --col: min(640px, 100%);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--void); color: var(--text);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; border-radius: 4px; }
::selection { background: var(--blue); color: #fff; }

/* backdrop */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 78% 30%, rgba(61, 123, 255, .16), transparent 70%),
    radial-gradient(45% 40% at 15% 85%, rgba(155, 92, 255, .10), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 64px 64px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 20%, #000 30%, transparent 85%);
  mask-image: radial-gradient(120% 90% at 50% 20%, #000 30%, transparent 85%);
}
#field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; }
.progress i { display: block; height: 100%; background: var(--grad); transform-origin: left; transform: scaleX(0); box-shadow: 0 0 12px var(--blue); }

/* cursor */
.cursor { position: fixed; top: 0; left: 0; z-index: 100; pointer-events: none; display: none; }
.has-cursor .cursor { display: block; }
.cursor-dot, .cursor-ring { position: absolute; top: 0; left: 0; border-radius: 50%; }
.cursor-dot { width: 6px; height: 6px; margin: -3px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.cursor-ring { width: 34px; height: 34px; margin: -17px; border: 1px solid rgba(140, 160, 255, .55); transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background .3s, border-color .3s; }
.cursor.is-hover .cursor-ring { width: 60px; height: 60px; margin: -30px; background: rgba(61, 123, 255, .14); border-color: var(--blue); }

/* header */
.top {
  position: fixed; top: 14px; left: 50%; z-index: 50; transform: translateX(-50%);
  display: flex; align-items: center; gap: 28px;
  width: min(1180px, calc(100% - 2 * var(--gutter) + 24px));
  padding: 10px 12px 10px 20px; border-radius: 16px; border: 1px solid transparent;
  transition: background .4s, border-color .4s, backdrop-filter .4s;
}
.is-scrolled .top { background: rgba(8, 10, 18, .72); border-color: var(--line); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); }
.brand { font-family: var(--mono); font-size: 15px; font-weight: 500; margin-right: auto; }
.brand i { font-style: normal; color: var(--dim); }
.nav { display: flex; gap: 6px; font-size: 14px; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--dim); transition: color .25s, background .25s; }
.nav a:hover, .nav a.is-active { color: var(--text); background: rgba(140, 160, 255, .1); }
.lang { position: relative; display: flex; padding: 3px; border-radius: 10px; border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; }
.lang button { position: relative; z-index: 1; background: none; border: 0; color: var(--dim); font: inherit; padding: 5px 10px; border-radius: 7px; transition: color .3s; }
.lang button.is-on { color: #fff; }
.lang-pill { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 7px; background: var(--grad); transition: transform .45s var(--ease), width .45s var(--ease); }
@media (max-width: 860px) { .nav { display: none; } }

/* layout */
main, .foot { position: relative; z-index: 2; }
main > section { padding: clamp(72px, 11vw, 150px) var(--gutter); max-width: 1180px; margin: 0 auto; }
.sec-title { font-size: clamp(34px, 4.6vw, 58px); font-weight: 600; letter-spacing: -.04em; line-height: 1; margin-bottom: clamp(32px, 5vw, 64px); }

/* hero */
.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }
main > .hero { padding-top: 130px; padding-bottom: 60px; }
.status { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; font-family: var(--mono); font-size: 13px; color: var(--text); padding: 7px 14px 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(12, 15, 24, .6); margin-bottom: 30px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 0 rgba(46, 230, 214, .6); animation: ping 2.2s infinite; }
@keyframes ping { 70%, 100% { box-shadow: 0 0 0 10px rgba(46, 230, 214, 0); } }
.hero-name {
  display: flex; flex-direction: column; font-weight: 600; line-height: .95; letter-spacing: -.055em;
  font-size: clamp(52px, 10.2vw, 148px); margin-left: -.05em;
  background: linear-gradient(180deg, #fff 30%, #9fb0d8); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-name .scramble { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hero-role { margin-top: 30px; font-size: clamp(18px, 2vw, 24px); font-weight: 500; letter-spacing: -.015em; }
.hero-lede { margin-top: 12px; max-width: 54ch; color: var(--dim); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn { position: relative; display: inline-flex; padding: 14px 24px; border-radius: 12px; font-weight: 500; font-size: 15px; will-change: transform; }
.btn-fill { background: var(--grad); color: #fff; box-shadow: 0 8px 30px -8px rgba(61, 123, 255, .7); transition: box-shadow .3s; }
.btn-fill:hover { box-shadow: 0 10px 44px -6px rgba(155, 92, 255, .85); }
.btn-line { border: 1px solid var(--line); background: rgba(12, 15, 24, .6); transition: border-color .3s, background .3s; }
.btn-line:hover { border-color: var(--blue); background: rgba(61, 123, 255, .12); }
.facts { display: flex; gap: clamp(24px, 4vw, 56px); margin-top: 60px; }
.facts div { display: flex; flex-direction: column-reverse; }
.facts dd { font-size: 40px; font-weight: 600; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.facts dt { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-top: 8px; }
/* load sequence: one orchestrated moment */
.hero > * { opacity: 0; transform: translateY(18px); }
.is-ready .hero > * { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform .9s var(--ease); }
.is-ready .hero > :nth-child(2) { transition-delay: .08s; } .is-ready .hero > :nth-child(3) { transition-delay: .35s; }
.is-ready .hero > :nth-child(4) { transition-delay: .45s; } .is-ready .hero > :nth-child(5) { transition-delay: .55s; }
.is-ready .hero > :nth-child(6) { transition-delay: .7s; }

/* about */
.about-big { max-width: 22ch; font-size: clamp(28px, 3.8vw, 50px); font-weight: 500; line-height: 1.12; letter-spacing: -.035em; }
.about-big, .about-cols { max-width: min(760px, 100%); }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 40px; color: var(--dim); }
@media (max-width: 700px) { .about-cols { grid-template-columns: 1fr; } }

/* timeline */
.timeline { position: relative; max-width: var(--col); padding-left: 34px; --p: 0; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 0; width: 1px; background: var(--line); }
.timeline::after { content: ""; position: absolute; left: 3px; top: 8px; bottom: 0; width: 3px; border-radius: 3px; background: linear-gradient(var(--blue), var(--violet)); transform-origin: top; transform: scaleY(var(--p)); box-shadow: 0 0 14px var(--blue); }
.tl-item { position: relative; padding-bottom: clamp(44px, 6vw, 80px); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -34px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--void); border: 1px solid var(--dim); z-index: 1; transition: background .4s, border-color .4s, box-shadow .4s; }
.tl-item.is-in::before { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.tl-when { font-family: var(--mono); font-size: 13px; color: var(--dim); margin-bottom: 8px; }
.tl-item h3 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.tl-org { margin: 6px 0 14px; font-weight: 500; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block; }
.tl-desc { color: var(--dim); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.chips li { font-family: var(--mono); font-size: 12px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); background: rgba(12, 15, 24, .7); color: #b9c3d9; }

/* stack */
.stack-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: rgba(8, 10, 18, .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.stack-col { padding: 28px; border-left: 1px solid var(--line); }
.stack-col:first-child { border-left: 0; }
.stack-col h3 { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--cyan); margin-bottom: 18px; }
.stack-col li { padding: 7px 0; font-size: 16px; }
@media (max-width: 900px) { .stack-grid { grid-template-columns: 1fr 1fr; } .stack-col:nth-child(3) { border-left: 0; } .stack-col:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 520px) { .stack-grid { grid-template-columns: 1fr; } .stack-col { border-left: 0; } .stack-col:nth-child(n+2) { border-top: 1px solid var(--line); } }
.spoken { display: flex; flex-wrap: wrap; gap: 14px 36px; margin-top: 36px; }
.spoken li { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.spoken b { font-weight: 500; }
.spoken i { display: block; width: 110px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; position: relative; }
.spoken i::after { content: ""; position: absolute; inset: 0; background: var(--grad); transform-origin: left; transform: scaleX(0); transition: transform 1.3s var(--ease) .2s; }
.spoken.is-in i::after { transform: scaleX(var(--lvl)); }

/* projects */
.cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.card { grid-column: span 2; position: relative; display: flex; flex-direction: column; gap: 12px; padding: 30px; border-radius: 16px; background: rgba(10, 13, 22, .82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); isolation: isolate; will-change: transform; }
.card-wide { grid-column: span 3; }
.card::before { /* border that lights up under the pointer */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: -1;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, -40%), var(--blue), var(--violet) 40%, var(--line) 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: 0; transition: opacity .4s; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(61, 123, 255, .13), transparent 60%); }
.card:hover::after { opacity: 1; }
.card h3 { font-size: 28px; font-weight: 600; letter-spacing: -.03em; }
.card p { color: var(--dim); flex: 1; max-width: 52ch; }
.card-tech { font-family: var(--mono); font-size: 12px; color: #9aa6bf; }
.card-link { font-size: 14px; font-weight: 500; color: var(--cyan); }
.card-link .is-muted { color: var(--dim); font-weight: 400; margin-left: 10px; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } .card, .card-wide { grid-column: auto; } }

/* education */
.edu { max-width: 820px; }
.edu li { display: grid; grid-template-columns: 96px 1fr auto; gap: 18px; align-items: baseline; padding: 18px 0; border-top: 1px solid var(--line); transition: padding-left .4s var(--ease), border-color .3s; }
.edu li:last-child { border-bottom: 1px solid var(--line); }
.edu li:hover { padding-left: 10px; border-color: var(--blue); }
.edu span, .edu i { font-family: var(--mono); font-size: 13px; font-style: normal; color: var(--dim); }
.edu b { font-weight: 500; }
@media (max-width: 600px) { .edu li { grid-template-columns: 1fr; gap: 2px; } }

/* contact */
.contact-title { font-size: clamp(34px, 5.6vw, 80px); font-weight: 600; line-height: 1; letter-spacing: -.05em; max-width: 15ch; }
.contact-mail { display: inline-block; margin-top: 40px; font-size: clamp(20px, 3.2vw, 42px); font-weight: 500; letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; border-bottom: 1px solid var(--violet); padding-bottom: 4px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.contact-links a { display: inline-block; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: rgba(12, 15, 24, .6); font-size: 15px; transition: border-color .3s; }
.contact-links a:hover { border-color: var(--blue); }

.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 28px var(--gutter); border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--dim); background: rgba(5, 6, 10, .7); }
.hud b { color: var(--cyan); font-weight: 500; }

/* reveal + language swap */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
[data-i18n].is-swapping { animation: swap .45s var(--ease); }
@keyframes swap { from { opacity: 0; filter: blur(5px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .hero > * { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
