/* =========================================================================
   Muhammad Mohsin · Portfolio stylesheet
   -------------------------------------------------------------------------
   Sections in this file:
     1. Design tokens (colours, fonts, spacing)   ← tweak the vibe here
     2. Base / reset
     3. Background (orbs, grid, cursor glow)
     4. Reusable bits (container, glass, buttons, section headings)
     5. Navbar
     6. Hero
     7. Stats
     8. About
     9. Projects + mockups
    10. Video editing
    11. Skills + orbit
    12. Timeline
    13. Contact
    14. Footer, toast, confetti
    15. Scroll reveal
    16. Responsive
    17. Reduced motion
   ========================================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
  --bg: #07060d;
  --bg-2: #0d0b18;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text: #f4f2ff;
  --text-dim: #b7b3cc;   /* still passes WCAG AA on --bg */
  --text-faint: #8a86a3;

  --purple: #a855f7;
  --violet: #7c3aed;
  --cyan: #22d3ee;
  --lime: #a3e635;
  --pink: #f472b6;

  --grad: linear-gradient(120deg, var(--purple) 0%, var(--cyan) 60%, var(--lime) 100%);
  --grad-btn: linear-gradient(120deg, #9333ea 0%, #6d28d9 45%, #0891b2 100%);

  --font-head: "Sora", "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;

  --radius: 20px;
  --radius-sm: 12px;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(80px, 12vw, 150px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 72px;
}

/* ---------- 2. Base / reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
  overflow-x: clip; /* stops anything decorative from causing sideways scroll */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.02em;
}

p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; }

::selection { background: var(--purple); color: #fff; }

/* Keyboard focus that's easy to see */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 8px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 1000;
  padding: 10px 16px; border-radius: 10px;
  background: var(--purple); color: #fff; font-weight: 600;
  transition: top .2s;
}
.skip-link:focus { top: 16px; }

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

kbd {
  font-family: var(--font-mono);
  font-size: .72em;
  padding: 1px 6px;
  margin: 0 1px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
}

/* ---------- 3. Background ---------- */
.bg {
  position: fixed; inset: 0; z-index: -1;
  overflow: hidden; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(124, 58, 237, .25), transparent 70%),
    var(--bg);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  will-change: transform;
  animation: float 22s ease-in-out infinite alternate;
}
.orb-1 { width: 520px; height: 520px; background: var(--violet); top: -120px; left: -140px; }
.orb-2 { width: 440px; height: 440px; background: #0e7490; top: 35%; right: -160px; animation-duration: 26s; animation-delay: -6s; }
.orb-3 { width: 360px; height: 360px; background: #4d7c0f; bottom: -120px; left: 20%; opacity: .3; animation-duration: 30s; animation-delay: -12s; }
.orb-4 { width: 300px; height: 300px; background: #be185d; top: 60%; left: -100px; opacity: .25; animation-duration: 24s; animation-delay: -3s; }

@keyframes float {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(80px, 60px, 0) scale(1.12); }
  100% { transform: translate3d(-40px, 120px, 0) scale(.95); }
}

.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 80%);
}

/* Tiny film-grain texture made from an inline SVG */
.noise {
  position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay;
  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'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor-glow {
  position: fixed; top: 0; left: 0; z-index: 0;
  width: 480px; height: 480px; margin: -240px 0 0 -240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, .16), rgba(34, 211, 238, .06) 40%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s;
  will-change: transform;
}
.cursor-glow.on { opacity: 1; }

/* ---------- 4. Reusable bits ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: var(--section-y) 0; position: relative; }

.glass {
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
}

.section-head { max-width: 720px; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.section-kicker {
  font-family: var(--font-mono);
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(2.1rem, 5.5vw, 3.75rem);
  font-weight: 700;
  margin-bottom: 20px;
}

.section-lead {
  color: var(--text-dim);
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  max-width: 60ch;
}
.section-head.center .section-lead { margin-left: auto; margin-right: auto; }

/* Buttons */
.btn {
  --pad-y: 12px; --pad-x: 22px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .98rem;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s, border-color .3s, color .3s;
}
.btn svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .3s var(--ease);
}
.btn:hover svg { transform: translateX(3px); }

.btn-lg { --pad-y: 17px; --pad-x: 30px; font-size: 1.05rem; }
.btn-sm { --pad-y: 10px; --pad-x: 16px; font-size: .88rem; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(168, 85, 247, .8), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary::after {
  /* shiny sweep on hover */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  background-size: 250% 100%; background-position: 150% 0;
  transition: background-position .8s var(--ease);
  pointer-events: none;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -10px rgba(168, 85, 247, .9), 0 0 0 1px rgba(255,255,255,.15) inset;
}
.btn-primary:hover::after { background-position: -50% 0; }

.btn-ghost {
  background: rgba(255,255,255,.04);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan) inset, 0 10px 30px -12px rgba(34, 211, 238, .7);
}

.btn[aria-disabled="true"] {
  opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important;
}

/* ---------- 5. Navbar ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .35s, border-color .35s, backdrop-filter .35s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10, 8, 20, .6);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 700; font-size: 1.2rem;
  position: relative; z-index: 2;
}
.logo img { transition: transform .5s var(--ease); }
.logo:hover img { transform: rotate(-12deg) scale(1.08); }
.logo-dot { color: var(--lime); }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  position: relative;
  display: block;
  padding: 9px 15px;
  border-radius: 999px;
  font-size: .94rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color .25s, background .25s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-links a.active:not(.nav-cta)::after {
  content: ""; position: absolute; left: 50%; bottom: 3px;
  width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 8px var(--lime);
}
.nav-links .nav-cta {
  color: var(--text);
  border: 1px solid var(--border-strong);
  margin-left: 6px;
}
.nav-links .nav-cta:hover,
.nav-links .nav-cta.active { border-color: var(--purple); background: rgba(168, 85, 247, .15); }

.hamburger {
  display: none;
  position: relative; z-index: 2;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
}
.hamburger span {
  position: absolute; left: 13px; width: 20px; height: 2px; border-radius: 2px;
  background: var(--text);
  transition: transform .35s var(--ease), opacity .25s, top .35s var(--ease);
}
.hamburger span:nth-child(1) { top: 16px; }
.hamburger span:nth-child(2) { top: 22px; }
.hamburger span:nth-child(3) { top: 28px; }
.hamburger[aria-expanded="true"] span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { top: 22px; transform: rotate(-45deg); }

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 100px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: .88rem;
  margin-bottom: 28px;
}
.pulse-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(163, 230, 53, .7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(163, 230, 53, .6); }
  70%  { box-shadow: 0 0 0 10px rgba(163, 230, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0); }
}

.hero-title { margin-bottom: 26px; }
.hero-name {
  display: block;
  font-size: clamp(2.6rem, 7.4vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  background: linear-gradient(180deg, #fff 30%, #c9c3e8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-role-line {
  display: flex; align-items: center;
  margin-top: 10px;
  min-height: 1.15em;
  font-size: clamp(2.3rem, 6.6vw, 5.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}
.hero-role {
  background: var(--grad);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: grad-shift 6s ease-in-out infinite alternate;
  white-space: nowrap;
}
.hero-role .scramble-char { color: var(--cyan); -webkit-text-fill-color: var(--cyan); opacity: .8; }
@keyframes grad-shift { to { background-position: 100% 0; } }

.caret {
  display: inline-block;
  width: .08em; height: .85em;
  margin-left: .08em;
  background: var(--lime);
  box-shadow: 0 0 14px var(--lime);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-sub {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--text-dim);
  max-width: 34ch;
  margin-bottom: 36px;
}

.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 36px; }

.hero-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-chips li {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: .86rem;
  color: var(--text-dim);
  border: 1px dashed var(--border-strong);
}

/* Code window on the right */
.hero-visual { position: relative; }
.code-window {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}
.window-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.2);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.window-title { margin-left: 10px; font-family: var(--font-mono); font-size: .8rem; color: var(--text-faint); }

.code {
  margin: 0;
  padding: 22px 24px 26px;
  font-family: var(--font-mono);
  font-size: clamp(.78rem, 1.1vw, .92rem);
  line-height: 1.85;
  color: #d6d3ea;
  overflow-x: auto;
}
.code .k { color: #c084fc; }
.code .v { color: #67e8f9; }
.code .p { color: #e9e5ff; }
.code .s { color: #bef264; }
.code .n { color: #fda4af; }
.code .f { color: #fde047; }
.code .c { color: var(--text-faint); font-style: italic; }
.code-caret {
  display: inline-block; width: 8px; height: 1.1em; vertical-align: -3px; margin-left: 4px;
  background: var(--cyan); animation: blink 1s steps(1) infinite;
}
.code-glow {
  position: absolute; inset: auto -30% -60% -30%; height: 70%;
  background: radial-gradient(ellipse at center, rgba(168,85,247,.35), transparent 70%);
  pointer-events: none;
}

.float-badge {
  position: absolute;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: .86rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  animation: bob 6s ease-in-out infinite;
  white-space: nowrap;
}
.badge-a { top: -22px; right: 8%; }
.badge-b { bottom: -20px; left: -18px; animation-delay: -3s; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
@keyframes bob { 50% { transform: translateY(-10px); } }

.scroll-hint {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  opacity: .6; transition: opacity .3s;
}
.scroll-hint:hover { opacity: 1; }
.mouse {
  display: block; width: 26px; height: 42px;
  border: 2px solid var(--text-dim); border-radius: 14px; position: relative;
}
.wheel {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--cyan);
  animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- 7. Stats ---------- */
.stats { padding: 0 0 20px; position: relative; z-index: 1; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px;
}
.stat {
  padding: 30px 22px;
  text-align: center;
  position: relative;
}
.stat + .stat::before {
  content: ""; position: absolute; left: 0; top: 22%; bottom: 22%;
  width: 1px; background: linear-gradient(transparent, var(--border-strong), transparent);
}
.stat-num {
  display: block;
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}
.stat:nth-child(1) .stat-num { color: var(--purple); text-shadow: 0 0 30px rgba(168,85,247,.5); }
.stat:nth-child(2) .stat-num { color: var(--cyan);   text-shadow: 0 0 30px rgba(34,211,238,.5); }
.stat:nth-child(3) .stat-num { color: var(--lime);   text-shadow: 0 0 30px rgba(163,230,53,.45); }
.stat:nth-child(4) .stat-num { color: var(--pink);   text-shadow: 0 0 30px rgba(244,114,182,.5); }
.stat-label { color: var(--text-dim); font-size: .92rem; line-height: 1.4; display: block; }

/* ---------- 8. About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(40px, 7vw, 100px);
  align-items: center;
}
.about-avatar { position: relative; max-width: 380px; margin: 0 auto; width: 100%; }
.avatar-ring {
  position: relative;
  aspect-ratio: 1;
  border-radius: 32px;
  padding: 3px;
  background: conic-gradient(from var(--angle, 0deg), var(--purple), var(--cyan), var(--lime), var(--pink), var(--purple));
  animation: spin-ring 8s linear infinite;
}
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin-ring { to { --angle: 360deg; } }
.avatar {
  width: 100%; height: 100%;
  border-radius: 29px;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(168,85,247,.45), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(34,211,238,.35), transparent 55%),
    #0d0b18;
  overflow: hidden;
}
.avatar span {
  font-family: var(--font-head);
  font-size: clamp(7rem, 16vw, 11rem);
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(168,85,247,.5));
}
.avatar-tag {
  position: absolute; bottom: -18px; right: -10px;
  padding: 10px 16px; border-radius: 14px; font-size: .9rem; font-weight: 600;
  animation: bob 6s ease-in-out infinite;
}

.about-text p { color: var(--text-dim); font-size: 1.1rem; }
.about-text p:first-child { color: var(--text); font-size: 1.22rem; }
.about-text strong, .about-text b { font-weight: inherit; } /* About body stays regular weight */

.about-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  margin-top: 28px;
}
.about-facts li {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: .95rem;
}
.about-facts .fact-ico { font-size: 1.3rem; }
.about-facts small { display: block; color: var(--text-faint); font-size: .78rem; line-height: 1.2; }

/* ---------- 9. Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.project-card {
  --accent: var(--purple);
  --mx: 50%; --my: 50%;
  position: relative;
  display: flex; flex-direction: column;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.015));
  border: 1px solid var(--border);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform .5s var(--ease), border-color .4s, box-shadow .4s;
  will-change: transform;
}
/* Glow that follows the cursor (position set by JS through --mx/--my) */
.project-card::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(500px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 22%, transparent), transparent 45%);
  opacity: 0; transition: opacity .4s;
}
/* Glowing border that follows the cursor */
.project-card::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  border-radius: inherit; padding: 1px;
  background: radial-gradient(320px circle at var(--mx) var(--my), var(--accent), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .4s;
}
.project-card:hover,
.project-card:focus-within {
  box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--accent) 60%, transparent);
  border-color: transparent;
}
.project-card:hover::before, .project-card:hover::after,
.project-card:focus-within::before, .project-card:focus-within::after { opacity: 1; }

.project-card.featured { grid-column: span 2; flex-direction: row; }
.project-card.featured .project-visual { flex: 1.15; aspect-ratio: auto; min-height: 340px; border-bottom: 0; border-right: 1px solid var(--border); }
.project-card.featured .project-body { flex: 1; justify-content: center; }
/* Alternate featured cards put the picture on the right */
.project-card.featured.flip { flex-direction: row-reverse; }
.project-card.featured.flip .project-visual { border-right: 0; border-left: 1px solid var(--border); }

.project-visual {
  position: relative; z-index: 1;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: #0a0914;
  transform: translateZ(20px);
}
.project-body {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  padding: 28px;
  flex: 1;
}
.project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.project-num { font-family: var(--font-mono); font-size: .8rem; color: var(--text-faint); }
.status {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.status-live    { color: var(--lime); border-color: rgba(163,230,53,.35); background: rgba(163,230,53,.08); }
.status-content { color: var(--cyan); border-color: rgba(34,211,238,.35); background: rgba(34,211,238,.08); }
.status-wip     { color: #fbbf24;     border-color: rgba(251,191,36,.4);  background: rgba(251,191,36,.08); }
.status-wip::before { animation: blink 1.2s steps(1) infinite; }
.status-private { color: #cbd5e1;     border-color: rgba(203,213,225,.3);  background: rgba(203,213,225,.06); }
.status-private::before { content: "🔒"; width: auto; height: auto; background: none; box-shadow: none; font-size: .7rem; }
.status-ended   { color: #fb7185;     border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.08); }

.project-card h3 { font-size: clamp(1.45rem, 2.4vw, 1.8rem); font-weight: 700; margin-bottom: 8px; }
.project-hook {
  font-family: var(--font-head);
  font-weight: 500;
  color: color-mix(in srgb, var(--accent) 70%, #fff);
  margin-bottom: 12px;
}
.project-desc { color: var(--text-dim); font-size: .98rem; margin-bottom: 20px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tags li {
  font-family: var(--font-mono);
  font-size: .74rem;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.project-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }

/* ---- Project mockups (all CSS/SVG, no image files) ---- */
.mock { position: absolute; inset: 0; display: flex; flex-direction: column; }
.mock-browser {
  position: absolute; inset: 18px 18px -12px;
  border-radius: 12px 12px 0 0;
  border: 1px solid var(--border-strong);
  background: #0f0d1c;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 50px -10px rgba(0,0,0,.7);
  transition: transform .6s var(--ease);
}
.project-card:hover .mock-browser { transform: translateY(-6px); }
.mock-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px;
  background: #16132a;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.mock-bar .dot { width: 8px; height: 8px; }
.mock-url {
  flex: 1; margin-left: 10px; padding: 3px 10px; border-radius: 6px;
  background: rgba(255,255,255,.06);
  font-family: var(--font-mono); font-size: .66rem; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mock-screen { position: relative; flex: 1; overflow: hidden; }

/* MonitorTest mock */
.mt-screen { display: grid; grid-template-columns: 1fr 150px; }
.mt-test {
  position: relative;
  background: linear-gradient(90deg, #ff0040 0 14.28%, #ff8a00 0 28.56%, #ffe600 0 42.84%, #22e36b 0 57.12%, #00d4ff 0 71.4%, #4f46e5 0 85.68%, #d946ef 0);
  animation: mt-cycle 9s steps(1) infinite;
}
@keyframes mt-cycle {
  0%  { background: linear-gradient(90deg, #ff0040 0 14.28%, #ff8a00 0 28.56%, #ffe600 0 42.84%, #22e36b 0 57.12%, #00d4ff 0 71.4%, #4f46e5 0 85.68%, #d946ef 0); }
  33% { background: linear-gradient(90deg, #000, #fff); }
  66% { background: #fff; }
}
.mt-pixel {
  position: absolute; top: 38%; left: 61%; width: 6px; height: 6px; background: #000;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 0 0 10px rgba(255,0,64,.35);
  border-radius: 1px;
  animation: blink 1s steps(1) infinite;
}
.mt-cross { position: absolute; inset: 0; pointer-events: none; }
.mt-cross::before, .mt-cross::after { content: ""; position: absolute; background: rgba(0,0,0,.35); }
.mt-cross::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.mt-cross::after  { top: 50%; left: 0; right: 0; height: 1px; }
.mt-panel { padding: 12px; background: #120f22; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 7px; }
.mt-panel b { font-family: var(--font-head); font-size: .72rem; margin-bottom: 2px; }
.mt-btn {
  font-family: var(--font-mono); font-size: .6rem; padding: 6px 8px; border-radius: 6px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--text-dim);
}
.mt-btn.on { background: rgba(34,211,238,.15); border-color: var(--cyan); color: #fff; }

/* Imposter mock */
.imp-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(circle at 50% 30%, rgba(139,92,246,.28), transparent 60%), #171a2a;
}
.imp-title { font-family: var(--font-head); font-weight: 600; font-size: clamp(1.1rem, 2.6vw, 1.5rem); line-height: 1; }

/* DaVinci-style timeline mock */
.dv { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr auto; background: #121019; }
.dv-viewer {
  position: relative; margin: 14px 14px 10px; border-radius: 8px; overflow: hidden;
  background: linear-gradient(135deg, #1e1b4b, #7c3aed 40%, #f472b6 70%, #fbbf24);
}
.dv-viewer::after {
  content: "REC ● 00:00:29:14"; position: absolute; top: 8px; left: 10px;
  font-family: var(--font-mono); font-size: .6rem; color: #fff; opacity: .85;
}
.dv-viewer .bars { position: absolute; left: 0; right: 0; height: 10%; background: #000; }
.dv-viewer .bars.top { top: 0; } .dv-viewer .bars.bottom { bottom: 0; }
.dv-tracks { position: relative; padding: 0 14px 14px; display: grid; gap: 5px; }
.dv-track { display: flex; gap: 4px; height: 14px; }
.dv-clip { border-radius: 3px; height: 100%; }
.dv-head {
  position: absolute; top: -4px; bottom: 10px; left: 14px; width: 2px; background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: playhead 6s linear infinite;
}
@keyframes playhead { from { left: 14px; } to { left: calc(100% - 16px); } }

/* BryteBack mock */
.bb-stamp {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-12deg);
  font-family: var(--font-mono); font-weight: 700; letter-spacing: .2em; font-size: clamp(.8rem, 2vw, 1.1rem);
  padding: 8px 16px; border: 3px solid #f43f5e; border-radius: 8px; color: #f43f5e;
  background: rgba(15, 13, 28, .7); box-shadow: 0 0 24px rgba(244,63,94,.35);
}

/* Shorts mock */
.shorts { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 4%; background: radial-gradient(circle at 50% 120%, #831843, #0a0914 65%); }
.phone {
  position: relative; height: 82%; aspect-ratio: 9 / 16; border-radius: 14px;
  border: 2px solid rgba(255,255,255,.18);
  overflow: hidden;
  box-shadow: 0 16px 40px -10px rgba(0,0,0,.8);
  transition: transform .6s var(--ease);
}
.phone:nth-child(2) { height: 92%; z-index: 1; }
.project-card:hover .phone:nth-child(1) { transform: rotate(-6deg) translateX(-6px); }
.project-card:hover .phone:nth-child(3) { transform: rotate(6deg) translateX(6px); }
.phone::before { content: ""; position: absolute; top: 5px; left: 50%; width: 30%; height: 4px; margin-left: -15%; border-radius: 4px; background: rgba(0,0,0,.6); }
.phone .play { position: absolute; inset: 0; margin: auto; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.9); display: grid; place-items: center; }
.phone .play::after { content: ""; border-left: 9px solid #0b0a14; border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 3px; }
.phone .views { position: absolute; bottom: 8px; left: 8px; right: 8px; font-family: var(--font-mono); font-size: .55rem; color: #fff; text-shadow: 0 1px 4px #000; }
.phone .line { display: block; height: 4px; border-radius: 2px; background: rgba(255,255,255,.7); margin-top: 4px; }

/* Head unit mock */
.hu { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 30%, #1f1b3a, #07060d 75%); }
.hu-dash {
  width: 86%; aspect-ratio: 2.1; border-radius: 18px; padding: 10px;
  background: linear-gradient(180deg, #2a2640, #15121f);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 20px 40px -10px #000, inset 0 2px 0 rgba(255,255,255,.08);
  display: grid; grid-template-columns: 24px 1fr 24px; gap: 8px; align-items: center;
}
.hu-knob { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #555, #111); border: 1px solid #000; }
.hu-screen {
  position: relative; height: 100%; border-radius: 8px; overflow: hidden;
  background: #050510; border: 1px solid #000;
  display: grid; grid-template-columns: 1fr 1fr;
}
.hu-half { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 8px; align-content: center; }
.hu-half span {
  display: grid; place-items: center; padding: 6px 2px; border-radius: 5px;
  font-size: .6rem; font-weight: 600; text-align: center;
}
.hu-old span { background: #1e3a8a; color: #bfdbfe; font-family: "Hiragino Sans", "Noto Sans JP", sans-serif; filter: saturate(.6); }
.hu-new span { background: linear-gradient(135deg, rgba(168,85,247,.35), rgba(34,211,238,.25)); color: #fff; border: 1px solid rgba(34,211,238,.4); }
.hu-scan {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--lime);
  box-shadow: 0 0 12px var(--lime), 0 0 30px var(--lime);
  animation: hu-scan 4s ease-in-out infinite alternate;
}
@keyframes hu-scan { from { left: 8%; } to { left: 92%; } }
.hu-stamp {
  position: absolute; top: 12px; right: 12px;
  font-family: var(--font-mono); font-size: .62rem; font-weight: 600; letter-spacing: .1em;
  padding: 5px 10px; border-radius: 6px;
  color: #fbbf24; border: 1px dashed #fbbf24; background: rgba(251,191,36,.08);
}

/* ---------- 10. Video editing ---------- */
.challenge-bar { padding: 22px 24px; margin-bottom: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.challenge-days { flex: 1; min-width: 240px; display: grid; grid-template-columns: repeat(30, 1fr); gap: 4px; }
.challenge-days span {
  height: 22px; border-radius: 4px;
  background: rgba(255,255,255,.06);
  transition: background .4s, box-shadow .4s;
}
.challenge-days span.done { background: linear-gradient(180deg, var(--lime), #65a30d); box-shadow: 0 0 8px rgba(163,230,53,.45); }
.challenge-caption { margin: 0; color: var(--text-dim); white-space: nowrap; }
.challenge-caption strong { color: var(--lime); font-family: var(--font-head); font-size: 1.2rem; }

.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.video-card { border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); transition: transform .4s var(--ease), border-color .3s; }
.video-card:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--poster);
}
.video-poster::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 2px, transparent 2px 4px);
  opacity: .5;
}
.play-btn {
  position: relative;
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.4);
  backdrop-filter: blur(8px);
  transition: transform .4s var(--ease), background .3s;
}
.play-btn::after { content: ""; border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 5px; }
.video-poster:hover .play-btn,
.video-poster:focus-visible .play-btn { transform: scale(1.12); background: rgba(168,85,247,.6); }
.video-poster.static { cursor: default; }
.poster-icon { position: relative; font-size: 2.6rem; filter: drop-shadow(0 6px 16px rgba(0,0,0,.5)); transition: transform .4s var(--ease); }
.video-card:hover .poster-icon { transform: scale(1.12) rotate(-6deg); }
.video-day {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--font-mono); font-size: .7rem; font-weight: 600;
  padding: 4px 9px; border-radius: 6px; background: rgba(0,0,0,.55); color: var(--lime);
}
.video-info { padding: 16px 18px 20px; }
.video-info h3 { font-size: 1.05rem; margin-bottom: 4px; }
.video-info p { margin: 0; font-size: .88rem; color: var(--text-faint); }

/* ---------- 11. Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(40px, 6vw, 90px);
  align-items: center;
}
.skill-list { display: grid; gap: 14px; margin-top: 36px; }
.skill {
  display: grid; grid-template-columns: 46px 1fr; gap: 16px; align-items: center;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color .3s, transform .4s var(--ease), background .3s;
}
.skill:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateX(6px); }
.skill-ico {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  color: var(--c);
}
.skill-ico svg { width: 24px; height: 24px; }
.skill-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 9px; }
.skill-name { font-family: var(--font-head); font-weight: 600; }
.skill-note { color: var(--text-faint); font-size: .8rem; font-family: var(--font-mono); text-align: right; }
.skill-bar { height: 7px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.skill-fill {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 50%, #7c3aed), var(--c));
  box-shadow: 0 0 12px var(--c);
  transition: width 1.6s var(--ease);
}
.skill.in .skill-fill { width: var(--level); }

/* Orbit */
.orbit-wrap { position: relative; width: min(100%, 460px); aspect-ratio: 1; margin: 0 auto; container-type: inline-size; overflow: hidden; }
.orbit {
  position: absolute; border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.14);
  animation: orbit-spin 40s linear infinite;
}
.orbit-outer { inset: 32px; }
.orbit-inner { inset: 27%; animation-duration: 28s; animation-direction: reverse; border-color: rgba(34,211,238,.2); }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
.orbit-badge {
  position: absolute; top: 50%; left: 50%;
  width: 60px; height: 60px; margin: -30px;
  /* place badge on the ring: rotate to its angle, push out by the radius, rotate back */
  transform: rotate(var(--a)) translate(var(--r)) rotate(calc(var(--a) * -1));
}
.orbit-badge > span {
  display: grid; place-items: center; width: 100%; height: 100%;
  border-radius: 18px;
  background: rgba(13, 11, 24, .85);
  border: 1px solid color-mix(in srgb, var(--c) 50%, transparent);
  color: var(--c);
  box-shadow: 0 0 24px -4px var(--c);
  animation: orbit-spin 40s linear infinite reverse; /* cancels the ring spin so icons stay upright */
}
.orbit-inner .orbit-badge > span { animation-duration: 28s; animation-direction: normal; }
.orbit-badge svg { width: 28px; height: 28px; }
.orbit-core {
  position: absolute; inset: 38%;
  border-radius: 50%;
  display: grid; place-content: center; text-align: center;
  background: radial-gradient(circle at 30% 25%, #a855f7, #4c1d95 60%, #1e1b4b);
  box-shadow: 0 0 60px rgba(168,85,247,.6), inset 0 0 20px rgba(255,255,255,.2);
}
.orbit-core span { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1; }
.orbit-core small { font-family: var(--font-mono); font-size: .62rem; color: #e9d5ff; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- 12. Timeline ---------- */
.timeline { position: relative; max-width: 980px; margin: 0 auto; }
.timeline::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px;
  background: linear-gradient(180deg, var(--purple), var(--cyan), var(--lime), transparent);
  opacity: .5;
}
.tl-item {
  position: relative;
  width: 50%;
  padding: 0 48px 48px 0;
}
.tl-item:nth-child(even) { margin-left: 50%; padding: 0 0 48px 48px; }
.tl-dot {
  position: absolute; top: 22px; right: -11px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--c, var(--purple));
  box-shadow: 0 0 0 5px var(--bg), 0 0 20px var(--c, var(--purple));
  display: grid; place-items: center; z-index: 1;
}
.tl-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--purple)); }
.tl-item:nth-child(even) .tl-dot { right: auto; left: -11px; }
.tl-card { padding: 24px 26px; transition: transform .4s var(--ease), border-color .3s; }
.tl-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.tl-when { font-family: var(--font-mono); font-size: .78rem; color: var(--c, var(--cyan)); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.tl-card h3 { font-size: 1.25rem; margin-bottom: 8px; display: flex; align-items: flex-start; gap: 10px; }
.tl-card p { margin: 0; color: var(--text-dim); font-size: .96rem; }
.tl-item.next .tl-card { border-style: dashed; border-color: rgba(163,230,53,.4); }
.tl-item.next .tl-dot { animation: pulse 2s infinite; }

/* ---------- 13. Contact ---------- */
.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  padding: clamp(28px, 5vw, 64px);
  position: relative; overflow: hidden;
}
.contact-card::before {
  content: ""; position: absolute; width: 400px; height: 400px; right: -150px; top: -150px;
  background: radial-gradient(circle, rgba(168,85,247,.35), transparent 65%);
  pointer-events: none;
}
.socials { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.socials a {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px 12px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  font-weight: 500; font-size: .95rem;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s, color .3s;
}
.socials a:hover { transform: translateY(-3px); border-color: var(--c); color: #fff; box-shadow: 0 10px 30px -12px var(--c); }
.socials svg { width: 22px; height: 22px; color: var(--c); }

.contact-form { position: relative; display: grid; gap: 16px; align-content: start; }
.field { position: relative; }
.field input,
.field textarea {
  width: 100%;
  padding: 24px 18px 10px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: rgba(0,0,0,.25);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  resize: vertical;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.field textarea { min-height: 150px; }
.field label {
  position: absolute; left: 19px; top: 17px;
  color: var(--text-faint);
  pointer-events: none;
  transition: transform .25s var(--ease), color .25s, font-size .25s;
  transform-origin: left top;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--purple);
  background: rgba(168,85,247,.06);
  box-shadow: 0 0 0 4px rgba(168,85,247,.18);
}
.field input:focus + label, .field textarea:focus + label,
.field input:not(:placeholder-shown) + label, .field textarea:not(:placeholder-shown) + label {
  transform: translateY(-10px) scale(.78);
  color: var(--cyan);
}
.field.invalid input, .field.invalid textarea { border-color: #f43f5e; }
.form-status { min-height: 1.5em; margin: 0; font-size: .92rem; color: var(--text-dim); }
.form-status.ok { color: var(--lime); }
.form-status.err { color: #fb7185; }

/* ---------- 14. Footer, toast, confetti ---------- */
.footer { padding: 40px 0 50px; border-top: 1px solid var(--border); position: relative; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 30px; font-size: .9rem; color: var(--text-faint); }
.footer-inner p { margin: 0; }
.footer-built { color: var(--text-dim); }
.footer-egg { width: 100%; text-align: center; font-size: .78rem; opacity: .55; margin-top: 10px !important; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 999; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 1000;
  max-width: calc(100% - 32px);
  padding: 16px 22px;
  border-radius: 16px;
  font-weight: 600;
  text-align: center;
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform .5s var(--ease), opacity .4s;
  border-color: rgba(163,230,53,.4);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast .t-big { display: block; font-family: var(--font-head); font-size: 1.15rem; color: var(--lime); margin-bottom: 2px; }

.noscript { text-align: center; padding: 20px; color: var(--text-dim); }

/* ---------- 14b. Project stories, How I Build, new mockups ---------- */

/* Small extras on project cards */
.project-subtitle {
  margin: -4px 0 8px;
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-faint);
}
.ai-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: .74rem; font-weight: 600;
  color: #e9d5ff;
  background: linear-gradient(120deg, rgba(168,85,247,.22), rgba(34,211,238,.14));
  border: 1px solid rgba(168,85,247,.4);
}
.project-note {
  margin: -8px 0 20px;
  font-size: .86rem;
  color: var(--text-dim);
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px dashed var(--border-strong);
  background: rgba(255,255,255,.02);
}

/* Problem → Solution → Result */
.psr {
  position: relative;
  display: grid; gap: 10px;
  margin: 4px 0 20px;
  counter-reset: psr;
}
.psr::before {
  /* the connector line running through the three dots */
  content: ""; position: absolute; left: 7px; top: 14px; bottom: 14px; width: 2px;
  background: linear-gradient(180deg, #fb7185, var(--cyan), var(--lime));
  opacity: .45; border-radius: 2px;
}
.psr-step { position: relative; padding-left: 28px; }
.psr-step::before {
  content: ""; position: absolute; left: 0; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--dot);
  box-shadow: 0 0 10px var(--dot);
}
.psr-problem  { --dot: #fb7185; }
.psr-solution { --dot: var(--cyan); }
.psr-result   { --dot: var(--lime); }
.psr-label {
  display: block;
  font-family: var(--font-mono); font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dot); margin-bottom: 2px;
}
.psr-step p { margin: 0; color: var(--text-dim); font-size: .94rem; line-height: 1.55; }

/* Larger version inside the story popup: three columns with arrows */
.psr-lg { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.psr-lg::before { display: none; }
.psr-lg .psr-step {
  padding: 18px 18px 18px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid color-mix(in srgb, var(--dot) 35%, transparent);
}
.psr-lg .psr-step::before { display: none; }
.psr-lg .psr-step:not(:last-child)::after {
  content: "→"; position: absolute; right: -13px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; z-index: 1;
  font-size: .8rem; background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text);
}
.psr-lg .psr-label { margin-bottom: 8px; }

/* Story popup */
.story-modal {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  background: linear-gradient(160deg, #15122a, #0b0a14);
  color: var(--text);
  box-shadow: 0 40px 120px -20px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.04) inset;
  overflow: auto;
}
.story-modal[open] { animation: modal-in .45s var(--ease); }
.story-modal::backdrop { background: rgba(4, 3, 10, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.story-body { position: relative; padding: clamp(24px, 5vw, 44px); }
.story-body::before {
  content: ""; position: absolute; top: -120px; right: -80px; width: 320px; height: 320px; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent, var(--purple)) 35%, transparent), transparent 65%);
}
.story-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 8px; position: relative; }
.story-title small {
  display: block; margin-top: 6px;
  font-family: var(--font-mono); font-size: .8rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint);
}
.story-body .project-hook { color: color-mix(in srgb, var(--accent) 70%, #fff); font-size: 1.05rem; position: relative; }
.story-long p { color: var(--text-dim); }
.story-long strong { color: var(--text); }
.story-body .project-note { margin: 4px 0 20px; }
.story-close {
  position: sticky; top: 14px; float: right; margin: 14px 14px 0 0; z-index: 2;
  width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  display: grid; place-items: center;
  background: rgba(255,255,255,.06); border: 1px solid var(--border-strong);
  transition: background .25s, border-color .25s, transform .3s var(--ease);
}
.story-close:hover { background: rgba(244,63,94,.15); border-color: #fb7185; transform: rotate(90deg); }
.story-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

/* How I Build */
.section-tight { padding-top: clamp(40px, 6vw, 70px); }
.how-line {
  position: relative;
  font-family: var(--font-head);
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 600;
  line-height: 1.4;
  padding-left: 20px;
  border-left: 3px solid;
  border-image: var(--grad) 1;
  margin: 0;
}
.how-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 48px; }
.how-step { position: relative; padding: 28px 26px; overflow: hidden; }
.how-num {
  display: block; margin-bottom: 14px;
  font-family: var(--font-head); font-size: 2.6rem; font-weight: 800; line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.how-step h3 { font-size: 1.2rem; margin-bottom: 8px; }
.how-step p { margin: 0; color: var(--text-dim); font-size: .96rem; }
.how-ex-heading { font-family: var(--font-mono); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 16px; }
.how-examples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.how-example {
  width: 100%; height: 100%; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px 22px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--accent) 7%, rgba(255,255,255,.03));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  transition: transform .35s var(--ease), box-shadow .35s, border-color .3s;
}
.how-example:hover, .how-example:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 18px 40px -18px var(--accent);
}
.how-ex-name { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: color-mix(in srgb, var(--accent) 60%, #fff); }
.how-ex-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .92rem; }
.how-ex-problem { color: var(--text-dim); text-decoration: line-through; text-decoration-color: rgba(251,113,133,.7); }
.how-ex-arrow { color: var(--text-faint); }
.how-ex-fix { color: var(--text); font-weight: 500; }
.how-ex-cta { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--text-faint); transition: color .3s; }
.how-ex-cta svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease); }
.how-example:hover .how-ex-cta { color: var(--accent); }
.how-example:hover .how-ex-cta svg { transform: translateX(4px); }

/* Imposter mock (matches the real app: eye logo, "Find the liar") */
.imp-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: #12102a; border: 2px solid #000; box-shadow: 0 0 0 1px rgba(139,92,246,.35), 0 10px 30px -6px rgba(139,92,246,.6);
}
.imp-icon svg { width: 36px; height: 36px; }
.imp-sub { margin-top: -8px; font-family: var(--font-mono); font-size: .56rem; letter-spacing: .25em; color: var(--text-faint); }
.imp-btns { display: grid; gap: 6px; width: 56%; }
.imp-btn { display: block; text-align: center; padding: 6px; border-radius: 999px; font-size: .62rem; font-weight: 700; border: 1px solid var(--border-strong); color: var(--text); }
.imp-btn.primary { background: #8b5cf6; border-color: #8b5cf6; }

/* BryteBack mock (teal data-recovery look) */
.bb-screen { display: grid; grid-template-columns: 1.2fr .9fr; align-items: center; gap: 6%; padding: 0 8%; background: radial-gradient(circle at 80% 40%, rgba(45,212,191,.22), transparent 55%), #0a0d0d; filter: saturate(.7); }
.bb-copy { display: flex; flex-direction: column; gap: 7px; }
.bb-kicker { font-family: var(--font-mono); font-size: .48rem; letter-spacing: .18em; color: #2dd4bf; }
.bb-logo { font-family: var(--font-head); font-weight: 800; font-size: clamp(1rem, 2.4vw, 1.5rem); color: #fff; line-height: 1; }
.bb-logo span { color: #2dd4bf; }
.bb-line { display: block; height: 6px; border-radius: 4px; background: rgba(255,255,255,.16); }
.bb-line.w70 { width: 90%; } .bb-line.w45 { width: 60%; }
.bb-cta { align-self: flex-start; margin-top: 4px; font-size: .56rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: #2dd4bf; color: #042f2e; }
.bb-hdd { width: 100%; filter: drop-shadow(0 0 18px rgba(45,212,191,.35)); }

/* Login Snaps art: PowerShell terminal */
.ls { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; background: radial-gradient(circle at 20% 0%, rgba(163,230,53,.16), transparent 55%), #05070a; }
.ls-term { width: 100%; height: 100%; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: #0c1a33; border: 1px solid rgba(125,211,252,.25); box-shadow: 0 20px 50px -10px rgba(0,0,0,.8); transition: transform .6s var(--ease); }
.project-card:hover .ls-term { transform: translateY(-4px); }
.ls-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #081427; border-bottom: 1px solid rgba(255,255,255,.08); }
.ls-bar .dot { width: 8px; height: 8px; }
.ls-tab { margin-left: 8px; font-family: var(--font-mono); font-size: .6rem; color: #93c5fd; }
.ls-out { flex: 1; margin: 0; padding: 12px 14px; font-family: var(--font-mono); font-size: clamp(.5rem, 1.1vw, .66rem); line-height: 1.7; color: #e2e8f0; white-space: pre-wrap; word-break: break-word; overflow: hidden; }
.ls-out .c { color: #64748b; font-style: italic; }
.ls-out .k { color: #fde047; }
.ls-out .p { color: #94a3b8; }
.ls-out .s { color: #7dd3fc; }
.ls-out .v { color: #c4b5fd; }
.ls-out .ok { color: var(--lime); }
.ls-caret { display: inline-block; width: 7px; height: 1.1em; vertical-align: -2px; margin-left: 4px; background: var(--lime); animation: blink 1s steps(1) infinite; }

/* Real screenshots on project cards */
.project-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.project-card:hover .project-shot { transform: scale(1.04); }

/* Screenshot gallery inside the story popup */
.story-gallery { display: grid; grid-template-columns: 1fr 1fr .45fr; gap: 10px; margin: 6px 0 22px; align-items: stretch; }
.story-gallery a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-strong); background: #000; transition: transform .35s var(--ease), border-color .3s; }
.story-gallery a:hover { transform: translateY(-3px); border-color: var(--accent); }
.story-gallery img { width: 100%; height: auto; }
/* the portrait shot fills the row height set by the two wide shots */
.story-gallery a.tall { position: relative; background: #e4e5e8; }
.story-gallery a.tall img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 600px) {
  .story-gallery { grid-template-columns: 1fr; }
  .story-gallery a.tall { position: static; max-width: 260px; }
  .story-gallery a.tall img { position: static; height: auto; }
}

/* Graphite mock: scientific calculator (no longer shown; Graphite uses real screenshots) */
.gr { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 0%, #334155, #0b0c10 70%); }
.gr-calc {
  width: min(64%, 260px);
  padding: 10px; border-radius: 16px;
  background: linear-gradient(180deg, #2a2d33, #16181c);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 50px -12px #000, inset 0 1px 0 rgba(255,255,255,.1);
  transform: translateY(6%);
  transition: transform .6s var(--ease);
}
.project-card:hover .gr-calc { transform: translateY(2%); }
.gr-titlebar { display: flex; align-items: center; gap: 10px; margin: -2px -2px 8px; padding: 0 4px; font-family: var(--font-body); font-size: .56rem; color: #cbd5e1; }
.gr-titlebar span { flex: 1; font-weight: 600; }
.gr-titlebar i { font-style: normal; color: #94a3b8; }
.gr-display { display: flex; flex-direction: column; align-items: flex-end; padding: 8px 10px; margin-bottom: 8px; border-radius: 8px; background: #0c0d10; border: 1px solid #000; }
.gr-display small { font-family: var(--font-mono); font-size: .54rem; color: var(--text-faint); }
.gr-display b { font-family: var(--font-mono); font-size: 1.3rem; line-height: 1.1; color: #e2e8f0; }
.gr-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.gr-keys span { display: grid; place-items: center; padding: 4px 0; border-radius: 6px; font-family: var(--font-mono); font-size: .55rem; background: #3a3e46; color: #e5e7eb; }
.gr-keys span.fn { background: #23262c; color: #94a3b8; }
.gr-keys span.eq { background: linear-gradient(135deg, #64748b, #cbd5e1); color: #0b0c10; font-weight: 700; }
.gr-name { position: absolute; top: 12px; left: 14px; font-family: var(--font-head); font-weight: 700; font-size: .8rem; letter-spacing: .04em; color: #cbd5e1; }

@media (max-width: 1024px) {
  .how-steps, .how-examples { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) and (min-width: 861px) {
  .nav-links a { padding: 9px 11px; font-size: .9rem; }
}
@media (max-width: 600px) {
  .psr-lg { grid-template-columns: 1fr; }
  .psr-lg .psr-step:not(:last-child)::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -13px; transform: translateX(-50%); }
  .story-close { margin: 10px 10px 0 0; }
}

/* ---------- 15. Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- 16. Responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-grid > * { min-width: 0; }
  .hero-visual { max-width: 560px; }
  .projects-grid { gap: 22px; }
  .project-card.featured, .project-card.featured.flip { flex-direction: column; }
  .project-card.featured .project-visual, .project-card.featured.flip .project-visual { aspect-ratio: 16 / 9; min-height: 0; border-right: 0; border-left: 0; border-bottom: 1px solid var(--border); }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skills-grid { grid-template-columns: 1fr; }
  .orbit-wrap { width: min(100%, 380px); }
}

@media (max-width: 860px) {
  .hamburger { display: block; }
  .nav-links {
    position: fixed; inset: 0; z-index: 1;
    flex-direction: column; justify-content: center; gap: 8px;
    background: rgba(7, 6, 13, .96);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    opacity: 0; visibility: hidden;
    transition: opacity .35s, visibility .35s;
  }
  .nav-links.open { opacity: 1; visibility: visible; }
  .nav-links li { opacity: 0; transform: translateY(16px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
  .nav-links.open li { opacity: 1; transform: none; }
  .nav-links.open li:nth-child(2) { transition-delay: .05s; } .nav-links.open li:nth-child(3) { transition-delay: .1s; }
  .nav-links.open li:nth-child(4) { transition-delay: .15s; } .nav-links.open li:nth-child(5) { transition-delay: .2s; }
  .nav-links.open li:nth-child(6) { transition-delay: .25s; }
  .nav-links a { font-family: var(--font-head); font-size: 1.6rem; padding: 12px 28px; }
  .nav-links .nav-cta { margin: 12px 0 0; }
  .nav-links a.active:not(.nav-cta)::after { bottom: 6px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3)::before { display: none; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }

  .about-grid { grid-template-columns: 1fr; }
  .about-avatar { max-width: 300px; }


  .contact-card { grid-template-columns: 1fr; }

  /* Timeline goes single-column with the line on the left */
  .timeline::before { left: 11px; }
  .tl-item, .tl-item:nth-child(even) { width: 100%; margin-left: 0; padding: 0 0 32px 44px; }
  .tl-dot, .tl-item:nth-child(even) .tl-dot { left: 0; right: auto; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .hero { padding-bottom: 90px; }
  .hero-ctas .btn { flex: 1 1 100%; }
  .badge-a { right: 4px; top: -18px; }
  .badge-b { left: 4px; }
  .video-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card.featured { grid-column: auto; }
  .about-facts { grid-template-columns: 1fr; }
  .stat { padding: 24px 10px; }
  .project-body { padding: 22px; }
  .mt-screen { grid-template-columns: 1fr 108px; }
  .challenge-days { grid-template-columns: repeat(15, 1fr); }
  .challenge-days span { height: 16px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .scroll-hint { display: none; }
  .project-actions .btn { flex: 1; }
  .eyebrow { font-size: .8rem; }
  .skill-note { display: none; }
  .skill { padding: 14px; gap: 14px; }
}

/* No cursor glow / tilt on touch devices */
@media (hover: none) {
  .cursor-glow { display: none; }
}

/* ---------- 17. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .reveal { opacity: 1; transform: none; }
  .cursor-glow { display: none; }
}
