/* ==========================================================
   Pushpendra Kumar portfolio
   Tokens: dark by default, light via system or toggle.
   Radius system: cards 20px, buttons and chips full pill.
   ========================================================== */

:root {
  --bg: #0e0e10;
  --bg-2: #131316;
  --surface: #17171b;
  --surface-2: #1e1e23;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ececef;
  --muted: #a1a1aa;
  --accent: #f2b84b;
  --accent-ink: #f2b84b;
  --accent-soft: rgba(242, 184, 75, 0.12);
  --on-accent: #1c1404;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 20px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 68px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f5f6;
    --bg-2: #ededef;
    --surface: #fcfcfc;
    --surface-2: #f1f1f3;
    --border: rgba(24, 24, 27, 0.09);
    --border-strong: rgba(24, 24, 27, 0.18);
    --text: #18181b;
    --muted: #55555e;
    --accent-ink: #8f5b00;
    --accent-soft: rgba(242, 184, 75, 0.18);
    --shadow: 0 24px 60px -28px rgba(60, 50, 30, 0.28);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #f5f5f6;
  --bg-2: #ededef;
  --surface: #fcfcfc;
  --surface-2: #f1f1f3;
  --border: rgba(24, 24, 27, 0.09);
  --border-strong: rgba(24, 24, 27, 0.18);
  --text: #18181b;
  --muted: #55555e;
  --accent-ink: #8f5b00;
  --accent-soft: rgba(242, 184, 75, 0.18);
  --shadow: 0 24px 60px -28px rgba(60, 50, 30, 0.28);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.section { padding: 112px 0; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: 8px 14px; border-radius: 999px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  min-height: 1.6em;
}
.caret {
  display: inline-block; width: 2px; height: 1.1em; margin-left: 4px;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.h2 {
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin-bottom: 40px;
}
.h3 { font-size: 1.5rem; font-weight: 650; letter-spacing: -0.02em; }
.lead { font-size: 1.2rem; line-height: 1.55; color: var(--text); max-width: 60ch; }
.section-sub { color: var(--muted); max-width: 60ch; margin: -24px 0 40px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 22px;
  border-radius: 999px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn i { font-size: 18px; }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 30px -12px rgba(242, 184, 75, 0.55); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -14px rgba(242, 184, 75, 0.7); }
.btn--ghost { border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); transform: translateY(-2px); }
.btn--sm { height: 40px; padding: 0 16px; font-size: 14px; }
.btn--lg { height: 56px; padding: 0 26px; font-size: 16px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 999px;
  background: transparent; color: var(--text);
  border: 1px solid var(--border-strong);
  cursor: pointer; font-size: 18px;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn--lg { width: 56px; height: 56px; font-size: 20px; }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-ink); font-weight: 600; }
.link-arrow i { transition: transform 0.3s var(--ease); }
.link-arrow:hover i { transform: translate(2px, -2px); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom-color: var(--border);
}
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; }
.brand__mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--mono); font-size: 13px; font-weight: 600;
}
.nav__links { display: flex; gap: 4px; }
.nav__links a {
  padding: 8px 14px; border-radius: 999px;
  color: var(--muted); font-size: 15px; font-weight: 500;
  transition: color 0.2s, background-color 0.2s;
}
.nav__links a:hover { color: var(--text); }
.nav__links a.is-active { color: var(--text); background: var(--surface-2); }
.nav__actions { display: flex; align-items: center; gap: 10px; }
.nav__menu { display: none; }

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

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 32px) 0 64px;
  overflow: hidden;
}
.hero::before {
  /* soft accent glow behind the photo */
  content: ""; position: absolute; z-index: -1;
  width: 720px; height: 720px; right: -160px; top: 50%;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(242, 184, 75, 0.16), transparent 62%);
  pointer-events: none;
}
#nav-sentinel { position: absolute; top: 0; left: 0; height: 40px; width: 1px; }
.hero__grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 64px; align-items: center; }
.hero__copy { display: grid; gap: 24px; }
.hero__title {
  font-size: clamp(2.25rem, 1.3rem + 3.2vw, 4rem);
  font-weight: 750; letter-spacing: -0.045em; line-height: 1.05;
}
.hero__title em { font-style: italic; color: var(--accent-ink); padding-right: 0.06em; }
.hero__sub { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* ---------- Stats ---------- */
.stats { border-block: 1px solid var(--border); background: var(--bg-2); }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 36px 24px; display: grid; gap: 6px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat__num { font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--muted); font-size: 14px; max-width: 24ch; }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 5fr 7fr; gap: 72px; align-items: center; }
.about__photo { position: relative; max-width: 420px; }
.about__photo::after {
  content: ""; position: absolute; inset: 8% -6% -6% 8%; z-index: -1;
  border-radius: 50%;
  background: var(--accent-soft);
}
.about__photo img { width: 100%; height: auto; border-radius: 50%; }
.about__body { display: grid; gap: 20px; }
.about__body .h2 { margin-bottom: 4px; }
.about__body > p:not(.lead) { color: var(--muted); max-width: 62ch; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 32px; margin: 12px 0 0; padding-top: 24px; border-top: 1px solid var(--border); }
.facts dt { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-family: var(--mono); }
.facts dt i { color: var(--accent); font-size: 16px; }
.facts dd { margin: 4px 0 0; font-weight: 550; }

/* ---------- Skills ---------- */
.skills { padding-top: 0; }
.marquee {
  overflow: hidden; border-bottom: 1px solid var(--border);
  padding: 22px 0; margin-bottom: 96px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; width: max-content; gap: 48px; animation: marquee 38s linear infinite; }
.marquee__track span {
  font-size: clamp(1.4rem, 1rem + 1.4vw, 2.1rem); font-weight: 650; letter-spacing: -0.03em;
  color: var(--muted); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 48px;
}
.marquee__track span::after { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

.skills__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.skill-group {
  padding: 28px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color 0.3s var(--ease), transform 0.4s var(--ease);
}
.skill-group:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.skill-group h3 { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 600; margin-bottom: 18px; }
.skill-group h3 i { color: var(--accent); font-size: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 6px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 14px; color: var(--text);
  transition: border-color 0.2s, color 0.2s;
}
.chips li:hover { border-color: var(--accent); }

/* ---------- Experience ---------- */
.experience { background: var(--bg-2); border-block: 1px solid var(--border); }
.timeline { position: relative; display: grid; gap: 56px; padding-left: 36px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px;
  background: var(--border-strong);
}
.timeline::after {
  /* accent line that draws as the section scrolls (where supported) */
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px;
  background: var(--accent);
  transform-origin: top;
  transform: scaleY(1);
}
.job { position: relative; display: grid; grid-template-columns: 200px 1fr; gap: 32px; }
.job::before {
  content: ""; position: absolute; left: -36px; top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-2); border: 2px solid var(--accent);
}
.job:first-child::before { background: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }
.job__meta { display: grid; gap: 4px; align-content: start; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.job__date { color: var(--text); font-weight: 500; }
.job__body h3 { font-size: 1.3rem; font-weight: 650; letter-spacing: -0.02em; margin-bottom: 14px; }
.job__body h3 span { color: var(--accent-ink); font-weight: 600; }
.job__body ul { display: grid; gap: 10px; }
.job__body li { position: relative; padding-left: 20px; color: var(--muted); max-width: 72ch; }
.job__body li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 2px; background: var(--accent); }

/* ---------- Projects bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(240px, auto);
  gap: 20px;
}
.tile {
  --mx: 50%; --my: 50%;
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 14px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.45s var(--ease), border-color 0.3s var(--ease);
}
.tile::before {
  /* cursor spotlight */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(242, 184, 75, 0.13), transparent 60%);
  opacity: 0; transition: opacity 0.35s var(--ease);
}
.tile:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.tile:hover::before { opacity: 1; }
.tile__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tile h3 { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.025em; }
.tile__date { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tile p { color: var(--muted); font-size: 15px; max-width: 58ch; }
.tile p strong { color: var(--text); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.tags li {
  font-family: var(--mono); font-size: 12px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}

/* ---------- Earlier work rail ---------- */
.earlier { padding-top: 0; }
.earlier__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 28px; }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 340px);
  gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
  --rail-pad: max(24px, calc((100vw - 1180px) / 2 + 24px));
  padding: 4px var(--rail-pad) 20px;
  scroll-padding-inline: var(--rail-pad);
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
/* ---------- Contact ---------- */
.contact { text-align: center; position: relative; overflow: hidden; }
.contact::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 40%;
  width: 900px; height: 520px; transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(242, 184, 75, 0.12), transparent 65%);
  pointer-events: none;
}
.contact__inner { display: grid; justify-items: center; gap: 24px; }
.contact__title {
  font-size: clamp(2.4rem, 1.4rem + 4vw, 4.5rem);
  font-weight: 750; letter-spacing: -0.045em; line-height: 1.05;
}
.contact__title span { color: var(--accent-ink); }
.contact .lead { color: var(--muted); }
.contact__mail { position: relative; display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.copy-toast {
  position: absolute; left: 50%; top: calc(100% + 12px); transform: translateX(-50%);
  font-family: var(--mono); font-size: 13px; color: var(--accent-ink);
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.copy-toast.show { opacity: 1; }
.contact__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.contact__links a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text); font-weight: 500; font-size: 15px;
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.contact__links a:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact__links i { font-size: 18px; color: var(--accent); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: 14px; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

/* ==========================================================
   Motion (only when the user has not asked for reduced motion)
   ========================================================== */
@media (prefers-reduced-motion: no-preference) {
  /* hero entrance */
  .rise { opacity: 0; transform: translateY(24px); animation: rise 0.9s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 110ms + 120ms); }
  .hero__media.rise { transform: translateY(40px); }
  @keyframes rise { to { opacity: 1; transform: none; } }


  /* scroll reveal, toggled by IntersectionObserver */
  .js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
  .js .reveal.in { opacity: 1; transform: none; }

  /* hero photo drifts slightly as you scroll (scroll-driven, progressive) */
  @supports (animation-timeline: scroll()) {
    .hero__watermark { animation: wm-drift linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
    @keyframes wm-drift { to { transform: translate(-50%, 0) translateX(-12vw); opacity: 0; } }

    .timeline::after { transform: scaleY(0); animation: draw linear both; animation-timeline: view(); animation-range: entry 20% cover 70%; }
    @keyframes draw { to { transform: scaleY(1); } }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee__track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
  .marquee__track span:nth-child(n+13) { display: none; }
  .caret { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1024px) {
  .nav__links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 2px;
    padding: 12px 16px 20px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  }
  .nav__links.open { transform: none; opacity: 1; visibility: visible; }
  .nav__links a { padding: 12px 14px; font-size: 16px; }
  .nav__menu { display: inline-grid; }

  .hero__grid { grid-template-columns: 1fr 0.8fr; gap: 40px; }
}

@media (max-width: 900px) {
  .hero { min-height: auto; }
  .hero__grid { grid-template-columns: 1fr; gap: 48px; }
  .hero__media { justify-self: center; }
}

@media (max-width: 767px) {
  .container { padding: 0 16px; }
  .section { padding: 80px 0; }
  .brand__name { display: none; }
  .nav__cv { display: none; }

  .hero { padding-top: calc(var(--nav-h) + 24px); min-height: auto; }
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .hero__ctas .btn { flex: 1 1 auto; justify-content: center; }

  .stats__grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 28px 16px; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }

  .about__grid { grid-template-columns: 1fr; gap: 40px; }
  .about__photo { max-width: 260px; margin: 0 auto; }
  .facts { grid-template-columns: 1fr; }

  .marquee { margin-bottom: 64px; }
  .skills__grid { grid-template-columns: 1fr; }
  .skill-group { padding: 22px; }

  .timeline { padding-left: 28px; gap: 44px; }
  .job { grid-template-columns: 1fr; gap: 10px; }
  .job::before { left: -28px; }
  .job__meta { grid-auto-flow: column; justify-content: start; gap: 12px; }


  .rail { grid-auto-columns: 82%; --rail-pad: 16px; }
  .earlier__head { flex-direction: column; align-items: flex-start; gap: 12px; }

  .contact__mail .btn--lg { font-size: 14px; padding: 0 18px; }
  .footer__inner { flex-direction: column; text-align: center; }
}

/* ==========================================================
   Project tiles (rendered from js/projects.js)
   ========================================================== */
.bento { grid-auto-rows: auto; }
.tile { padding: 14px 14px 22px; gap: 12px; }
.tile__media { border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface-2); }
.tile__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.tile:hover .tile__media img { transform: scale(1.05); }
.tile__content { display: flex; flex-direction: column; gap: 10px; padding: 4px 10px 0; flex: 1; }
.tile__tagline { color: var(--text); font-weight: 500; }
.tile__more {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  color: var(--accent-ink); font-weight: 600; font-size: 14px;
}
.tile__more i { transition: transform 0.3s var(--ease); }
.tile:hover .tile__more i { transform: translateX(3px); }
.tile__open {
  position: absolute; inset: 0; z-index: 2;
  background: transparent; border: 0; cursor: pointer; border-radius: inherit;
}
.tile__open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#featured-grid > .tile:nth-child(1) { grid-column: span 4; display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 20px; padding: 14px; }
#featured-grid > .tile:nth-child(1) .tile__content { padding: 10px 14px 10px 0; }
#featured-grid > .tile:nth-child(2) { grid-column: span 2; grid-row: span 2; }
#featured-grid > .tile:nth-child(2) .tile__media { aspect-ratio: 4 / 5; }
#featured-grid > .tile:nth-child(3),
#featured-grid > .tile:nth-child(4) { grid-column: span 2; }
#featured-grid > .tile:nth-child(5),
#featured-grid > .tile:nth-child(6) { grid-column: span 3; }
#featured-grid > .tile:nth-child(1),
#featured-grid > .tile:nth-child(2) {
  background: radial-gradient(120% 90% at 100% 0%, rgba(242, 184, 75, 0.16), transparent 55%), var(--surface);
}

/* ---------- More projects rail ---------- */
.earlier__nav { display: flex; align-items: center; gap: 10px; }
.earlier__nav .link-arrow { margin-left: 8px; }
.card {
  position: relative;
  scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 12px 18px;
  border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.4s var(--ease), border-color 0.3s;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.card__img { border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface-2); }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.card:hover .card__img img { transform: scale(1.05); }
.card h3 { font-size: 1.05rem; font-weight: 600; padding: 6px 8px 0; }
.card p { color: var(--muted); font-size: 14px; padding: 0 8px; }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 0; margin-top: auto; }
.card__links { position: relative; z-index: 3; display: flex; gap: 6px; }
.card__links a {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text); font-size: 16px;
  transition: border-color 0.2s;
}
.card__links a:hover { border-color: var(--accent); }

/* ---------- Responsive for new blocks ---------- */
@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  #featured-grid > .tile:nth-child(n) { grid-column: span 1; grid-row: auto; }
  #featured-grid > .tile:nth-child(1) { grid-column: span 2; }
  #featured-grid > .tile:nth-child(2) .tile__media { aspect-ratio: 16 / 10; }
}
@media (max-width: 900px) {
  .hero__media { max-width: 440px; justify-self: center; }
}
@media (max-width: 767px) {
  .bento { grid-template-columns: 1fr; }
  #featured-grid > .tile:nth-child(n) { grid-column: auto; }
  #featured-grid > .tile:nth-child(1) { display: flex; padding: 14px 14px 22px; }
  #featured-grid > .tile:nth-child(1) .tile__content { padding: 4px 10px 0; }
}


/* ==========================================================
   Hero v3: giant name watermark + 3D cartoon avatar
   ========================================================== */
.hero { flex-direction: column; align-items: stretch; justify-content: center; gap: 28px; }
.hero::before { display: none; }
.hero > .container { position: relative; z-index: 1; }
.hero__watermark {
  position: absolute; left: 50%; top: calc(var(--nav-h) + 4vh); z-index: 0;
  transform: translateX(-50%);
  font-size: clamp(4.5rem, 16.5vw, 16rem); font-weight: 800; letter-spacing: -0.06em; line-height: 0.9;
  color: var(--text); opacity: 0.055; white-space: nowrap; pointer-events: none; user-select: none;
}
.hero__top, .hero__bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.hero__meta { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.hero__bottom {
  padding-top: 18px; border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em;
}
.hero__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
.hero__title-soft { color: var(--muted); font-style: italic; font-weight: 600; }

.hero__media { position: relative; height: min(70vh, 620px); min-height: 440px; max-width: none; justify-self: stretch; }
.avatar { position: absolute; inset: 0; z-index: 1; cursor: grab; touch-action: pan-y; }
.avatar:active { cursor: grabbing; }
.avatar canvas { display: block; width: 100% !important; height: 100% !important; }
.avatar-blob {
  position: absolute; left: 50%; bottom: 4%; z-index: 0;
  width: min(78%, 420px); aspect-ratio: 3 / 4; transform: translateX(-50%);
  border-radius: 50% 50% 46% 46%;
  background:
    radial-gradient(60% 50% at 50% 38%, rgba(242, 184, 75, 0.28), transparent 70%),
    radial-gradient(70% 60% at 50% 60%, var(--accent-soft), transparent 75%);
}
.avatar-hint {
  position: absolute; left: 50%; bottom: 0; z-index: 2; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap;
}
.avatar-hint i { color: var(--accent); font-size: 15px; }
@media (prefers-reduced-motion: no-preference) {
  .avatar-hint { opacity: 0; animation: hint-in 0.8s var(--ease) 2.6s forwards; }
  @keyframes hint-in { to { opacity: 1; } }
}

/* ==========================================================
   Selected work: numbered accordion
   ========================================================== */
.work { border-top: 1px solid var(--border-strong); }
.work__item { border-bottom: 1px solid var(--border-strong); }
.work__heading { margin: 0; }
.work__toggle {
  width: 100%; display: grid; grid-template-columns: 64px 1fr auto 44px; align-items: center; gap: 20px;
  padding: 28px 4px; background: none; border: 0; color: var(--text); cursor: pointer; text-align: left;
  font: inherit;
}
.work__num { font-family: var(--mono); font-size: 14px; color: var(--muted); transition: color 0.3s; }
.work__title {
  font-size: clamp(1.5rem, 1rem + 2vw, 2.5rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1;
  transition: transform 0.5s var(--ease), color 0.3s;
}
.work__cat { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; text-align: right; }
.work__icon {
  position: relative; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--border-strong);
  transition: background-color 0.3s, border-color 0.3s, transform 0.5s var(--ease);
}
.work__icon::before, .work__icon::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; margin: -1px 0 0 -7px;
  background: currentColor; border-radius: 2px; transition: transform 0.4s var(--ease);
}
.work__icon::after { transform: rotate(90deg); }
.work__toggle:hover .work__title { transform: translateX(8px); color: var(--accent-ink); }
.work__toggle:hover .work__num { color: var(--accent-ink); }
.work__toggle:hover .work__icon { border-color: var(--accent); }
.work__item.is-open .work__icon { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: rotate(180deg); }
.work__item.is-open .work__icon::after { transform: rotate(0deg); }
.work__item.is-open .work__num { color: var(--accent-ink); }

.work__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.6s var(--ease); }
.work__item.is-open .work__panel { grid-template-rows: 1fr; }
.work__clip { overflow: hidden; }
.work__body { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; padding: 4px 4px 40px 88px; }
.work__meta { font-family: var(--mono); font-size: 13px; color: var(--accent-ink); margin-bottom: 12px; }
.work__summary { font-size: 1.08rem; color: var(--text); max-width: 56ch; margin-bottom: 20px; }
.work__features { display: grid; gap: 9px; margin-bottom: 22px; }
.work__features li { display: flex; gap: 10px; color: var(--muted); font-size: 15px; }
.work__features li i { color: var(--accent); font-size: 18px; flex: none; margin-top: 2px; }
.work__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.work__private { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.work__private i { color: var(--accent); }
.work__media { margin: 0; align-self: start; }
.work__media img { width: 100%; border-radius: 18px; border: 1px solid var(--border); background: #0e0e10; aspect-ratio: 16 / 10; object-fit: cover; }
.work__media figcaption { margin-top: 10px; font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

@media (prefers-reduced-motion: no-preference) {
  .work__text, .work__media { opacity: 0; transform: translateY(18px); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
  .work__item.is-open .work__text { opacity: 1; transform: none; transition-delay: 0.15s; }
  .work__item.is-open .work__media { opacity: 1; transform: none; transition-delay: 0.25s; }
}
@media (prefers-reduced-motion: reduce) {
  .work__panel { transition: none; }
}

/* Earlier work cards (links to GitHub) */
.tag-inline { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { height: 520px; min-height: 0; }
  .work__body { grid-template-columns: 1fr; padding-left: 4px; }
}
@media (max-width: 767px) {
  .hero__watermark { top: calc(var(--nav-h) + 8px); font-size: 22vw; }
  .hero__top { flex-direction: column; align-items: flex-start; gap: 4px; }
  .hero__bottom { flex-direction: column; align-items: flex-start; gap: 6px; font-size: 12px; }
  .hero__media { height: 460px; }
  .work__toggle { grid-template-columns: 36px 1fr 40px; gap: 12px; padding: 22px 0; }
  .work__cat { display: none; }
  .work__icon { width: 40px; height: 40px; }
  .work__body { gap: 24px; padding: 0 0 32px; }
}

/* Hero title sized for the two-column layout */
.hero .hero__title { font-size: clamp(2.25rem, 1.3rem + 2.6vw, 3.4rem); }
.hero .hero__grid { grid-template-columns: 1.1fr 0.9fr; }
@media (max-width: 900px) { .hero .hero__grid { grid-template-columns: 1fr; } }

/* About photo: suit cutout in an arch frame */
.about__photo {
  position: relative; width: 100%; max-width: 380px; aspect-ratio: 4 / 5;
  border-radius: 999px 999px 28px 28px; overflow: hidden;
  background:
    radial-gradient(70% 55% at 50% 40%, rgba(242, 184, 75, 0.35), transparent 70%),
    var(--surface-2);
  border: 1px solid var(--border);
}
.about__photo::after { display: none; }
.about__photo img {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  height: 90%; width: auto; max-width: none; border-radius: 0;
  transition: transform 0.8s var(--ease);
}
.about__photo:hover img { transform: translateX(-50%) scale(1.03); transform-origin: bottom center; }
@media (max-width: 767px) { .about__photo { max-width: 280px; } }

/* About: 3D cartoon close-up inside the arch */
.about__photo .avatar { position: absolute; inset: 0; }

/* Fix: image column was sized to the image's 1200px intrinsic width and got clipped */
.work__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.work__body > * { min-width: 0; }
.work__media img { display: block; max-width: 100%; height: auto; }
@media (max-width: 900px) { .work__body { grid-template-columns: minmax(0, 1fr); } }

.work__platforms { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.work__platforms li {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--accent-soft); color: var(--text);
}
.work__platforms i { font-size: 15px; color: var(--accent-ink); }
.stat__num:not(:has(span)) { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem); }
