/* ==========================================================================
   Pranav Sharma — Portfolio
   Design system: "engineering notebook" — a calm, structured light theme
   with a single electric-blue accent, a geometric display face for
   headings, and a monospace face reserved for technical labels (skills,
   stack tags, dates) since the subject is genuinely code/data driven.
   ========================================================================== */

:root {
  /* ---- palette : light (default) ---- */
  --bg: #F7F8FB;
  --bg-alt: #EEF1F7;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --border: #E1E5EE;
  --text: #14151A;
  --text-muted: #565B6B;
  --text-faint: #8A8FA3;
  --accent: #2D5DF0;
  --accent-2: #0EA672;
  --accent-contrast: #FFFFFF;
  --shadow: 220 30% 15%;

  --font-display: "Outfit", "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --maxw: 1320px;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0A0C12;
  --bg-alt: #10131C;
  --surface: #12151F;
  --surface-raised: #171B27;
  --border: #262B3A;
  --text: #E9EBF2;
  --text-muted: #A6ABC0;
  --text-faint: #6A7089;
  --accent: #5B85FF;
  --accent-2: #1FDA9A;
  --accent-contrast: #08101F;
  --shadow: 220 60% 2%;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

/* Animated accent scrollbar — keeps the "everything moves" feel present
   even in the browser chrome itself */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  border: 2px solid var(--bg);
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: padding-box; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

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

p { max-width: 66ch; color: var(--text-muted); }

.mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

/* ---- visible keyboard focus ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   Section scaffolding
   ========================================================================== */

.section {
  padding-block: 96px;
  position: relative;
}

.section--tight { padding-block: 64px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 24px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}
.section-head > div {
  display: flex;
  align-items: center;
}

.section-title {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
}
.title-bar {
  display: inline-block;
  width: 0;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.7s cubic-bezier(.16,1,.3,1);
  flex-shrink: 0;
  margin-right: 16px;
  vertical-align: middle;
}
.section-head.is-visible .title-bar { width: 32px; }

.section-kicker {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  position: relative;
}
.section-kicker::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.6s cubic-bezier(.16,1,.3,1);
}
.section-head.is-visible .section-kicker::before,
.reveal.is-visible .section-kicker::before { width: 22px; }

.reveal {
  opacity: 0;
  transform: translateY(46px) scale(0.94);
  transition: opacity 0.9s cubic-bezier(.16,1,.3,1), transform 0.9s cubic-bezier(.16,1,.3,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px) scale(0.95);
  transition: opacity 0.6s cubic-bezier(.16,1,.3,1), transform 0.6s cubic-bezier(.16,1,.3,1);
}
.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.reveal-stagger > *:nth-child(1) { transition-delay: 0.02s; }
.reveal-stagger > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger > *:nth-child(3) { transition-delay: 0.14s; }
.reveal-stagger > *:nth-child(4) { transition-delay: 0.2s; }
.reveal-stagger > *:nth-child(5) { transition-delay: 0.26s; }
.reveal-stagger > *:nth-child(6) { transition-delay: 0.32s; }
.reveal-stagger > *:nth-child(7) { transition-delay: 0.38s; }
.reveal-stagger > *:nth-child(8) { transition-delay: 0.44s; }
.reveal-stagger > *:nth-child(9) { transition-delay: 0.5s; }
.reveal-stagger > *:nth-child(10) { transition-delay: 0.56s; }
.reveal-stagger > *:nth-child(11) { transition-delay: 0.62s; }
.reveal-stagger > *:nth-child(12) { transition-delay: 0.68s; }

/* Slide-in-from-left / right — used for alternating timeline items */
.reveal-left {
  opacity: 0;
  transform: translateX(-64px) rotate(-2deg);
  transition: opacity 0.8s cubic-bezier(.16,1,.3,1), transform 0.8s cubic-bezier(.16,1,.3,1);
}
.reveal-left.is-visible { opacity: 1; transform: translateX(0) rotate(0deg); }

.reveal-right {
  opacity: 0;
  transform: translateX(64px) rotate(2deg);
  transition: opacity 0.8s cubic-bezier(.16,1,.3,1), transform 0.8s cubic-bezier(.16,1,.3,1);
}
.reveal-right.is-visible { opacity: 1; transform: translateX(0) rotate(0deg); }

/* Pop-in — used for badges, icons, small chips */
.reveal-pop {
  opacity: 0;
  transform: scale(0.5) rotate(-6deg);
  transition: opacity 0.55s cubic-bezier(.34,1.56,.64,1), transform 0.55s cubic-bezier(.34,1.56,.64,1);
}
.reveal-pop.is-visible { opacity: 1; transform: scale(1) rotate(0deg); }
.reveal-stagger.pop-stagger > * {
  opacity: 0;
  transform: scale(0.5) rotate(-6deg);
  transition: opacity 0.55s cubic-bezier(.34,1.56,.64,1), transform 0.55s cubic-bezier(.34,1.56,.64,1);
}
.reveal-stagger.pop-stagger.is-visible > * {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* ==========================================================================
   Top navigation
   ========================================================================== */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background-color 0.35s ease;
  animation: navDropIn 0.7s cubic-bezier(.16,1,.3,1);
}
@keyframes navDropIn {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}
.nav.is-scrolled {
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--accent-contrast);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  background-size: 200% 200%;
  animation: gradientShift 6s ease-in-out infinite;
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 60%, transparent);
  transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), border-radius 0.35s ease;
}
.brand:hover .brand-mark {
  transform: rotate(-8deg) scale(1.08);
  border-radius: 30% 70% 65% 35% / 40% 45% 55% 60%;
}
.brand-name { transition: color 0.2s ease; }
.brand:hover .brand-name { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links li {
  opacity: 0;
  transform: translateY(-10px);
  animation: navItemIn 0.5s cubic-bezier(.16,1,.3,1) forwards;
}
.nav-links li:nth-child(1) { animation-delay: 0.05s; }
.nav-links li:nth-child(2) { animation-delay: 0.1s; }
.nav-links li:nth-child(3) { animation-delay: 0.15s; }
.nav-links li:nth-child(4) { animation-delay: 0.2s; }
.nav-links li:nth-child(5) { animation-delay: 0.25s; }
@keyframes navItemIn {
  to { opacity: 1; transform: translateY(0); }
}
.nav-links a {
  font-size: 0.92rem;
  color: var(--text-muted);
  position: relative;
  padding-bottom: 4px;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}
.nav-num {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav-links a:hover .nav-num,
.nav-links a.active .nav-num { opacity: 1; transform: translateX(0); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 14px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
}

/* ---- theme toggle switch ---- */
.theme-switch {
  --w: 52px;
  --h: 28px;
  width: var(--w);
  height: var(--h);
  border-radius: var(--h);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  position: relative;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.theme-switch .knob {
  position: absolute;
  top: 2px; left: 2px;
  width: calc(var(--h) - 6px);
  height: calc(var(--h) - 6px);
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-contrast);
  transform: translateX(0);
  transition: transform 0.35s cubic-bezier(.5,-0.2,.3,1.4), background-color 0.3s ease;
}
html[data-theme="dark"] .theme-switch .knob {
  transform: translateX(calc(var(--w) - var(--h)));
}
.theme-switch svg { width: 13px; height: 13px; }
.theme-switch .icon-sun { opacity: 1; }
.theme-switch .icon-moon { opacity: 0; position: absolute; }
html[data-theme="dark"] .theme-switch .icon-sun { opacity: 0; }
html[data-theme="dark"] .theme-switch .icon-moon { opacity: 1; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  padding-top: 152px;
  padding-bottom: 110px;
  overflow: hidden;
}

.hero-net {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.8;
}
html[data-theme="dark"] .hero-net { opacity: 0.9; }

/* Big soft glow blobs that fill the empty margins and float gently */
.hero-glow {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}
.hero-glow--a {
  width: 480px; height: 480px;
  top: -180px; left: -160px;
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  animation: floatBlob 13s ease-in-out infinite;
}
.hero-glow--b {
  width: 420px; height: 420px;
  bottom: -200px; right: -140px;
  background: color-mix(in srgb, var(--accent-2) 30%, transparent);
  animation: floatBlob 16s ease-in-out infinite reverse;
}
@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -25px) scale(1.08); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}

.eyebrow-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.eyebrow-line .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 20%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 20%, transparent); }
  50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent-2) 8%, transparent); }
}

.hero-title {
  font-size: clamp(2.8rem, 6.4vw, 5.4rem);
  margin-bottom: 22px;
  font-weight: 700;
}
.hero-title .line {
  display: block;
  opacity: 0;
  transform: translateY(28px);
  animation: heroLineIn 0.9s cubic-bezier(.2,.7,.15,1) forwards;
}
.hero-title .line:nth-child(2) { animation-delay: 0.15s; }
.hero-title .accent-text {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: heroLineIn 0.9s cubic-bezier(.2,.7,.15,1) forwards, gradientShift 6s ease-in-out infinite 1s;
}
@keyframes heroLineIn {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  color: var(--text-muted);
  height: 1.6em;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
}
.hero-role .caret {
  display: inline-block;
  width: 3px;
  height: 1.05em;
  background: var(--accent);
  margin-left: 3px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-lede {
  font-size: 1.15rem;
  margin-bottom: 38px;
  max-width: 52ch;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.hero-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
}
.hero-meta span {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  transition: border-color 0.25s ease, transform 0.25s ease;
  opacity: 0;
  animation: pillIn 0.6s cubic-bezier(.34,1.56,.64,1) forwards;
  animation-delay: 1.1s;
}
.hero-meta span:nth-child(2) { animation-delay: 1.2s; }
.hero-meta span:nth-child(3) { animation-delay: 1.3s; }
@keyframes pillIn {
  from { opacity: 0; translate: 0 10px; scale: 0.9; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}
.hero-meta span:hover { border-color: var(--accent); transform: translateY(-2px); }
.hero-meta img { width: 15px; height: 15px; object-fit: contain; }

.hero-portrait-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  animation: floatY 5.5s ease-in-out infinite;
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}
.hero-portrait {
  position: relative;
  width: min(100%, 460px);
  aspect-ratio: 1 / 1;
  border-radius: 32px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 40px 80px -24px hsl(var(--shadow) / 0.45);
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
}
.hero-portrait img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(0.08);
}
.hero-portrait::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from var(--spin-angle, 0deg), var(--accent), var(--accent-2), var(--accent));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spinBorder 5s linear infinite;
  opacity: 0.9;
  z-index: 2;
  pointer-events: none;
}
@property --spin-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes spinBorder {
  to { --spin-angle: 360deg; }
}
.hero-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 6%, transparent);
  z-index: 3;
}
.hero-portrait-tag {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 20px 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-2);
  box-shadow: 0 14px 28px -12px hsl(var(--shadow) / 0.45);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 9px;
  z-index: 4;
}
.hero-portrait-tag img {
  width: 22px; height: 22px;
  object-fit: contain;
}

.hero-badge-float {
  position: absolute;
  z-index: 4;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 16px 32px -14px hsl(var(--shadow) / 0.5);
}
.hero-badge-float--top {
  top: 6%;
  right: -6%;
  animation: floatY 4.5s ease-in-out infinite 0.3s;
}
.hero-badge-float--bottom {
  bottom: 12%;
  left: -8%;
  animation: floatY 5s ease-in-out infinite 0.6s;
}
.hero-badge-float .dot-live {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: pulse 2s ease-in-out infinite;
}

/* ==========================================================================
   Page-wide ambient motion — keeps the whole page feeling alive, not just
   the hero: a scroll progress bar, a soft cursor-follow glow, and drifting
   accent blobs seeded into every section.
   ========================================================================== */

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

.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
  transform: translate(calc(var(--mx, 50vw) - 50%), calc(var(--my, 50vh) - 50%));
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}
.cursor-glow.is-active { opacity: 1; }

.section { overflow: hidden; }

.section-ambient {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.5;
}
html[data-theme="dark"] .section-ambient { opacity: 0.65; }
.section-ambient--tl {
  width: 320px; height: 320px;
  top: -120px; left: -100px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  animation: floatBlob 15s ease-in-out infinite;
}
.section-ambient--br {
  width: 340px; height: 340px;
  bottom: -140px; right: -110px;
  background: color-mix(in srgb, var(--accent-2) 20%, transparent);
  animation: floatBlob 18s ease-in-out infinite reverse;
}
.section > .container { position: relative; z-index: 1; }

/* Gentle continuous drift applied to small accent icons throughout the page */
.drift-icon { display: inline-block; animation: driftIcon 4s ease-in-out infinite; }
@keyframes driftIcon {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(-4deg); }
}

@media (max-width: 720px) {
  .section-ambient { display: none; }
  .cursor-glow { display: none; }
}

/* ==========================================================================
   Global particle field — a fixed, full-page canvas that drifts behind
   every section (not just the hero), so the whole page stays alive.
   ========================================================================== */

.global-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}
html[data-theme="dark"] .global-particles { opacity: 0.7; }
.hero, .section, .footer { position: relative; z-index: 1; }

/* ==========================================================================
   Page load curtain — a quick animated wipe on first paint
   ========================================================================== */

.page-curtain {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.7s cubic-bezier(.76,0,.24,1), opacity 0.5s ease 0.2s;
  /* Fail-safe: even if JS never adds "is-gone" (blocked script, slow
     network, replaced-file mismatch, etc.), the curtain auto-dismisses
     itself via pure CSS so the page is never permanently hidden. */
  animation: curtainAutoHide 0.01s linear 2.2s forwards;
}
@keyframes curtainAutoHide {
  to { transform: translateY(-100%); opacity: 0; pointer-events: none; }
}
.page-curtain.is-gone {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
.page-curtain-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
  animation: curtainPulse 1s ease-in-out infinite;
}
@keyframes curtainPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.9); opacity: 0.6; }
}

/* ==========================================================================
   Word-by-word text reveal — used on section titles as they scroll in
   ========================================================================== */

.word-reveal { overflow: hidden; display: inline-block; }
.word-reveal .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%) rotate(4deg);
  transition: opacity 0.6s cubic-bezier(.16,1,.3,1), transform 0.6s cubic-bezier(.16,1,.3,1);
  transition-delay: calc(var(--i, 0) * 0.05s);
}
.word-reveal.is-visible .word { opacity: 1; transform: translateY(0) rotate(0deg); }

/* ==========================================================================
   Stats strip — animated count-up numbers
   ========================================================================== */

.stats-strip {
  position: relative;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat-cell {
  padding: 36px 24px;
  text-align: center;
  border-left: 1px solid var(--border);
  transition: background-color 0.25s ease, transform 0.25s ease;
}
.stat-cell:first-child { border-left: none; }
.stat-cell:hover { background: var(--bg-alt); transform: translateY(-3px); }
.stat-number {
  animation: statPulse 3.5s ease-in-out infinite;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--accent);
  display: block;
  line-height: 1;
  margin-bottom: 8px;
}
@keyframes statPulse {
  0%, 100% { scale: 1; }
  50% { scale: 1.06; }
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
@media (max-width: 720px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-cell:nth-child(3) { border-left: none; }
}

/* ==========================================================================
   Marquee ticker — infinite scrolling strip of skills/tech
   ========================================================================== */

.marquee {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  background: var(--bg-alt);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  gap: 40px;
  animation: marqueeScroll 26s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track--reverse {
  animation-name: marqueeScrollReverse;
  animation-duration: 32s;
}
@keyframes marqueeScrollReverse {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}
.marquee--dim {
  background: var(--bg);
  border-top: none;
  padding: 14px 0;
}
.marquee--dim .marquee-item { color: var(--text-faint); font-size: 0.8rem; }
.marquee--dim .dot-sep { color: var(--accent-2); }
.marquee-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.marquee-item .dot-sep { color: var(--accent); }
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ==========================================================================
   Button shine sweep
   ========================================================================== */

.btn-primary { position: relative; overflow: hidden; }
.btn-primary::before {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, color-mix(in srgb, var(--accent-contrast) 45%, transparent), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.btn-primary:hover::before { left: 130%; }

/* Rotating theme-toggle icon swap */
.theme-switch .icon-sun, .theme-switch .icon-moon { transition: opacity 0.3s ease, transform 0.4s ease; }
.theme-switch .icon-sun { transform: rotate(0deg); }
html[data-theme="dark"] .theme-switch .icon-sun { transform: rotate(90deg); }
.theme-switch .icon-moon { transform: rotate(-90deg); }
html[data-theme="dark"] .theme-switch .icon-moon { transform: rotate(0deg); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  font-family: var(--font-body);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
  transition: border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
  transform: translateY(-2px);
}

.btn-sm { padding: 9px 16px; font-size: 0.85rem; }

/* ==========================================================================
   About
   ========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
}
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  animation: idleFloat 7s ease-in-out infinite;
}
.about-card:nth-of-type(2) { animation-delay: -3.5s; }
@keyframes idleFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}
.about-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: 0 20px 40px -22px hsl(var(--shadow) / 0.4);
}
.about-card + .about-card { margin-top: 18px; }
.about-card h4 {
  font-size: 0.95rem;
  margin-bottom: 14px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-weight: 500;
}
.skill-group { margin-bottom: 16px; }
.skill-group:last-child { margin-bottom: 0; }
.skill-group-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-alt);
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.tag:hover {
  transform: translateY(-3px) scale(1.05);
  border-color: var(--accent);
  color: var(--accent);
}

.soft-skills { display: flex; flex-wrap: wrap; gap: 10px; }
.soft-skill {
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.soft-skill:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-alt));
}

/* ==========================================================================
   Timeline (experience + education) — a genuine chronological sequence
   ========================================================================== */

.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 1px solid var(--border);
}
.timeline-item {
  position: relative;
  padding-bottom: 36px;
  transition: transform 0.3s ease;
}
.timeline-item:hover { transform: translateX(4px); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  transition: transform 0.3s ease;
}
.timeline-item:hover::before { transform: scale(1.3); }
.timeline-item.is-current::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 6px;
  display: inline-block;
}
.timeline-title { font-size: 1.05rem; margin-bottom: 4px; }
.timeline-org { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 8px; }
.badge-current {
  display: inline-block;
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent-2);
  border: 1px solid color-mix(in srgb, var(--accent-2) 40%, transparent);
  border-radius: 999px;
  padding: 2px 9px;
  vertical-align: middle;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

/* ==========================================================================
   Projects
   ========================================================================== */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  perspective: 1200px;
}
.project-card {
  position: relative;
  background: linear-gradient(165deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface) 55%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.25s ease, transform 0.3s cubic-bezier(.2,.8,.2,1), box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  will-change: transform;
}
.project-card::before {
  content: "";
  position: absolute;
  top: -40%; right: -30%;
  width: 220px; height: 220px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.project-card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  transform: translateY(-6px) rotateX(2deg);
  box-shadow: 0 24px 48px -20px hsl(var(--shadow) / 0.4);
}
.project-card:hover::before { opacity: 1; }
.project-star {
  position: absolute;
  top: 20px; right: 20px;
  color: var(--accent);
  opacity: 0.8;
  animation: starPulse 2.6s ease-in-out infinite;
}
@keyframes starPulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.15) rotate(8deg); opacity: 1; }
}
.project-star svg { width: 18px; height: 18px; }
.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.project-category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0.03em;
}
.project-title { font-size: 1.18rem; padding-right: 24px; }
.project-desc { font-size: 0.93rem; margin: 0; }
.project-stack {
  margin-top: auto;
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-top: 8px;
}

/* ==========================================================================
   Certifications / Achievements
   ========================================================================== */

.cert-list { display: flex; flex-direction: column; }
.cert-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  transition: transform 0.3s ease, padding-left 0.3s ease;
}
.cert-item:hover { transform: translateX(6px); }
.cert-item:first-child { border-top: none; }
.cert-date { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); }
.cert-title { font-size: 1rem; margin-bottom: 4px; }
.cert-issuer { font-size: 0.85rem; color: var(--accent); margin-bottom: 6px; display: block; }
.cert-desc { font-size: 0.88rem; margin: 0; }

.achv-list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}
.achv-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--text-muted);
  padding: 12px 0;
  border-top: 1px solid var(--border);
  transition: transform 0.25s ease, color 0.25s ease;
}
.achv-list li:hover { transform: translateX(6px); color: var(--text); }
.achv-list li svg {
  flex-shrink: 0; margin-top: 3px; color: var(--accent-2); width: 16px; height: 16px;
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1);
}
.achv-list li:hover svg { transform: scale(1.3) rotate(-8deg); }

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-wrap {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: start;
}
.contact-info h3 { font-size: 1.6rem; margin-bottom: 14px; }
.contact-channels { margin-top: 28px; display: flex; flex-direction: column; gap: 14px; }
.contact-channel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.contact-channel:hover {
  border-color: var(--accent);
  transform: translateX(6px);
  box-shadow: 0 12px 24px -16px hsl(var(--shadow) / 0.5);
}
.contact-channel .icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), background-color 0.2s ease;
}
.contact-channel:hover .icon {
  transform: rotate(-8deg) scale(1.1);
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-alt));
}
.contact-channel .label { font-size: 0.72rem; color: var(--text-faint); font-family: var(--font-mono); }
.contact-channel .value { font-size: 0.94rem; }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.form-row { margin-bottom: 18px; }
.form-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}
.form-control {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
  outline: none;
}
.hp-field { position: absolute; left: -9999px; opacity: 0; }

.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; }
.form-status { font-size: 0.85rem; min-height: 1.2em; }
.form-status.ok { color: var(--accent-2); }
.form-status.err { color: #E5484D; }

.form-alt-send {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--text-faint);
  text-align: center;
}
.form-alt-send a { color: var(--accent); border-bottom: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); }
.form-alt-send a:hover { color: var(--text); border-bottom-color: var(--text); }

.btn-spinner {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent-contrast) 35%, transparent);
  border-top-color: var(--accent-contrast);
  animation: spin 0.7s linear infinite;
  display: none;
}
.is-loading .btn-spinner { display: inline-block; }
.is-loading .btn-label { opacity: 0.7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  border-top: 1px solid var(--border);
  padding-block: 32px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-faint);
}
.footer-socials { display: flex; gap: 12px; }
.footer-socials a {
  color: var(--text-muted);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.footer-socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }
.footer-socials svg { width: 17px; height: 17px; }

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, border-color 0.2s ease;
  z-index: 90;
  box-shadow: 0 12px 24px -12px hsl(var(--shadow) / 0.4);
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  animation: backToTopBounce 2.4s ease-in-out infinite;
}
@keyframes backToTopBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
  animation-play-state: paused;
}

/* ==========================================================================
   Institution logo badge (Islington College crest)
   ========================================================================== */

.org-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.org-badge img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}
.org-logo-card {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 6px;
}
.org-logo-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.timeline-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-portrait-wrap { order: -1; }
  .hero-portrait { width: min(100%, 300px); margin-inline: auto; }
  .hero-badge-float { display: none; }
  .hero-glow--a, .hero-glow--b { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 40px; }
  .project-grid { grid-template-columns: 1fr; }
  .contact-wrap { grid-template-columns: 1fr; }
  .achv-list { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.mobile-open {
    display: flex;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
    gap: 16px;
  }
  .section { padding-block: 64px; }
  .cert-item { grid-template-columns: 1fr; gap: 6px; }
  .form-row.two { grid-template-columns: 1fr; }
}
