/* =========================================================
   Shubham Sinha — Portfolio
   Design system + layout + motion
   ========================================================= */

:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --bg-soft: #101013;
  --bg-card: #131317;
  --surface: #17171c;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #8a8a95;
  --accent: #c7f94b;          /* electric lime — signature */
  --accent-2: #7cf5d1;        /* mint */
  --accent-soft: rgba(199, 249, 75, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
a { color: inherit; text-decoration: none; }
img, svg, video, canvas { max-width: 100%; height: auto; display: block; }
button, input { max-width: 100%; }
::selection { background: var(--accent); color: #0a0a0b; }
.accent { color: var(--accent); }

/* ---------- keyboard focus ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---------- skip link ---------- */
.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 10002;
  padding: 10px 16px; border-radius: 100px;
  background: var(--accent); color: #0a0a0b; font-weight: 600; font-size: 0.9rem;
  transform: translateY(-150%); transition: transform 0.25s var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

/* custom scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #26262c; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #33333a; }

/* ---------- background glows ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60vw 60vw at 80% -10%, rgba(199, 249, 75, 0.08), transparent 60%),
    radial-gradient(50vw 50vw at 0% 20%, rgba(124, 245, 209, 0.06), transparent 55%);
  z-index: -2;
  pointer-events: none;
}

/* grain */
.grain {
  position: fixed; inset: 0; z-index: 9998; pointer-events: none; opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------- custom cursor ---------- */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; border-radius: 50%;
  pointer-events: none; z-index: 9999; transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}
.cursor-dot { width: 7px; height: 7px; background: #fff; }
.cursor-ring {
  width: 34px; height: 34px; border: 1.5px solid rgba(255,255,255,0.6);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), background 0.25s;
}
.cursor-ring.is-hover { width: 56px; height: 56px; background: rgba(255,255,255,0.12); border-color: transparent; }
@media (hover: none), (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }
@media (max-width: 1100px) {
  .cursor-dot, .cursor-ring { display: none !important; }
}

/* ---------- scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 10000; transition: width 0.1s linear;
}

/* ---------- preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 10001; background: var(--bg);
  display: grid; place-items: center; transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.preloader.is-done { opacity: 0; visibility: hidden; }
.preloader__inner { display: flex; flex-direction: column; align-items: center; gap: 18px; width: min(320px, 78vw); }
.preloader__name {
  font-family: var(--font-mono); letter-spacing: 0.28em; font-size: clamp(0.68rem, 2.8vw, 0.8rem);
  color: var(--text-muted); text-align: center; max-width: 100%;
}
.preloader__bar { width: 100%; height: 2px; background: var(--border); overflow: hidden; }
.preloader__bar span { display: block; height: 100%; width: 0%; background: var(--accent); }
.preloader__count { font-family: var(--font-mono); font-size: 3rem; font-weight: 600; }

/* ---------- layout ---------- */
.section {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(48px, 8vw, 112px) clamp(16px, 4vw, 24px);
  width: 100%;
}
.section__head {
  display: flex; align-items: baseline; gap: clamp(10px, 2vw, 18px);
  margin-bottom: clamp(28px, 5vw, 64px); flex-wrap: wrap;
}
.section__index { font-family: var(--font-mono); color: var(--accent); font-size: 0.95rem; flex-shrink: 0; }
.section__title {
  font-size: clamp(1.65rem, 4.5vw + 0.4rem, 3rem); font-weight: 600; letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px clamp(16px, 4vw, 44px);
  padding-top: max(18px, env(safe-area-inset-top));
  transition: background 0.4s var(--ease), border-color 0.4s, padding 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
  padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: 12px;
}
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; flex-shrink: 1; }
.nav__logo {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: var(--accent); color: #0a0a0b; font-family: var(--font-mono); font-weight: 700; font-size: 0.9rem;
}
.nav__brand-text { font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav__links { display: flex; gap: 2px; flex-wrap: nowrap; min-width: 0; }
.nav__links a {
  position: relative; padding: 8px 10px; font-size: 0.88rem; color: var(--text-muted);
  border-radius: 8px; transition: color 0.25s; white-space: nowrap;
}
.nav__links a::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 4px; height: 1.5px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after { transform: scaleX(1); }
.nav__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav__resume { padding: 9px 14px; font-size: 0.88rem; font-weight: 500; color: var(--text-muted); border-radius: 100px; transition: color 0.25s, background 0.25s; }
.nav__resume:hover { color: var(--text); background: var(--surface); }
.nav__cta {
  padding: 9px 16px; border-radius: 100px; font-size: 0.88rem; font-weight: 500;
  border: 1px solid var(--border-strong); transition: background 0.25s, color 0.25s, border-color 0.25s;
  white-space: nowrap;
}
.nav__cta:hover { background: var(--accent); color: #0a0a0b; border-color: var(--accent); }
.nav__burger { display: none; background: none; border: 0; cursor: pointer; width: 40px; height: 40px; position: relative; }
.nav__burger span {
  position: absolute; left: 9px; right: 9px; height: 2px; background: var(--text); transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav__burger span:nth-child(1) { top: 15px; }
.nav__burger span:nth-child(2) { bottom: 15px; }
.nav.is-open .nav__burger span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav.is-open .nav__burger span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 99; background: var(--bg-soft);
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  padding: max(72px, env(safe-area-inset-top)) clamp(24px, 6vw, 40px) max(32px, env(safe-area-inset-bottom));
  transform: translateY(-100%); transition: transform 0.5s var(--ease); pointer-events: none;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.mobile-menu.is-open { transform: translateY(0); pointer-events: auto; }
.mobile-menu a {
  font-size: clamp(1.45rem, 6vw, 2rem); font-weight: 600; padding: 10px 0;
  color: var(--text-muted); transition: color 0.25s, padding-left 0.3s var(--ease);
}
.mobile-menu a:hover { color: var(--accent); padding-left: 10px; }
.mobile-menu__cta { color: var(--accent) !important; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 100px;
  font-weight: 500; font-size: 0.98rem; cursor: pointer;
  transition: transform 0.3s var(--ease), background 0.3s, color 0.3s, border-color 0.3s;
  max-width: 100%;
}
.btn svg { transition: transform 0.3s var(--ease); flex-shrink: 0; }
.btn--primary { background: var(--accent); color: #0a0a0b; }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px -12px var(--accent); }
.btn--primary:hover svg { transform: translateX(4px); }
.btn--ghost { border: 1px solid var(--border-strong); color: var(--text); }
.btn--ghost:hover { background: var(--surface); border-color: var(--text-dim); transform: translateY(-2px); }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh; min-height: 100dvh;
  display: flex; align-items: center;
  /* Extra bottom pad so meta links clear the absolute scroll cue */
  padding: max(100px, calc(72px + env(safe-area-inset-top))) clamp(16px, 4vw, 24px) 110px;
  max-width: var(--maxw); margin: 0 auto; width: 100%;
}
.hero__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1;
  /* keep the field faint behind the headline (left), fuller on the right */
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.42) 34%, #000 72%);
          mask-image: linear-gradient(90deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.42) 34%, #000 72%);
}
.hero__inner { width: 100%; max-width: 900px; min-width: 0; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono);
  font-size: clamp(0.72rem, 2.6vw, 0.82rem); line-height: 1.35;
  color: var(--text-muted); padding: 7px 14px; border: 1px solid var(--border); border-radius: 100px;
  background: rgba(255,255,255,0.02); margin-bottom: 28px; max-width: 100%;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2s infinite; flex-shrink: 0; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(199,249,75,0.5); } 70% { box-shadow: 0 0 0 10px rgba(199,249,75,0); } 100% { box-shadow: 0 0 0 0 rgba(199,249,75,0); } }

.hero__title {
  font-size: clamp(1.85rem, 0.6rem + 7.2vw, 5.6rem);
  line-height: 1.06; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 30px;
  overflow-wrap: break-word; word-break: normal; hyphens: manual;
}
/* block + max-width so each intentional line can wrap on narrow screens
   (inline-block shrink-to-fit was overflowing ~320px viewports) */
.hero__title .line { display: block; overflow: hidden; max-width: 100%; }
.hero__title .reveal-text {
  display: block; max-width: 100%;
  transform: translateY(110%); transition: transform 0.9s var(--ease);
}
.hero.is-in .reveal-text { transform: translateY(0); }
.hero.is-in .line:nth-child(2) .reveal-text { transition-delay: 0.08s; }
.hero.is-in .line:nth-child(3) .reveal-text { transition-delay: 0.16s; }

.hero__lead { max-width: 620px; font-size: clamp(0.98rem, 2.2vw, 1.22rem); color: var(--text-muted); margin-bottom: 38px; overflow-wrap: break-word; }
.hero__lead strong { color: var(--text); font-weight: 600; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 42px; }
.hero__actions .btn { flex: 1 1 auto; min-width: min(100%, 11.5rem); }
.hero__meta { display: flex; flex-wrap: wrap; gap: 16px 24px; font-family: var(--font-mono); font-size: 0.86rem; }
.hero__meta a { color: var(--text-dim); position: relative; transition: color 0.25s; }
.hero__meta a:hover { color: var(--accent); }
.hero__scroll {
  position: absolute; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); letter-spacing: 0.2em;
}
.hero__scroll-line { width: 1px; height: 44px; background: linear-gradient(var(--text-dim), transparent); position: relative; overflow: hidden; }
.hero__scroll-line::after { content: ""; position: absolute; top: -50%; left: 0; width: 100%; height: 50%; background: var(--accent); animation: scrolldown 1.8s infinite; }
@keyframes scrolldown { 0% { top: -50%; } 100% { top: 100%; } }

/* ---------- marquee ---------- */
.marquee { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow: hidden; padding: 22px 0; background: var(--bg-soft); }
.marquee__track { display: flex; width: max-content; animation: marquee 40s linear infinite; font-size: clamp(1.4rem, 4vw, 2.4rem); font-weight: 500; color: var(--text-dim); }
.marquee__group { display: flex; gap: 28px; padding-right: 28px; flex-shrink: 0; }
.marquee__track .dot { color: var(--accent); }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* ---------- about ---------- */
.about__grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr); gap: clamp(30px, 5vw, 70px); align-items: start; }
.about__photo { position: relative; min-width: 0; }
.about__photo-frame { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-card); aspect-ratio: 1/1; transform-style: preserve-3d; }
.about__photo-frame img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.15) contrast(1.02); transition: filter 0.5s, transform 0.6s var(--ease); }
.about__photo-frame:hover img { filter: grayscale(0) contrast(1.05); transform: scale(1.05); }
.about__photo-glow { position: absolute; inset: 0; background: linear-gradient(160deg, transparent 55%, rgba(199,249,75,0.14)); pointer-events: none; }
.about__badge {
  position: absolute; right: max(-10px, -2vw); bottom: max(-14px, -3vw);
  background: var(--accent); color: #0a0a0b; border-radius: 16px;
  padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 16px 40px -14px rgba(199,249,75,0.5); max-width: calc(100% - 8px);
}
.about__badge-num { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; line-height: 1; }
.about__badge-label { font-size: 0.72rem; font-weight: 600; line-height: 1.1; text-transform: uppercase; letter-spacing: 0.06em; }
.about__body { min-width: 0; }
.about__lead { font-size: clamp(1.05rem, 2.6vw, 1.5rem); color: var(--text); font-weight: 500; margin-bottom: 22px; letter-spacing: -0.01em; overflow-wrap: break-word; }
.about__body p { color: var(--text-muted); margin-bottom: 18px; overflow-wrap: break-word; }
.about__body strong { color: var(--text); font-weight: 600; }
.about__stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 20px); margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--border);
}
.stat { min-width: 0; }
.stat__num {
  display: block; font-size: clamp(1.35rem, 3.5vw, 2.4rem); font-weight: 700; color: var(--accent);
  font-family: var(--font-mono); letter-spacing: -0.02em; overflow-wrap: anywhere;
}
.stat__label { font-size: clamp(0.75rem, 2vw, 0.82rem); color: var(--text-dim); }

/* ---------- intro video ---------- */
.intro {
  margin: 0 0 clamp(36px, 5vw, 72px);
  scroll-margin-top: 96px;
}
.intro__player {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000;
  object-fit: contain;
}
.intro__caption {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ---------- timeline ---------- */
.timeline { position: relative; display: flex; flex-direction: column; gap: 20px; }
.timeline__item {
  position: relative; display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); gap: 28px;
  padding: clamp(20px, 3vw, 30px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card);
  transition: border-color 0.4s, transform 0.4s var(--ease), background 0.4s;
  min-width: 0;
}
.timeline__item:hover { border-color: var(--border-strong); background: var(--surface); transform: translateY(-3px); }
.timeline__marker { display: none; }
.timeline__meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.timeline__date { font-family: var(--font-mono); font-size: 0.86rem; color: var(--accent); }
.timeline__place { font-size: 0.86rem; color: var(--text-dim); }
.timeline__body { min-width: 0; }
.timeline__role {
  font-size: clamp(1.1rem, 2.4vw, 1.35rem); font-weight: 600; margin-bottom: 16px;
  overflow-wrap: break-word; line-height: 1.25;
}
.timeline__role span { color: var(--text-dim); font-weight: 400; }
.timeline__points { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.timeline__points li { position: relative; padding-left: 22px; color: var(--text-muted); font-size: 0.96rem; }
.timeline__points li::before { content: ""; position: absolute; left: 0; top: 10px; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.timeline__points strong { color: var(--text); font-weight: 600; }
.timeline__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.timeline__tags span { font-family: var(--font-mono); font-size: 0.74rem; padding: 4px 10px; border: 1px solid var(--border); border-radius: 100px; color: var(--text-dim); }

/* ---------- projects ---------- */
.project--featured {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr); gap: clamp(24px, 4vw, 40px); align-items: center;
  padding: clamp(22px, 4vw, 48px); border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--bg-card), var(--bg-soft)); overflow: hidden; margin-bottom: 26px;
  transition: border-color 0.4s; min-width: 0;
}
.project--featured:hover { border-color: var(--border-strong); }
.project__glow { position: absolute; top: -40%; right: -20%; width: min(500px, 80vw); height: min(500px, 80vw); background: radial-gradient(circle, rgba(199,249,75,0.12), transparent 60%); pointer-events: none; }
.project__content { min-width: 0; position: relative; z-index: 1; }
.project__label { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); }
.project__title { font-size: clamp(1.55rem, 3.5vw + 0.4rem, 2.6rem); font-weight: 600; margin: 8px 0 14px; letter-spacing: -0.02em; overflow-wrap: break-word; }
.project__desc { color: var(--text-muted); margin-bottom: 18px; max-width: 52ch; }
.project__highlights { list-style: none; display: flex; flex-direction: column; gap: 9px; margin-bottom: 22px; }
.project__highlights li { position: relative; padding-left: 24px; font-size: 0.92rem; color: var(--text-muted); overflow-wrap: break-word; }
.project__highlights li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
.project__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.project__tags span { font-family: var(--font-mono); font-size: 0.76rem; padding: 5px 11px; border: 1px solid var(--border); border-radius: 100px; color: var(--text-dim); }
.project__links { display: flex; flex-wrap: wrap; gap: 12px; }
.project__link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 100px; background: var(--accent); color: #0a0a0b;
  font-weight: 500; font-size: 0.9rem; transition: transform 0.3s var(--ease), box-shadow 0.3s;
  max-width: 100%;
}
.project__link:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -12px var(--accent); }
.project__link--ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.project__link--ghost:hover { background: var(--surface); box-shadow: none; }

/* pipeline motif */
.project__visual { display: grid; place-items: center; min-height: 280px; }
.pipeline { position: relative; display: flex; flex-direction: column; gap: 18px; align-items: center; width: 200px; }
.pipeline__node {
  position: relative; z-index: 2; width: 130px; padding: 14px 0; text-align: center; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface); font-family: var(--font-mono); font-size: 0.82rem;
  transition: border-color 0.3s, box-shadow 0.3s, color 0.3s;
}
.pipeline__node.is-live { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 24px -6px var(--accent-soft); }
.pipeline__wires { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.pipeline__wires .wire { stroke: var(--border-strong); stroke-width: 1.5; fill: none; stroke-dasharray: 4 4; }

/* project grid */
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 40px; }
.project-card {
  position: relative; padding: clamp(20px, 3vw, 26px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card);
  display: flex; flex-direction: column; transition: border-color 0.4s, transform 0.4s var(--ease), background 0.4s;
  min-width: 0;
}
.project-card:hover { border-color: var(--border-strong); background: var(--surface); transform: translateY(-4px); }
.project-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.project-card__icon { font-size: 1.7rem; }
.project-card__links { display: flex; align-items: center; gap: 10px; color: var(--text-dim); flex-wrap: wrap; }
.project-card__links a:hover { color: var(--accent); }
.project-card__badge { font-family: var(--font-mono); font-size: 0.68rem; padding: 3px 9px; border-radius: 100px; border: 1px solid var(--border); color: var(--text-dim); }
.project-card__title { font-size: clamp(1.1rem, 2.5vw, 1.25rem); font-weight: 600; margin-bottom: 10px; overflow-wrap: break-word; }
.project-card__desc { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 14px; flex: 1; }
.project-card__caselink { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent); transition: opacity 0.25s; white-space: nowrap; }
.project-card__caselink:hover { opacity: 0.75; }
.project-card__metric {
  display: inline-flex; align-items: baseline; gap: 8px; align-self: flex-start; flex-wrap: wrap;
  font-size: 0.82rem; color: var(--text-dim); margin-bottom: 16px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 100px; background: var(--accent-soft);
  max-width: 100%;
}
.project-card__metric strong { font-family: var(--font-mono); color: var(--accent); font-weight: 600; }
.project-card__tags { display: flex; flex-wrap: wrap; gap: 7px; }
.project-card__tags span { font-family: var(--font-mono); font-size: 0.72rem; padding: 4px 10px; border: 1px solid var(--border); border-radius: 100px; color: var(--text-dim); }

.work__more { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 0.92rem; color: var(--text-muted); border-bottom: 1px solid var(--border); padding-bottom: 4px; transition: color 0.25s, gap 0.3s var(--ease); }
.work__more:hover { color: var(--accent); gap: 16px; }

/* ---------- skills ---------- */
.skills__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.skill-group {
  padding: clamp(20px, 3vw, 28px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card);
  transition: border-color 0.4s, transform 0.4s var(--ease); min-width: 0;
}
.skill-group:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.skill-group__title { font-family: var(--font-mono); font-size: 0.86rem; color: var(--accent); margin-bottom: 18px; text-transform: uppercase; letter-spacing: 0.08em; }
.skill-group__chips { display: flex; flex-wrap: wrap; gap: 9px; }
.skill-group__chips span { padding: 8px 15px; border: 1px solid var(--border); border-radius: 100px; font-size: 0.9rem; color: var(--text-muted); cursor: default; transition: border-color 0.25s, color 0.25s; }
.skill-group__chips span:hover { border-color: var(--border-strong); color: var(--text); }

/* ---------- contact ---------- */
.contact { text-align: center; }
.contact__inner { display: flex; flex-direction: column; align-items: center; width: 100%; min-width: 0; }
.contact__eyebrow { font-family: var(--font-mono); font-size: 0.86rem; color: var(--accent); margin-bottom: 20px; }
.contact__title {
  font-size: clamp(2rem, 0.5rem + 7vw, 5rem); font-weight: 600; line-height: 1.05;
  letter-spacing: -0.03em; margin-bottom: 24px; overflow-wrap: break-word; max-width: 100%;
}
.contact__lead { max-width: 46ch; width: 100%; color: var(--text-muted); margin-bottom: 34px; font-size: clamp(0.95rem, 2.2vw, 1.05rem); padding: 0 4px; }
.contact__email {
  appearance: none; background: none; border: 0; cursor: pointer; font: inherit; color: inherit;
  font-size: clamp(1rem, 3.6vw, 2.2rem); font-weight: 600; letter-spacing: -0.02em; position: relative; padding: 0 0 8px;
  background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-position: left bottom; background-size: 0% 2px;
  transition: background-size 0.4s var(--ease), color 0.3s;
  max-width: 100%; overflow-wrap: anywhere; word-break: break-word;
}
.contact__email:hover { background-size: 100% 2px; color: var(--accent); }
.contact__email.is-copied { color: var(--accent); background-size: 100% 2px; }
.contact__copied {
  display: inline-block; min-height: 1.2em; margin-top: 10px;
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-dim);
  transition: color 0.25s var(--ease);
}
.contact__copied.is-visible { color: var(--accent); }
.contact__gmail {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px; padding: 9px 18px;
  border: 1px solid var(--border-strong); border-radius: 100px;
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-muted);
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.contact__gmail:hover { color: var(--text); border-color: var(--text-dim); background: var(--surface); }
.contact__gmail svg { color: var(--accent); }
.contact__links {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 14px 22px; margin-top: 40px; font-family: var(--font-mono); font-size: 0.9rem;
  width: 100%;
}
.contact__links a { color: var(--text-dim); transition: color 0.25s; }
.contact__links a:hover { color: var(--text); }
.contact__linkbtn {
  appearance: none; background: none; border: 0; padding: 0; font: inherit;
  color: var(--text-dim); cursor: pointer; transition: color 0.25s;
}
.contact__linkbtn:hover { color: var(--text); }
.contact__linkbtn.is-copied { color: var(--accent); }

/* ---------- footer ---------- */
.footer {
  max-width: var(--maxw); margin: 0 auto;
  padding: 34px clamp(16px, 4vw, 24px);
  padding-bottom: max(34px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-dim);
  width: 100%;
}
.footer__top:hover { color: var(--accent); }

/* ---------- responsive ---------- */
/* Large tablets / small laptops — Education link crowded the desktop nav */
@media (max-width: 1100px) {
  .nav__links, .nav__actions { display: none; }
  .nav__burger { display: block; flex-shrink: 0; }
}

@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__photo { max-width: min(320px, 100%); margin: 0 auto; width: 100%; }
  .about__badge { right: 8px; bottom: -14px; }
  .about__stats { gap: 14px; }
  .project--featured { grid-template-columns: 1fr; }
  .project__visual { order: -1; min-height: 200px; }
  .timeline__item { grid-template-columns: 1fr; gap: 16px; }
  .project-grid, .skills__grid { grid-template-columns: 1fr; }
  .hero__canvas {
    -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.55) 40%, #000 78%);
            mask-image: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.55) 40%, #000 78%);
  }
}

@media (max-width: 768px) {
  /* Scroll cue sits on top of hero meta links on phones — hide it */
  .hero__scroll { display: none; }
  .hero {
    padding-bottom: max(48px, env(safe-area-inset-bottom));
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .about__stats { grid-template-columns: 1fr; text-align: left; }
  .stat { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
  .stat__num { flex-shrink: 0; }
  .hero__actions .btn { flex: 1 1 100%; }
  .project__link, .project__link--ghost { width: 100%; }
  .timeline__item:hover, .project-card:hover, .skill-group:hover { transform: none; }
  .contact__links { gap: 12px 18px; }

  /* Flatten hero line-mask animation so phrases wrap freely on narrow screens */
  .hero__title {
    font-size: clamp(1.7rem, 8.5vw, 2.35rem);
    line-height: 1.12;
  }
  .hero__title .line {
    display: inline; overflow: visible;
  }
  .hero__title .line::after { content: "\A"; white-space: pre; }
  .hero__title .reveal-text {
    display: inline;
    transform: none !important;
    transition: none !important;
  }
  .hero__eyebrow { white-space: normal; line-height: 1.4; }
}

@media (max-width: 380px) {
  .nav__brand-text { display: none; }
  .hero__eyebrow { border-radius: 14px; }
  .preloader__name { letter-spacing: 0.18em; }
}

/* Short viewports (landscape phones, browser chrome) */
@media (max-height: 560px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-top: max(88px, calc(56px + env(safe-area-inset-top)));
    padding-bottom: 48px;
  }
  .hero__scroll { display: none; }
  .hero__title { margin-bottom: 16px; }
  .hero__lead { margin-bottom: 20px; }
  .hero__actions { margin-bottom: 20px; }
}

/* Very wide screens — keep content readable, extra side breathing room */
@media (min-width: 1600px) {
  :root { --maxw: 1240px; }
  .section, .hero, .footer { padding-left: clamp(24px, 6vw, 80px); padding-right: clamp(24px, 6vw, 80px); }
}

/* Hover-capable only: keep lift effects off coarse pointers (already mostly handled) */
@media (hover: none) {
  .btn--primary:hover, .btn--ghost:hover,
  .project__link:hover, .timeline__item:hover,
  .project-card:hover, .skill-group:hover {
    transform: none; box-shadow: none;
  }
}
