/* =====================================================================
   Shivam Srivastav — Portfolio
   Design tokens → base → layout → components → sections → pages
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #fafafa;
  --bg-alt: #f4f4f6;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --text-muted: #52525b;
  --text-subtle: #71717a;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.08);
  --accent-border: rgba(79, 70, 229, 0.22);
  --accent-text: #4338ca;
  --on-accent: #ffffff;
  --success: #15803d;
  --success-soft: rgba(21, 128, 61, 0.1);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, 0.1);
  --danger: #b91c1c;
  --glow-1: rgba(99, 102, 241, 0.16);
  --glow-2: rgba(14, 165, 233, 0.12);
  --header-bg: rgba(250, 250, 250, 0.78);
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.05);
  --shadow: 0 1px 2px rgba(24, 24, 27, 0.04), 0 8px 24px -8px rgba(24, 24, 27, 0.1);
  --shadow-lg: 0 2px 4px rgba(24, 24, 27, 0.04), 0 20px 40px -12px rgba(24, 24, 27, 0.16);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --container: 1160px;
  --gutter: 16px;
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b10;
    --bg-alt: #0f0f15;
    --surface: #131319;
    --surface-2: #1a1a22;
    --border: #25252e;
    --border-strong: #33333d;
    --text: #f4f4f5;
    --text-muted: #a1a1aa;
    --text-subtle: #8b8b94;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-soft: rgba(129, 140, 248, 0.1);
    --accent-border: rgba(129, 140, 248, 0.28);
    --accent-text: #a5b4fc;
    --on-accent: #0b0b10;
    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, 0.1);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.1);
    --danger: #f87171;
    --glow-1: rgba(99, 102, 241, 0.2);
    --glow-2: rgba(14, 165, 233, 0.1);
    --header-bg: rgba(11, 11, 16, 0.72);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b10;
  --bg-alt: #0f0f15;
  --surface: #131319;
  --surface-2: #1a1a22;
  --border: #25252e;
  --border-strong: #33333d;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-subtle: #8b8b94;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: rgba(129, 140, 248, 0.1);
  --accent-border: rgba(129, 140, 248, 0.28);
  --accent-text: #a5b4fc;
  --on-accent: #0b0b10;
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.1);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.1);
  --danger: #f87171;
  --glow-1: rgba(99, 102, 241, 0.2);
  --glow-2: rgba(14, 165, 233, 0.1);
  --header-bg: rgba(11, 11, 16, 0.72);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--on-accent); }
[hidden] { display: none !important; }

.icon { width: 1.1em; height: 1.1em; flex-shrink: 0; vertical-align: -0.18em; }
.icon--lg { width: 1.5em; height: 1.5em; }
.icon--accent { color: var(--accent); }
[data-icon] { display: inline-flex; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; } }
.narrow { max-width: 680px; }
.center { text-align: center; justify-content: center; }
.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
.text-accent { color: var(--accent); }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600;
  transition: top 0.15s;
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent;
  font-size: 0.95rem; font-weight: 600; line-height: 1; white-space: nowrap;
  cursor: pointer; transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 0.875rem; border-radius: 9px; }
.btn--lg { height: 50px; padding: 0 24px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 6px 16px -6px var(--accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-sm); }
.btn--secondary:hover { border-color: var(--accent-border); color: var(--accent-text); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn .icon { width: 18px; height: 18px; }

.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); font-weight: 600; font-size: 0.9rem; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-link .icon { width: 14px; height: 14px; }

/* ---------- Badges ---------- */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 500; line-height: 1.4;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.badge--client { background: var(--warn-soft); color: var(--warn); border-color: transparent; font-weight: 600; }
.badge--product { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; font-weight: 600; }
.badge--skill { font-size: 0.875rem; padding: 6px 12px; color: var(--text); background: var(--surface); border-color: var(--border); transition: border-color .2s, color .2s; }
.badge--skill:hover { border-color: var(--accent-border); color: var(--accent-text); }
.badge__note { font-size: 0.72rem; color: var(--text-subtle); font-weight: 500; padding-left: 8px; border-left: 1px solid var(--border); }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.status__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-subtle); }
.status--live { color: var(--success); }
.status--live .status__dot { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: 12px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.card__title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; margin-bottom: 16px; }

.grid { display: grid; gap: 16px; }
@media (min-width: 700px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } .grid--3 { grid-template-columns: repeat(2, 1fr); } .grid { gap: 20px; } }
@media (min-width: 1024px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

.checklist { list-style: none; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.93rem; color: var(--text-muted); }
.checklist .icon { color: var(--success); margin-top: 0.25em; width: 16px; height: 16px; }
.bullets { padding-left: 1.2em; display: grid; gap: 8px; color: var(--text-muted); }
.bullets li::marker { color: var(--accent); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: var(--header-bg); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color 0.2s;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; }
.brand__mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #0ea5e9); color: #fff; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.02em;
}
.nav__actions { display: flex; gap: 8px; align-items: center; }
.nav__menu { display: flex; align-items: center; gap: 4px; }
.nav__menu a:not(.btn) { padding: 8px 12px; border-radius: 8px; font-size: 0.92rem; font-weight: 500; color: var(--text-muted); transition: color .2s, background .2s; }
.nav__menu a:not(.btn):hover { color: var(--text); background: var(--surface-2); }
.nav__menu a.is-active:not(.btn) { color: var(--text); background: var(--accent-soft); }
.nav__cta { margin-left: 8px; }

@media (max-width: 899px) {
  .nav__menu {
    position: fixed; inset: var(--header-h) 0 auto 0; z-index: 49;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px var(--gutter) 20px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s, transform .2s var(--ease), visibility .2s;
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
  }
  .menu-open .nav__menu { opacity: 1; visibility: visible; transform: none; }
  .nav__menu a:not(.btn) { padding: 12px; font-size: 1rem; }
  .nav__cta { margin: 8px 0 0; height: 44px; }
  .brand__name { font-size: 0.98rem; }
}
@media (min-width: 900px) { .nav__toggle { display: none; } }
@media (min-width: 900px) and (max-width: 1080px) { .nav__menu a:not(.btn) { padding: 8px 9px; font-size: 0.88rem; } }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
@media (min-width: 900px) { .section { padding: 104px 0; } }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); }
.section-head--row { max-width: none; display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; justify-content: space-between; }
.section-head--row > div { max-width: 720px; }
.section-lead { margin-top: 14px; color: var(--text-muted); font-size: 1.05rem; max-width: 65ch; }
.subhead { font-size: 1.15rem; margin: 56px 0 20px; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 64px; }
@media (min-width: 900px) { .hero { padding: 128px 0 112px; } }
.hero__bg, .case-hero .hero__bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 15% 0%, var(--glow-1), transparent 70%),
    radial-gradient(ellipse 45% 40% at 90% 10%, var(--glow-2), transparent 70%);
}
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px; opacity: 0.35;
  mask-image: radial-gradient(ellipse 70% 60% at 30% 20%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 20%, #000 20%, transparent 75%);
}
.hero__inner { position: relative; min-width: 0; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: center; }
.hero__grid > * { min-width: 0; }
@media (min-width: 1100px) { .hero__grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 56px; } }

/* "At a glance" panel */
.hero__panel {
  position: relative; padding: 24px; display: grid; gap: 16px;
  background: linear-gradient(160deg, var(--accent-soft), transparent 55%), var(--surface);
  box-shadow: var(--shadow-lg);
}
.hero__panel .eyebrow { margin: 0; }
.glance-profile { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.glance-profile__photo {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--accent), var(--shadow);
}
.glance-profile__name { margin: 0; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.glance-profile__meta { margin: 2px 0 0; font-size: 0.82rem; color: var(--text-subtle); }
.glance-stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.glance-stats div { min-width: 0; padding: 12px 6px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); text-align: center; }
.glance-stats dd { margin: 0; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; order: -1; }
.glance-stats div { display: flex; flex-direction: column; gap: 4px; }
.glance-stats dt { font-size: 0.7rem; color: var(--text-subtle); line-height: 1.3; overflow-wrap: anywhere; }
.glance-list li { min-width: 0; }
.glance-label { margin: 4px 0 -6px; font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-subtle); }
.glance-list { list-style: none; display: grid; gap: 2px; }
.glance-list a { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 10px; transition: background .2s; }
.glance-list a:hover { background: var(--surface-2); }
.glance-list a:hover .icon { transform: translateX(3px); color: var(--accent); }
.glance-list__name { flex: 1; font-weight: 600; font-size: 0.95rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glance-list__type { font-size: 0.72rem; color: var(--text-subtle); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.glance-list .icon { width: 16px; height: 16px; color: var(--text-subtle); transition: transform .2s var(--ease), color .2s; }
@media (max-width: 1099px) { .hero__panel { max-width: 560px; } }
.hero__title { font-size: clamp(2.6rem, 1.6rem + 5vw, 4.75rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; }
/* Phones: keep the name on one line, scaled to the screen width */
@media (max-width: 699px) { .hero__title { font-size: min(9vw, 3.5rem); white-space: nowrap; } }
.hero__role {
  margin: 14px 0 0; font-size: clamp(1.15rem, 1rem + 1vw, 1.6rem); font-weight: 600; letter-spacing: -0.015em;
  background: linear-gradient(90deg, var(--accent), #0ea5e9); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lead { margin-top: 20px; max-width: 60ch; font-size: clamp(1rem, .95rem + .35vw, 1.15rem); color: var(--text-muted); }
.hero__cta { margin-top: 32px; }
.hero__social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.social-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 0.875rem; font-weight: 500;
  transition: color .2s, border-color .2s;
}
.social-pill:hover { color: var(--text); border-color: var(--border-strong); }
.hero__facts {
  margin: 48px 0 0; padding-top: 28px; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; max-width: 720px;
}
.hero__facts dt { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-subtle); }
.hero__facts dd { margin: 4px 0 0; font-weight: 600; }
@media (max-width: 479px) {
  .hero__cta .btn { flex: 1 1 100%; }
}

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 900px) { .about__grid { grid-template-columns: 320px minmax(0, 1fr); gap: 56px; align-items: start; } }
.about__main { display: grid; gap: 28px; min-width: 0; }
.about__text p { font-size: 1.075rem; color: var(--text-muted); }
.about__text p:first-child { color: var(--text); font-size: 1.15rem; }
.about__interests-title { font-size: 0.78rem; font-family: var(--mono); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-subtle); margin-bottom: 12px; }
.interest-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.interest-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-weight: 500; font-size: 0.92rem;
}

/* ---------- Meet the team ---------- */
.members { display: grid; gap: 24px; max-width: 980px; }
.member { display: grid; gap: 20px; align-content: start; padding: 24px; }
@media (min-width: 560px) { .member { grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; } }
@media (min-width: 1024px) { .member { grid-template-columns: 220px minmax(0, 1fr); gap: 36px; padding: 28px; } }
.member__photo {
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border);
  background: var(--surface-2); box-shadow: var(--shadow-lg); max-width: 260px;
}
.member__photo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 20%; display: block; }
.member__body { display: grid; gap: 10px; min-width: 0; }
.member__role { margin: 0; font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-text); }
.member__name { font-size: 1.45rem; letter-spacing: -0.02em; }
.member__bio { margin: 0; color: var(--text-muted); }
.member__facts { list-style: none; margin: 2px 0; padding: 0; display: grid; gap: 8px; font-size: 0.92rem; color: var(--text-muted); }
.member__facts li { display: flex; gap: 10px; align-items: flex-start; }
.member__facts .icon { flex: none; width: 17px; height: 17px; margin-top: 3px; }
.member__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* Portrait card in About (click to enlarge) */
.portrait { margin: 0; max-width: 320px; }
@media (max-width: 899px) { .portrait { max-width: 280px; } }
.portrait__btn {
  position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--border); cursor: zoom-in;
  border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-lg);
}
.portrait__btn img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 20%; transition: transform .5s var(--ease); }
.portrait__btn::after { content: ""; position: absolute; inset: auto 0 0 0; height: 30%; background: linear-gradient(to top, rgba(0,0,0,.55), transparent); pointer-events: none; }
.portrait__btn:hover img { transform: scale(1.03); }
.portrait__zoom {
  position: absolute; right: 12px; bottom: 12px; z-index: 1; display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 10px; background: rgba(0,0,0,.45); color: #fff; backdrop-filter: blur(6px); opacity: .85; transition: opacity .2s;
}
.portrait__btn:hover .portrait__zoom { opacity: 1; }
.portrait__caption { margin-top: 14px; display: grid; gap: 2px; }
.portrait__caption strong { font-size: 1.05rem; }
.portrait__caption span { font-size: 0.85rem; color: var(--text-subtle); }

/* Hero avatar is clickable too */
.glance-profile__btn { padding: 0; border: 0; background: none; border-radius: 50%; cursor: zoom-in; flex-shrink: 0; transition: transform .2s var(--ease); }
.glance-profile__btn:hover { transform: scale(1.05); }

/* Lightbox */
.lightbox {
  padding: 0; border: 0; background: transparent; max-width: min(92vw, 520px); max-height: 90vh; overflow: visible;
}
.lightbox::backdrop { background: rgba(5, 5, 10, .82); backdrop-filter: blur(6px); }
.lightbox img { display: block; width: 100%; height: auto; max-height: 86vh; object-fit: contain; border-radius: var(--radius-lg); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lightbox__close { position: absolute; top: -14px; right: -14px; border-radius: 50%; }
@media (max-width: 600px) { .lightbox__close { top: 8px; right: 8px; } }

/* ---------- Work cards ---------- */
.work-list { display: grid; gap: 24px; }
.work-card {
  display: grid; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: border-color .25s, box-shadow .25s, transform .25s var(--ease);
}
.work-card:hover { border-color: var(--accent-border); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.work-card__body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 640px) { .work-card__body { padding: 32px; } }
/* Every card uses the same layout: details on the left, screenshot on the right */
@media (min-width: 1000px) {
  .work-card { grid-template-columns: 1.25fr 1fr; }
}
.work-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.work-card__title { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.85rem); }
.work-card__title a:hover { color: var(--accent-text); }
.work-card__sub { margin: -6px 0 0; font-size: 0.92rem; color: var(--text-subtle); font-weight: 500; }
.work-card__desc { color: var(--text-muted); margin: 0; }
.work-card__period { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-family: var(--mono); font-size: 0.8rem; color: var(--text-subtle); white-space: nowrap; }
.work-card__period .icon { width: 13px; height: 13px; }
.work-card__team { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.86rem; color: var(--text-subtle); }
.work-card__team .icon { flex: none; width: 15px; height: 15px; color: var(--accent-text); }
.work-card__team a { color: var(--text-muted); font-weight: 600; position: relative; z-index: 1; }
.work-card__team a:hover { color: var(--accent-text); }
.work-card__highlight {
  margin: 0; padding: 12px 16px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
  background: var(--accent-soft); color: var(--text); font-size: 0.93rem;
}
.work-card .checklist { grid-template-columns: 1fr; }
@media (min-width: 560px) { .work-card .checklist { grid-template-columns: 1fr 1fr; } }
.work-card .btn-row { margin-top: 6px; }
.work-card__visual {
  position: relative; min-height: 200px; border-top: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface-2);
}
@media (min-width: 1000px) { .work-card__visual { border-top: 0; border-left: 1px solid var(--border); } }
/* Screenshot sits at the top, level with the project title, instead of floating in the middle */
.work-card__visual { display: flex; align-items: flex-start; justify-content: center; padding: 24px; }
@media (min-width: 640px) { .work-card__visual { padding: 32px; } }
@media (min-width: 1000px) { .work-card__visual { padding-top: 58px; } }
.browser-frame {
  width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-strong);
  background: var(--surface); box-shadow: var(--shadow-lg); transition: transform .35s var(--ease);
}
.work-card:hover .browser-frame { transform: translateY(-4px); }
.browser-frame__bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.browser-frame__bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.browser-frame__bar span { margin-left: 8px; font-family: var(--mono); font-size: 0.72rem; color: var(--text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser-frame img { width: 100%; height: auto; }
.module-grid { list-style: none; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.module-grid li {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); font-size: 0.85rem; font-weight: 600; box-shadow: var(--shadow-sm);
  transition: border-color .25s;
}
.work-card:hover .module-grid li { border-color: var(--accent-border); }
.module-grid .icon { color: var(--accent); width: 18px; height: 18px; }
@media (max-width: 380px) { .module-grid { grid-template-columns: 1fr; } }

/* project card (compact) */
.project-card { position: relative; display: flex; flex-direction: column; gap: 12px; transition: border-color .25s, box-shadow .25s, transform .25s var(--ease); }
.project-card:hover { border-color: var(--accent-border); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.project-card__link { position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.project-card .btn-row, .project-card .btn { position: relative; z-index: 1; }
.project-card__top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.project-card h3 { font-size: 1.15rem; }
.project-card p { color: var(--text-muted); margin: 0; font-size: 0.94rem; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; display: grid; gap: 20px; position: relative; }
.timeline__item { position: relative; }
@media (min-width: 700px) {
  .timeline { padding-left: 28px; }
  .timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
  .timeline__item::before { content: ""; position: absolute; left: -28px; top: 28px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
}
.timeline__head { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: flex-start; }
.timeline__date { font-family: var(--mono); font-size: 0.82rem; color: var(--text-subtle); padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; white-space: nowrap; margin: 0; }
.edu__title { display: flex; gap: 14px; align-items: flex-start; }
.edu__title h3 { font-size: 1.2rem; margin-bottom: 4px; }
.edu__title p { margin: 0; }
.edu__title .icon { margin-top: 2px; }
.edu__cgpa { margin-top: 16px; }
.edu__block { margin-top: 16px; }
.edu__block h5 { font-size: 0.85rem; color: var(--text-subtle); font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .05em; }
.timeline .bullets { margin-top: 14px; }

/* ---------- Skills ---------- */
.skill-group .tags { gap: 10px; }

/* ---------- Certifications ---------- */
.cert-card { display: flex; flex-direction: column; gap: 8px; transition: border-color .25s, transform .25s var(--ease), box-shadow .25s; }
.cert-card:hover { border-color: var(--accent-border); transform: translateY(-2px); box-shadow: var(--shadow); }
.cert-card__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }
.cert-card__icon .icon { width: 22px; height: 22px; }
.cert-card h3 { font-size: 1.05rem; line-height: 1.35; }
.cert-card p { margin: 0; font-size: 0.92rem; }
.cert-card .btn-row { margin-top: auto; padding-top: 8px; }
.cert-card__img { border-radius: 10px; border: 1px solid var(--border); aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 8px; }
/* Certificates: a section per issuer, a card per certificate */
.cert-sections { display: grid; gap: 40px; }
.cert-section__title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin-bottom: 16px; }
.cert-section__count { font-family: var(--mono); font-size: 0.75rem; font-weight: 500; color: var(--text-subtle); padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; }
.cert-card { gap: 14px; }
.cert-card__text h4 {
  font-size: 1rem; line-height: 1.35; letter-spacing: -0.01em;
  min-height: 2.7em; /* always reserve two lines */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Single column on phones: no neighbouring card to line up with, so drop the reserved line */
@media (max-width: 699px) { .cert-card__text h4 { min-height: 0; } }
.cert-card__by, .cert-card__date { margin: 0; font-size: 0.875rem; line-height: 1.5; min-height: 1.5em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cert-card__by { color: var(--text-muted); margin-top: 6px; }
.cert-card__date { color: var(--text-subtle); font-family: var(--mono); font-size: 0.78rem; }
.cert-card .btn-row { margin-top: auto; }
.cert-card__photo { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #fff; transition: border-color .2s; }
.cert-card__photo img { width: 100%; aspect-ratio: 10 / 7; object-fit: contain; background: #fff; transition: transform .3s var(--ease); }
.cert-card__photo:hover { border-color: var(--accent-border); }
.cert-card__photo:hover img { transform: scale(1.02); }

/* ---------- Resume CTA ---------- */
.resume-cta {
  display: grid; gap: 32px; padding: 28px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent-soft), transparent 55%), var(--surface);
}
@media (min-width: 900px) { .resume-cta { grid-template-columns: 1.4fr 1fr; padding: 48px; align-items: center; } }
.resume-cta h2 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); }
.resume-cta .btn-row { margin-top: 28px; }
.resume-outline {
  list-style: none; counter-reset: r; display: grid; gap: 2px;
  padding: 20px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border);
}
.resume-outline li { counter-increment: r; display: flex; gap: 14px; align-items: center; padding: 8px 4px; font-weight: 500; border-bottom: 1px solid var(--border); }
.resume-outline li:last-child { border-bottom: 0; }
.resume-outline li::before { content: counter(r, decimal-leading-zero); font-family: var(--mono); font-size: 0.78rem; color: var(--accent-text); }

/* ---------- Contact ---------- */
.contact { display: grid; gap: 32px; }
@media (min-width: 960px) { .contact { grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: start; } }
.contact h2 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); }
.contact__list { list-style: none; display: grid; gap: 10px; margin-top: 28px; }
.contact-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); transition: border-color .2s, transform .2s var(--ease);
}
.contact-item:hover { border-color: var(--accent-border); transform: translateX(3px); }
.contact-item__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.contact-item > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.contact-item__label { font-size: 0.78rem; color: var(--text-subtle); font-weight: 500; }
.contact-item__value { font-weight: 600; overflow-wrap: anywhere; }
.contact-form { display: grid; gap: 16px; padding: 24px; }
@media (min-width: 640px) { .contact-form { padding: 32px; } }
.field-row { display: grid; gap: 16px; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.88rem; font-weight: 600; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 10px; padding: 11px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field__error { margin: 0; min-height: 0; font-size: 0.82rem; color: var(--danger); }
.field__error:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { margin: 0; font-size: 0.9rem; }
.form-status:empty { display: none; }
.form-status.is-success { color: var(--success); }
.form-status.is-error { color: var(--danger); }
.form-status.is-info { color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 0; font-size: 0.9rem; color: var(--text-muted); background: var(--bg-alt); }
.footer { display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: flex-start; justify-content: space-between; }
.footer p { margin: 0; }
.footer__brand { display: grid; gap: 10px; max-width: 340px; }
.footer__brand .brand { color: var(--text); }
.footer__tagline { color: var(--text-subtle); font-size: 0.88rem; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer__nav a:hover { color: var(--text); }
.footer__bottom { margin-top: 32px; padding-top: 18px; padding-bottom: 22px; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--text-subtle); }

.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); box-shadow: var(--shadow-lg);
  transition: transform .2s var(--ease), border-color .2s;
}
.to-top:hover { transform: translateY(-2px); border-color: var(--accent-border); }
.to-top .icon { transform: rotate(-90deg); width: 18px; height: 18px; }
.footer__links { display: flex; gap: 6px; flex-wrap: wrap; }
.footer-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; }
.footer-link:hover { color: var(--text); background: var(--surface-2); }
.footer__top:hover { color: var(--text); }
.footer:last-child { padding-bottom: 32px; } /* case-study footer has no bottom bar */
/* Phones: finger-sized tap targets (44px) and footer items on one baseline */
@media (max-width: 699px) {
  .footer { align-items: center; }
  .footer__nav { gap: 0 18px; }
  .footer__nav a, .footer__top, .breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer-link { min-height: 44px; }
}

/* ---------- Case study page ---------- */
.case-hero { position: relative; overflow: hidden; padding: 48px 0 40px; border-bottom: 1px solid var(--border); }
@media (min-width: 900px) { .case-hero { padding: 72px 0 56px; } }
.breadcrumb { margin-bottom: 24px; }
.breadcrumb a { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }
.case__title { font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem); font-weight: 800; letter-spacing: -0.035em; margin: 16px 0 14px; max-width: 22ch; }
.case__lead { font-size: clamp(1.02rem, .95rem + .4vw, 1.2rem); color: var(--text-muted); max-width: 62ch; margin-bottom: 24px; }
.case__highlight {
  margin: 32px 0 0; padding: 18px 22px; max-width: 820px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  font-size: 1.02rem; font-weight: 500; box-shadow: var(--shadow-sm);
}
.case-layout { display: grid; gap: 32px; padding-top: 40px; padding-bottom: 88px; }
@media (min-width: 1000px) {
  .case-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 56px; padding-top: 56px; }
  .case-aside { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
}
.case-aside { display: grid; gap: 20px; }
.case-facts dl { margin: 0; display: grid; gap: 14px; }
@media (max-width: 999px) { .case-facts dl { grid-template-columns: 1fr 1fr; } }
.case-facts dt { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-subtle); }
.case-facts dd { margin: 2px 0 0; font-weight: 600; font-size: 0.95rem; overflow-wrap: anywhere; }
.case-facts__wide { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--border); }
.case-team { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; }
.case-team a { color: var(--accent-text); }
.case-team small { display: block; font-weight: 500; font-size: 0.82rem; color: var(--text-subtle); }
.case-toc { display: none; }
@media (min-width: 1000px) {
  .case-toc { display: block; }
  .case-toc ol { list-style: none; display: grid; gap: 2px; border-left: 1px solid var(--border); }
  .case-toc a { display: block; padding: 5px 14px; margin-left: -1px; border-left: 2px solid transparent; font-size: 0.9rem; color: var(--text-muted); }
  .case-toc a:hover { color: var(--text); border-left-color: var(--accent); }
}
.case-content { display: grid; gap: 56px; min-width: 0; }
.case-section h2 { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; margin-bottom: 18px; }
.case-section > p { color: var(--text-muted); font-size: 1.05rem; max-width: 72ch; }
.case-section .bullets { font-size: 1.02rem; }
.feature-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
.feature { display: flex; gap: 14px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color .2s; }
.feature:hover { border-color: var(--accent-border); }
.feature__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.feature h3 { font-size: 1rem; margin: 2px 0 4px; }
.feature p { font-size: 0.92rem; color: var(--text-muted); margin: 0; }
.arch { display: grid; gap: 10px; margin-top: 24px; align-items: stretch; }
.arch__layer { padding: 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.arch__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.arch__head h3 { font-size: 1rem; }
.arch__layer ul { list-style: none; display: grid; gap: 6px; }
.arch__layer li { font-size: 0.85rem; color: var(--text-muted); padding: 6px 10px; border-radius: 8px; background: var(--surface-2); line-height: 1.4; }
.arch__arrow { display: grid; place-items: center; color: var(--text-subtle); transform: rotate(90deg); }
@media (min-width: 700px) and (max-width: 1279px) {
  .arch { grid-template-columns: 1fr 1fr; gap: 14px; }
  .arch__arrow { display: none; }
}
@media (min-width: 1280px) {
  .arch { display: flex; align-items: stretch; }
  .arch__layer { flex: 1 1 0; min-width: 0; }
  .arch__arrow { transform: none; width: 20px; flex-shrink: 0; align-self: center; }
}
.shots { display: grid; gap: 16px; }
@media (min-width: 700px) { .shots { grid-template-columns: 1fr 1fr; } .shots:has(> .shot:only-child) { grid-template-columns: 1fr; } }
.shot { margin: 0; }
.shot img { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); width: 100%; transition: transform .25s var(--ease); }
.shot a:hover img { transform: scale(1.01); }
.shot figcaption { margin-top: 8px; font-size: 0.85rem; color: var(--text-subtle); }
.disclaimer {
  display: flex; gap: 12px; padding: 16px 18px; border-radius: var(--radius);
  background: var(--warn-soft); color: var(--text); font-size: 0.92rem; margin: 0;
}
.disclaimer .icon { color: var(--warn); margin-top: 3px; }
.case-cta { display: grid; gap: 20px; padding: 28px; }
@media (min-width: 800px) { .case-cta { grid-template-columns: 1fr auto; align-items: center; } }
.case-cta h2 { font-size: 1.3rem; margin-bottom: 6px; }
.case-pager { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.case-pager a { display: flex; flex-direction: column; gap: 6px; transition: border-color .2s; }
.case-pager a:hover { border-color: var(--accent-border); }
.case-pager span { display: inline-flex; align-items: center; gap: 6px; }
.case-pager__next { text-align: right; align-items: flex-end; grid-column: 2; }
@media (max-width: 559px) { .case-pager { grid-template-columns: 1fr; } .case-pager__next { grid-column: auto; } }
