/* =========================================================
   Chathudu Sahassara — Story Portfolio
   ========================================================= */
:root {
  --bg: #07090f;
  --bg-2: #0b0e17;
  --surface: #10141f;
  --surface-2: #151a28;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #e9edf6;
  --muted: #8b93a7;
  --dim: #5b6377;
  --mint: #5ef2c2;
  --violet: #8b7bff;
  --amber: #ffb86b;
  --pink: #ff7ab6;
  --grad: linear-gradient(120deg, var(--mint), var(--violet));
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --radius: 18px;
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
::selection { background: var(--mint); color: var(--bg); }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- noise + progress ---------- */
.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 90; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 120;
  background: var(--grad); transform-origin: 0 50%; transform: scaleX(0);
}

/* ---------- code card head (shared) ---------- */
.code-card__head {
  display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line);
  color: var(--dim); font-size: 12px; font-family: var(--mono);
}
.code-card__head i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.code-card__head i:nth-child(2) { background: #febc2e; }
.code-card__head i:nth-child(3) { background: #28c840; }
.code-card__head span { margin-left: 8px; }

/* ---------- cursor ---------- */
.cursor, .cursor-dot { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 150; border-radius: 50%; opacity: 0; }
.cursor {
  width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1px solid rgba(94, 242, 194, .6);
  transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background .3s, opacity .3s;
}
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--mint); }
.cursor.is-hover { width: 70px; height: 70px; margin: -35px 0 0 -35px; background: rgba(94, 242, 194, .08); }
.has-cursor .cursor, .has-cursor .cursor-dot { opacity: 1; }
@media (pointer: coarse) { .cursor, .cursor-dot { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 999px;
  font-weight: 600; font-size: 15px; border: 1px solid transparent; cursor: pointer;
  transition: background .3s, color .3s, border-color .3s, box-shadow .3s; will-change: transform;
}
.btn--primary { background: var(--mint); color: #04130e; box-shadow: 0 10px 30px -10px rgba(94, 242, 194, .6); }
.btn--primary:hover { background: #8af7d6; box-shadow: 0 14px 40px -10px rgba(94, 242, 194, .8); }
.btn--ghost { border-color: var(--line-2); color: var(--text); background: rgba(255, 255, 255, .02); }
.btn--ghost:hover { border-color: var(--mint); color: var(--mint); }
.btn--sm { padding: 9px 18px; font-size: 14px; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex; align-items: center; gap: 24px;
  padding: 18px var(--gutter); transition: background .4s, padding .4s, border-color .4s; border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(7, 9, 15, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding-top: 12px; padding-bottom: 12px; border-color: var(--line); }
.nav__logo { font-family: var(--mono); font-weight: 600; font-size: 18px; letter-spacing: -.02em; }
.nav__logo span { color: var(--mint); }
.nav__links { display: flex; gap: 6px; margin-left: auto; }
.nav__links a { padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); transition: color .3s, background .3s; }
.nav__links a:hover { color: var(--text); }
.nav__links a.is-active { color: var(--bg); background: var(--text); }
.nav__toggle { display: none; }

@media (max-width: 900px) {
  .nav__cv { display: none; }
  .nav__toggle {
    display: grid; place-content: center; gap: 6px; margin-left: auto; width: 44px; height: 44px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--line-2); cursor: pointer;
  }
  .nav__toggle span { display: block; width: 18px; height: 2px; background: var(--text); transition: transform .3s var(--ease); }
  .nav.is-open .nav__toggle span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav.is-open .nav__toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav__links {
    position: fixed; inset: 0; z-index: -1; flex-direction: column; justify-content: center; align-items: flex-start;
    gap: 4px; padding: 0 var(--gutter); background: rgba(7, 9, 15, .97); margin: 0;
    clip-path: circle(0 at calc(100% - 40px) 40px); transition: clip-path .7s var(--ease); visibility: hidden;
  }
  .nav.is-open .nav__links { clip-path: circle(150% at calc(100% - 40px) 40px); visibility: visible; }
  .nav__links a { font-size: clamp(28px, 8vw, 44px); font-weight: 600; color: var(--text); padding: 6px 0; background: none !important; }
  .nav__links a.is-active { color: var(--mint); }
}

/* ---------- story rail ---------- */
.rail { position: fixed; left: 22px; top: 50%; transform: translateY(-50%); z-index: 80; }
.rail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; position: relative; }
.rail ol::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--line-2); }
.rail li { display: flex; align-items: center; gap: 12px; position: relative; }
.rail i { width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--dim); transition: all .4s var(--ease); flex: none; }
.rail span { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); opacity: 0; transform: translateX(-6px); transition: all .4s var(--ease); white-space: nowrap; }
.rail li.is-done i { background: var(--dim); }
.rail li.is-active i { background: var(--mint); border-color: var(--mint); box-shadow: 0 0 0 4px rgba(94, 242, 194, .18); }
.rail li.is-active span { opacity: 1; transform: none; color: var(--mint); }
.rail { transition: opacity .5s var(--ease), transform .5s var(--ease); }
.rail-hidden .rail { opacity: 0; transform: translate(-20px, -50%); pointer-events: none; }
@media (max-width: 1320px) { .rail { display: none; } }
main { overflow-x: clip; }

/* ---------- shared chapter styles ---------- */
.chapter { position: relative; padding: clamp(90px, 14vh, 160px) 0; }
.chapter__num { font-family: var(--mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--mint); margin: 0 0 18px; display: flex; align-items: center; gap: 12px; }
.chapter__num::before { content: ""; width: 34px; height: 1px; background: currentColor; }
.chapter__title { font-size: clamp(36px, 6vw, 76px); line-height: 1.02; letter-spacing: -.035em; margin: 0 0 22px; font-weight: 700; max-width: 16ch; }
.chapter__lead { color: var(--muted); font-size: clamp(17px, 1.6vw, 20px); max-width: 56ch; margin: 0; }
.chapter__head { margin-bottom: clamp(50px, 8vh, 90px); }
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.wi { display: inline-block; will-change: transform; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  font-family: var(--mono); font-size: 12px; padding: 5px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line); color: #c3c9d8;
}

.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 10px; margin: 0 0 26px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(7, 9, 15, .5); backdrop-filter: blur(6px); }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(94, 242, 194, .6); animation: pulse 2s infinite; }

/* ---------- HERO ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; padding: 120px 0 100px; }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__glow {
  position: absolute; inset: auto -20% -40% -20%; height: 80%; pointer-events: none;
  background: radial-gradient(50% 50% at 30% 50%, rgba(139, 123, 255, .18), transparent 70%), radial-gradient(40% 50% at 75% 60%, rgba(94, 242, 194, .12), transparent 70%);
}
.hero__inner { position: relative; z-index: 2; }
.hero__name { font-size: clamp(56px, 13vw, 190px); line-height: .9; letter-spacing: -.055em; margin: 0 0 28px; font-weight: 700; }
.hero__name .line { display: block; overflow: hidden; padding-bottom: .04em; }
.hero__name .char { display: inline-block; will-change: transform; }
.line--outline { color: transparent; -webkit-text-stroke: 1.5px rgba(233, 237, 246, .75); }
.hero__role { font-family: var(--mono); font-size: clamp(16px, 2vw, 22px); margin: 0 0 18px; color: var(--text); min-height: 1.6em; }
.typed { color: var(--mint); }
.caret { display: inline-block; width: .55em; height: 1.1em; background: var(--mint); vertical-align: -.18em; margin-left: 4px; animation: blink 1s steps(1) infinite; }
.hero__lead { color: var(--muted); max-width: 54ch; font-size: clamp(16px, 1.5vw, 19px); margin: 0 0 34px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 46px; }
.hero__meta { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 0; margin: 0; color: var(--muted); font-size: 14px; }
.hero__meta b { color: var(--text); }
.scroll-cue { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); z-index: 2; }
.scroll-cue i { width: 1px; height: 46px; background: linear-gradient(var(--mint), transparent); animation: drip 2s var(--ease) infinite; transform-origin: top; }

/* ---------- marquee ---------- */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: 22px 0; background: var(--bg-2); }
.marquee__track { display: flex; gap: 34px; width: max-content; animation: marquee 38s linear infinite; font-size: clamp(22px, 3vw, 34px); font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.marquee__track span:nth-child(even) { color: var(--mint); }
.marquee__track span:nth-child(4n+3) { color: transparent; -webkit-text-stroke: 1px var(--muted); }

/* ---------- CH1 SPARK ---------- */
.spark { padding-top: 0; }
.spark__scroll { height: 240vh; position: relative; }
.spark__sticky { position: sticky; top: 0; height: 100svh; display: flex; align-items: center; }
.spark__text { font-size: clamp(28px, 4.6vw, 62px); line-height: 1.15; letter-spacing: -.03em; font-weight: 600; margin: 0; max-width: 22ch; }
.spark__grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.edu { display: grid; gap: 18px; }
.edu__card { position: relative; padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.edu__card h3 { margin: 10px 0 6px; font-size: clamp(20px, 2vw, 25px); letter-spacing: -.02em; line-height: 1.2; }
.edu__card p { margin: 0 0 14px; color: var(--muted); }
.edu__tag { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.edu__note { font-size: 14px; color: var(--dim); font-style: italic; }
.edu__card--accent { border-color: rgba(94, 242, 194, .3); background: linear-gradient(160deg, rgba(94, 242, 194, .08), var(--surface) 60%); }
.edu__card--accent .edu__tag { color: var(--mint); }
.code-card { border-radius: var(--radius); background: #0a0d16; border: 1px solid var(--line-2); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(139, 123, 255, .08); overflow: hidden; }
.code-card__body { margin: 0; padding: 22px; font-family: var(--mono); font-size: clamp(12px, 1.25vw, 14.5px); line-height: 1.85; overflow-x: auto; }
.cl { display: block; min-height: 1.85em; }
.k { color: var(--violet); } .v { color: var(--text); } .p { color: var(--mint); } .s { color: var(--amber); } .f { color: var(--pink); } .c { color: var(--dim); }

/* ---------- CH2 TIMELINE ---------- */
.timeline { position: relative; display: grid; gap: clamp(40px, 8vh, 80px); }
.timeline__line { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--line); transform: translateX(-50%); }
.timeline__fill { position: absolute; inset: 0; background: linear-gradient(var(--mint), var(--violet)); transform-origin: top; transform: scaleY(0); }
.tl-item { position: relative; width: 50%; }
.tl-item--left { padding-right: clamp(30px, 5vw, 70px); }
.tl-item--right { margin-left: 50%; padding-left: clamp(30px, 5vw, 70px); }
.tl-item__node { position: absolute; top: 34px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--mint); box-shadow: 0 0 0 6px rgba(94, 242, 194, .12); }
.tl-item--left .tl-item__node { right: -8px; }
.tl-item--right .tl-item__node { left: -8px; }
.tl-card { padding: clamp(24px, 3vw, 34px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color .4s, transform .4s var(--ease); }
.tl-card:hover { border-color: rgba(94, 242, 194, .35); }
.tl-card__date { font-family: var(--mono); font-size: 13px; color: var(--mint); margin: 0 0 8px; }
.tl-card h3 { font-size: clamp(22px, 2.4vw, 28px); margin: 0; letter-spacing: -.02em; line-height: 1.2; }
.tl-card__org { margin: 4px 0 18px; color: var(--amber); font-weight: 500; }
.tl-card ul { margin: 0 0 20px; padding: 0; list-style: none; display: grid; gap: 10px; color: var(--muted); font-size: 15.5px; }
.tl-card li { padding-left: 18px; position: relative; }
.tl-card li::before { content: "▹"; position: absolute; left: 0; color: var(--mint); }
.tl-card li b { color: var(--text); font-weight: 600; }

/* ---------- CH3 LEVELS ---------- */
.levels { padding: 0; background: radial-gradient(60% 50% at 80% 50%, rgba(139, 123, 255, .08), transparent 70%); }
.levels__scroll { position: relative; }
.levels__sticky { padding: clamp(90px, 14vh, 160px) 0; }
.levels__layout { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(30px, 5vw, 80px); align-items: center; }
.xp { margin-top: 40px; max-width: 440px; }
.xp__top { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.xp__top #xpLabel { color: var(--mint); }
.xp__bar { height: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.xp__bar span { display: block; height: 100%; width: 100%; background: var(--grad); border-radius: 10px; box-shadow: 0 0 20px rgba(94, 242, 194, .5); transform-origin: 0 50%; }
.xp__steps { list-style: none; display: flex; justify-content: space-between; padding: 0; margin: 10px 0 0; font-family: var(--mono); font-size: 12px; color: var(--dim); }
.xp__steps li { transition: color .3s; }
.xp__steps li.is-on { color: var(--text); }
.stages { display: grid; gap: 18px; }
.stage { padding: clamp(24px, 3vw, 36px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.stage__lvl { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--amber); margin: 0 0 10px; }
.stage h3 { font-size: clamp(22px, 2.6vw, 32px); line-height: 1.15; letter-spacing: -.025em; margin: 0 0 12px; }
.stage h3 small { font-size: .55em; color: var(--muted); font-weight: 500; }
.stage__desc { color: var(--muted); margin: 0 0 20px; }
.quests { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.quests li { display: flex; gap: 12px; align-items: flex-start; font-size: 15.5px; }
.quests span { flex: none; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; background: rgba(94, 242, 194, .12); color: var(--mint); margin-top: 2px; }

/* interactive (desktop) mode: one stage at a time while pinned */
.levels--interactive .levels__scroll { height: 420vh; }
.levels--interactive .levels__sticky { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; padding: 0; }
.levels--interactive .stages { position: relative; min-height: 440px; }
.levels--interactive .stage {
  position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(40px) scale(.97); pointer-events: none;
  transition: opacity .6s var(--ease), transform .6s var(--ease), border-color .6s;
}
.levels--interactive .stage.is-active { opacity: 1; transform: none; pointer-events: auto; border-color: rgba(94, 242, 194, .3); box-shadow: 0 40px 80px -40px rgba(94, 242, 194, .25); }
.levels--interactive .stage.is-past { opacity: 0; transform: translateY(-40px) scale(.97); }
.levelup {
  position: absolute; top: -18px; right: 20px; z-index: 3; font-family: var(--mono); font-size: 12px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; background: var(--mint); color: #04130e; pointer-events: none;
}

/* ---------- CH4 BUILDS ---------- */
.builds { padding-bottom: clamp(60px, 10vh, 120px); overflow: hidden; }
.builds__pin { padding-top: 0; }
.builds__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: clamp(36px, 6vh, 60px); }
.builds__head .chapter__title { margin: 0; }
.builds__counter { font-family: var(--mono); font-size: 15px; color: var(--dim); white-space: nowrap; }
.builds__counter span:first-child { font-size: 42px; color: var(--text); font-weight: 600; }
.builds__track {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px;
  max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter);
}
.builds__counter { display: none; }
@media (min-width: 680px) { .project--featured { grid-column: span 2; } }

/* horizontal reel mode (desktop, set by JS) */
.builds--h { padding-top: 0; padding-bottom: 0; }
.builds--h .builds__pin { height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.builds--h .builds__counter { display: block; }
.builds--h .chapter__title { font-size: clamp(32px, 4.4vw, 60px); }
.builds--h .builds__track {
  display: flex; width: max-content; max-width: none; margin: 0;
  padding-left: max(var(--gutter), calc((100vw - 1240px) / 2 + var(--gutter)));
}
.builds--h .project { width: 370px; }
.builds--h .project--featured { width: 600px; }
.builds--h .project__visual { height: 150px; }
.builds--h .project--featured .project__visual { height: 150px; }

.project {
  flex: none; display: flex; flex-direction: column; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); overflow: hidden;
  transition: border-color .4s, transform .5s var(--ease), box-shadow .5s;
}
.project:hover { border-color: var(--line-2); transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); }
.project__visual {
  position: relative; height: 170px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(80% 120% at 20% 0%, rgba(94, 242, 194, .22), transparent 60%), linear-gradient(135deg, #0f1726, #121022);
  border-bottom: 1px solid var(--line);
}
.project__visual::before {
  content: ""; position: absolute; inset: 0; opacity: .35;
  background-image: linear-gradient(var(--line-2) 1px, transparent 1px), linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
  background-size: 26px 26px; mask-image: radial-gradient(70% 80% at 50% 50%, #000, transparent);
  -webkit-mask-image: radial-gradient(70% 80% at 50% 50%, #000, transparent);
  transition: transform 1.2s var(--ease);
}
.project:hover .project__visual::before { transform: scale(1.15); }
.project__visual code { position: relative; font-family: var(--mono); font-size: 16px; color: var(--text); padding: 10px 16px; border-radius: 10px; background: rgba(7, 9, 15, .6); border: 1px solid var(--line-2); }
.project__visual code span { color: var(--mint); }
.project[data-cat="ml"] .project__visual { background: radial-gradient(80% 120% at 20% 0%, rgba(139, 123, 255, .3), transparent 60%), linear-gradient(135deg, #12102a, #0d1322); }
.project[data-cat="ml"] .project__visual code span { color: var(--violet); }
.project[data-cat="mobile"] .project__visual { background: radial-gradient(80% 120% at 20% 0%, rgba(255, 184, 107, .25), transparent 60%), linear-gradient(135deg, #1a140e, #0f1322); }
.project[data-cat="mobile"] .project__visual code span { color: var(--amber); }
.project--featured .project__visual { height: 210px; }
.project--featured .project__visual code { font-size: 20px; }
.project__body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.project__top { display: flex; justify-content: space-between; align-items: center; }
.project__no { font-family: var(--mono); font-size: 13px; color: var(--dim); }
.project h3 { margin: 0; font-size: 21px; line-height: 1.25; letter-spacing: -.02em; }
.project--featured h3 { font-size: clamp(22px, 2.4vw, 28px); }
.project p { margin: 0; color: var(--muted); font-size: 15px; }
.project .chips { margin-top: 2px; }
.project__link { margin-top: auto; padding-top: 10px; font-weight: 600; font-size: 14.5px; color: var(--mint); display: inline-flex; gap: 6px; align-items: center; }
.project__link span { transition: transform .3s var(--ease); }
.project__link:hover span { transform: translate(3px, -3px); }
.project__link--muted { color: var(--dim); font-weight: 500; }
.tag { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 5px 10px; border-radius: 6px; }
.tag--web { color: var(--mint); background: rgba(94, 242, 194, .1); }
.tag--ml { color: var(--violet); background: rgba(139, 123, 255, .14); }
.tag--mobile { color: var(--amber); background: rgba(255, 184, 107, .12); }
.project--end { justify-content: center; align-items: flex-start; gap: 16px; padding: 34px; background: transparent; border-style: dashed; }
.project--end:hover { transform: none; box-shadow: none; }
.project--end p { font-size: 28px; font-weight: 600; color: var(--text); margin: 0; }

.no-anim .timeline__fill { transform: none; }
.levels:not(.levels--interactive) .xp__steps li { color: var(--text); }

/* ---------- CH5 TOOLKIT ---------- */
.toolkit { background: linear-gradient(var(--bg), var(--bg-2) 30%, var(--bg)); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: clamp(60px, 10vh, 110px); }
.stat { background: var(--bg-2); padding: clamp(22px, 3vw, 36px); }
.stat b { display: block; font-size: clamp(44px, 6vw, 76px); line-height: 1; letter-spacing: -.04em; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { display: block; margin-top: 10px; color: var(--muted); font-size: 15px; }

.toolkit__grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(30px, 5vw, 70px); align-items: center; }
.orbit { --s: min(520px, 86vw); position: relative; width: var(--s); height: var(--s); margin: 0 auto; }
.orbit__core { position: absolute; inset: 50% auto auto 50%; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-weight: 600; font-size: 26px; color: #04130e; background: var(--grad); box-shadow: 0 0 60px rgba(94, 242, 194, .45); z-index: 2; }
.orbit__ring { position: absolute; left: 50%; top: 50%; border: 1px dashed var(--line-2); border-radius: 50%; animation: spin var(--t) linear infinite; }
.orbit__ring--1 { --d: 40%; --t: 30s; }
.orbit__ring--2 { --d: 68%; --t: 46s; animation-direction: reverse; }
.orbit__ring--3 { --d: 96%; --t: 64s; }
.orbit__ring { width: var(--d); height: var(--d); margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2); }
.orbit__item { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--a)) translateX(calc(var(--s) * var(--k))) rotate(calc(var(--a) * -1)); }
.orbit__ring--1 .orbit__item { --k: .2; }
.orbit__ring--2 .orbit__item { --k: .34; }
.orbit__ring--3 .orbit__item { --k: .48; }
.orbit__item i {
  position: absolute; left: 0; top: 0; translate: -50% -50%; font-style: normal; font-family: var(--mono); font-size: 12px; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text);
  animation: spin var(--t) linear infinite reverse;
}
.orbit__ring--2 .orbit__item i { animation-direction: normal; border-color: rgba(139, 123, 255, .35); }
.orbit__ring--1 .orbit__item i { border-color: rgba(94, 242, 194, .35); }

.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 30px; }
.skill-group h4 { margin: 0 0 12px; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.skill-group .chips span { transition: border-color .3s, color .3s, background .3s; }
.skill-group .chips span:hover { border-color: var(--mint); color: var(--mint); background: rgba(94, 242, 194, .06); }

.wins { margin-top: clamp(80px, 12vh, 140px); }
.wins__title { font-size: clamp(26px, 3vw, 38px); letter-spacing: -.025em; margin: 0 0 34px; }
.wins__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.wins__list li { display: flex; gap: 16px; padding: 28px; background: var(--bg); transition: background .4s; }
.wins__list li:hover { background: var(--surface); }
.wins__list li > span { font-family: var(--mono); font-size: 13px; color: var(--mint); padding-top: 3px; }
.wins__list b { display: block; font-size: 18px; margin-bottom: 6px; letter-spacing: -.01em; }
.wins__list p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- EPILOGUE ---------- */
.epilogue { padding-bottom: 0; overflow: hidden; background: radial-gradient(60% 60% at 50% 100%, rgba(94, 242, 194, .1), transparent 70%); }
.epilogue__title { font-size: clamp(40px, 7.5vw, 104px); line-height: 1; letter-spacing: -.045em; margin: 0 0 28px; font-weight: 700; max-width: 14ch; }
.epilogue__mail {
  display: inline-flex; align-items: center; gap: 18px; margin: 46px 0 40px; font-size: clamp(22px, 4vw, 50px); font-weight: 600; letter-spacing: -.03em;
  padding-bottom: 8px; border-bottom: 2px solid var(--line-2); transition: color .3s, border-color .3s; word-break: break-all;
}
.epilogue__mail span { color: var(--mint); transition: transform .4s var(--ease); }
.epilogue__mail:hover { color: var(--mint); border-color: var(--mint); }
.epilogue__mail:hover span { transform: translateX(10px); }
.contact { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 40px; }
.contact a { padding: 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-weight: 500; font-size: 15.5px; transition: border-color .3s, transform .4s var(--ease); overflow-wrap: anywhere; }
.contact a:hover { border-color: var(--mint); transform: translateY(-4px); }
.contact small { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
.epilogue__cta { display: flex; flex-wrap: wrap; gap: 14px; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 40px; padding-bottom: 40px; margin-top: clamp(80px, 12vh, 140px); border-top: 1px solid var(--line); color: var(--dim); font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .wins__list { grid-template-columns: 1fr 1fr; }
  .contact { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .spark__grid, .levels__layout, .toolkit__grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .timeline__line { left: 7px; transform: none; }
  .tl-item, .tl-item--right { width: 100%; margin-left: 0; padding: 0 0 0 36px; }
  .tl-item--left .tl-item__node, .tl-item--right .tl-item__node { left: 0; right: auto; }
  .builds__head { flex-direction: column; align-items: flex-start; }
  .spark__scroll { height: 180vh; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .skills, .wins__list, .contact { grid-template-columns: 1fr; }
  .orbit__item i { font-size: 10px; padding: 4px 8px; }
  .orbit__core { width: 64px; height: 64px; margin: -32px 0 0 -32px; font-size: 18px; }
  .scroll-cue { display: none; }
  .hide-sm { display: none; }
}

/* ---------- keyframes ---------- */
@keyframes blink { 50% { opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(94, 242, 194, .6); } 70% { box-shadow: 0 0 0 10px rgba(94, 242, 194, 0); } 100% { box-shadow: 0 0 0 0 rgba(94, 242, 194, 0); } }
@keyframes drip { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .spark__scroll { height: auto; }
  .spark__sticky { position: static; height: auto; padding: 100px 0 60px; }
}
