/* =========================================================
   Ritul Kumawat — Editorial Minimal
   Warm paper background · near-black ink · one accent
   ========================================================= */

:root {
  --paper:      #f7f4ee;
  --paper-2:    #efeae1;
  --ink:        #14110d;
  --ink-soft:   #4a453d;
  --ink-faint:  #8b8578;
  --accent:     #b4431f;   /* burnt terracotta */
  --line:       #ddd6c9;
  --max:        1080px;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;          /* safety net against horizontal scroll on mobile */
}
img { max-width: 100%; }        /* never let an image force horizontal overflow */

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

a { color: inherit; text-decoration: none; }

/* ---------------- Layout helpers ---------------- */
.hero, .stats, .section, .footer { max-width: var(--max); margin-inline: auto; padding-inline: 24px; }

/* ---------------- Nav ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin-inline: auto;
  padding: 18px 24px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
}
.nav__brand { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; letter-spacing: -0.01em; }
.nav__links { display: flex; gap: 26px; }
.nav__links a {
  font-size: 0.92rem;
  color: var(--ink-soft);
  position: relative;
  transition: color 0.2s ease;
}
.nav__links a::after {
  content: "";
  position: absolute; left: 0; bottom: -4px;
  width: 0; height: 1px; background: var(--accent);
  transition: width 0.25s ease;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }

@media (max-width: 620px) { .nav__links { gap: 16px; } .nav__links a { font-size: 0.82rem; } }
@media (max-width: 460px) {
  .nav { padding: 14px 16px; }
  .nav__brand { font-size: 1rem; }
  .nav__links { gap: 13px; }
  .nav__links a { font-size: 0.78rem; }
}

/* ---------------- Hero ---------------- */
.hero {
  padding-top: 88px;
  padding-bottom: 64px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero__portrait { justify-self: end; }
.hero__portrait img {
  width: 100%;
  max-width: 340px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  filter: grayscale(12%) contrast(1.02);
  box-shadow: 0 20px 50px -20px rgba(20, 17, 13, 0.35);
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .hero__portrait { justify-self: start; order: -1; }
  .hero__portrait img { max-width: 180px; }
}
.hero__eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 22px;
}
.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.9rem, 8vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 30px;
}
.hero__lede {
  max-width: 640px;
  font-size: clamp(1.05rem, 2.4vw, 1.28rem);
  color: var(--ink-soft);
  line-height: 1.6;
}
.hero__lede strong { color: var(--ink); font-weight: 600; }
.hero__note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink);
}
.hero__rule { display: inline-block; width: 46px; height: 1px; background: var(--accent); }
.hero__note a { color: var(--accent); font-style: normal; border-bottom: 1px solid transparent; transition: border-color 0.2s ease; }
.hero__note a:hover { border-color: var(--accent); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-block;
  padding: 13px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 2px;
  transition: transform 0.18s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--accent); transform: translateY(-2px); }
.btn--ghost { border: 1px solid var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

/* ---------------- Stats ---------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-top: 40px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat__num { font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1; color: var(--accent); }
.stat__label { font-size: 0.86rem; color: var(--ink-soft); }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); gap: 28px; } }

/* ---------------- Section ---------------- */
.section { padding-top: 96px; padding-bottom: 20px; }
.section__kicker {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 14px;
}
.section__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 40px;
}

/* ---------------- Prose ---------------- */
.prose { max-width: 680px; }
.prose p { margin-bottom: 22px; font-size: 1.08rem; color: var(--ink-soft); }
.prose strong { color: var(--ink); font-weight: 600; }

/* ---------------- Story timeline ---------------- */
.story { position: relative; }
.story__chapters { list-style: none; }

/* the vertical spine + scroll-driven fill; sits under the dots */
.story__track {
  position: absolute;
  left: 139px;                /* aligns with the dot column */
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--line);
}
.story__progress {
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  height: 0;                  /* set live via JS as you scroll */
  background: var(--accent);
  transition: height 0.1s linear;
}

.chapter {
  position: relative;
  display: grid;
  grid-template-columns: 120px 1fr;
  column-gap: 56px;
  padding-bottom: 54px;
  /* reveal state */
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.chapter:last-child { padding-bottom: 0; }
.chapter.is-visible { opacity: 1; transform: none; }

/* dot sitting on the spine, aligned to each chapter */
.chapter::before {
  content: "";
  position: absolute;
  left: 140px;
  top: 8px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink-faint);
  transform: translate(-50%, 0) scale(0.7);
  transition: transform 0.4s ease, background 0.4s ease, border-color 0.4s ease;
  z-index: 2;
}
.chapter.is-visible::before {
  background: var(--accent);
  border-color: var(--accent);
  transform: translate(-50%, 0) scale(1);
}

.chapter__aside {
  text-align: right;
  padding-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chapter__age {
  font-family: var(--serif);
  font-size: 1.7rem;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.chapter__tag {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.chapter__body { padding-top: 2px; }
.chapter__title {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.chapter__body p { color: var(--ink-soft); font-size: 1.03rem; max-width: 620px; }
.chapter__body strong { color: var(--ink); font-weight: 600; }

@media (max-width: 720px) {
  .story__track { left: 7px; }
  .chapter {
    grid-template-columns: 1fr;
    column-gap: 0;
    padding-left: 34px;
    padding-bottom: 40px;
  }
  .chapter::before { left: 7px; top: 6px; }
  .chapter__aside {
    text-align: left;
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
  }
  .chapter__age { font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .chapter { opacity: 1; transform: none; transition: none; }
  .chapter::before { transform: translate(-50%, 0) scale(1); }
  .story__progress { transition: none; }
}

/* ---------------- Timeline ---------------- */
.timeline { list-style: none; border-top: 1px solid var(--line); }
.entry {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}
.entry__meta { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.entry__date { font-size: 0.9rem; font-weight: 500; color: var(--ink); }
.entry__place { font-size: 0.82rem; color: var(--ink-faint); }
.entry__role { font-family: var(--serif); font-size: 1.4rem; font-weight: 500; letter-spacing: -0.01em; }
.entry__org { color: var(--accent); font-weight: 500; margin: 2px 0 12px; font-size: 0.98rem; }
.entry__desc { color: var(--ink-soft); max-width: 620px; }
.entry__points { list-style: none; display: flex; flex-direction: column; gap: 9px; max-width: 640px; }
.entry__points li { position: relative; padding-left: 20px; color: var(--ink-soft); font-size: 0.98rem; }
.entry__points li::before { content: ""; position: absolute; left: 0; top: 11px; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.entry__points strong, .entry__desc strong { color: var(--ink); font-weight: 600; }
@media (max-width: 720px) { .entry { grid-template-columns: 1fr; gap: 12px; } }

.entry__desc { color: var(--ink-soft); max-width: 640px; font-size: 0.99rem; }
.entry__desc em { font-style: italic; }

/* ---------------- College / IIT Delhi (lighter, secondary) ---------------- */
/* subgrid keeps title / role / description rows aligned across all columns
   even when one item's text wraps to more lines than the others. */
.college-list {
  list-style: none;
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 22px;
  row-gap: 0;
}
.college-item {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  row-gap: 10px;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}
.college-item__title { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; margin: 0; }
.college-item__role { font-size: 0.8rem; line-height: 1.4; color: var(--ink-faint); margin: 0; align-self: start; }
.college-item__desc { font-size: 0.92rem; color: var(--ink-soft); margin: 0; }
@media (max-width: 980px) and (min-width: 561px) {
  .college-list { grid-template-columns: repeat(2, 1fr); row-gap: 24px; }
}
@media (max-width: 560px) {
  .college-list { grid-template-columns: 1fr; }
  .college-item { grid-template-rows: none; grid-row: auto; margin-bottom: 8px; }
}

/* ---------------- Photo gallery ---------------- */
.gallery {
  margin-top: 52px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.gallery__item { margin: 0; }
.gallery__item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  background: var(--paper-2);
  filter: grayscale(12%) contrast(1.02);
  transition: transform 0.35s ease, filter 0.35s ease;
}
.gallery__item:hover img { transform: translateY(-4px); filter: grayscale(0%) contrast(1.03); }

/* graceful placeholder when a photo file isn't present yet */
.gallery__item.is-empty img { display: none; }
.gallery__item.is-empty::before {
  content: "Photo coming soon";
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  background: var(--paper-2);
  border: 1px dashed var(--line);
  color: var(--ink-faint);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.gallery__item figcaption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--ink-faint);
}
@media (max-width: 640px) { .gallery { grid-template-columns: 1fr; gap: 24px; } }

/* ---------------- Cards ---------------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-2);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--ink); }
.card__title { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; margin-bottom: 12px; letter-spacing: -0.01em; }
.card__desc { color: var(--ink-soft); font-size: 0.98rem; margin-bottom: 16px; }
.card__desc strong { color: var(--ink); }
.card__tags { font-size: 0.82rem; letter-spacing: 0.04em; color: var(--accent); font-weight: 500; }
.card__link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: color 0.2s ease;
}
.card__link:hover { color: var(--accent); }

/* featured card, centered on its own row below the top two */
.card--center {
  grid-column: 1 / -1;
  max-width: calc(50% - 10px);
  margin-inline: auto;
}
@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr; }
  .card--center { grid-column: auto; max-width: none; }
}

/* ---------------- Contact ---------------- */
.section--contact { padding-bottom: 40px; }
.contact__lede { max-width: 560px; color: var(--ink-soft); font-size: 1.1rem; margin-bottom: 30px; }
.contact__links { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------------- Footer ---------------- */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 40px;
  padding-bottom: 40px;
  margin-top: 60px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.88rem;
}
.footer__top { color: var(--ink-soft); }
.footer__top:hover { color: var(--accent); }

/* ---------------- Reveal animation ---------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .card:hover { transform: none; }
}
