/* ============================================================
   Jaskaran Singh — Portfolio
   Liquid Glass × Material design system · mobile-first
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* surfaces */
  --bg: #07080d;
  --bg-elev: #0c0e16;
  --ink: #f2f4fa;
  --ink-2: rgba(235, 239, 250, 0.72);
  --ink-3: rgba(228, 233, 248, 0.48);

  /* liquid glass */
  --glass: linear-gradient(150deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.028));
  --glass-strong: linear-gradient(150deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.16);
  --glass-shadow: 0 10px 40px rgba(2, 4, 12, 0.45);
  --blur: 22px;

  /* material accents */
  --accent: #8aa3ff;
  --on-accent: #061024;
  --tonal: rgba(124, 156, 255, 0.14);
  --tonal-ink: #aebfff;
  --card-solid: #12151f;

  /* motion — Material 3 emphasized easing */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.5, 1);
  --t-fast: 180ms;
  --t-med: 360ms;
  --t-slow: 700ms;

  /* shape */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 34px;

  /* layout */
  --max-w: 1140px;
  --gutter: clamp(1.1rem, 4.5vw, 2.5rem);
  --dock-h: 64px;
}

[data-theme="light"] {
  --bg: #eef0f7;
  --bg-elev: #f7f8fc;
  --ink: #11141d;
  --ink-2: rgba(22, 27, 41, 0.74);
  --ink-3: rgba(22, 27, 41, 0.5);

  --glass: linear-gradient(150deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.38));
  --glass-strong: linear-gradient(150deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.55));
  --glass-border: rgba(20, 30, 60, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.9);
  --glass-shadow: 0 12px 36px rgba(38, 50, 90, 0.14);

  --accent: #3d63ff;
  --on-accent: #ffffff;
  --tonal: rgba(61, 99, 255, 0.1);
  --tonal-ink: #2c4fd8;
  --card-solid: #fafbfe;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--dock-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 1rem;
  overflow-x: hidden;
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

::selection { background: rgba(124, 156, 255, 0.35); }

/* ---------- Ambient background ---------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.ambient::after {
  /* fine grain so glass has something to refract */
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.ambient .blob {
  position: absolute;
  width: 65vmax;
  height: 65vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  will-change: transform;
}

.blob-a {
  top: -28vmax; left: -18vmax;
  background: radial-gradient(circle at 35% 35%, rgba(110, 134, 215, 0.3), transparent 65%);
  animation: drift-a 26s var(--ease) infinite alternate;
}

.blob-b {
  bottom: -30vmax; right: -22vmax;
  background: radial-gradient(circle at 60% 45%, rgba(150, 160, 200, 0.16), transparent 62%);
  animation: drift-b 32s var(--ease) infinite alternate;
}

.blob-c {
  top: 28%; left: 52%;
  width: 42vmax; height: 42vmax;
  background: radial-gradient(circle at 50% 50%, rgba(176, 188, 245, 0.12), transparent 60%);
  animation: drift-c 38s var(--ease) infinite alternate;
}

[data-theme="light"] .ambient .blob { opacity: 0.55; }

@keyframes drift-a { to { transform: translate(9vmax, 7vmax) scale(1.12); } }
@keyframes drift-b { to { transform: translate(-8vmax, -6vmax) scale(1.08); } }
@keyframes drift-c { to { transform: translate(-6vmax, 8vmax) scale(0.92); } }

/* ---------- Glass primitives ---------- */
.glass {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(170%);
  backdrop-filter: blur(var(--blur)) saturate(170%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}

.glass::before {
  /* specular sweep along the top edge */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.14) 0%, transparent 32%);
  opacity: 0.7;
}

/* ---------- Dock navigation ---------- */
.dock {
  position: fixed;
  z-index: 60;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border-radius: 999px;
  max-width: calc(100vw - 24px);
  transition: transform var(--t-med) var(--ease), bottom var(--t-med) var(--ease);
}

.dock-brand {
  display: none;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 8px 14px 8px 10px;
  align-items: center;
  gap: 9px;
}

.dock-brand .mark-img {
  width: 32px; height: 32px;
  border-radius: 11px;
  object-fit: cover;
  border: 1.5px solid var(--glass-border);
  box-shadow: 0 0 0 2px var(--tonal);
}

.dock-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 9px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.dock-link svg { width: 21px; height: 21px; }

.dock-link:hover { color: var(--ink); }

.dock-link.active {
  color: var(--tonal-ink);
  background: var(--tonal);
}

.theme-btn {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  margin-left: 4px;
  border-radius: 999px;
  color: var(--ink-2);
  background: var(--tonal);
  transition: transform var(--t-fast) var(--ease-spring), background var(--t-fast) var(--ease);
}

.theme-btn:active { transform: scale(0.88); }
.theme-btn svg { width: 19px; height: 19px; }
.theme-btn .sun { display: none; }
[data-theme="light"] .theme-btn .sun { display: block; }
[data-theme="light"] .theme-btn .moon { display: none; }

@media (max-width: 374px) {
  /* five links + toggle on the narrowest phones */
  .dock { padding: 5px; gap: 0; }
  .dock-link { padding: 7px 7px; font-size: 0.58rem; }
  .dock-link svg { width: 19px; height: 19px; }
  .theme-btn { width: 38px; height: 38px; margin-left: 2px; }
}

@media (min-width: 900px) {
  .dock {
    bottom: auto;
    top: 18px;
    gap: 4px;
  }
  .dock-brand { display: inline-flex; }
  .dock-link {
    flex-direction: row;
    gap: 8px;
    padding: 9px 16px;
    font-size: 0.82rem;
  }
  .dock-link svg { width: 17px; height: 17px; }
}

/* ---------- Layout ---------- */
.wrap {
  width: min(var(--max-w), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

section { padding-block: clamp(4rem, 10vw, 7rem); }

.section-head { margin-bottom: clamp(2rem, 5vw, 3.2rem); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--tonal-ink);
  background: var(--tonal);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.section-title {
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.section-title::after {
  /* draws in when the section header reveals */
  content: "";
  display: block;
  width: 0;
  height: 3px;
  margin-top: 12px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.9;
  transition: width 0.8s var(--ease) 0.15s;
}

.section-head.in .section-title::after { width: 52px; }

.section-sub {
  margin-top: 10px;
  max-width: 56ch;
  color: var(--ink-2);
  font-size: clamp(0.95rem, 2.4vw, 1.05rem);
}

.grad-text { color: var(--accent); }

/* ---------- Buttons (Material w/ ripple) ---------- */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  transition: transform var(--t-fast) var(--ease-spring), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.96); }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn-filled {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 4px 16px rgba(10, 14, 30, 0.3);
}

.btn-filled:hover { box-shadow: 0 8px 24px rgba(10, 14, 30, 0.4); transform: translateY(-2px); filter: brightness(1.06); }

.btn-glass {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  color: var(--ink);
}

.btn-glass:hover { transform: translateY(-2px); }

.btn-tonal { background: var(--tonal); color: var(--tonal-ink); }
.btn-tonal:hover { transform: translateY(-2px); }

.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  pointer-events: none;
  background: currentColor;
  opacity: 0.22;
  animation: ripple 550ms var(--ease) forwards;
}

@keyframes ripple { to { transform: scale(3.2); opacity: 0; } }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-2);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.chip-tonal { background: var(--tonal); color: var(--tonal-ink); border-color: transparent; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: max(1.5rem, env(safe-area-inset-top)) clamp(3rem, 8vh, 6rem);
}

@media (min-width: 900px) {
  /* desktop dock floats at the top — clear it */
  .hero { padding-top: clamp(6rem, 14vh, 8rem); }
}

#hero-canvas {
  /* covers the viewport (no letterbox bands), while the vignette mask
     shapes the visible constellation into a centered, contained object */
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.4s var(--ease);
  -webkit-mask-image: radial-gradient(58% 52% at 50% 48%, black 36%, transparent 72%);
  mask-image: radial-gradient(58% 52% at 50% 48%, black 36%, transparent 72%);
}

#hero-canvas.ready { opacity: 0.95; }

@media (max-width: 899px) {
  #hero-canvas {
    -webkit-mask-image: radial-gradient(80% 48% at 50% 46%, black 38%, transparent 75%);
    mask-image: radial-gradient(80% 48% at 50% 46%, black 38%, transparent 75%);
  }
  #hero-canvas.ready { opacity: 0.8; }
}

.hero-card {
  padding: clamp(1.6rem, 5vw, 3.4rem);
  border-radius: var(--r-xl);
}

.hero-layout {
  display: flex;
  flex-direction: column-reverse;
  gap: 1.6rem;
  align-items: center;
  text-align: center;
}

.hero-avatar {
  position: relative;
  flex: none;
  width: clamp(180px, 52vw, 230px);
  aspect-ratio: 4 / 5;
  padding: 4px;
  border-radius: var(--r-lg);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: 0 18px 44px rgba(2, 4, 12, 0.5), inset 0 1px 0 var(--glass-highlight);
  animation: avatar-float 6s var(--ease) infinite alternate;
  will-change: transform;
}

.hero-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 32% 18%; /* frame the speaker, not the crowd */
  border-radius: calc(var(--r-lg) - 4px);
  background: var(--bg-elev);
}

.hero-avatar::after {
  /* glass glare across the photo */
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: calc(var(--r-lg) - 4px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 45%);
  pointer-events: none;
}

.hero-avatar-badge {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #f0f3ff;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 10, 18, 0.55);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

@keyframes avatar-float {
  to { transform: translateY(-10px); }
}

@media (min-width: 760px) {
  .hero-layout {
    flex-direction: row;
    text-align: left;
    justify-content: space-between;
    gap: 2.5rem;
  }
  .hero-avatar { width: clamp(200px, 21vw, 250px); }
  .hero-copy { max-width: 62ch; }
}

@media (max-width: 759px) {
  .hero-domains, .hero-eyebrow { justify-content: center; }
  .hero-cta { justify-content: center; }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-2);
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--tonal);
  margin-bottom: 1.3rem;
}

.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.hero h1 {
  font-size: clamp(2.5rem, 9vw, 4.8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.hero h1 .grad-text {
  /* supporting line — clearly smaller than the name */
  display: block;
  font-size: 0.58em;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-top: 0.18em;
}

.hero .tagline {
  margin-top: 1.15rem;
  font-size: clamp(0.95rem, 2.6vw, 1.12rem);
  font-weight: 500;
  line-height: 1.75;
  letter-spacing: 0.005em;
  color: var(--ink-2);
  max-width: 58ch;
  text-align: left;
  text-wrap: pretty;
  hyphens: none;
}

/* justify only where lines are long enough to avoid rivers */
@media (min-width: 480px) {
  .hero .tagline { text-align: justify; }
}

.hero-domains {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-cta {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-social {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 16px;
  color: var(--ink-2);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  transition: transform var(--t-fast) var(--ease-spring), color var(--t-fast) var(--ease);
}

.icon-btn:hover { transform: translateY(-3px) scale(1.05); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

/* hero stats */
.hero-stats {
  margin-top: clamp(1.8rem, 4vw, 2.6rem);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat {
  padding: 16px 18px;
  border-radius: var(--r-md);
}

.stat .num {
  font-size: clamp(1.05rem, 3.4vw, 1.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.stat .lbl {
  font-size: 0.74rem;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

@media (min-width: 700px) {
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
}

.scroll-hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-3);
  animation: bob 2.4s var(--ease) infinite;
  display: none;
}

@media (min-width: 900px) { .scroll-hint { display: block; } }

@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  gap: 18px;
}

.about-text-card { padding: clamp(1.5rem, 4vw, 2.4rem); }

.about-text-card p { color: var(--ink-2); }
.about-text-card p + p { margin-top: 0.9rem; }
.about-text-card strong { color: var(--ink); font-weight: 600; }

.edu-card {
  padding: 1.4rem 1.5rem;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.edu-icon {
  flex: none;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: var(--tonal);
  color: var(--tonal-ink);
}

.edu-icon svg { width: 22px; height: 22px; }

.edu-card h3 { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }
.edu-card .deg { color: var(--ink-2); font-size: 0.88rem; margin-top: 2px; }
.edu-card .meta { color: var(--ink-3); font-size: 0.78rem; margin-top: 6px; font-weight: 600; }

@media (min-width: 900px) {
  .about-grid { grid-template-columns: 1.5fr 1fr; }
  .about-side { display: flex; flex-direction: column; gap: 18px; }
}

/* focus cards */
.focus-grid {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.focus-card { padding: 1.5rem; transition: transform var(--t-med) var(--ease); }
.focus-card:hover { transform: translateY(-5px); }

.focus-card .f-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--tonal);
  color: var(--tonal-ink);
  border: 1px solid var(--glass-border);
  margin-bottom: 14px;
}

.focus-card .f-icon svg { width: 23px; height: 23px; }
.focus-card h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.focus-card p { margin-top: 7px; color: var(--ink-2); font-size: 0.9rem; }

@media (min-width: 700px) { .focus-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Experience timeline ---------- */
.timeline { position: relative; display: grid; gap: 20px; }

.xp-card { padding: clamp(1.4rem, 4vw, 2rem); }

.xp-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: baseline;
  justify-content: space-between;
}

.xp-head h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.xp-head .role { color: var(--tonal-ink); font-weight: 600; font-size: 0.92rem; }
.xp-head .dates {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.xp-card ul { margin-top: 14px; display: grid; gap: 10px; }

.xp-card li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-2);
  font-size: 0.92rem;
}

.xp-card li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.68em;
  width: 12px; height: 2px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.85;
}

.xp-card li strong { color: var(--ink); font-weight: 600; }

.xp-chips { margin-top: 16px; }

/* ---------- Projects ---------- */
.proj-grid { display: grid; gap: 18px; }

@media (min-width: 640px) { .proj-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .proj-grid { grid-template-columns: repeat(3, 1fr); } }

.proj-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
  transform-style: preserve-3d;
}

.proj-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 22px 50px rgba(2, 4, 12, 0.55), inset 0 1px 0 var(--glass-highlight);
}

.proj-media {
  position: relative;
  aspect-ratio: 16 / 9.4;
  overflow: hidden;
  border-radius: calc(var(--r-lg) - 7px);
  margin: 7px 7px 0;
}

.proj-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease);
}

.proj-card:hover .proj-media img { transform: scale(1.06); }

.proj-media .live-badge {
  position: absolute;
  top: 10px; right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 11px;
  border-radius: 999px;
  color: #dcfce7;
  background: rgba(8, 28, 16, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(74, 222, 128, 0.35);
}

.proj-media-grad {
  display: grid;
  place-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--glass-border);
}

.proj-media-grad .wordmark {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.proj-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 20px;
  gap: 10px;
}

.proj-body h3 { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }
.proj-body p { color: var(--ink-2); font-size: 0.87rem; flex: 1; }

.proj-links {
  display: flex;
  gap: 14px;
  margin-top: 4px;
}

.proj-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tonal-ink);
  transition: opacity var(--t-fast) var(--ease);
}

.proj-links a:hover { opacity: 0.7; }
.proj-links svg { width: 14px; height: 14px; }

.proj-more { margin-top: 26px; text-align: center; }

/* ---------- Publications ---------- */
.pub-list { display: grid; gap: 16px; }

.pub-card {
  display: flex;
  gap: 16px;
  padding: 1.4rem 1.5rem;
  align-items: flex-start;
  transition: transform var(--t-med) var(--ease);
}

.pub-card:hover { transform: translateX(6px); }

.pub-badge {
  flex: none;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  margin-top: 3px;
}

.pub-badge.alt { background: var(--tonal); color: var(--tonal-ink); }

.pub-card h3 { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.4; }
.pub-card .venue { color: var(--ink-2); font-size: 0.85rem; margin-top: 5px; }
.pub-card .venue em { color: var(--ink-3); font-style: normal; }

.pub-links { display: flex; gap: 14px; margin-top: 10px; }

.pub-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--tonal-ink);
}

.pub-links a:hover { opacity: 0.7; }
.pub-links svg { width: 13px; height: 13px; }

@media (max-width: 540px) {
  .pub-card { flex-direction: column; gap: 10px; }
}

/* ---------- Photo gallery (masonry) ---------- */
.gallery {
  column-count: 2;
  column-gap: 12px;
}

@media (min-width: 900px) { .gallery { column-count: 3; column-gap: 16px; } }

.gallery-item {
  break-inside: avoid;
  margin: 0 0 12px;
  padding: 6px;
  overflow: hidden;
  border-radius: var(--r-md);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}

@media (min-width: 900px) { .gallery-item { margin-bottom: 16px; } }

.gallery-item img {
  width: 100%;
  border-radius: calc(var(--r-md) - 5px);
  transition: transform var(--t-slow) var(--ease);
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 44px rgba(2, 4, 12, 0.55), inset 0 1px 0 var(--glass-highlight);
}

.gallery-item:hover img { transform: scale(1.04); }

/* ---------- Achievements ---------- */
.ach-grid { display: grid; gap: 14px; }

@media (min-width: 700px) { .ach-grid { grid-template-columns: repeat(2, 1fr); } }

.ach-card { padding: 1.5rem; }

.ach-card .a-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ach-card .a-icon {
  width: 42px; height: 42px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--tonal);
  color: var(--tonal-ink);
}

.ach-card .a-icon svg { width: 20px; height: 20px; }
.ach-card h3 { font-size: 1rem; font-weight: 700; }

.ach-card ul { display: grid; gap: 8px; }

.ach-card li {
  display: flex;
  gap: 10px;
  color: var(--ink-2);
  font-size: 0.88rem;
}

.ach-card li::before {
  content: "✦";
  color: var(--tonal-ink);
  font-size: 0.7rem;
  margin-top: 3px;
}

.ach-card li strong { color: var(--ink); font-weight: 600; }

/* ---------- Blog cards ---------- */
.blog-grid { display: grid; gap: 18px; }

@media (min-width: 640px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

.post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}

.post-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 22px 50px rgba(2, 4, 12, 0.55), inset 0 1px 0 var(--glass-highlight);
}

.post-media {
  position: relative;
  aspect-ratio: 16 / 8.6;
  overflow: hidden;
  border-radius: calc(var(--r-lg) - 7px);
  margin: 7px 7px 0;
  background: var(--bg-elev);
}

.post-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease);
}

.post-card:hover .post-media img { transform: scale(1.05); }

.post-media .m-badge {
  position: absolute;
  top: 10px; left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 5px 11px;
  border-radius: 999px;
  color: #fff;
  background: rgba(8, 10, 18, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.post-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 18px 20px 20px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }

.post-body h3 {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.38;
  flex: 1;
}

.post-read {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tonal-ink);
  margin-top: 4px;
}

.post-read svg {
  width: 14px; height: 14px;
  transition: transform var(--t-fast) var(--ease);
}

.post-card:hover .post-read svg { transform: translate(3px, -3px); }

.post-featured { grid-column: 1 / -1; }

@media (min-width: 900px) {
  .post-featured { display: grid; grid-template-columns: 1.25fr 1fr; }
  .post-featured .post-media {
    aspect-ratio: auto;
    height: 100%;
    margin: 7px 0 7px 7px;
  }
  .post-featured .post-body { padding: 30px 32px; justify-content: center; }
  .post-featured h3 { font-size: 1.5rem; flex: none; }
  .post-featured p.excerpt { color: var(--ink-2); font-size: 0.94rem; }
}

/* ---------- Contact ---------- */
.contact-card {
  padding: clamp(2rem, 6vw, 3.5rem);
  text-align: center;
  border-radius: var(--r-xl);
}

.contact-card h2 {
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.contact-card p {
  margin: 1rem auto 0;
  max-width: 52ch;
  color: var(--ink-2);
}

.contact-cta {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.contact-meta {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  justify-content: center;
  color: var(--ink-3);
  font-size: 0.85rem;
  font-weight: 600;
}

.contact-meta span { display: inline-flex; align-items: center; gap: 7px; }
.contact-meta svg { width: 15px; height: 15px; }

/* ---------- Footer ---------- */
footer {
  padding: 2.2rem 0 calc(var(--dock-h) + 34px);
  text-align: center;
  color: var(--ink-3);
  font-size: 0.82rem;
}

@media (min-width: 900px) { footer { padding-bottom: 2.2rem; } }

footer .foot-social {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

/* ---------- Blog page hero ---------- */
.page-hero {
  padding-top: clamp(7rem, 16vh, 9rem);
  padding-bottom: clamp(2rem, 5vw, 3rem);
}

.page-hero h1 {
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.page-hero p {
  margin-top: 0.9rem;
  color: var(--ink-2);
  max-width: 58ch;
  font-size: clamp(0.95rem, 2.5vw, 1.08rem);
}

/* ---------- Article preview page ---------- */
.post-page { padding-top: clamp(6.5rem, 14vh, 8.5rem); }

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--tonal-ink);
  margin-bottom: 1.6rem;
  transition: opacity var(--t-fast) var(--ease);
}

.post-back:hover { opacity: 0.7; }
.post-back svg { width: 16px; height: 16px; }

.post-hero { max-width: 880px; margin-inline: auto; }

.post-hero .post-meta { margin-bottom: 0.8rem; }

.post-hero h1 {
  font-size: clamp(1.7rem, 5.5vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.14;
}

.post-banner {
  margin: clamp(1.4rem, 4vw, 2.2rem) 0 0;
  padding: 7px;
  border-radius: var(--r-lg);
  overflow: hidden;
}

.post-banner img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: calc(var(--r-lg) - 6px);
  background: var(--bg-elev);
}

.article-card {
  position: relative;
  max-width: 880px;
  margin: 22px auto 0;
  padding: clamp(1.6rem, 5vw, 2.8rem);
  border-radius: var(--r-xl);
}

.article-body p {
  color: var(--ink-2);
  font-size: clamp(1rem, 2.6vw, 1.12rem);
  line-height: 1.85;
  text-align: justify;
  text-wrap: pretty;
}

.article-body p + p { margin-top: 1.1rem; }

.article-body p:first-child::first-letter {
  float: left;
  font-size: 3em;
  line-height: 0.85;
  font-weight: 800;
  padding-right: 10px;
  color: var(--accent);
}

.article-fade {
  height: 64px;
  margin-top: -8px;
  background: linear-gradient(to bottom, transparent, rgba(10, 12, 20, 0.0));
  mask-image: linear-gradient(to bottom, black, transparent);
}

.article-cta {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.article-cta .cta-note {
  color: var(--ink-3);
  font-size: 0.86rem;
  font-weight: 600;
}

.article-cta .btn svg { width: 17px; height: 17px; }



/* ---------- Sub-pages & home peeks ---------- */
.subpage { padding-top: clamp(3.5rem, 9vh, 5.5rem); }

@media (min-width: 900px) {
  .subpage { padding-top: clamp(4.5rem, 10vh, 6rem); }
}

.head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.head-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  margin-bottom: 4px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--tonal-ink);
  background: var(--tonal);
  transition: transform var(--t-fast) var(--ease-spring);
  white-space: nowrap;
}

.head-link:hover { transform: translateY(-2px); }
.head-link svg { width: 15px; height: 15px; }

.peek-grid { display: grid; gap: 14px; }

@media (min-width: 760px) { .peek-grid { grid-template-columns: repeat(3, 1fr); } }

.peek-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 1.4rem 1.5rem;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}

.peek-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 46px rgba(2, 4, 12, 0.55), inset 0 1px 0 var(--glass-highlight);
}

.peek-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.peek-card h3 { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }

.peek-card .dates {
  flex: none;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.peek-card .role { color: var(--tonal-ink); font-weight: 600; font-size: 0.85rem; }
.peek-card .sum { color: var(--ink-2); font-size: 0.87rem; flex: 1; }

.peek-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tonal-ink);
}

.peek-more svg {
  width: 14px; height: 14px;
  transition: transform var(--t-fast) var(--ease);
}

.peek-card:hover .peek-more svg { transform: translateX(3px); }

/* photo strip peek */
.photo-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.photo-strip .gallery-item { margin: 0; }

.photo-strip .gallery-item img {
  aspect-ratio: 1;
  object-fit: cover;
  width: 100%;
}

/* credentials mini peek */
.ach-mini-card {
  display: block;
  padding: 1.5rem 1.6rem;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}

.ach-mini-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 46px rgba(2, 4, 12, 0.55), inset 0 1px 0 var(--glass-highlight);
}

.ach-mini {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
}

@media (min-width: 760px) { .ach-mini { grid-template-columns: repeat(4, 1fr); } }

.ach-mini .item .big {
  font-size: clamp(1.1rem, 3.2vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.ach-mini .item .small {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 2px;
}

.ach-mini-card .peek-more { margin-top: 16px; }

/* "there's more behind this" stub card */
.more-stub {
  border-style: dashed;
  border-color: rgba(138, 163, 255, 0.3);
  opacity: 0.88;
}

.more-stub::before { display: none; }
.more-stub h3 { color: var(--ink-2); font-weight: 600; }
.more-stub:hover { opacity: 1; transform: translateX(6px); }

@media (max-width: 540px) {
  .head-row { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ============================================================
   Mobile performance & density (< 900px)
   ============================================================ */
@media (max-width: 899px) {
  /* Solid card surfaces: per-card backdrop blur is the #1 source of
     scroll jank on phones. The background is near-solid anyway. */
  .glass,
  .btn-glass,
  .icon-btn,
  .chip {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--card-solid);
  }

  /* The floating dock keeps true glass — one small fixed element is cheap
     and it sells the design language. */
  .dock {
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    backdrop-filter: blur(18px) saturate(170%);
    background: var(--glass);
  }

  .chip-tonal { background: var(--tonal); }
  .theme-btn { background: var(--tonal); }
  .dock-link.active { background: var(--tonal); }

  /* Static ambience — animating 65vmax blurred blobs costs real GPU time */
  .ambient .blob { animation: none; filter: blur(70px); }
  .ambient::after { opacity: 0.35; }

  /* Snappier, earlier reveals so content never "pops in" mid-scroll */
  .reveal {
    transform: translateY(14px);
    transition-duration: 420ms;
  }

  /* Tighter rhythm */
  section { padding-block: clamp(3.2rem, 9vw, 5rem); }
  .section-sub { font-size: 0.92rem; }
}

/* ---------- Mobile text clamping ("Show more") ---------- */
.clamp-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--tonal-ink);
  background: var(--tonal);
}

@media (max-width: 759px) {
  [data-clamp].clamped {
    position: relative;
    overflow: hidden;
    max-height: var(--clamp-h, 12.5em);
  }

  [data-clamp].clamped::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 4.5em;
    background: linear-gradient(to bottom, transparent, var(--card-solid));
    pointer-events: none;
  }

  .clamp-toggle { display: inline-flex; }
}


/* ---------- Scroll-linked section transitions ---------- */
/* Compositor-driven (no JS, no main-thread work) where supported;
   older browsers keep the IntersectionObserver reveals. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    main section:not(.hero) > .wrap {
      animation: section-enter linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 45%;
    }

    .hero > .wrap {
      animation: hero-exit linear both;
      animation-timeline: view();
      animation-range: exit 10% exit 85%;
    }
  }
}

/* transform-only: animating opacity on these wrappers turns them into
   backdrop roots in Chromium, which kills backdrop-filter (liquid glass)
   on every card inside them */
@keyframes section-enter {
  from { transform: translateY(38px) scale(0.982); }
  to { transform: none; }
}

@keyframes hero-exit {
  to { transform: translateY(-48px) scale(0.95); }
}

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
  transition-delay: var(--d, 0ms);
}

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

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

/* ---------- Fallback: no backdrop-filter ---------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .btn-glass, .icon-btn { background: var(--bg-elev); }
}
