/* ==========================================================================
   K. Shanti Swarup — academic profile
   Single stylesheet. No framework, no build step.

   Palette and type are deliberately restrained: this page has to read as an
   institutional record, not a personal portfolio. Colour is used to encode
   meaning (maroon = section marker, gold = hairline accent) and nowhere else.
   ========================================================================== */

:root{
  /* Ink */
  --navy-900:#0e1a2b;   /* headings */
  --navy-700:#1c3050;   /* sub-headings, links */
  --ink:#28323f;        /* body copy */
  --muted:#5d6b7e;      /* secondary copy */
  --faint:#8593a5;      /* captions, metadata */

  /* Accents — used sparingly */
  --maroon:#8a1a2c;
  --maroon-dark:#6d1523;
  --gold:#a8842c;

  /* Surfaces */
  --bg:#ffffff;
  --bg-tint:#f6f7f9;
  --bg-deep:#0e1a2b;
  --rule:#dfe3ea;
  --rule-soft:#eceff4;

  /* Type */
  --serif:'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans:'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* Rhythm */
  --wrap:1120px;
  --wrap-narrow:760px;
  --pad:clamp(20px, 5vw, 48px);
  --section-y:clamp(56px, 8vw, 96px);
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--sans);
  font-size:16.5px;
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

img{max-width:100%;height:auto;display:block}

/* --- Links -------------------------------------------------------------- */
a{color:var(--navy-700);text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px;text-decoration-color:#b9c3d1}
a:hover{color:var(--maroon);text-decoration-color:currentColor}

/* Visible focus everywhere — keyboard users must never lose their place. */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,
[tabindex]:focus-visible{
  outline:2px solid var(--maroon);
  outline-offset:3px;
  border-radius:2px;
}

.skip-link{
  position:absolute;left:-9999px;top:0;z-index:200;
  background:var(--navy-900);color:#fff;padding:12px 18px;
  text-decoration:none;font-size:14px;font-weight:600;
}
.skip-link:focus{left:8px;top:8px}

/* --- Layout ------------------------------------------------------------- */
.wrap{max-width:var(--wrap);margin:0 auto;padding-inline:var(--pad)}
.wrap-narrow{max-width:var(--wrap-narrow);margin:0 auto;padding-inline:var(--pad)}
.section{padding-block:var(--section-y)}
.section--tint{background:var(--bg-tint);border-block:1px solid var(--rule-soft)}

/* --- Typography --------------------------------------------------------- */
h1,h2,h3,h4{font-family:var(--serif);color:var(--navy-900);font-weight:600;line-height:1.2;margin:0}
h1{font-size:clamp(30px,4.6vw,50px);letter-spacing:-.015em}
h2{font-size:clamp(24px,3vw,33px);letter-spacing:-.01em}
h3{font-size:clamp(18px,2vw,21px)}
h4{font-size:16.5px}
p{margin:0 0 1.05em}
p:last-child{margin-bottom:0}

.lede{font-size:clamp(17px,1.6vw,19.5px);color:var(--muted);line-height:1.7}

/* The eyebrow encodes the section's place in the record, not decoration. */
.eyebrow{
  display:block;
  font-family:var(--sans);
  font-size:11.5px;font-weight:600;
  letter-spacing:.14em;text-transform:uppercase;
  color:var(--maroon);
  margin-bottom:12px;
}
.section-head{margin-bottom:clamp(28px,4vw,44px);max-width:70ch}
.section-head p{color:var(--muted);margin-top:12px}

/* Gold hairline: the one ornamental flourish on the page. */
.rule-gold{width:52px;height:2px;background:var(--gold);border:0;margin:18px 0 0}

/* --- Header / navigation ------------------------------------------------ */
.site-header{
  position:sticky;top:0;z-index:100;
  background:rgba(255,255,255,.94);
  backdrop-filter:saturate(140%) blur(8px);
  border-bottom:1px solid var(--rule);
}
.header-inner{
  max-width:var(--wrap);margin:0 auto;padding:0 var(--pad);
  display:flex;align-items:center;gap:20px;min-height:66px;
}
.brand{
  flex:0 0 auto;
  display:flex;flex-direction:column;
  text-decoration:none;color:var(--navy-900);
  padding-block:10px;line-height:1.25;
}
.brand:hover{color:var(--maroon)}
.brand-name{font-family:var(--serif);font-size:18px;font-weight:600;letter-spacing:-.01em}
.brand-sub{font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--faint);font-weight:600;white-space:nowrap}

.nav{margin-left:auto}
.nav-list{display:flex;flex-wrap:nowrap;align-items:center;gap:2px;list-style:none;margin:0;padding:0}
.nav-list a{
  display:block;padding:9px 11px;border-radius:5px;
  font-size:14px;font-weight:500;color:var(--ink);
  text-decoration:none;white-space:nowrap;
  transition:background .15s ease, color .15s ease;
}
.nav-list a:hover{background:var(--bg-tint);color:var(--maroon)}
.nav-list a[aria-current="page"]{color:var(--maroon);font-weight:600;box-shadow:inset 0 -2px 0 var(--maroon)}

.nav-toggle{
  display:none;margin-left:auto;
  background:transparent;border:1px solid var(--rule);border-radius:6px;
  padding:8px 12px;font:inherit;font-size:13px;font-weight:600;
  color:var(--navy-900);cursor:pointer;align-items:center;gap:8px;
}
.nav-toggle:hover{border-color:var(--faint)}
.nav-toggle svg{display:block}

/* --- Hero --------------------------------------------------------------- */
.hero{padding-block:clamp(44px,7vw,84px) clamp(40px,6vw,72px)}
.hero-grid{display:grid;grid-template-columns:minmax(0,1fr) 232px;gap:clamp(28px,5vw,64px);align-items:start}

/* Nameplate: maroon rule + serif name. This is the page's signature. */
.nameplate{border-left:3px solid var(--maroon);padding-left:clamp(18px,2.5vw,28px)}
.nameplate h1{margin-bottom:10px}
.nameplate .title{font-size:17px;font-weight:600;color:var(--navy-700);margin:0}
.nameplate .affil{font-size:15.5px;color:var(--muted);margin:2px 0 0}
.hero-intro{margin-top:26px;max-width:62ch}

.portrait{
  width:100%;                     /* grid item was shrink-to-fit without this */
  border:1px solid var(--rule);
  padding:7px;background:#fff;
  border-radius:2px;
}
.portrait img{width:100%;height:auto}
.portrait img{border-radius:1px}
.portrait figcaption{font-size:11.5px;color:var(--faint);margin-top:8px;line-height:1.45}

.hero-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:30px}

/* --- Buttons ------------------------------------------------------------ */
.btn{
  display:inline-flex;align-items:center;gap:8px;
  font-family:var(--sans);font-size:14.5px;font-weight:600;
  padding:11px 20px;border-radius:4px;text-decoration:none;
  border:1px solid transparent;cursor:pointer;
  transition:background .16s ease,border-color .16s ease,color .16s ease;
}
.btn-primary{background:var(--maroon);color:#fff;border-color:var(--maroon)}
.btn-primary:hover{background:var(--maroon-dark);border-color:var(--maroon-dark);color:#fff}
.btn-ghost{background:#fff;color:var(--navy-900);border-color:var(--rule)}
.btn-ghost:hover{border-color:var(--navy-700);color:var(--maroon);background:#fff}

/* --- Facts strip -------------------------------------------------------- */
.facts{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  border:1px solid var(--rule);border-radius:3px;background:#fff;overflow:hidden;
}
.fact{padding:20px 22px;border-right:1px solid var(--rule-soft)}
.fact:last-child{border-right:none}
.fact dt{font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--faint);font-weight:600;margin-bottom:6px}
.fact dd{margin:0;font-family:var(--serif);font-size:18px;color:var(--navy-900);line-height:1.35}
.fact dd span{display:block;font-family:var(--sans);font-size:13px;color:var(--muted);margin-top:3px}

/* --- Cards -------------------------------------------------------------- */
.card-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.card{
  background:#fff;border:1px solid var(--rule);border-radius:3px;
  padding:22px 24px;
  transition:border-color .18s ease, box-shadow .18s ease;
}
.card:hover{border-color:#c6cede;box-shadow:0 2px 14px rgba(14,26,43,.055)}
.card h3{margin-bottom:8px}
.card p{font-size:14.5px;color:var(--muted);margin:0}
.card .card-meta{font-family:var(--mono);font-size:12px;color:var(--gold);letter-spacing:.02em;margin-bottom:10px;display:block}

/* Research-area groups */
.area-group{border-top:1px solid var(--rule);padding-top:22px;margin-top:26px}
.area-group:first-of-type{margin-top:0}
.area-group h3{margin-bottom:14px}
.area-list{display:flex;flex-wrap:wrap;gap:8px;list-style:none;padding:0;margin:0}
.area-list li{
  border:1px solid var(--rule);border-radius:2px;
  padding:7px 13px;font-size:14px;color:var(--navy-700);background:#fff;
}

/* --- Definition/record lists -------------------------------------------- */
.record{border-top:1px solid var(--rule);margin:0}
.record-row{
  display:grid;grid-template-columns:150px minmax(0,1fr);
  gap:8px 28px;
  padding:16px 0;border-bottom:1px solid var(--rule-soft);
}
.record-key{font-family:var(--mono);font-size:12.5px;color:var(--faint);letter-spacing:.03em;padding-top:3px}
.record-val{margin:0}
.record-val strong{color:var(--navy-900);font-weight:600}
.record-val .sub{display:block;font-size:14px;color:var(--muted);margin-top:2px}

/* --- Timeline ----------------------------------------------------------- */
.timeline{list-style:none;margin:0;padding:0;border-left:1px solid var(--rule);margin-left:6px}
.timeline li{position:relative;padding:0 0 26px 26px}
.timeline li:last-child{padding-bottom:0}
.timeline li::before{
  content:"";position:absolute;left:-4.5px;top:9px;
  width:8px;height:8px;border-radius:50%;
  background:#fff;border:2px solid var(--maroon);
}
.timeline .t-years{font-family:var(--mono);font-size:12.5px;color:var(--gold);letter-spacing:.03em}
.timeline .t-role{font-family:var(--serif);font-size:18px;color:var(--navy-900);font-weight:600;margin:2px 0 1px}
.timeline .t-org{font-size:14.5px;color:var(--muted)}

/* --- Filters ------------------------------------------------------------ */
.filters{
  display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;
  padding:20px 22px;background:var(--bg-tint);
  border:1px solid var(--rule);border-radius:3px;margin-bottom:26px;
}
.field{display:flex;flex-direction:column;gap:6px;flex:1 1 200px;min-width:0}
.field label{font-size:11.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--faint);font-weight:600}
.field input,.field select{
  font:inherit;font-size:15px;color:var(--ink);
  padding:9px 12px;border:1px solid var(--rule);border-radius:3px;background:#fff;
  width:100%;
}
.field input:hover,.field select:hover{border-color:var(--faint)}
.result-count{font-size:13.5px;color:var(--muted);flex:0 0 auto;padding-bottom:10px}
.result-count strong{color:var(--navy-900);font-family:var(--mono);font-size:14px}

/* --- Publications ------------------------------------------------------- */
.year-block{margin-bottom:38px}
.year-head{
  display:flex;align-items:baseline;gap:14px;
  padding-bottom:8px;margin-bottom:4px;
  border-bottom:2px solid var(--navy-900);
}
.year-head h2{font-size:26px}
.year-head .year-count{font-family:var(--mono);font-size:12.5px;color:var(--faint)}

.pub{padding:18px 0;border-bottom:1px solid var(--rule-soft)}
.pub-authors{font-size:14.5px;color:var(--muted);margin:0 0 4px}
.pub-authors .self{color:var(--navy-900);font-weight:600}
.pub-title{font-family:var(--serif);font-size:18px;line-height:1.4;color:var(--navy-900);margin:0 0 6px;font-weight:600}
.pub-meta{font-size:14px;color:var(--muted);margin:0}
.pub-meta .journal{font-style:italic;color:var(--navy-700)}
.pub-doi{
  display:inline-flex;align-items:center;gap:6px;
  font-family:var(--mono);font-size:12.5px;
  margin-top:8px;text-decoration:none;
  color:var(--maroon);border:1px solid var(--rule);border-radius:2px;padding:4px 9px;
}
.pub-doi:hover{border-color:var(--maroon);background:#fdf7f8;color:var(--maroon-dark)}
.pub-doi svg{opacity:.65}

.empty-state{padding:38px 4px;text-align:center;color:var(--muted)}
.empty-state strong{display:block;font-family:var(--serif);font-size:19px;color:var(--navy-900);margin-bottom:6px}

/* --- Supervision table -------------------------------------------------- */
.sv-list{list-style:none;margin:0;padding:0;border-top:1px solid var(--rule)}
.sv-item{
  display:grid;grid-template-columns:76px minmax(0,1fr);
  gap:6px 24px;padding:16px 0;border-bottom:1px solid var(--rule-soft);
}
.sv-year{font-family:var(--mono);font-size:13px;color:var(--gold);padding-top:3px}
.sv-name{font-family:var(--serif);font-size:17px;color:var(--navy-900);font-weight:600;margin:0}
.sv-name .roll{font-family:var(--mono);font-size:12px;color:var(--faint);font-weight:400;margin-left:8px}
.sv-thesis{font-size:14.5px;color:var(--muted);margin:3px 0 0}
.sv-note{font-size:13px;color:var(--faint);font-style:italic;margin:4px 0 0}

/* --- Books -------------------------------------------------------------- */
.book{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;padding:20px 0;border-bottom:1px solid var(--rule-soft)}
.book h3{margin-bottom:4px}
.book .book-meta{font-size:14.5px;color:var(--muted)}

/* --- Profile links ------------------------------------------------------ */
.profile-list{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));list-style:none;padding:0;margin:0}
.profile-link{
  display:block;padding:18px 20px;background:#fff;
  border:1px solid var(--rule);border-radius:3px;text-decoration:none;
  transition:border-color .18s ease,box-shadow .18s ease;
}
.profile-link:hover{border-color:var(--maroon);box-shadow:0 2px 14px rgba(138,26,44,.07)}
.profile-link .pl-name{font-family:var(--serif);font-size:17px;font-weight:600;color:var(--navy-900);display:flex;align-items:center;gap:7px}
.profile-link .pl-desc{font-size:13.5px;color:var(--muted);margin-top:5px;display:block}
.profile-link:hover .pl-name{color:var(--maroon)}

/* --- Contact ------------------------------------------------------------ */
.contact-grid{display:grid;gap:clamp(24px,4vw,48px);grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}

/* --- Notice / caveat box ------------------------------------------------ */
.notice{
  border:1px solid var(--rule);border-left:3px solid var(--gold);
  background:var(--bg-tint);padding:16px 20px;border-radius:2px;
  font-size:14px;color:var(--muted);
}
.notice strong{color:var(--navy-900)}

/* --- Footer ------------------------------------------------------------- */
.site-footer{background:var(--bg-deep);color:#c3ccd9;padding-block:clamp(40px,6vw,60px) 28px;margin-top:0}
.footer-grid{display:grid;gap:32px;grid-template-columns:1.4fr 1fr 1fr}
.site-footer h2{color:#fff;font-size:19px;margin-bottom:4px}
.site-footer .f-title{font-size:14px;color:#9fb0c4;margin:0}
.site-footer h3{
  color:#fff;font-family:var(--sans);font-size:11.5px;font-weight:600;
  letter-spacing:.13em;text-transform:uppercase;margin-bottom:12px;
}
.site-footer ul{list-style:none;margin:0;padding:0}
.site-footer li{margin-bottom:8px}
.site-footer a{color:#c3ccd9;text-decoration:none;font-size:14.5px}
.site-footer a:hover{color:#fff;text-decoration:underline}
.footer-bottom{
  border-top:1px solid rgba(255,255,255,.13);
  margin-top:34px;padding-top:20px;
  display:flex;flex-wrap:wrap;gap:10px;justify-content:space-between;
  font-size:12.5px;color:#8496ab;
}

/* --- Responsive --------------------------------------------------------- */
@media (max-width:1180px){
  .nav-list a{padding:9px 8px;font-size:13.5px}
}

@media (max-width:1080px){
  .nav-toggle{display:inline-flex}
  .nav{
    display:none;
    position:absolute;left:0;right:0;top:100%;
    background:#fff;border-bottom:1px solid var(--rule);
    box-shadow:0 14px 28px rgba(14,26,43,.09);
    padding:8px var(--pad) 16px;
  }
  .nav.is-open{display:block}
  .nav-list{flex-direction:column;align-items:stretch;gap:0}
  .nav-list a{padding:13px 4px;border-bottom:1px solid var(--rule-soft);font-size:15.5px;border-radius:0}
  .nav-list a[aria-current="page"]{box-shadow:none;border-left:3px solid var(--maroon);padding-left:12px}
  .header-inner{position:relative}

  .hero-grid{grid-template-columns:1fr;gap:30px}
  .portrait{max-width:200px}
  .footer-grid{grid-template-columns:1fr 1fr}
}

@media (max-width:640px){
  body{font-size:16px}
  .record-row{grid-template-columns:1fr;gap:2px}
  .record-key{padding-top:0}
  .sv-item{grid-template-columns:1fr;gap:2px}
  .sv-year{padding-top:0}
  .fact{border-right:none;border-bottom:1px solid var(--rule-soft)}
  .fact:last-child{border-bottom:none}
  .filters{flex-direction:column;align-items:stretch}
  .result-count{padding-bottom:0}
  .footer-grid{grid-template-columns:1fr;gap:26px}
  .hero-actions .btn{flex:1 1 100%;justify-content:center}
}

@media (max-width:400px){
  .nameplate{padding-left:14px}
  .card{padding:18px 16px}
}

/* --- Print -------------------------------------------------------------- */
@media print{
  .site-header,.hero-actions,.filters,.site-footer,.skip-link{display:none}
  body{font-size:11pt;color:#000}
  a{color:#000;text-decoration:none}
  .pub-doi::after{content:" (" attr(href) ")";font-size:9pt}
}

/* --- Motion preference -------------------------------------------------- */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms !important;transition-duration:.001ms !important}
}

/* --- Research honeycomb -------------------------------------------------
   Rebuilt from the hexagonal diagram on the previous site. The cells
   interlock because odd columns are offset half a cell vertically; the
   geometry is generated in build.py, not hand-tuned here.

   Below 760px the labels would be too small to read, so the diagram is
   replaced by the plain list that screen readers use at every width.       */

.hex-figure{margin:0}

.honeycomb{
  display:block;
  width:100%;max-width:640px;height:auto;
  margin:0;                      /* left rail, same as the section heading */
  overflow:visible;
}
.honeycomb polygon{
  fill:#fff;
  stroke:#b4bfd0;
  stroke-width:1.4;
  transition:fill .2s ease, stroke .2s ease;
}
.honeycomb text{
  font-family:var(--sans);
  font-size:12.5px;
  font-weight:500;
  letter-spacing:.005em;
  fill:var(--navy-900);
  transition:fill .2s ease;
}
/* Hovering isolates one cell so the interlocking structure is legible.
   Deliberately no lift or shadow — these cells are not links, and motion
   that mimics a button would promise an interaction that does not exist. */
.honeycomb .hex:hover polygon{fill:#fbf5f6;stroke:var(--maroon);stroke-width:1.8}
.honeycomb .hex:hover text{fill:var(--maroon-dark)}

/* Screen-reader equivalent, visually hidden on wide screens. */
.hex-list{
  position:absolute;width:1px;height:1px;
  margin:-1px;padding:0;overflow:hidden;
  clip:rect(0 0 0 0);clip-path:inset(50%);
  white-space:nowrap;border:0;list-style:none;
}

@media (max-width:760px){
  .honeycomb{display:none}
  .hex-list{
    position:static;width:auto;height:auto;
    margin:0;overflow:visible;
    clip:auto;clip-path:none;white-space:normal;
    display:grid;gap:8px;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  }
  .hex-list li{
    background:#fff;border:1px solid var(--rule);border-radius:3px;
    padding:13px 16px;font-size:14.5px;color:var(--navy-700);
    border-left:3px solid var(--maroon);
  }
}
