/* ==========================================================
   Shreya Jha — personal academic site
   Colors live at the top; change them here to restyle the site.
   ========================================================== */

:root {
  --bg:          #f6eee1;   /* cream */
  --surface:     #fcf7ee;
  --tint:        #f2e2e2;   /* soft rose */
  --text:        #2a1d22;
  --muted:       #6f5c63;
  --line:        #e6d6cc;
  --accent:      #7b2142;   /* burgundy */
  --accent-2:    #a8336a;   /* mature magenta */
  --accent-soft: #f1dbe3;

  --serif: "EB Garamond", Garamond, Georgia, "Times New Roman", serif;
  --sans:  "Source Sans 3", -apple-system, "Segoe UI", Roboto, sans-serif;
  --max:   1040px;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #321620; --surface: #3e1d28; --tint: #472431; --text: #f6ebef;
    --muted: #cdb2bd; --line: #57303e; --accent: #f0afc6; --accent-2: #f58cb9;
    --accent-soft: #532a39; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #321620; --surface: #3e1d28; --tint: #472431; --text: #f6ebef;
  --muted: #cdb2bd; --line: #57303e; --accent: #f0afc6; --accent-2: #f58cb9;
  --accent-soft: #532a39; color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 18px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; margin: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.wordmark {
  font-family: var(--serif); font-size: 1.4rem; font-weight: 500;
  color: var(--text); text-decoration: none;
}
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.97rem; font-weight: 500; }
.nav a:hover { color: var(--accent); }
.theme-toggle {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* ---------- Hero / About ---------- */
.hero {
  display: grid; grid-template-columns: 300px 1fr; gap: 56px;
  padding-top: 72px; padding-bottom: 32px; align-items: start;
}
.portrait { margin: 0; position: relative; }
.portrait::before {
  content: ""; position: absolute; inset: 14px -14px -14px 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  opacity: 0.9;
}
.portrait img {
  position: relative; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius);
}
.eyebrow {
  margin: 4px 0 10px; font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-2);
}
h1 { font-size: clamp(2.9rem, 6.5vw, 4rem); font-weight: 500; letter-spacing: -0.01em; }
.affil { margin: 8px 0 22px; color: var(--muted); font-size: 1.05rem; }

.links { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0 0 28px; }
.links a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text); text-decoration: none; font-size: 0.93rem; font-weight: 500;
  transition: border-color .15s, color .15s;
}
.links a:hover { border-color: var(--accent); color: var(--accent); }
.links svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.bio p { margin: 0 0 14px; max-width: 62ch; }

/* ---------- Sections ---------- */
.block { padding-top: 56px; padding-bottom: 8px; }
.section-title {
  display: flex; align-items: center; gap: 16px;
  font-size: 2rem; margin-bottom: 24px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-note { margin: -12px 0 20px; color: var(--muted); font-size: 0.92rem; }

/* News */
.news { list-style: none; padding: 0; margin: 0; }
.news li { display: grid; grid-template-columns: 76px 1fr; gap: 16px; padding: 7px 0; }
.news .date { font-family: var(--serif); font-size: 1.08rem; color: var(--accent-2); font-variant-numeric: tabular-nums; }

/* Publications */
.pubs { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.pub {
  display: grid; grid-template-columns: 120px 1fr; gap: 20px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.pub:last-child { border-bottom: 0; }
.venue {
  align-self: start; justify-self: start;
  padding: 3px 10px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid var(--accent-soft); color: var(--accent); background: transparent;
  white-space: nowrap;
}
.venue-main { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.pub h3 { font-size: 1.25rem; font-weight: 500; margin-bottom: 4px; }
.authors { margin: 0; color: var(--muted); font-size: 0.97rem; }
.authors b { color: var(--text); font-weight: 600; }
.pub-links { margin: 4px 0 0; font-size: 0.93rem; }

/* Projects */
.projects { display: grid; grid-template-columns: 1fr; gap: 18px; }
.project {
  display: grid; grid-template-columns: 200px 1fr; align-items: stretch;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.project:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -18px color-mix(in srgb, var(--accent) 60%, transparent); }
.media { aspect-ratio: 1 / 1; align-self: start; background: var(--tint); position: relative; overflow: hidden; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media a { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.media a img { background: #fff; }
.media-video { background: #12101a; }
.media-plot { background: #fff; }
.media video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Placeholder shown until a figure is added */
.media.is-empty img { display: none; }
.media.is-empty {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -60 400 400' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%23a8336a' stroke-opacity='.28' stroke-width='1.4'%3E%3Cpath d='M0 150C60 110 90 190 150 140S250 90 300 130 370 170 400 120'/%3E%3Cpath d='M0 165C55 130 95 205 155 158S245 105 305 148 365 190 400 140'/%3E%3Cpath d='M0 135C65 95 85 170 145 125S255 75 295 112 375 150 400 100'/%3E%3Cpath d='M0 180C50 150 100 215 160 175S240 125 310 165 360 205 400 160'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat,
    linear-gradient(135deg, var(--tint), var(--accent-soft));
}
.media.is-empty::after {
  content: attr(data-label);
  position: absolute; left: 12px; bottom: 8px;
  font-family: var(--serif); font-style: italic; font-size: 0.95rem; color: var(--accent);
}

.project-body { padding: 12px 22px 12px; display: flex; flex-direction: column; }
.kicker { margin: 0 0 2px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-2); }
.project h3 { font-size: 1.35rem; margin-bottom: 4px; }
.project-body p { margin: 0 0 6px; font-size: 0.95rem; line-height: 1.55; }
.project-links { margin-top: auto !important; font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 80px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; padding: 24px; color: var(--muted); font-size: 0.88rem; }

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 40px; }
  .portrait { max-width: 260px; }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .block { padding-top: 44px; }
  .nav { gap: 14px; }
  .nav a[href="#publications"] { display: none; }
  .pub { grid-template-columns: 1fr; gap: 8px; }
  .project { grid-template-columns: 1fr; }
  .media { aspect-ratio: 1 / 1; height: auto; }
  .news li { grid-template-columns: 56px 1fr; }
  .footer-inner { flex-direction: column; gap: 4px; padding: 20px 16px; }
}
