/* ============================================================= *
 *  Arogya Baral — portfolio 2026
 *  Beautiful, soft, glass aesthetic with a living aurora
 *  background and automatic light / dark themes.
 * ============================================================= */

:root {
  color-scheme: dark;

  /* accents (shared across themes) */
  --violet: #8b7bff;
  --indigo: #6d5efc;
  --cyan: #56cffb;
  --teal: #38e6c5;
  --pink: #ff8fc7;

  /* dark theme surfaces */
  --bg-0: #080a12;
  --bg-1: #0b0e18;
  --text: #f5f7fc;
  --muted: #bcc4d8;
  --soft: #8992a8;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.28);
  --tag-bg: rgba(30, 36, 54, 0.55);
  --tag-text: #eef2fb;
  --code-bg: rgba(139, 123, 255, 0.12);
  --header-bg: rgba(255, 255, 255, 0.05);
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.7);
  --aurora-alpha: 0.6;
  --grid-alpha: 0;

  /* iOS-26 "liquid glass" bits */
  --glass-blur: 30px;
  --glass-hi: rgba(255, 255, 255, 0.4);
  --glass-sheen: rgba(255, 255, 255, 0.1);
  --glass-inner: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* ---- Light theme variables (applied via toggle OR system pref) ------ */
:root[data-theme="light"] {
  color-scheme: light;
  --bg-0: #eef1fb;
  --bg-1: #f7f9ff;
  --text: #171a26;
  --muted: #4d566e;
  --soft: #7a839a;
  --surface: rgba(255, 255, 255, 0.42);
  --surface-2: rgba(255, 255, 255, 0.6);
  --border: rgba(255, 255, 255, 0.7);
  --border-strong: rgba(23, 26, 45, 0.14);
  --tag-bg: rgba(255, 255, 255, 0.9);
  --tag-text: #202740;
  --code-bg: rgba(109, 94, 252, 0.14);
  --header-bg: rgba(255, 255, 255, 0.45);
  --shadow: 0 18px 40px -22px rgba(60, 70, 120, 0.55);
  --aurora-alpha: 0.9;
  --glass-blur: 30px;
  --glass-hi: rgba(255, 255, 255, 0.9);
  --glass-sheen: rgba(255, 255, 255, 0.45);
  --glass-inner: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg-0: #eef1fb;
    --bg-1: #f7f9ff;
    --text: #171a26;
    --muted: #4d566e;
    --soft: #7a839a;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-2: rgba(255, 255, 255, 0.92);
    --border: rgba(23, 26, 45, 0.1);
    --border-strong: rgba(23, 26, 45, 0.2);
    --tag-bg: rgba(255, 255, 255, 0.8);
    --tag-text: #3b4560;
    --code-bg: rgba(109, 94, 252, 0.12);
    --header-bg: rgba(255, 255, 255, 0.66);
    --shadow: 0 24px 60px rgba(72, 84, 140, 0.16);
    --aurora-alpha: 0.85;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 60%, var(--bg-1) 100%);
  transition: background 600ms ease, color 400ms ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
}

/* Living aurora — slow drifting colour blobs + a gentle hue cycle so the
   whole site subtly changes colour over time. */
body::before {
  content: "";
  position: fixed;
  inset: -35%;
  z-index: -2;
  pointer-events: none;
  opacity: var(--aurora-alpha);
  background:
    radial-gradient(46% 50% at 18% 22%, rgba(139, 123, 255, 0.5), transparent 66%),
    radial-gradient(44% 48% at 82% 18%, rgba(86, 207, 251, 0.46), transparent 68%),
    radial-gradient(50% 54% at 72% 82%, rgba(56, 230, 197, 0.4), transparent 70%),
    radial-gradient(46% 50% at 28% 78%, rgba(255, 143, 199, 0.4), transparent 70%);
  will-change: transform, filter;
  /* No blur: soft gradients already; hue-rotate alone stays GPU-composited. */
  animation: auroraDrift 34s ease-in-out infinite alternate, hueCycle 42s linear infinite;
}

/* Soft ambient sheen — static paint, moved only via transform (cheap). */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(700px circle at 50% 38%, rgba(255, 255, 255, 0.05), transparent 60%);
  transform: translate3d(var(--ambient-x, 0px), var(--ambient-y, 0px), 0);
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

@keyframes auroraDrift {
  0% { transform: translate3d(-3%, -2%, 0) rotate(0deg) scale(1.12); }
  50% { transform: translate3d(3%, 1%, 0) rotate(4deg) scale(1.2); }
  100% { transform: translate3d(-1%, 3%, 0) rotate(-4deg) scale(1.12); }
}

@keyframes hueCycle {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(360deg); }
}

/* Perf: don't render sections until they're near the viewport (120fps scroll). */
main > section:not(.hero):not(.stats-row) {
  content-visibility: auto;
  contain-intrinsic-size: auto 520px;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

::selection {
  background: rgba(139, 123, 255, 0.32);
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

/* ---- Header --------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 14px;
  z-index: 50;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background:
    linear-gradient(150deg, var(--glass-sheen), transparent 46%),
    var(--header-bg);
  box-shadow: var(--shadow), var(--glass-inner);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  transition: border-color 260ms ease, background 400ms ease;
}

.site-header:hover {
  border-color: var(--border-strong);
}

.nav-wrap {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 10px 0 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text);
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
  box-shadow: 0 6px 18px rgba(139, 123, 255, 0.4);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 var(--glass-hi);
  padding: 4px;
}

.nav-links a {
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 15px;
  transition: 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--surface-2);
  color: var(--text);
}

.theme-toggle,
.menu-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: var(--glass-inner);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  color: var(--text);
  cursor: pointer;
  transition: 220ms ease;
}

.theme-toggle:hover,
.menu-button:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-1px);
}

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

.theme-toggle.playing {
  color: var(--violet);
  border-color: var(--border-strong);
  animation: musicPulse 1.7s ease-out infinite;
}

@keyframes musicPulse {
  0% { box-shadow: var(--glass-inner), 0 0 0 0 rgba(139, 123, 255, 0.45); }
  100% { box-shadow: var(--glass-inner), 0 0 0 13px rgba(139, 123, 255, 0); }
}

.menu-button {
  display: none;
}

.mobile-panel {
  display: none;
}

.page {
  padding: 82px 0 56px;
}

/* ---- Hero ----------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--indigo);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

:root[data-theme="light"] .eyebrow { color: var(--indigo); }

.eyebrow::before {
  content: "";
  width: 30px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
}

.hero {
  display: grid;
  min-height: calc(100vh - 106px);
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.62fr);
  align-items: center;
  gap: 64px;
  padding-top: 26px;
}

.hero h1,
.page-title {
  margin: 0;
  max-width: 900px;
  font-size: clamp(2.9rem, 7vw, 6.4rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1;
}

/* Every title flows through a shifting multi-colour gradient. */
.hero h1,
.page-title,
.section-head h2,
.gradient-text {
  background: linear-gradient(
    100deg,
    var(--violet) 0%,
    var(--indigo) 22%,
    var(--cyan) 44%,
    var(--teal) 62%,
    var(--pink) 80%,
    var(--violet) 100%
  );
  background-size: 260% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 9s linear infinite;
}

@keyframes shimmer {
  to { background-position: 260% center; }
}

.lede {
  max-width: 700px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.75;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background:
    linear-gradient(150deg, var(--glass-sheen), transparent 50%),
    var(--surface-2);
  box-shadow: var(--glass-inner);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0 22px;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 240ms ease, background 240ms ease;
}

.button:hover {
  transform: translateY(-2px);
  background: var(--surface-2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.button.primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--indigo), var(--violet) 45%, var(--cyan));
  box-shadow: 0 14px 40px rgba(109, 94, 252, 0.34);
}

.button.primary:hover {
  box-shadow: 0 18px 50px rgba(109, 94, 252, 0.5);
}

/* ---- Cards ---------------------------------------------------------- */
.hero-card,
.card,
.project-card,
.timeline-item,
.contact-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    linear-gradient(150deg, var(--glass-sheen), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow), var(--glass-inner);
  backdrop-filter: blur(var(--glass-blur)) saturate(185%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(185%);
}

.hero-card::before,
.card::before,
.project-card::before,
.timeline-item::before,
.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--card-x, 50%) var(--card-y, 50%), rgba(139, 123, 255, 0.16), transparent 55%);
  transition: opacity 260ms ease;
}

.hero-card:hover::before,
.card:hover::before,
.project-card:hover::before,
.timeline-item:hover::before,
.contact-card:hover::before {
  opacity: 1;
}

/* 3D stage for the floating-box hover. */
.hero,
.grid-3,
.grid-2,
.project-grid,
.split {
  perspective: 1500px;
}

.card,
.project-card,
.timeline-item,
.contact-card {
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), border-color 320ms ease, box-shadow 320ms ease;
}

/* Fallback lift for touch / no-pointer devices (JS handles the 3D tilt). */
.card:hover,
.project-card:hover,
.timeline-item:hover,
.contact-card:hover {
  transform: translateY(-10px);
  border-color: var(--border-strong);
}

/* "Floating in the sky" — a soft cast shadow appears beneath a lifted box. */
.card.is-floating,
.project-card.is-floating,
.timeline-item.is-floating,
.contact-card.is-floating,
.hero-card.is-floating {
  border-color: var(--border-strong);
  box-shadow: 0 28px 50px -24px rgba(0, 0, 0, 0.65), 0 10px 24px -16px rgba(109, 94, 252, 0.4), var(--glass-inner);
}

/* ---- Portrait (no scan animation) ---------------------------------- */
.portrait-frame {
  justify-self: end;
  width: min(100%, 360px);
  padding: 12px;
}

.portrait {
  aspect-ratio: 1 / 1.12;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface-2);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-card:hover .portrait img {
  transform: scale(1.045);
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 12px;
  border: 1px solid var(--border);
  background: var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.status-strip div {
  background: var(--surface-2);
  padding: 15px 12px;
}

.metric {
  display: block;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.96rem;
  font-weight: 800;
}

.label {
  display: block;
  margin-top: 4px;
  color: var(--soft);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---- Sections ------------------------------------------------------- */
.section {
  padding: 74px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
}

.section-head p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.card {
  padding: 26px;
}

.card h3,
.timeline-item h3,
.project-card h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.card p,
.timeline-item p,
.project-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

/* ---- Tags ----------------------------------------------------------- */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag {
  border: 1px solid var(--border);
  border-radius: 999px;
  /* No backdrop-filter here — nesting it inside the glass card blurs the
     pill's own text. A solid-enough fill keeps the label razor-sharp. */
  background: var(--tag-bg);
  box-shadow: inset 0 1px 0 var(--glass-hi);
  color: var(--tag-text);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 7px 12px;
  transition: 200ms ease;
}

/* Make the dense resume skill tags read razor-sharp. */
.skill-block .tag {
  font-weight: 800;
  color: var(--text);
}

.tag:hover {
  border-color: var(--violet);
  color: var(--text);
}

/* ---- Resume split --------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 28px;
  align-items: start;
}

.sticky-stack {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 16px;
}

.profile-mini {
  padding: 24px;
}

.profile-mini img {
  width: 92px;
  height: 92px;
  border-radius: 22px;
  object-fit: cover;
  margin-bottom: 18px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.profile-mini h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.profile-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.94rem;
}

.skill-block + .skill-block {
  margin-top: 22px;
}

.skill-block h4 {
  margin: 0 0 10px;
  color: var(--indigo);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---- Timeline ------------------------------------------------------- */
.timeline {
  display: grid;
  gap: 16px;
}

.timeline-item {
  padding: 26px;
}

.timeline-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.timeline-item .timeline-top > div > p {
  margin: 4px 0 0;
  color: var(--indigo);
  font-weight: 600;
}

.date-pill {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  padding: 8px 12px;
}

.clean-list {
  display: grid;
  gap: 9px;
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.65;
  list-style: none;
}

.clean-list li {
  position: relative;
}

.clean-list li::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
}

/* ---- Projects ------------------------------------------------------- */
.project-grid {
  display: grid;
  gap: 16px;
}

.project-card {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 28px;
}

.project-number {
  font-family: "JetBrains Mono", monospace;
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.85;
}

.project-link {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  transition: 200ms ease;
}

.project-link:hover {
  border-color: var(--violet);
  background: var(--code-bg);
  transform: translateY(-2px);
}

/* ---- Contact -------------------------------------------------------- */
.contact-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 34px;
  align-items: start;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.social-tile {
  display: flex;
  min-height: 82px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(150deg, var(--glass-sheen), transparent 50%),
    var(--surface);
  box-shadow: var(--glass-inner);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  padding: 16px;
  font-weight: 600;
  transition: 200ms ease;
}

.social-tile:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.social-tile i {
  width: 24px;
  font-size: 1.35rem;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.contact-card {
  padding: 30px;
}

.form-grid {
  display: grid;
  gap: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--glass-inner);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  color: var(--text);
  font: inherit;
  outline: 0;
  padding: 14px 16px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

textarea {
  min-height: 158px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--soft);
}

input:focus,
textarea:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(139, 123, 255, 0.16);
}

/* ---- Footer --------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 30px;
  padding: 30px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--soft);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.footer-links {
  display: flex;
  gap: 18px;
  font-size: 1.15rem;
}

.footer-links a {
  color: var(--muted);
  transition: color 180ms ease, transform 180ms ease;
}

.footer-links a:hover {
  color: var(--violet);
  transform: translateY(-2px);
}

/* ---- Stats row ------------------------------------------------------ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 8px;
}

.stat {
  padding: 28px 22px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    linear-gradient(150deg, var(--glass-sheen), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow), var(--glass-inner);
  backdrop-filter: blur(var(--glass-blur)) saturate(185%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(185%);
  text-align: center;
}

.stat-num {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(2.2rem, 4.4vw, 3.1rem);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(120deg, var(--violet), var(--indigo) 40%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---- Journey path --------------------------------------------------- */
.path-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 14px;
}

.path-step {
  position: relative;
  padding: 26px 24px;
}

.path-index {
  display: inline-block;
  margin-bottom: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--soft);
}

.path-arrow {
  align-self: center;
  color: var(--violet);
  font-size: 1.4rem;
  opacity: 0.85;
}

@media (max-width: 860px) {
  .path-row {
    grid-template-columns: 1fr;
  }

  .path-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }
}

/* ---- Scroll progress bar ------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 100;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, var(--violet), var(--cyan), var(--teal));
  box-shadow: 0 0 12px rgba(139, 123, 255, 0.6);
}

/* ---- Back to top ---------------------------------------------------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: var(--shadow), var(--glass-inner);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px) scale(0.9);
  pointer-events: none;
  transition: opacity 300ms ease, transform 300ms cubic-bezier(0.22, 1, 0.36, 1), border-color 200ms ease;
}

.to-top.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

/* ---- Reveal --------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Responsive ----------------------------------------------------- */
/* Large tablets / small laptops */
@media (max-width: 1080px) {
  .hero {
    gap: 40px;
  }

  .contact-layout {
    gap: 26px;
  }

  .split {
    gap: 22px;
  }
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    top: 10px;
    width: min(100% - 20px, 1180px);
    border-radius: 22px;
  }

  .nav-links {
    display: none;
  }

  .menu-button {
    display: grid;
  }

  .mobile-panel.open {
    display: grid;
    gap: 8px;
    padding: 0 14px 14px;
  }

  .mobile-panel a {
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--muted);
    font-weight: 700;
    padding: 13px 14px;
  }

  .page {
    padding-top: 64px;
  }

  .hero,
  .split,
  .contact-layout,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    gap: 34px;
    padding-top: 70px;
  }

  .portrait-frame {
    justify-self: start;
    width: min(100%, 320px);
  }

  .section-head {
    display: grid;
  }

  .sticky-stack {
    position: static;
  }

  .project-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .project-link {
    width: 100%;
  }

  .timeline-top {
    display: grid;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .social-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* Phones */
@media (max-width: 600px) {
  .shell {
    width: min(100% - 24px, 1180px);
  }

  .nav-wrap {
    min-height: 52px;
    padding: 0 8px 0 14px;
  }

  .brand {
    font-size: 0.86rem;
  }

  .hero {
    gap: 26px;
    padding-top: 56px;
  }

  .hero h1,
  .page-title {
    font-size: clamp(2.3rem, 12vw, 3.4rem);
    line-height: 1.02;
  }

  .lede {
    font-size: 1.02rem;
  }

  .cta-row .button {
    flex: 1 1 auto;
  }

  .section {
    padding: 52px 0;
  }

  .section-head h2 {
    font-size: clamp(1.7rem, 8vw, 2.3rem);
  }

  .card,
  .contact-card,
  .timeline-item {
    padding: 20px;
  }

  .project-card {
    padding: 22px;
  }

  .status-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .social-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .stat {
    padding: 22px 16px;
  }
}

/* Small phones */
@media (max-width: 380px) {
  .hero h1,
  .page-title {
    font-size: clamp(2rem, 13vw, 2.7rem);
  }

  .nav-wrap {
    gap: 8px;
  }

  .status-strip,
  .social-grid {
    grid-template-columns: 1fr;
  }

  .card,
  .contact-card,
  .timeline-item,
  .project-card {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
