/* =========================================================
   Akshit Singh — styles
   Palette: night indigo, mist, amber
   Type: Times New Roman throughout
   ========================================================= */
:root {
  --night: #12142b;
  --night-2: #1c1f40;
  --mist: #e8e6f3;
  --mist-dim: #aeacc8;
  --amber: #ffb547;
  --blue: #8ab2ff;
  --line: rgba(232, 230, 243, 0.14);

  --serif: "Times New Roman", Times, "Liberation Serif", "Nimbus Roman", serif;

  --s-1: 0.95rem;
  --s0: 1.2rem;
  --s1: 1.6rem;
  --s2: 2.25rem;

  --wrap: 1180px;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --dim: 0;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night); color: var(--mist); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--serif); font-size: var(--s0); line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; overflow-x: hidden;
}
img, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: rgba(255, 181, 71, 0.6); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--amber); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--amber); color: var(--night); }
button { font-family: var(--serif); }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--amber); color: var(--night); padding: 0.5rem 1rem; }
.skip-link:focus { top: 1rem; }

/* ---------- Background art ---------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: calc(1 - var(--dim) * 0.6); }
#bg-art { width: 100%; height: 100%; }
.scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 15% 85%, rgba(18, 20, 43, 0.85), rgba(18, 20, 43, 0) 70%),
    linear-gradient(90deg, rgba(18, 20, 43, 0.9) 0%, rgba(18, 20, 43, 0.55) 48%, rgba(18, 20, 43, 0) 80%),
    linear-gradient(0deg, rgba(18, 20, 43, 0.8), rgba(18, 20, 43, 0) 45%);
  opacity: calc(0.55 + var(--dim) * 0.45);
}

/* ---------- Layout ---------- */
.page { position: relative; z-index: 2; transition: opacity 0.4s ease, transform 0.4s ease; }
body.leaving .page, body.leaving .site-nav { opacity: 0; transform: translateY(-6px); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

.section {
  display: grid; grid-template-columns: minmax(10rem, 15rem) minmax(0, 42rem);
  gap: 1.5rem clamp(2rem, 5vw, 4.5rem);
  padding: clamp(3.5rem, 8vw, 6rem) 0; border-top: 1px solid var(--line);
}
.section--wide { grid-template-columns: minmax(0, 1fr); }
.section > h2 { margin: 0; }
.section-body > :first-child { margin-top: 0; }
@media (max-width: 820px) { .section { grid-template-columns: 1fr; } }

h1, h2, h3 { font-family: var(--serif); line-height: 1.1; }
h1, h2 { font-weight: 400; letter-spacing: -0.015em; }
h2 { font-size: var(--s2); }
h3 { font-size: 1.4rem; font-weight: 700; margin: 0 0 0.35rem; }
p { margin: 0 0 1.1em; }
.muted { color: var(--mist-dim); }

/* ---------- Navigation ---------- */
.site-nav { position: fixed; inset: 0 0 auto 0; z-index: 10; transition: background 0.3s ease, opacity 0.4s ease, transform 0.4s ease; }
.site-nav.is-scrolled { background: rgba(18, 20, 43, 0.78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1rem; padding-bottom: 1rem; }
.nav-name { font-size: 1.3rem; text-decoration: none; letter-spacing: 0.01em; }
.nav-links { display: flex; gap: clamp(1rem, 2.5vw, 2rem); list-style: none; margin: 0; padding: 0; }
.nav-links a { font-size: 1.1rem; text-decoration: none; color: var(--mist-dim); padding: 0.3rem 0; border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.nav-links a:hover { color: var(--mist); }
.nav-links a[aria-current="page"] { color: var(--mist); border-bottom-color: var(--amber); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--mist); font-size: 1.05rem; padding: 0.3rem 0.9rem; border-radius: 999px; cursor: pointer; }
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; padding: 0.5rem var(--pad) 1rem; background: rgba(18, 20, 43, 0.96); border-bottom: 1px solid var(--line); display: none; }
  .site-nav.is-open .nav-links { display: flex; }
  .site-nav.is-open { background: rgba(18, 20, 43, 0.96); }
  .nav-links a { display: block; padding: 0.7rem 0; font-size: 1.25rem; }
}

/* ---------- Hero ---------- */
.hero { min-height: 62vh; display: flex; align-items: flex-end; padding: 8rem 0 3.5rem; }
.hero > .wrap { width: 100%; }
.hero--home { min-height: 100vh; min-height: 100svh; padding-bottom: clamp(4.5rem, 10vh, 7.5rem); }

.home-intro { display: grid; grid-template-columns: clamp(9rem, 16vw, 13.5rem) minmax(0, 1fr); gap: clamp(1.5rem, 3.5vw, 3rem); align-items: end; }
@media (max-width: 640px) { .home-intro { grid-template-columns: 1fr; gap: 1.25rem; } }

.headshot {
  position: relative; margin: 0; aspect-ratio: 4 / 5; border-radius: 4px; overflow: hidden;
  background: var(--night-2); border: 1px solid rgba(232, 230, 243, 0.25);
  box-shadow: 0 0 0 6px rgba(18, 20, 43, 0.5);
}
.headshot img { width: 100%; height: 100%; object-fit: cover; }
.headshot.is-missing img { display: none; }
.headshot.is-missing {
  display: grid; place-items: center;
  background: radial-gradient(circle, rgba(232, 230, 243, 0.22) 1.2px, transparent 1.6px) 0 0 / 9px 9px, var(--night-2);
}
.headshot.is-missing::before { content: "AS"; font-size: 2.6rem; letter-spacing: 0.04em; color: var(--mist); }
.headshot[data-hint]::after { content: attr(data-hint); position: absolute; left: 0.5rem; right: 0.5rem; bottom: 0.5rem; font-size: 0.8rem; line-height: 1.3; color: var(--amber); text-align: center; }
@media (max-width: 640px) { .headshot { width: 7.5rem; } }

.name {
  font-weight: 400; font-size: clamp(3.75rem, 11vw, 9.5rem); line-height: 0.86; letter-spacing: -0.035em;
  margin: 0 0 1.5rem -0.05em; text-shadow: 0 2px 40px rgba(18, 20, 43, 0.6);
}
.name span { display: block; }
.lead, .hero-meta, .page-intro { text-shadow: 0 1px 18px rgba(18, 20, 43, 0.95); }
.lead { font-size: var(--s1); line-height: 1.3; max-width: 30ch; margin: 0 0 0.6rem; }
.hero-meta { color: var(--mist-dim); max-width: 46ch; margin: 0 0 1.75rem; }
.page-title { font-weight: 400; font-size: clamp(3.25rem, 8.5vw, 7rem); line-height: 0.92; letter-spacing: -0.03em; margin: 0 0 1.1rem; }
.page-intro { font-size: var(--s1); line-height: 1.35; max-width: 34ch; margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  .hero-anim > * { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-anim > :nth-child(1) { animation-delay: 0.35s; }
  .hero-anim > :nth-child(2) { animation-delay: 0.55s; }
  .hero-anim > :nth-child(3) { animation-delay: 0.7s; }
  .hero-anim > :nth-child(4) { animation-delay: 0.85s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn { display: inline-flex; align-items: center; font-size: 1.1rem; padding: 0.65rem 1.35rem; border-radius: 999px; text-decoration: none; border: 1px solid var(--amber); transition: background 0.2s, color 0.2s, border-color 0.2s; }
.btn--solid { background: var(--amber); color: var(--night); }
.btn--solid:hover { background: #ffc66e; color: var(--night); }
.btn--ghost { color: var(--mist); border-color: rgba(232, 230, 243, 0.45); background: rgba(18, 20, 43, 0.4); backdrop-filter: blur(6px); }
.btn--ghost:hover { border-color: var(--amber); color: var(--amber); }

/* ---------- Home sections ---------- */
.interests { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1.25rem; }
.interests li { padding-left: 1.25rem; border-left: 2px solid var(--amber); }
.interests strong { display: block; font-size: 1.3rem; }
.interests span { color: var(--mist-dim); }

.news { list-style: none; padding: 0; margin: 0; }
.news li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.news li:first-child { padding-top: 0; }
.news time { color: var(--amber); font-style: italic; }

.edu { display: grid; gap: 1.5rem; }
.edu h3 { font-size: 1.35rem; }
.edu p { margin: 0; color: var(--mist-dim); }
.contact-links { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; font-size: 1.25rem; }

/* ---------- Places gallery ---------- */
.places-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem; }
.places-head p { margin: 0; color: var(--mist-dim); max-width: 46ch; }
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 2rem 1.5rem; margin-top: 2rem; }
.place-tile { margin: 0; }
.place-media { position: relative; aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; background: var(--night-2); border: 1px solid var(--line); }
.place-media video { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.08) contrast(1.04); transition: transform 0.8s ease; }
.place-tile:hover video { transform: scale(1.04); }
.place-media::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 60px rgba(18, 20, 43, 0.55); }
.place-tile figcaption { padding-top: 0.7rem; line-height: 1.35; }
.place-tile figcaption b { display: block; font-size: 1.2rem; font-weight: 700; }
.place-tile figcaption span { color: var(--mist-dim); font-style: italic; }
.place-tile.is-missing video { display: none; }
.place-tile.is-missing .place-media { background: radial-gradient(circle, rgba(232, 230, 243, 0.18) 1.1px, transparent 1.5px) 0 0 / 9px 9px, var(--night-2); }
.place-media[data-hint]::before { content: attr(data-hint); position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; text-align: center; color: var(--amber); font-size: 0.95rem; }

/* ---------- Publications ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 2rem; }
.chip { font-size: 1.02rem; color: var(--mist-dim); background: rgba(28, 31, 64, 0.6); border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 1rem; cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s; }
.chip:hover { color: var(--mist); border-color: rgba(232, 230, 243, 0.35); }
.chip[aria-pressed="true"] { color: var(--night); background: var(--mist); border-color: var(--mist); }
.pub-count { margin-left: auto; color: var(--mist-dim); font-style: italic; }

.pubs { list-style: none; margin: 0; padding: 0; }
.pub { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 0.5rem 2rem; padding: 2rem 0; border-top: 1px solid var(--line); }
.pub[hidden] { display: none; }
.pub > div:last-child { max-width: 46rem; }
.pub-venue { line-height: 1.3; }
.pub-venue b { display: block; color: var(--amber); font-size: 1.3rem; font-weight: 700; }
.pub-venue span { color: var(--mist-dim); font-size: 1rem; font-style: italic; }
.pub h3 { font-size: 1.55rem; max-width: 34ch; line-height: 1.2; }
.pub--featured h3 { font-size: clamp(1.8rem, 3vw, 2.3rem); }
.authors { color: var(--mist-dim); margin: 0 0 0.6rem; font-size: 1.08rem; max-width: 60ch; }
.me { color: var(--mist); font-weight: 700; text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 0.18em; }
.badge { display: inline-block; font-size: 0.95rem; padding: 0.1rem 0.7rem; border-radius: 999px; border: 1px solid rgba(255, 181, 71, 0.5); color: var(--amber); margin: 0 0.4rem 0.6rem 0; }
.pub-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; font-size: 1.1rem; margin-top: 0.4rem; }
.pub-links a { text-decoration: none; border-bottom: 1px solid rgba(255, 181, 71, 0.55); }
@media (max-width: 720px) { .pub { grid-template-columns: 1fr; } }

/* ---------- Expandable panels ---------- */
.toggle { background: none; border: 0; padding: 0; color: var(--mist-dim); cursor: pointer; font-size: 1.05rem; display: inline-flex; align-items: center; gap: 0.45rem; }
.toggle:hover { color: var(--amber); }
.toggle::before { content: "+"; display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; border: 1px solid currentColor; border-radius: 50%; font-size: 0.9rem; line-height: 1; transition: transform 0.3s; }
.toggle[aria-expanded="true"]::before { transform: rotate(45deg); }
.panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s ease; }
.panel > div { overflow: hidden; }
.panel.is-open { grid-template-rows: 1fr; }
.panel ul { margin: 0.9rem 0 0.2rem; padding-left: 1.1rem; color: var(--mist-dim); }
.panel li { margin-bottom: 0.45rem; }
.panel li::marker { color: var(--amber); }

/* ---------- Timeline ---------- */
.timeline { --progress: 0; position: relative; list-style: none; margin: 0; padding: 0 0 0 2rem; }
.timeline::before, .timeline::after { content: ""; position: absolute; left: 0.3rem; top: 0.6rem; bottom: 0.6rem; width: 2px; background: var(--line); }
.timeline::after { background: var(--amber); bottom: auto; height: calc((100% - 1.2rem) * var(--progress)); }
.t-item { position: relative; padding: 0 0 2.75rem; }
.t-item::before { content: ""; position: absolute; left: calc(-2rem - 0.02rem); top: 0.45rem; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--night); border: 2px solid var(--amber); }
.t-date { color: var(--amber); font-style: italic; }
.t-item h3 { font-size: 1.5rem; margin: 0.15rem 0 0.15rem; }
.t-org { color: var(--mist-dim); margin: 0 0 0.6rem; }
.t-item > p { max-width: 60ch; }

/* ---------- Mentors ---------- */
.mentors { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2.25rem 2.5rem; }
.mentor { display: grid; grid-template-columns: 3.5rem 1fr; gap: 1rem; align-items: start; }
.mentor-mark { width: 3.5rem; height: 3.5rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.25rem; color: var(--night); background: var(--mist); overflow: hidden; }
.mentor-mark img { width: 100%; height: 100%; object-fit: cover; }
.mentor h3 { font-size: 1.35rem; margin: 0.1rem 0; }
.mentor .role { color: var(--amber); font-style: italic; margin: 0 0 0.5rem; }
.mentor p { margin: 0; color: var(--mist-dim); }

/* ---------- CV ---------- */
.cv-frame { width: 100%; height: 85vh; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.cv-fallback { padding: 2rem; color: var(--night); }
@media (max-width: 720px) { .cv-frame { display: none; } }

/* ---------- Corner: pause + scene caption ---------- */
.art-pause {
  position: fixed; left: var(--pad); bottom: 1.25rem; z-index: 5;
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.98rem; color: var(--mist-dim); cursor: pointer;
  background: rgba(18, 20, 43, 0.6); border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.9rem 0.35rem 0.6rem;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s;
}
.art-pause:hover { color: var(--mist); }
.art-pause::before { content: ""; width: 0.7rem; height: 0.7rem; background: linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65%); }
.art-pause[aria-pressed="true"]::before { background: currentColor; clip-path: polygon(10% 0, 100% 50%, 10% 100%); }
body.past-hero .art-pause { opacity: 0; transform: translateY(10px); pointer-events: none; }

.scene-caption {
  position: fixed; right: var(--pad); bottom: 1.25rem; z-index: 5; margin: 0; max-width: 21rem; text-align: right;
  color: var(--mist-dim); font-size: 0.98rem; line-height: 1.35; opacity: calc(1 - var(--dim)); pointer-events: none;
  text-shadow: 0 1px 12px rgba(18, 20, 43, 0.95);
}
.scene-caption b { display: block; color: var(--mist); font-size: 1.1rem; font-weight: 400; font-style: italic; }
@media (max-width: 820px) { .scene-caption { display: none; } }

/* ---------- Footer ---------- */
.site-footer { position: relative; z-index: 2; border-top: 1px solid var(--line); padding: 2.5rem 0 6rem; color: var(--mist-dim); font-size: 1.02rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }

@media (max-width: 820px) {
  .scrim { background: rgba(18, 20, 43, 0.85); opacity: calc(0.5 + var(--dim) * 0.5); }
  .news li { grid-template-columns: 1fr; gap: 0.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* small screens: the pause button sits at the top and scrolls away with the page */
@media (max-width: 820px) {
  .art-pause { position: absolute; top: 4.6rem; right: var(--pad); left: auto; bottom: auto; }
  body.past-hero .art-pause { opacity: 1; transform: none; pointer-events: auto; }
}

/* ---------- News: "see more" with arrow ---------- */
.panel .news--more { margin: 0; padding: 0; color: inherit; }
.panel .news--more li { margin: 0; }
.news--more li:first-child { padding-top: 0.85rem; }
.toggle--more { margin-top: 1.1rem; color: var(--mist); }
.toggle--more::before { display: none; }
.toggle--more::after { content: "\2193"; display: inline-block; color: var(--amber); transition: transform 0.3s ease; }
.toggle--more[aria-expanded="true"]::after { transform: rotate(180deg); }

/* closed panels can't be tabbed into */
.panel > div { visibility: hidden; transition: visibility 0s linear 0.4s; }
.panel.is-open > div { visibility: visible; transition: visibility 0s; }

/* live step counter under the About-page caption */
.scene-status { display: block; margin-top: 0.3rem; color: var(--amber); font-style: italic; font-variant-numeric: tabular-nums; }
