/* ============================================================
   Suvrajit Maji — academic personal site
   Modern editorial typography on warm paper
   ============================================================ */

:root {
  --paper:        oklch(0.985 0.005 85);
  --paper-2:      oklch(0.965 0.008 85);
  --paper-warm:   oklch(0.955 0.012 70);
  --ink:          oklch(0.18 0.012 260);
  --ink-soft:     oklch(0.32 0.012 260);
  --muted:        oklch(0.52 0.010 260);
  --muted-2:      oklch(0.68 0.010 260);
  --rule:         oklch(0.88 0.008 260);
  --rule-soft:    oklch(0.93 0.006 260);
  --accent:       oklch(0.42 0.13 255);   /* oxford indigo */
  --accent-2:     oklch(0.55 0.12 35);    /* terra */
  --highlight:    oklch(0.94 0.06 95);    /* faint warm wash for mark */

  --serif: "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Geist", "Söhne", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --maxw: 1200px;
  --rail: 280px;
  --gap:  72px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      oklch(0.16 0.012 260);
    --paper-2:    oklch(0.20 0.012 260);
    --paper-warm: oklch(0.22 0.013 250);
    --ink:        oklch(0.95 0.006 85);
    --ink-soft:   oklch(0.82 0.008 85);
    --muted:      oklch(0.65 0.010 260);
    --muted-2:    oklch(0.50 0.010 260);
    --rule:       oklch(0.30 0.012 260);
    --rule-soft:  oklch(0.24 0.012 260);
    --accent:     oklch(0.78 0.13 245);
    --accent-2:   oklch(0.78 0.12 45);
    --highlight:  oklch(0.32 0.07 95);
  }
}

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  /* subtle paper grain */
  background:
    radial-gradient(1200px 600px at 80% -10%, color-mix(in oklch, var(--accent) 6%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, color-mix(in oklch, var(--accent-2) 5%, transparent), transparent 60%),
    var(--paper);
}

/* ----- Type ----- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 4.5vw, 3.6rem); line-height: 1.05; font-weight: 400; }
h2 { font-size: 1.55rem; line-height: 1.2; margin-top: 2.4em; margin-bottom: 0.6em; font-weight: 500; }
h3 { font-size: 1.15rem; line-height: 1.3; margin-top: 1.6em; margin-bottom: 0.3em; font-weight: 600; }
p  { margin: 0 0 1em 0; text-wrap: pretty; }
a  { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in oklch, var(--accent) 35%, transparent); transition: color .15s, border-color .15s, background .15s; }
a:hover { color: var(--ink); border-bottom-color: var(--ink); background: color-mix(in oklch, var(--accent) 8%, transparent); }
strong, b { font-weight: 600; color: var(--ink); }
em, i { font-style: italic; }
hr { border: none; border-top: 1px solid var(--rule); margin: 2.2em 0; }

::selection { background: color-mix(in oklch, var(--accent) 25%, transparent); color: var(--ink); }

/* eyebrow / small-caps label */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--muted-2);
}

/* ----- Layout shell ----- */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 40px 96px;
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: var(--gap);
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; gap: 40px; padding: 32px 22px 64px; }
}

.rail {
  position: sticky;
  top: 40px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
@media (max-width: 900px) {
  .rail { position: static; }
}

.main { min-width: 0; }

/* ----- Identity card ----- */
.identity {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.identity .avatar00 {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper-2);
  box-shadow: 0 0 0 1px var(--rule), 0 8px 24px -16px color-mix(in oklch, var(--ink) 50%, transparent);
}
.identity .avatar {
  width: min(320px, 100%);
  aspect-ratio: 1 / 1;

  border-radius: 24px;
  object-fit: cover;
  background: var(--paper-2);

  box-shadow:
    0 0 0 1px var(--rule),
    0 24px 60px -24px color-mix(in oklch, var(--ink) 35%, transparent);

  transition: transform 0.3s ease;
}
.identity .name {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.005em;
}
.identity .role {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}
.identity .role .org { color: var(--ink-soft); }

/* ----- Nav ----- */
nav.primary {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 8px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 8px 0;
}
nav.primary a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink-soft);
  border: none;
  background: transparent;
  text-decoration: none;
}
nav.primary a:hover { color: var(--accent); background: transparent; }
nav.primary a .num {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted-2);
  letter-spacing: 0.05em;
}
nav.primary a[aria-current="page"] { color: var(--ink); }
nav.primary a[aria-current="page"]::before {
  content: "›";
  font-family: var(--serif);
  margin-right: 6px;
  color: var(--accent);
}

/* meta lines */
.meta-list { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); line-height: 1.9; letter-spacing: 0.02em; }
.meta-list a { font-family: var(--mono); border: none; }
.meta-list a:hover { color: var(--accent); background: transparent; }
.meta-list .k { color: var(--muted-2); display: inline-block; width: 4.2em; }

/* ----- Page header ----- */
.page-head {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 28px;
  margin-bottom: 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.page-head .meta {
  display: flex;
  gap: 18px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ----- Prose ----- */
.prose {
  max-width: 68ch;
  font-size: 1.04rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.prose p { margin-bottom: 1.1em; }
.prose strong { color: var(--ink); }
.prose h2 { color: var(--ink); }
.prose h2 + p { margin-top: 0.4em; }

/* drop hint on lead paragraph */
.lead {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.32rem;
  line-height: 1.45;
  color: var(--ink);
  letter-spacing: -0.005em;
  max-width: 32ch;
}

/* ----- Cards ----- */
.card {
  background: color-mix(in oklch, var(--paper-2) 70%, transparent);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 22px 24px;
}
.card h3 { margin-top: 0; }

/* contact ledger */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 36px;
  margin: 24px 0 8px;
  padding: 24px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: color-mix(in oklch, var(--paper-warm) 60%, var(--paper));
}
.contact .col h4 {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.contact .col p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); line-height: 1.6; }
@media (max-width: 640px) { .contact { grid-template-columns: 1fr; } }

/* ----- Affiliations strip ----- */
.affiliations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 8px;
}
.affiliations .tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
}
.affiliations .tag .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
}

/* ----- Pills / chips ----- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  background: var(--paper);
}

/* ----- Timeline (CV / news) ----- */
.timeline {
  border-left: 1px solid var(--rule);
  padding-left: 24px;
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.timeline .entry { position: relative; }
.timeline .entry::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 9px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--accent);
}
.timeline .when {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}
.timeline .what {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin: 4px 0 4px;
  color: var(--ink);
}
.timeline .where {
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.timeline .note {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 6px;
}

/* ----- News entries ----- */
.year-block { margin-bottom: 40px; }
.year-block .year-mark {
  font-family: var(--serif);
  font-size: 3.2rem;
  line-height: 1;
  color: color-mix(in oklch, var(--accent) 30%, var(--paper));
  -webkit-text-stroke: 0.5px var(--accent);
  letter-spacing: -0.02em;
  margin: 0;
}
.news-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.news-item:last-child { border-bottom: 1px solid var(--rule); }
.news-item .date {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.news-item .body { color: var(--ink-soft); font-size: 0.98rem; line-height: 1.55; }
.news-item .body .venue {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 8px;
}
@media (max-width: 640px) {
  .news-item { grid-template-columns: 1fr; gap: 4px; }
}

/* ----- Research blocks ----- */
.research-block {
  margin: 32px 0 48px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.research-block .label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.research-block h2 { margin: 0 0 12px; }
.research-block .sub {
  color: var(--muted);
  font-style: italic;
  margin-bottom: 18px;
}
.figure-placeholder {
  margin: 18px 0;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background:
    repeating-linear-gradient(135deg,
      color-mix(in oklch, var(--paper-warm) 80%, transparent) 0 9px,
      color-mix(in oklch, var(--paper-2) 80%, transparent) 9px 18px);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
  justify-content: flex-end;
}
.figure-placeholder .fp-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  align-self: flex-start;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 3px 8px;
  border-radius: 4px;
}
.figure-placeholder figcaption {
  font-size: 0.86rem;
  color: var(--ink-soft);
  font-style: italic;
}

/* ----- Pubs (scholar embed) ----- */
.scholar-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 22px 26px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: color-mix(in oklch, var(--paper-warm) 50%, var(--paper));
  margin: 24px 0;
}
.scholar-card .glyph {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklch, var(--accent) 60%, var(--accent-2)));
  display: grid; place-items: center;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1.6rem;
}
.scholar-card .meta-row {
  display: flex; flex-direction: column; gap: 4px;
}
.scholar-card .label {
  font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}
.scholar-card .title { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper) !important;
  font-family: var(--sans);
  font-size: 0.88rem;
  border: none !important;
  letter-spacing: 0.01em;
}
.btn:hover { background: var(--accent); color: var(--paper) !important; }
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translateX(3px); }
@media (max-width: 640px) {
  .scholar-card { grid-template-columns: 1fr; text-align: left; }
}

/* selected publications */
.pub-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
}
.pub {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 18px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.pub:last-child { border-bottom: 1px solid var(--rule); }
.pub .yr {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.pub .t {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 6px;
}
.pub .t a { color: var(--ink); border-bottom-color: var(--rule); }
.pub .t a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.pub .a {
  font-size: 0.9rem; color: var(--ink-soft);
  margin-bottom: 6px;
}
.pub .v {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.pub .v .venue { color: var(--accent); }
@media (max-width: 640px) { .pub { grid-template-columns: 1fr; gap: 4px; } }

/* ----- Hero (home) ----- */
.hero {
  display: grid;
  gap: 40px;
  margin-bottom: 52px;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--rule);
}
.hero h1 {
  font-size: clamp(2.6rem, 5.2vw, 4rem);
  font-weight: 350;
  line-height: 1;
  letter-spacing: -0.02em;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero .tagline {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--ink-soft);
  font-weight: 350;
  max-width: 32ch;
  margin-top: 18px;
}

/* ----- Now ----- */
.now {
  margin: 44px 0;
  padding: 26px 28px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: color-mix(in oklch, var(--paper-warm) 50%, var(--paper));
  position: relative;
}
.now::before {
  content: "";
  position: absolute;
  left: -1px; top: 16px; bottom: 16px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.now .label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.now p { margin: 0; color: var(--ink); }
.now .now-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.now .now-line {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 0.96rem;
  color: var(--ink-soft);
}
.now .now-line .when {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

/* ----- Gallery grid ----- */
.gal {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.gal figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gal .frame {
  aspect-ratio: 3/4;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background:
    repeating-linear-gradient(135deg,
      color-mix(in oklch, var(--paper-warm) 90%, transparent) 0 10px,
      color-mix(in oklch, var(--paper-2) 90%, transparent) 10px 20px);
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.gal .frame.land { aspect-ratio: 4/3; }
.gal .frame .tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 4px 10px;
  border-radius: 999px;
}
.gal figcaption {
  font-size: 0.82rem;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

/* ----- Footer ----- */
.foot {
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.foot a { color: var(--muted); border: none; }
.foot a:hover { color: var(--accent); background: transparent; }
@media (max-width: 640px) {
  .foot { flex-direction: column; gap: 10px; }
}

/* ----- Topbar (skinny brand mark on mobile/desktop) ----- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in oklch, var(--paper) 78%, transparent);
  border-bottom: 1px solid var(--rule-soft);
}
.topbar .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.topbar .mark {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-decoration: none;
  border: none;
  display: inline-flex; align-items: center; gap: 10px;
}
.topbar .mark .glyph {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 0.88rem;
  font-style: italic;
}
.topbar .top-nav {
  display: flex;
  gap: 22px;
}
.topbar .top-nav a {
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--ink-soft);
  border: none;
}
.topbar .top-nav a:hover { color: var(--accent); background: transparent; }
.topbar .top-nav a[aria-current="page"] { color: var(--accent); }
@media (max-width: 720px) {
  .topbar .inner { padding: 12px 22px; }
  .topbar .top-nav { display: none; }
}

/* ----- Quote ----- */
blockquote.pull {
  font-family: var(--serif);
  font-size: 1.4rem;
  line-height: 1.4;
  font-style: italic;
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding: 8px 22px;
  margin: 28px 0;
  max-width: 32ch;
}
blockquote.pull cite {
  display: block;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* helper for soft mark */
mark { background: var(--highlight); color: inherit; padding: 0 0.1em; border-radius: 2px; }

/* link icons (external) */
.ext::after {
  content: "↗";
  font-family: var(--mono);
  font-size: 0.78em;
  margin-left: 4px;
  color: var(--muted-2);
}
