/* ============================================================
   Shanmuganathan Raman — academic site
   Design system: "Plasma" — a scientific-colormap identity.
   Soft cool-violet paper, deep violet->magenta accent, and the
   plasma colormap (familiar from vision/ML figures) as signature.
   Fonts (loaded in <head>): Space Grotesk / Inter / IBM Plex Mono.
   ============================================================ */

:root {
  --bg:        #f2f0f9;   /* soft cool-violet paper */
  --bg-2:      #ece9f6;
  --surface:   #ffffff;
  --surface-2: #faf9fd;
  --ink:       #181420;   /* plum-black */
  --ink-2:     #3c3550;
  --muted:     #726b85;
  --line:      #e4e0ef;
  --line-2:    #efecf7;

  /* plasma-derived accent ramp */
  --accent:      #7d1ba0;   /* deep plasma violet (links/markers) */
  --accent-2:    #c0298a;   /* magenta */
  --accent-hot:  #f1820c;   /* plasma amber (hover/highlight) */
  --accent-soft: #f3e6fb;   /* violet wash */

  --grad:     linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --plasma:   linear-gradient(90deg,
                #0d0887 0%, #4b03a4 16%, #7d03a8 32%, #a82296 48%,
                #cb4679 62%, #e56b5d 74%, #f89441 86%, #fdc527 95%, #f0f921 100%);

  --maxw: 1080px;
  --radius: 14px;
  --shadow:   0 1px 2px rgba(24,20,32,0.04), 0 8px 24px -12px rgba(76,40,110,0.18);
  --shadow-sm:0 1px 2px rgba(24,20,32,0.05), 0 4px 14px -10px rgba(76,40,110,0.20);

  --ff-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --ff-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ff-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(900px 520px at 88% -8%, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(640px 440px at -6% 6%, rgba(241,130,12,0.07) 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- plasma signature ramp ---------- */
.ramp {
  height: 5px; width: 100%; border-radius: 4px;
  background: var(--plasma);
  box-shadow: 0 1px 10px -2px rgba(125,3,168,0.35);
}
.ramp--thin { height: 3px; border-radius: 0; box-shadow: none; }

/* ============================================================
   Navigation
   ============================================================ */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(242,240,249,0.82);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 15px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.brand {
  font-family: var(--ff-display);
  font-weight: 600; font-size: 1.08rem; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 10px;
}
.brand__dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.brand__sub {
  font-family: var(--ff-mono); font-size: 0.64rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
}
.nav-links { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }
.nav-links a {
  font-family: var(--ff-mono);
  font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-2); text-decoration: none;
  padding: 8px 12px; border-radius: 8px; position: relative;
  transition: color .16s ease, background .16s ease;
}
.nav-links a:hover { color: var(--ink); background: var(--surface); }
.nav-links a.current { color: var(--accent); background: var(--surface); }
.nav-links a.current::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px;
  height: 2px; background: var(--grad); border-radius: 2px;
}

/* ============================================================
   Hero (home)
   ============================================================ */
.hero { padding: 72px 0 14px; }
.hero__grid {
  display: grid; grid-template-columns: 1fr 230px; gap: 52px; align-items: center;
}
.eyebrow {
  font-family: var(--ff-mono); font-size: 0.72rem; letter-spacing: 0.2em;
  text-transform: uppercase; margin: 0 0 20px;
  display: flex; align-items: center; gap: 12px;
  color: var(--accent); font-weight: 500;
}
.eyebrow::before {
  content: ""; width: 30px; height: 3px; border-radius: 3px; background: var(--grad);
}
.hero__name {
  font-family: var(--ff-display);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.0;
  font-size: clamp(2.6rem, 6.4vw, 4.3rem);
  margin: 0 0 10px; color: var(--ink);
}
.hero__link { color: inherit; text-decoration: none; }
.hero__link:hover {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero__email {
  font-family: var(--ff-mono); font-size: 0.85rem; color: var(--muted);
  margin: 0 0 28px;
}
.hero__email a { color: var(--accent); text-decoration: none; }
.hero__email a:hover { color: var(--accent-hot); }

.roles { margin: 0 0 24px; }
.roles p { margin: 0 0 4px; }
.roles .role-title { font-weight: 600; color: var(--ink); }
.roles .role-org { color: var(--ink-2); }
.roles a { color: var(--accent); text-decoration: none; }
.roles a:hover { color: var(--accent-hot); text-decoration: underline; text-underline-offset: 2px; }

.contact {
  font-size: 0.9rem; color: var(--muted); line-height: 1.75; font-style: normal;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-image: var(--grad) 1; border-image-slice: 1;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px; box-shadow: var(--shadow-sm);
}
.contact a { color: var(--accent); text-decoration: none; }
.contact a:hover { color: var(--accent-hot); text-decoration: underline; }
.contact .mono { font-family: var(--ff-mono); font-size: 0.82rem; }

.portrait {
  width: 230px; height: 230px; border-radius: var(--radius);
  object-fit: cover; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.portrait-fallback {
  width: 230px; height: 230px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(130% 130% at 80% 14%, var(--accent-soft) 0%, transparent 55%),
    var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  font-family: var(--ff-display); font-weight: 700; font-size: 3.8rem;
  letter-spacing: -0.03em;
  background-image: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero__ramp { margin-top: 46px; }

/* ============================================================
   Page header (sub-pages)
   ============================================================ */
.page-head { padding: 64px 0 6px; }
.page-head h1 {
  font-family: var(--ff-display); font-weight: 700; letter-spacing: -0.03em;
  font-size: clamp(2.3rem, 5.2vw, 3.4rem); margin: 8px 0 10px; color: var(--ink);
}
.page-head .sub { color: var(--muted); max-width: 62ch; margin: 0; }
.page-head .sub a { color: var(--accent); text-decoration: none; }
.page-head .sub a:hover { color: var(--accent-hot); text-decoration: underline; }
.page-head__ramp { margin-top: 30px; }

/* ============================================================
   Content / prose
   ============================================================ */
.content { padding: 12px 0 96px; }
.prose { max-width: 100%; }

.prose h2 {
  font-family: var(--ff-display);
  font-weight: 600; font-size: 1.55rem; letter-spacing: -0.02em;
  color: var(--ink); margin: 58px 0 20px;
  padding-top: 26px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 13px;
}
.prose h2:first-of-type { margin-top: 18px; }
.prose h2::before {
  content: ""; flex: 0 0 auto; width: 12px; height: 12px;
  background: var(--grad); border-radius: 4px;
  box-shadow: 0 2px 8px -2px rgba(125,3,168,0.5);
}
.prose h3 {
  font-family: var(--ff-display);
  font-weight: 500; font-size: 1.1rem; letter-spacing: -0.01em;
  color: var(--accent); margin: 32px 0 14px;
  display: inline-flex; align-items: center; gap: 9px;
}
.prose h3::before {
  content: ""; width: 16px; height: 2px; border-radius: 2px;
  background: var(--accent-2); opacity: 0.7;
}
.prose h4 {
  font-family: var(--ff-display); font-weight: 500; font-size: 1.12rem;
  color: var(--ink); margin: 0;
}
.prose p { margin: 0 0 14px; color: var(--ink-2); }
.prose a {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  transition: color .14s, border-color .14s;
}
.prose a:hover { color: var(--accent-hot); border-bottom-color: var(--accent-hot); }

/* generic bullet lists */
.prose ul { list-style: none; padding: 0; margin: 0 0 14px; }
.prose ul > li { position: relative; padding-left: 22px; margin-bottom: 10px; color: var(--ink-2); }
.prose ul > li::before {
  content: ""; position: absolute; left: 2px; top: 0.66em;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--grad);
}
.prose ul > li p { margin: 0; }

/* numbered (ordered) lists -> elevated cards with mono counters */
.prose ol {
  list-style: none; counter-reset: item; padding: 0; margin: 0 0 14px;
}
.prose ol > li {
  counter-increment: item; position: relative;
  padding: 16px 18px 16px 58px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.prose ol > li:hover {
  transform: translateY(-1px);
  border-color: #d9cfe9;
  box-shadow: 0 2px 4px rgba(24,20,32,0.05), 0 14px 30px -16px rgba(76,40,110,0.30);
}
.prose ol > li::before {
  content: counter(item, decimal-leading-zero);
  position: absolute; left: 18px; top: 17px;
  font-family: var(--ff-mono); font-size: 0.74rem; font-weight: 500;
  color: var(--accent); letter-spacing: 0.02em;
}
.prose ol > li p { margin: 0; color: var(--ink-2); line-height: 1.56; }

/* interests page: calm gradient-numbered cards */
.interest-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 10px;
}
.interest-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 24px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.interest-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(24,20,32,0.05), 0 18px 36px -18px rgba(76,40,110,0.32);
}
.interest-card .idx {
  font-family: var(--ff-mono); font-size: 1.05rem; font-weight: 500;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.site-footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 24px 36px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--ff-mono); font-size: 0.72rem; letter-spacing: 0.04em;
  color: var(--muted);
}
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { color: var(--accent-hot); text-decoration: underline; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  .hero { padding: 44px 0 10px; }
  .hero__grid { grid-template-columns: 1fr; gap: 30px; }
  .portrait, .portrait-fallback { width: 160px; height: 160px; }
  .portrait-fallback { font-size: 2.6rem; }
  .interest-grid { grid-template-columns: 1fr; }
  .site-nav__inner { padding: 12px 18px; }
  .nav-links a { padding: 7px 9px; }
}

/* ============================================================
   Accessibility
   ============================================================ */
a:focus-visible, .brand:focus-visible {
  outline: 2px solid var(--accent-hot); outline-offset: 3px; border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  .site-nav, .site-footer, .ramp, .hero__ramp, .page-head__ramp { display: none; }
  body { background: #fff; }
  .prose ol > li { box-shadow: none; border-color: #ddd; }
  .prose a { color: var(--ink); border-bottom: none; }
}
