/* ═══════════════════════════════════════════════════════════
   TILES — the modular grid and every panel that sits in it.

   Two grid systems:
   · .grid  12 columns, spans authored per tile (.s12 … .s3)
            used where the asymmetry is deliberate
   · .deck  auto-filling equal columns, used for uniform sets
            (roles, schools) so they reflow on their own
   ═══════════════════════════════════════════════════════════ */

.block { margin-bottom: clamp(56px, 7vw, 104px); scroll-margin-top: 24px; }
.block:last-child { margin-bottom: 0; }

.block__head { margin-bottom: var(--gap); display: grid; gap: 14px; justify-items: start; }
.block__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3.2rem);
  line-height: 0.96; letter-spacing: -0.038em; text-transform: uppercase;
  max-width: 20ch; text-wrap: balance;
}

/* ── grids ───────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}
.s12 { grid-column: span 12; }
.s8  { grid-column: span 8; }
.s6  { grid-column: span 6; }
.s4  { grid-column: span 4; }
.s3  { grid-column: span 3; }

@media (max-width: 1060px) {
  .s8 { grid-column: span 12; }
  .s6 { grid-column: span 12; }
  .s4 { grid-column: span 6; }
  .s3 { grid-column: span 6; }
}
@media (max-width: 620px) {
  .s4 { grid-column: span 12; }
  /* metrics stay two-up — they read better as a pair than a stack */
  .s3 { grid-column: span 6; }
}

.deck {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 292px), 1fr));
  gap: var(--gap);
}
.deck--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }

/* ── the tile itself ─────────────────────────────────────── */
.tile {
  position: relative;
  display: grid; align-content: start; gap: 12px;
  padding: clamp(20px, 2vw, 28px);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease),
              transform 0.5s var(--ease);
}
.tile::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  opacity: 0; transition: opacity var(--dur) var(--ease);
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 72%);
}
.tile--spot:hover::after { opacity: 1; }
/* while the pointer drives the tilt, transform must not lag behind it */
.tile.is-tilting { transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }

.tile__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.1rem, 0.98rem + 0.5vw, 1.45rem);
  line-height: 1.06; letter-spacing: -0.032em;
  text-transform: uppercase; text-wrap: balance;
}
.tile__meta { font: 500 var(--fs-mono)/1.5 var(--font-mono); color: var(--ink-3); }

/* ═══ HERO PANEL ═══════════════════════════════════════════ */
.tile--hero {
  min-height: clamp(400px, 58vh, 600px);
  align-content: center;
  padding: clamp(28px, 4vw, 60px);
  border-radius: var(--radius-xl);
  background: var(--bg-1);
  isolation: isolate;
}
.hero__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: -2; opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.hero__canvas.is-ready { opacity: var(--gl-opacity, 1); }
.hero__veil { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--veil); }

/* Wide enough for "AGGARWAL" to hold one line at the top of the
   clamp; the lede is narrowed separately for readability. */
.hero__body { display: grid; gap: 0; justify-items: start; max-width: min(100%, 600px); }
.hero__body .tag { margin-bottom: 20px; }

.hero__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.6rem, 1.1rem + 5.4vw, 6.4rem);
  line-height: 0.85; letter-spacing: -0.048em; text-transform: uppercase;
  margin-bottom: 22px;
}
.hero__lede {
  font-size: var(--fs-lede); color: var(--ink-2);
  max-width: 42ch; margin-bottom: 30px; text-wrap: pretty;
}
.hero__lede b { color: var(--ink); font-weight: 600; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* on narrow screens the object sits behind the type — scrim it */
@media (max-width: 900px) {
  .hero__veil::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to bottom,
      transparent 12%,
      color-mix(in srgb, var(--bg-1) 72%, transparent) 44%,
      var(--bg-1) 92%);
  }
}

/* ═══ METRIC TILES ═════════════════════════════════════════ */
.tile--stat { gap: 6px; padding-block: clamp(18px, 1.8vw, 24px); }
.stat__k {
  font: 500 var(--fs-micro)/1 var(--font-mono);
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3);
}
.stat__v {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.9rem, 1.3rem + 1.7vw, 3rem);
  line-height: 1; letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat__n { font: 500 var(--fs-micro)/1.4 var(--font-mono); color: var(--ink-3); }
.tile--stat::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent); opacity: 0; transition: opacity var(--dur) var(--ease);
}
.tile--stat:hover::before { opacity: 1; }

/* ═══ PROFILE + SPEC ═══════════════════════════════════════ */
.tile--spec { gap: 14px; }
.spec { display: grid; gap: 1px; }
.spec > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: var(--fs-mono);
}
.spec > div:last-child { border-bottom: 0; }
.spec dt { color: var(--ink-3); letter-spacing: 0.04em; }
.spec dd { color: var(--ink); font-weight: 500; text-align: right; }

/* ═══ TICKER ═══════════════════════════════════════════════ */
.tile--ticker {
  padding: 14px 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.ticker__track {
  display: flex; align-items: center; gap: 24px; width: max-content;
  animation: marquee 46s linear infinite;
}
.ticker__track span {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(0.9rem, 0.82rem + 0.32vw, 1.12rem);
  text-transform: uppercase; letter-spacing: -0.012em;
  color: var(--ink-2); white-space: nowrap;
}
.ticker__track i { color: var(--accent); font-size: 0.5rem; font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }
.tile--ticker:hover .ticker__track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .ticker__track { animation: none; } }

/* ═══ FILTERS ══════════════════════════════════════════════ */
.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.filter {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--ink-2);
  font: 500 var(--fs-mono)/1 var(--font-mono);
  letter-spacing: 0.07em; text-transform: uppercase;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
.filter em { font-style: normal; color: var(--ink-3); font-size: 0.85em; }
.filter:hover { color: var(--ink); border-color: var(--ink-3); }
.filter.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.filter.is-active em { color: color-mix(in srgb, var(--accent-ink) 62%, transparent); }

/* ═══ ROLE TILES ═══════════════════════════════════════════ */
.tile--job {
  gap: 0; padding-top: 22px;
  grid-template-rows: auto auto auto 1fr auto;
}
.tile--job.is-hidden { display: none; }

.job__idx {
  position: absolute; top: 20px; right: 22px;
  font: 500 var(--fs-micro)/1 var(--font-mono);
  color: var(--ink-3); font-variant-numeric: tabular-nums;
  transition: color var(--dur-fast) var(--ease);
}
.tile--job:hover .job__idx { color: var(--accent); }

.tile--job .chip { margin-bottom: 16px; }
.job__role {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.22rem; line-height: 1.08;
  letter-spacing: -0.032em; text-transform: uppercase;
  margin-bottom: 5px; padding-right: 28px;
}
.job__org { font-size: var(--fs-sm); color: var(--ink); margin-bottom: 12px; }
.job__desc { font-size: var(--fs-sm); color: var(--ink-2); text-wrap: pretty; }
.job__date {
  margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--line);
  font: 500 var(--fs-mono)/1 var(--font-mono); color: var(--ink-3);
}

/* the two university posts lead the deck */
.tile--job.is-lead { border-color: color-mix(in srgb, var(--accent) 32%, transparent); }
.tile--job.is-lead::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(155deg, var(--accent-soft), transparent 55%);
}
.tile--job:hover { border-color: var(--line-2); }
.tile--job.is-lead:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }

.deck__empty {
  padding: 36px 4px; color: var(--ink-3);
  font: 500 var(--fs-mono)/1 var(--font-mono);
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* replayed when the discipline filter changes */
@keyframes job-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ═══ EDUCATION ════════════════════════════════════════════ */
.tile--edu { gap: 10px; }
.tile--edu .prose { font-size: var(--fs-sm); }
.mini {
  display: flex; gap: 26px; margin-top: 6px;
  padding-top: 15px; border-top: 1px solid var(--line);
}
.mini dt {
  font: 500 var(--fs-micro)/1 var(--font-mono);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 6px;
}
.mini dd {
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  letter-spacing: -0.02em;
}

/* ═══ AWARD TILES ══════════════════════════════════════════ */
/* Bottom-aligned so tiles sharing a row share a baseline. Once
   they stack full-width that baseline is meaningless and the
   reserved height reads as a hole, so it goes. */
.tile--award { gap: 9px; min-height: 172px; align-content: end; }
@media (max-width: 620px) {
  .tile--award { min-height: 0; align-content: start; }
}
.award__result {
  font: 500 var(--fs-micro)/1 var(--font-mono);
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--accent);
}
.tile--award .prose { font-size: var(--fs-sm); }
.tile--award .tile__title { font-size: clamp(1.2rem, 1rem + 0.8vw, 1.7rem); }

/* ═══ CONTACT ══════════════════════════════════════════════ */
.tile--cta {
  padding: clamp(28px, 4vw, 56px);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 140% at 88% 8%, var(--accent-soft), transparent 60%),
    var(--bg-1);
  gap: 0; justify-items: start;
}
.tile--cta .tag { margin-bottom: 20px; }
.cta__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.2rem, 1.1rem + 4.6vw, 5.4rem);
  line-height: 0.87; letter-spacing: -0.048em; text-transform: uppercase;
  max-width: 13ch; margin-bottom: 20px;
}
.cta__sub { max-width: 44ch; color: var(--ink-2); font-size: var(--fs-lede); }

.tile--link {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 4px 16px;
  padding-block: 22px;
}
.link__k {
  grid-area: 1 / 1;
  font: 500 var(--fs-micro)/1 var(--font-mono);
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3);
}
.link__v {
  grid-area: 2 / 1;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.3rem);
  letter-spacing: -0.022em;
  overflow-wrap: anywhere;
}
.tile--link i {
  grid-area: 1 / 2 / 3 / 3;
  width: 10px; height: 10px;
  border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor;
  transform: rotate(45deg); color: var(--ink-3);
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
}
.tile--link:hover { border-color: var(--accent); background: var(--accent-soft); }
.tile--link:hover i { transform: rotate(45deg) translate(3px, -3px); color: var(--accent); }

/* ═══ DEBUG — press G to see the tile boundaries ═══════════ */
html.show-grid .tile { outline: 1px dashed var(--accent); outline-offset: -1px; }
html.show-grid .grid { background: var(--accent-soft); }
