/* ==========================================================================
   Hariom Sahu — Portfolio
   Plain CSS. Tokens first, then base, layout, components, utilities.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #141517;
  --ink-2: #3c3e44;
  --muted: #6b6d74;
  --line: #e3e1da;
  --line-strong: #cfccc3;
  --accent: #166a55;
  --accent-ink: #ffffff;
  --accent-soft: #e3efe9;
  --accent-2: #2f5fd0;
  --shadow: 0 1px 2px rgba(20, 21, 23, 0.04), 0 8px 24px -12px rgba(20, 21, 23, 0.12);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d0e10;
  --surface: #15171a;
  --ink: #ececee;
  --ink-2: #c3c4c9;
  --muted: #8d8f97;
  --line: #24262b;
  --line-strong: #34373d;
  --accent: #5cc4a2;
  --accent-ink: #07130f;
  --accent-soft: #143028;
  --accent-2: #8aa8ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0e10;
    --surface: #15171a;
    --ink: #ececee;
    --ink-2: #c3c4c9;
    --muted: #8d8f97;
    --line: #24262b;
    --line-strong: #34373d;
    --accent: #5cc4a2;
    --accent-ink: #07130f;
    --accent-soft: #143028;
  --accent-2: #8aa8ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

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

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.025em; line-height: 1.12; color: var(--ink); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
strong { font-weight: 600; color: var(--ink); }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  z-index: 100;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: clamp(72px, 11vw, 128px) 0;
  border-top: 1px solid var(--line);
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 280px minmax(0, 1fr); gap: 64px; }
  .grid-2 .section-head { position: sticky; top: 104px; align-self: start; }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: clamp(30px, 4vw, 40px);
}
.section-head-wide { margin-bottom: 48px; }

/* ---------- Header: floating, centred bar (60% of the page on desktop) ---------- */
.site-header {
  position: sticky;
  top: 12px;
  z-index: 50;
  padding: 0 16px;
  margin-top: 12px;
  pointer-events: none;
}

.header-inner {
  position: relative;
  width: 60vw;
  min-width: 740px;
  max-width: 100%;
  height: 62px;
  margin: 0 auto;
  padding: 0 10px 0 12px;
  display: flex;
  align-items: center;
  gap: 20px;
  /* Frosted glass: translucent fill + strong backdrop blur */
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid color-mix(in srgb, var(--line-strong) 80%, transparent);
  border-radius: 16px;
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 40%, transparent) inset, 0 6px 20px -12px rgba(20, 21, 23, 0.18);
  pointer-events: auto;
  transition: box-shadow 0.3s var(--ease), background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.site-header.is-scrolled .header-inner {
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 30%, transparent) inset, var(--shadow);
}
:root[data-theme="dark"] .header-inner { box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px -12px rgba(0,0,0,0.6); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .header-inner { box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px -12px rgba(0,0,0,0.6); }
}
@media (max-width: 900px) {
  .header-inner { width: 100%; min-width: 0; }
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.nav a {
  position: relative;
  padding: 8px 12px;
  white-space: nowrap;
  font-size: 15px;
  color: var(--muted);
  border-radius: 8px;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.nav a.is-active, .nav a[aria-current="page"] { color: var(--ink); }
.nav a.is-active::after, .nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
}

.header-actions { display: flex; gap: 6px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 18px;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }

.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

.menu-btn { display: none; }

@media (max-width: 760px) {
  .menu-btn { display: inline-grid; }
  .header-actions { margin-left: auto; }
  .header-inner { height: 56px; }
  .nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 6px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 14px 0; font-size: 17px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }
  .nav a:hover { background: none; }
  .nav a.is-active::after, .nav a[aria-current="page"]::after { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 10vw, 112px) 0 clamp(64px, 9vw, 104px); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 12px;
  font-size: 14px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: ping 2.2s var(--ease) infinite;
}
@keyframes ping {
  0% { transform: scale(1); opacity: 0.6; }
  80%, 100% { transform: scale(2.6); opacity: 0; }
}

.hero-hello {
  margin-top: 32px;
  font-size: clamp(36px, 4.8vw, 64px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--ink-2);
}

/* Name: green → blue colour run, letters hop on hover */
.name {
  display: inline-block;
  font-weight: 700;
  color: var(--accent);
  cursor: default;
  white-space: nowrap;
}
.name .ch {
  display: inline-block;
  color: color-mix(in oklab, var(--accent-2) calc(var(--i) * 9%), var(--accent));
  transform-origin: 50% 80%;
  will-change: transform;
}
.name .ch.sp { width: 0.28em; }
.name:hover .ch,
.name.is-playing .ch {
  animation: name-hop 0.7s cubic-bezier(0.3, 1.6, 0.5, 1) both;
  animation-delay: calc(var(--i) * 45ms);
}
@keyframes name-hop {
  0%   { transform: translateY(0) rotate(0); }
  35%  { transform: translateY(-0.22em) rotate(-6deg) scale(1.08); }
  65%  { transform: translateY(0.04em) rotate(3deg); }
  100% { transform: translateY(0) rotate(0); }
}

.hero-title {
  margin-top: 18px;
  max-width: 24ch;
  font-size: clamp(26px, 3.4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.02;
  text-wrap: balance;
}
.hero-title em { color: var(--accent); letter-spacing: -0.02em; }

.hero-lede {
  margin-top: 28px;
  max-width: 58ch;
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--ink-2);
}

.hero-cta {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px;
  font: 500 15.5px/1 var(--font-sans);
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { font-size: 16px; transition: transform 0.25s var(--ease); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover svg { transform: translateY(2px); }
.btn-ghost { color: var(--ink); border-color: var(--line-strong); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); background: var(--surface); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }

/* ---------- Metrics ---------- */
.metrics {
  margin: clamp(56px, 8vw, 88px) 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.metric { padding: 24px 24px 26px; border-left: 1px solid var(--line); }
.metric:first-child { border-left: 0; }
.metric dt {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.metric dd {
  margin: 10px 0 0;
  font-size: clamp(34px, 3.6vw, 44px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.metric small {
  display: block;
  margin-top: 12px;
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
  color: var(--muted);
}
@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 420px) {
  .metric { padding: 18px 16px 20px; }
}

/* Metrics shown inside the experience card */
.role-subhead {
  margin: 28px 0 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.metrics-inline {
  margin: 14px 0 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--bg);
  box-shadow: none;
}
.metrics-inline .metric { padding: 20px 22px 22px; }
.metrics-inline .metric:nth-child(3) { border-left: 0; }
.metrics-inline .metric:nth-child(n + 3) { border-top: 1px solid var(--line); }
.metrics-inline .metric dd { font-size: clamp(30px, 3vw, 38px); color: var(--accent); }
.metrics-inline .metric dd small { color: var(--muted); }
.role-subhead + .bullets { margin-top: 14px; }
@media (max-width: 520px) {
  .metrics-inline { grid-template-columns: minmax(0, 1fr); }
  .metrics-inline .metric { padding: 18px 20px; }
  .metrics-inline .metric { border-left: 0 !important; }
  .metrics-inline .metric + .metric { border-top: 1px solid var(--line); }
}

/* ---------- About ---------- */
.prose-lg {
  font-size: clamp(20px, 2.2vw, 25px);
  line-height: 1.45;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 34ch;
  text-wrap: pretty;
}

.principles {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  counter-reset: p;
}
.principles li {
  counter-increment: p;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.principles li::before {
  content: "0" counter(p);
  padding-top: 4px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
}
.principles h3 { font-size: 19px; letter-spacing: -0.015em; }
.principles p { grid-column: 2; margin-top: 8px; font-size: 15.5px; color: var(--muted); line-height: 1.6; max-width: 62ch; }
@media (max-width: 480px) {
  .principles li { grid-template-columns: 40px minmax(0, 1fr); }
}

.stack { margin-top: 48px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 6px 12px;
  font-size: 14px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.tags-sm { margin-top: 20px; gap: 6px; }
.tags-sm li {
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: transparent;
}

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

.role {
  padding: clamp(22px, 3vw, 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.role-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.role h3 { font-size: 21px; }
.org { margin-top: 4px; font-size: 15px; color: var(--muted); }
.when {
  flex-shrink: 0;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.role-summary { margin-top: 18px; color: var(--ink-2); }
@media (max-width: 560px) {
  .role-head { flex-direction: column-reverse; gap: 12px; }
}

.bullets { margin-top: 18px; display: grid; gap: 10px; }
.bullets li {
  position: relative;
  padding-left: 22px;
  font-size: 15.5px;
  color: var(--ink-2);
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 8px;
  height: 1.5px;
  background: var(--accent);
}

/* ---------- Section head with trailing link ---------- */
.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}
.link-arrow {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1.5px solid var(--line-strong);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), gap 0.2s var(--ease);
}
.link-arrow:hover { color: var(--accent); border-color: var(--accent); gap: 12px; }

/* ---------- Project cards ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 800px) {
  .project-grid { grid-template-columns: minmax(0, 1fr); }
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }

.card-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  overflow: hidden;
  font: inherit;
  color: inherit;
  text-align: left;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease);
}
.card-media.is-playable { cursor: pointer; }
.card-media.is-playable:hover img { transform: scale(1.03); }

.cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(20px, 3vw, 28px);
  background:
    radial-gradient(120% 90% at 100% 0%, var(--accent-soft) 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 23px, color-mix(in srgb, var(--line) 70%, transparent) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, color-mix(in srgb, var(--line) 70%, transparent) 23px 24px),
    var(--bg);
}
.cover-cat {
  position: absolute;
  top: clamp(20px, 3vw, 28px);
  left: clamp(20px, 3vw, 28px);
  right: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.cover-kpi {
  font-size: clamp(40px, 5.5vw, 64px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.cover-label { margin-top: 8px; font-size: 14px; color: var(--ink-2); }

.play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  font-size: 24px;
  color: #fff;
  background: rgba(10, 10, 12, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease);
}
.play svg { margin-left: 3px; }
.card-media.is-playable:hover .play { transform: translate(-50%, -50%) scale(1.08); background: var(--accent); }

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: clamp(20px, 2.6vw, 28px);
}
.card-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.card h3 { margin-top: 10px; font-size: clamp(20px, 2vw, 23px); letter-spacing: -0.025em; }
.card-summary { margin-top: 10px; font-size: 15.5px; color: var(--ink-2); }

.card-details { margin-top: 16px; }
.card-details summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.card-details summary::-webkit-details-marker { display: none; }
.card-details summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: transform 0.2s var(--ease);
}
.card-details[open] summary::after { content: "−"; }
.card-details .bullets { margin-top: 12px; }
.card-details .bullets li { font-size: 14.5px; }
.card .tags-sm { margin-top: 18px; }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 22px;
}
.action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  font: 500 14px/1 var(--font-sans);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.action svg { font-size: 15px; }
.action:hover { border-color: var(--ink); }
.action-primary { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.action-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.action-muted { color: var(--muted); border-style: dashed; cursor: default; font-weight: 400; }
.action-muted:hover { border-color: var(--line-strong); }

/* ---------- Sub-page hero ---------- */
.page-hero { padding: clamp(56px, 9vw, 104px) 0 clamp(40px, 6vw, 64px); }
.page-title {
  max-width: 16ch;
  font-size: clamp(40px, 6.4vw, 72px);
  letter-spacing: -0.04em;
  line-height: 1.03;
  text-wrap: balance;
}
.page-title em { color: var(--accent); }
.page-lede { margin-top: 20px; max-width: 56ch; font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); }
.section-tight { padding-top: clamp(32px, 5vw, 48px); }

/* ---------- Toolbar + filter chips ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 36px;
  padding: 0 14px;
  font: 500 14px/1 var(--font-sans);
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.count-label { margin-left: auto; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }

/* ---------- Post list ---------- */
.post-list { border-top: 1px solid var(--line); }
.post-item { border-bottom: 1px solid var(--line); }
.post-item > a {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 24px;
  gap: 32px;
  padding: 28px 0;
  transition: padding 0.25s var(--ease);
}
.post-date { padding-top: 5px; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.post-main h3 { font-size: clamp(19px, 2vw, 23px); letter-spacing: -0.02em; transition: color 0.2s var(--ease); }
.post-main p { margin-top: 8px; max-width: 64ch; font-size: 15.5px; color: var(--ink-2); }
.post-main .tags-sm { margin-top: 14px; }
.post-arrow { padding-top: 2px; font-size: 20px; color: var(--muted); transition: transform 0.25s var(--ease), color 0.2s var(--ease); }
.post-item > a:hover h3 { color: var(--accent); }
.post-item > a:hover .post-arrow { color: var(--accent); transform: translateX(4px); }
@media (max-width: 700px) {
  .post-item > a { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 24px 0; }
  .post-arrow { display: none; }
}

/* ---------- Empty states ---------- */
.empty { color: var(--muted); font-size: 15.5px; }
.empty a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.empty-card {
  display: grid;
  gap: 6px;
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}
.empty-card strong { font-size: 19px; letter-spacing: -0.015em; }

/* ---------- Single post ---------- */
.container-narrow { max-width: calc(720px + var(--gutter) * 2); }
.post { padding: clamp(40px, 7vw, 72px) 0 clamp(72px, 10vw, 120px); }
.link-back {
  display: inline-flex;
  gap: 8px;
  font-size: 14.5px;
  color: var(--muted);
  transition: color 0.2s var(--ease), gap 0.2s var(--ease);
}
.link-back:hover { color: var(--ink); gap: 12px; }
.post-header { margin-top: 36px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.post-meta { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.post-title {
  margin-top: 14px;
  font-size: clamp(34px, 5.2vw, 52px);
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-wrap: balance;
}
.post-summary { margin-top: 16px; font-size: 19px; color: var(--ink-2); }
.post-summary:empty { display: none; }
.post-header .tags-sm { margin-top: 20px; }
.post-header .tags-sm:empty { display: none; }

/* Article typography */
.prose { padding-top: 36px; font-size: 18px; line-height: 1.75; color: var(--ink-2); overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { margin-top: 2.2em; font-size: 27px; letter-spacing: -0.025em; line-height: 1.2; scroll-margin-top: 96px; }
.prose h3 { margin-top: 1.8em; font-size: 21px; letter-spacing: -0.02em; scroll-margin-top: 96px; }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent); }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--accent);
  font-family: var(--font-serif);
  font-size: 1.35em;
  line-height: 1.45;
  color: var(--ink);
}
.prose img, .prose video { display: block; max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose :not(pre) > code {
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border-radius: 6px;
}
.prose pre {
  padding: 20px 22px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.65;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.prose pre code { font-family: inherit; background: none; padding: 0; color: var(--ink); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; color: var(--ink); border-bottom-color: var(--line-strong); }
.embed { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.embed iframe, .embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; }

/* Syntax highlighting (highlight.js classes, themed with site tokens) */
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-meta .hljs-keyword { color: #a3405c; }
.hljs-string, .hljs-attr, .hljs-template-tag, .hljs-addition { color: var(--accent); }
.hljs-number, .hljs-literal, .hljs-symbol { color: #b25d10; }
.hljs-title, .hljs-title.function_, .hljs-section { color: #3657b8; }
.hljs-comment, .hljs-quote, .hljs-meta { color: var(--muted); font-style: italic; }
.hljs-type, .hljs-class .hljs-title, .hljs-params { color: var(--ink-2); }
.hljs-deletion { color: #b3261e; }
:root[data-theme="dark"] .hljs-keyword, :root[data-theme="dark"] .hljs-built_in { color: #f38ba8; }
:root[data-theme="dark"] .hljs-number, :root[data-theme="dark"] .hljs-literal { color: #fab387; }
:root[data-theme="dark"] .hljs-title, :root[data-theme="dark"] .hljs-title.function_ { color: #89b4fa; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hljs-keyword, :root:not([data-theme="light"]) .hljs-built_in { color: #f38ba8; }
  :root:not([data-theme="light"]) .hljs-number, :root:not([data-theme="light"]) .hljs-literal { color: #fab387; }
  :root:not([data-theme="light"]) .hljs-title, :root:not([data-theme="light"]) .hljs-title.function_ { color: #89b4fa; }
}

.post-footer { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); }
.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.post-nav-link {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  font-weight: 500;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.2s var(--ease);
}
.post-nav-link span { font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--muted); }
.post-nav-link:hover { border-color: var(--ink); }
.post-nav-next { grid-column: 2; text-align: right; }
@media (max-width: 600px) {
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .post-nav-next { grid-column: auto; }
}

/* ---------- Video dialog ---------- */
.video-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  color: #fff;
  background: #0b0b0d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  overflow: hidden;
}
.video-dialog::backdrop { background: rgba(8, 8, 10, 0.78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.video-dialog[open] { animation: dialog-in 0.25s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
.video-dialog-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 10px 10px 18px; }
.video-dialog-title { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-dialog .icon-btn { color: #fff; border-color: rgba(255, 255, 255, 0.18); }
.video-dialog .icon-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.35); }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Footer nav ---------- */
.footer-nav { display: flex; flex-wrap: wrap; gap: 20px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--bg);
  background: var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  z-index: 60;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(88px, 12vw, 144px); }
.contact-title {
  max-width: 20ch;
  font-size: clamp(34px, 5.6vw, 64px);
  letter-spacing: -0.04em;
  line-height: 1.05;
  text-wrap: balance;
}
.contact-title em { color: var(--accent); }

.contact-row {
  margin-top: 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}
.contact-email {
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 500;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat;
  padding-bottom: 2px;
  transition: background-size 0.35s var(--ease), color 0.2s var(--ease);
}
.contact-email:hover { background-size: 100% 1.5px; color: var(--accent); }


/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 28px;
  font-size: 14px;
  color: var(--muted);
}
.footer-inner a:hover { color: var(--ink); }

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

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

.emoji { font-style: normal; margin-left: 2px; }

/* Cursor trail canvas */
.cursor-trail {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 45;
}

/* ---------- About: portrait slot ---------- */
.about-head { display: grid; gap: 28px; align-content: start; }
.portrait {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.portrait:hover { transform: translateY(-4px) rotate(-1deg); }
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portrait-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(90% 70% at 20% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(90% 70% at 90% 100%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 70%),
    var(--surface);
}
.portrait-fallback span {
  font-size: 88px;
  font-weight: 700;
  letter-spacing: -0.06em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (max-width: 899px) {
  .portrait { max-width: 220px; }
}

/* ---------- About: typewriter paragraph ---------- */
.typewriter .tw-rest { color: transparent; }
.typewriter .tw-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin: 0 1px -0.15em;
  background: var(--accent);
  animation: caret 0.9s steps(1) infinite;
}
.typewriter.is-done .tw-caret { animation: caret 0.9s steps(1) 3 forwards; }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- Toolbox with logos ---------- */
.toolbox { display: grid; gap: 22px; }
.tool-group-title {
  margin-bottom: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.tool {
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  background:
    radial-gradient(140px circle at var(--mx) var(--my), color-mix(in srgb, var(--c) 16%, transparent), transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  cursor: default;
  transition: transform 0.35s cubic-bezier(0.3, 1.4, 0.5, 1), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.tool:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--c) 55%, var(--line));
  box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--c) 70%, transparent);
}
.tool-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--c) 18%, #e7e5df);
  border-radius: 11px;
  transition: transform 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.tool-icon img { width: 24px; height: 24px; display: block; }
.tool:hover .tool-icon { transform: rotate(-10deg) scale(1.12); }
.tool-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) {
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stack-title { margin-bottom: 18px; font-size: 20px; letter-spacing: -0.02em; }

/* ---------- About: education ---------- */
.edu { margin-top: 48px; }
.edu-card {
  position: relative;
  padding: clamp(22px, 3vw, 30px);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent-2) 8%, transparent), transparent 55%),
    radial-gradient(120% 140% at 0% 100%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 55%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}
/* Gradient hairline border that lights up on hover */
.edu-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.edu-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.edu-card:hover::before { opacity: 1; }

.edu-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.edu-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  font-size: 26px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 15px;
  box-shadow: 0 10px 22px -12px var(--accent);
}
.edu-icon svg { stroke: currentColor; stroke-width: 1.7; }
.edu.is-in .edu-icon { animation: cap-toss 1s 1.9s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes cap-toss {
  0% { transform: translateY(0) rotate(0); }
  40% { transform: translateY(-10px) rotate(-14deg); }
  100% { transform: translateY(0) rotate(0); }
}
.edu-main h4 { margin: 0; font-size: clamp(18px, 2vw, 21px); font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.edu-main p { margin-top: 4px; font-size: 15px; color: var(--muted); }
.edu-main .edu-span { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); }

/* CGPA ring */
.cgpa { position: relative; width: 92px; height: 92px; display: grid; place-items: center; }
.cgpa svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.cgpa circle { fill: none; stroke-width: 5; }
.cgpa-track { stroke: var(--line); }
.cgpa-ring {
  stroke-linecap: round;
  stroke-dasharray: 163.36;
  stroke-dashoffset: 163.36;
  transition: stroke-dashoffset 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s;
}
.edu.is-in .cgpa-ring { stroke-dashoffset: 21.24; } /* 87% of the circle */
.stop-a { stop-color: var(--accent); }
.stop-b { stop-color: var(--accent-2); }
.cgpa-value { position: relative; margin-top: -6px; font-size: 22px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.cgpa-value small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 1px; }
.cgpa-label { position: absolute; bottom: 20px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em; color: var(--muted); }

/* 2021 → 2025 timeline */
.edu-timeline { position: relative; margin-top: 30px; padding-top: 6px; }
.edu-track {
  position: absolute;
  top: 11.5px;
  left: 7px;
  right: 7px;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.edu-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.6s cubic-bezier(0.65, 0, 0.35, 1) 0.2s;
}
.edu-fill::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  transform: translateX(-80px);
}
.edu.is-in .edu-fill { transform: scaleX(1); }
.edu.is-in .edu-fill::after { animation: glint 2.8s 2s ease-in-out infinite; }
@keyframes glint { 0% { transform: translateX(-80px); } 60%, 100% { transform: translateX(900px); } }

.edu-years { position: relative; height: 62px; }
.edu-years li {
  position: absolute;
  top: 0;
  left: calc(7px + var(--k) * (100% - 14px) / 4);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.edu-years li:first-child { left: 0; transform: none; align-items: flex-start; }
.edu-years li:last-child { left: 100%; transform: translateX(-100%); align-items: flex-end; }
.edu-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  transform: scale(0.6);
  transition: transform 0.4s cubic-bezier(0.3, 1.8, 0.5, 1), border-color 0.3s var(--ease), background-color 0.3s var(--ease);
  transition-delay: calc(0.2s + var(--k) * 0.4s);
}
.edu.is-in .edu-dot { transform: scale(1); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.edu.is-in li:last-child .edu-dot {
  background: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-2) 20%, transparent);
}
.edu-year { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.edu-tag { margin-top: -5px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.edu-years li:last-child .edu-tag { color: var(--accent-2); font-weight: 600; }

@media (max-width: 560px) {
  .edu-top { grid-template-columns: auto minmax(0, 1fr); }
  .cgpa { grid-column: 1 / -1; justify-self: start; width: 84px; height: 84px; }
  .cgpa-label { bottom: 17px; }
}

/* ---------- Projects: Work / Personal split ---------- */
.seg {
  position: relative;
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  margin-bottom: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.seg-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  background: var(--ink);
  border-radius: 10px;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.45);
}
.seg.is-ready .seg-pill { transition: transform 0.45s cubic-bezier(0.3, 1.3, 0.5, 1), width 0.45s cubic-bezier(0.3, 1.3, 0.5, 1); }
.seg-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  font: 500 15px/1 var(--font-sans);
  color: var(--ink-2);
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.3s var(--ease);
}
.seg-btn[aria-selected="true"] { color: var(--bg); }
.seg-count {
  min-width: 22px;
  padding: 3px 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-align: center;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.proj-groups { display: grid; gap: 64px; }
.group-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.group-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  font-size: 22px;
  color: #fff;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #000));
  box-shadow: 0 10px 22px -12px var(--accent);
}
.proj-group-personal .group-icon {
  background: linear-gradient(135deg, var(--accent-2), color-mix(in srgb, var(--accent-2) 55%, #7c3aed));
  box-shadow: 0 10px 22px -12px var(--accent-2);
}
.group-head h2 { font-size: clamp(22px, 2.6vw, 28px); letter-spacing: -0.025em; }
.group-head p { margin-top: 4px; font-size: 15px; color: var(--muted); }
.group-count {
  font-size: clamp(32px, 3.4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--line-strong);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) {
  .group-head { grid-template-columns: auto minmax(0, 1fr); }
  .group-count { display: none; }
  .seg { display: flex; width: 100%; }
  .seg-btn { flex: 1; justify-content: center; padding: 0 8px; }
}

/* Badge on the card image */
.media-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  font: 600 12px/1 var(--font-sans);
  color: #fff;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.4);
}
.media-badge svg { font-size: 13px; }
.media-badge-work { background: color-mix(in srgb, var(--accent) 88%, transparent); }
.media-badge-personal { background: color-mix(in srgb, var(--accent-2) 88%, transparent); }
:root[data-theme="dark"] .media-badge { color: #0d0e10; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .media-badge { color: #0d0e10; } }

/* Card footer: Live link + Demo video always at the bottom */
.card-body { padding-bottom: 20px; }
.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px clamp(20px, 2.6vw, 28px) 18px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 55%, var(--surface));
}
.action.is-disabled {
  color: var(--muted);
  border-style: dashed;
  cursor: not-allowed;
  opacity: 0.85;
}
.action.is-disabled:hover { border-color: var(--line-strong); }
.action em {
  margin-left: 2px;
  padding: 2px 6px;
  font-style: normal;
  font-size: 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.action-icon { width: 36px; padding: 0; justify-content: center; margin-left: auto; }

/* Empty-group placeholder */
.card-placeholder { border-style: dashed; background: transparent; }
.card-placeholder:hover { box-shadow: none; }
.cover-empty {
  display: grid;
  place-items: center;
  font-size: 44px;
  color: var(--line-strong);
}
.card-placeholder .cover-empty svg { animation: float 3.5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.action em { font-family: var(--font-sans); letter-spacing: 0; font-weight: 500; }
@media (max-width: 560px) {
  .card-foot { gap: 6px; }
  .card-foot .action:not(.action-icon) { flex: 1 1 0; justify-content: center; padding: 0 8px; font-size: 13.5px; gap: 5px; }
  .action em { font-size: 10px; padding: 2px 5px; }
}

/* ---------- Contact: colourful brand icon tiles ---------- */
.socials {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.social {
  --g1: #333; --g2: #111; --glow: #333;
  --tx: 0px;
  --ty: 0px;
  position: relative;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  color: #fff;
  background: linear-gradient(145deg, var(--g1), var(--g2));
  border-radius: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -2px 0 rgba(0, 0, 0, 0.18),
    0 8px 18px -10px var(--glow);
  transform: translate(var(--tx), var(--ty));
  transition: transform 0.35s cubic-bezier(0.3, 1.4, 0.5, 1), box-shadow 0.35s var(--ease);
  overflow: visible;
  isolation: isolate;
}
.social-github   { --g1: #3a4450; --g2: #161b22; --glow: #24292f; }
.social-linkedin { --g1: #1d8cf0; --g2: #0a58b0; --glow: #0a66c2; }
.social-x        { --g1: #3a3a3a; --g2: #000;    --glow: #000; }
.social-phone    { --g1: #34d17a; --g2: #0f9a4c; --glow: #16a34a; }
.social-email    { --g1: #ffffff; --g2: #f1f3f4; --glow: #ea4335; color: #ea4335; }
:root[data-theme="dark"] .social-github, :root[data-theme="dark"] .social-x { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14), inset 0 1px 0 rgba(255,255,255,0.2), 0 8px 18px -10px #000; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .social-github, :root:not([data-theme="light"]) .social-x { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14), inset 0 1px 0 rgba(255,255,255,0.2), 0 8px 18px -10px #000; }
}
.social-email { box-shadow: inset 0 0 0 1px #e3e1da, inset 0 -2px 0 rgba(0,0,0,0.05), 0 8px 18px -10px rgba(234, 67, 53, 0.6); }

/* Shine that sweeps across on hover */
.social::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 48%, transparent 66%);
  background-size: 250% 100%;
  background-position: 130% 0;
  pointer-events: none;
}
/* Coloured ring that pulses out on hover */
.social::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 22px;
  border: 2px solid var(--glow);
  opacity: 0;
  pointer-events: none;
}
.social-icon { display: grid; place-items: center; transition: transform 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); filter: drop-shadow(0 1px 1px rgba(0,0,0,0.18)); }
.social-icon svg { width: 28px; height: 28px; }
.social-icon .si { fill: currentColor; stroke: none; }
.social-icon .logo-color { width: 32px; height: 24px; filter: none; }
.social-email .social-icon { filter: none; }

.social:hover, .social:focus-visible {
  transform: translate(var(--tx), calc(var(--ty) - 4px)) rotate(-4deg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 18px 34px -12px var(--glow),
    0 0 0 4px color-mix(in srgb, var(--glow) 18%, transparent);
}
.social:hover::before, .social:focus-visible::before { animation: shine 0.9s var(--ease); }
.social:hover::after { animation: ring 0.8s var(--ease) forwards; }
.social:hover .social-icon, .social:focus-visible .social-icon { transform: scale(1.14) rotate(4deg); }
@keyframes shine { from { background-position: 130% 0; } to { background-position: -30% 0; } }
@keyframes ring { 0% { opacity: 0.7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.4); } }

/* Tiles pop in one after another when the section appears */
.socials.is-in li { animation: pop-in 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.socials.is-in li:nth-child(2) { animation-delay: 0.07s; }
.socials.is-in li:nth-child(3) { animation-delay: 0.14s; }
.socials.is-in li:nth-child(4) { animation-delay: 0.21s; }
.socials.is-in li:nth-child(5) { animation-delay: 0.28s; }
@keyframes pop-in { from { opacity: 0; transform: translateY(14px) scale(0.7); } }

/* Label bubble */
.social-tip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  display: grid;
  gap: 2px;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  color: var(--bg);
  background: var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px) scale(0.96);
  transition: opacity 0.2s var(--ease), transform 0.25s var(--ease);
}
.social-tip strong { font-size: 13px; font-weight: 600; color: inherit; }
.social-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  border: 6px solid transparent;
  border-top-color: var(--ink);
  transform: translateX(-50%);
}
.social:hover .social-tip, .social:focus-visible .social-tip { opacity: 1; transform: translate(-50%, 0) scale(1); }
.socials li:first-child .social-tip { left: 0; transform: translate(0, 6px) scale(0.96); }
.socials li:first-child .social:hover .social-tip { transform: translate(0, 0) scale(1); }
.socials li:first-child .social-tip::after { left: 32px; }

@media (max-width: 480px) {
  .socials { gap: 10px; }
  .social { width: 58px; height: 58px; border-radius: 17px; }
  .social-icon svg { width: 24px; height: 24px; }
  .social-icon .logo-color { width: 28px; height: 21px; }
}
.socials li:last-child .social-tip { left: auto; right: 0; transform: translate(0, 6px) scale(0.96); }
.socials li:last-child .social:hover .social-tip, .socials li:last-child .social:focus-visible .social-tip { transform: translate(0, 0) scale(1); }
.socials li:last-child .social-tip::after { left: auto; right: 26px; transform: none; }
.contact { overflow-x: clip; }

/* ---------- Contact: layout with location card ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 56px;
  align-items: center;
}
@media (max-width: 960px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .locate { max-width: 440px; }
}

.locate {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.js .locate.reveal.is-in { transition: transform 0.5s cubic-bezier(0.3, 1.4, 0.5, 1), box-shadow 0.4s var(--ease), opacity 0.7s var(--ease); }
.js .locate.reveal.is-in:hover, .locate:hover { transform: translateY(-6px) rotate(-0.8deg); box-shadow: 0 24px 48px -24px rgba(20, 21, 23, 0.35); }

.locate-map {
  position: relative;
  display: block;
  height: 200px;
  background:
    repeating-linear-gradient(0deg, transparent 0 19px, var(--line) 19px 20px),
    repeating-linear-gradient(90deg, transparent 0 19px, var(--line) 19px 20px),
    var(--bg);
  overflow: hidden;
}
.locate-map iframe {
  position: absolute;
  inset: -40px;
  width: calc(100% + 80px);
  height: calc(100% + 80px);
  border: 0;
  pointer-events: none;
  filter: saturate(0.75) contrast(1.02);
  transition: transform 0.8s var(--ease);
}
.locate:hover .locate-map iframe { transform: scale(1.06); }
:root[data-theme="dark"] .locate-map iframe { filter: invert(0.92) hue-rotate(180deg) saturate(0.6) brightness(0.95); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .locate-map iframe { filter: invert(0.92) hue-rotate(180deg) saturate(0.6) brightness(0.95); }
}
/* soft vignette so the pin pops */
.locate-map::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 60% at 50% 50%, transparent 55%, color-mix(in srgb, var(--surface) 55%, transparent));
  pointer-events: none;
}

.locate-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 30px;
  height: 40px;
  transform: translate(-50%, -100%);
  animation: pin-drop 0.9s cubic-bezier(0.3, 1.6, 0.5, 1) both, pin-bob 2.6s 1s ease-in-out infinite;
}
.locate-pin svg { position: relative; width: 100%; height: 100%; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.3)); }
.locate-pin path { fill: #ea4335; }
.locate-pin circle { fill: #fff; }
.pin-pulse {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 16px;
  height: 7px;
  margin-left: -8px;
  border-radius: 50%;
  background: color-mix(in srgb, #ea4335 55%, transparent);
  animation: pin-ring 2s ease-out infinite;
}
.pin-pulse-2 { animation-delay: 1s; }
@keyframes pin-drop { from { opacity: 0; transform: translate(-50%, -260%); } }
@keyframes pin-bob { 50% { transform: translate(-50%, -112%); } }
@keyframes pin-ring { from { transform: scale(1); opacity: 0.9; } to { transform: scale(5); opacity: 0; } }

.locate-open {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 999px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.locate-map:hover .locate-open, .locate-map:focus-visible .locate-open { opacity: 1; transform: none; }

.locate-body { padding: 22px 24px 24px; }
.locate-kicker { font-size: 13px; font-weight: 600; color: var(--accent); }
.locate-body h3 { margin-top: 6px; font-size: 24px; letter-spacing: -0.03em; }
.locate-copy { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.locate-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
}
.locate-facts dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--muted); }
.locate-facts dd { margin: 3px 0 0; font-size: 14.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Hero: terminal-prompt name  ~/Hariom-Sahu $ ▌ ---------- */
.prompt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0; }
.prompt-path, .prompt-sign {
  font-family: var(--font-mono);
  font-size: 0.72em;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--muted);
}
.prompt-path { margin-right: 0.06em; }
.prompt-sign { margin-left: 0.32em; color: var(--accent); }
.prompt-caret {
  display: inline-block;
  width: 0.42em;
  height: 0.78em;
  margin-left: 0.22em;
  align-self: center;
  transform: translateY(0.06em);
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  animation: prompt-blink 1.05s steps(1) infinite;
}
@keyframes prompt-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .prompt-caret { animation: none; } }

/* ---------- Terminal logo:  ~/hs ▌  (types ~/hariom-sahu on hover) ---------- */
.brand { padding: 0; border-radius: 10px; }
.brand-term {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 12px 0 11px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  border: 1px solid var(--line);
  border-radius: 10px;
  white-space: nowrap;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.bt-path { color: var(--accent); margin-right: 1px; }
.bt-short, .bt-full { display: inline-block; overflow: hidden; vertical-align: bottom; }
.bt-short {
  width: 2ch;
  animation: bt-type 0.5s steps(2, end) 0.3s both;
}
.bt-full { max-width: 0; }
.bt-caret {
  width: 0.55em;
  height: 1.05em;
  margin-left: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  animation: prompt-blink 1.05s steps(1) infinite;
}
@keyframes bt-type { from { width: 0; } }

/* Hover: autocomplete ~/hs → ~/hariom-sahu */
.brand:hover .brand-term, .brand:focus-visible .brand-term {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  box-shadow: 0 6px 18px -10px var(--accent);
}
.brand:hover .bt-short, .brand:focus-visible .bt-short { width: 0; animation: none; }
.brand:hover .bt-full, .brand:focus-visible .bt-full {
  max-width: 11ch;
  transition: max-width 0.55s steps(11, end);
}
.brand:hover .bt-caret { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .bt-short { animation: none; }
  .bt-caret { animation: none; }
  .brand:hover .bt-full { transition: none; }
}
@media (max-width: 760px) { .brand-term { height: 36px; font-size: 15px; } }
