/* ---------------------------------------------------------------------------
   Anamul Hoque Emtiaj — academic homepage
   Hand-written CSS. No framework, no build step.

   Palette is deliberately matched to resume.tex (navy ink + navy link + grey)
   so the CV and the site read as one set of materials.
   --------------------------------------------------------------------------- */

/* ---- tokens: light is the base definition ---- */
:root {
  --bg:          #fcfbf9;
  --bg-raised:   #ffffff;
  --bg-sunk:     #f5f3ef;
  --border:      #e0dcd4;
  --border-soft: #ebe7e0;
  --text:        #16191f;
  --text-muted:  #5b6270;
  --text-faint:  #6e737f;
  --accent:      #1f4e8c;
  --accent-soft: #e8eef7;
  --on-accent:   #ffffff;
  --shadow:      0 1px 2px rgba(22, 25, 31, .05);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* ~72 characters at the body size: the range that reads fastest */
  --measure: 40rem;
  color-scheme: light;
}

/* ---- dark, when the viewer's OS asks for it ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #101317;
    --bg-raised:   #171b21;
    --bg-sunk:     #1b1f26;
    --border:      #2c323b;
    --border-soft: #232830;
    --text:        #e8eaee;
    --text-muted:  #a2a8b4;
    --text-faint:  #8d939f;
    --accent:      #8ab4e8;
    --accent-soft: #19222f;
    --on-accent:   #0e1116;
    --shadow:      none;
    color-scheme: dark;
  }
}

/* ---- dark, when the viewer clicks the toggle ---- */
:root[data-theme="dark"] {
  --bg:          #101317;
  --bg-raised:   #171b21;
  --bg-sunk:     #1b1f26;
  --border:      #2c323b;
  --border-soft: #232830;
  --text:        #e8eaee;
  --text-muted:  #a2a8b4;
  --text-faint:  #8d939f;
  --accent:      #8ab4e8;
  --accent-soft: #19222f;
  --on-accent:   #0e1116;
  --shadow:      none;
  color-scheme: dark;
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

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

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .12s ease, color .12s ease;
}
a:hover { border-bottom-color: currentColor; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--bg-sunk);
  border-radius: 3px;
  padding: .08em .3em;
}

/* ---------------------------------------------------------------------------
   layout
   --------------------------------------------------------------------------- */

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 1rem; top: 1rem; z-index: 100;
  background: var(--bg-raised);
  border: 1px solid var(--accent);
  padding: .5rem .8rem;
  border-radius: 6px;
}

/* ---- sticky nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
@supports not (backdrop-filter: blur(1px)) {
  .nav { background: var(--bg); }
}

.nav-inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: .5rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-name {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.005em;
  white-space: nowrap;
  color: var(--text);
  border: 0;
}
.nav-name:hover { border: 0; color: var(--accent); }

.nav-links {
  display: flex;
  gap: .1rem;
  margin-left: auto;
}

.nav-links a {
  font-size: .84rem;
  color: var(--text-muted);
  padding: .2rem .5rem;
  border-radius: 5px;
  border: 0;
}
.nav-links a:hover { color: var(--text); background: var(--bg-sunk); border: 0; }
/* set by the scroll observer */
.nav-links a[aria-current="true"] { color: var(--accent); background: var(--accent-soft); }

/* On narrow screens the section links do not fit; the page is short enough to
   scroll, so drop them rather than leaving a half-clipped row. */
@media (max-width: 36rem) {
  .nav-links { display: none; }
}

.theme-btn {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 1.9rem; height: 1.9rem;
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: .9rem;
  line-height: 1;
  padding: 0;
}
.theme-btn:hover { color: var(--text); border-color: var(--text-faint); }

/* ---------------------------------------------------------------------------
   hero
   --------------------------------------------------------------------------- */

.hero { padding: 3.4rem 0 2rem; }

.hero h1 {
  font-family: var(--serif);
  text-wrap: balance;
  font-size: clamp(2.1rem, 6.5vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -.022em;
  line-height: 1.1;
  margin: 0 0 .35rem;
}

.hero .role {
  color: var(--text-muted);
  font-size: .95rem;
  margin: 0 0 1.35rem;
}

.hero p.lede {
  font-size: 1.02rem;
  line-height: 1.72;
  margin: 0 0 1.35rem;
}

/* the "applying for Fall 2027" line: closes the intro, set apart from it */
.hero p.seeking {
  font-size: .95rem;
  margin: -.35rem 0 1.5rem;
  padding: .5rem .85rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
  color: var(--text);
}

/* interest keywords — quiet, scannable, not badge-y */
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .55rem;
  padding: 0;
  margin: 0 0 1.6rem;
  font-size: .84rem;
  color: var(--text-muted);
}
.tags li { display: flex; align-items: center; gap: .55rem; }
.tags li:not(:last-child)::after {
  content: "";
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
  opacity: .6;
}

/* link row: one primary action, the rest quiet */
.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .9rem;
}
.links a {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  font-size: .89rem;
  color: var(--text-muted);
  border: 0;
}
.links a:hover { color: var(--accent); border: 0; }
.links a.primary {
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 7px;
  padding: .38rem .85rem;
  font-weight: 550;
  margin-right: .35rem;
}
.links a.primary:hover { color: var(--on-accent); filter: brightness(1.08); }
.links svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* ---------------------------------------------------------------------------
   sections
   --------------------------------------------------------------------------- */

section { padding: 2.1rem 0; scroll-margin-top: 3.4rem; }

section > h2 {
  font-family: var(--font);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 1.35rem;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--border-soft);
}

/* ---- news ---- */
.news { list-style: none; padding: 0; margin: 0; }
.news li {
  display: grid;
  grid-template-columns: 5.4rem 1fr;
  gap: .9rem;
  padding: .3rem 0;
  font-size: .93rem;
}
.news time {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  font-size: .82rem;
  padding-top: .18rem;
  white-space: nowrap;
}
@media (max-width: 30rem) {
  .news li { grid-template-columns: 1fr; gap: 0; }
  .news time { padding-top: 0; display: block; }
}

/* ---- entries: research + experience ---- */
.entry {
  position: relative;
  padding: 0 0 1.5rem 1.1rem;
  border-left: 2px solid var(--border);
}
.entry:last-child { padding-bottom: 0; }
.entry::before {
  content: "";
  position: absolute;
  left: -5px; top: .62rem;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .1rem .9rem;
  margin-bottom: .12rem;
}
.entry-head h3 {
  font-size: 1.02rem;
  font-weight: 650;
  margin: 0;
  line-height: 1.35;
  letter-spacing: -.008em;
}
.entry-head .when {
  font-size: .8rem;
  color: var(--text-faint);
  margin-left: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.entry .meta {
  font-size: .875rem;
  color: var(--text-muted);
  margin: 0 0 .6rem;
}

.entry ul { margin: 0; padding-left: 1.05rem; }
.entry ul li { margin-bottom: .38rem; font-size: .945rem; }
.entry ul li:last-child { margin-bottom: 0; }
.entry ul li::marker { color: var(--text-faint); }

/* nested sub-entry: client engagements under one employer */
.sub {
  margin-top: 1rem;
  padding-left: .95rem;
  border-left: 1px solid var(--border-soft);
}
.sub .entry-head h3 { font-size: .96rem; font-weight: 600; }
.sub .org-loc { font-weight: 400; color: var(--text-muted); }

/* ---- publications ---- */
.pub-note {
  font-size: .85rem;
  color: var(--text-faint);
  margin: -.5rem 0 1.2rem;
}

.pub {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: .9rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-soft);
}
.pub:first-of-type { border-top: 0; padding-top: 0; }

.pub-tag {
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: .3rem;
}

.pub h3 {
  text-wrap: pretty;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.42;
  margin: 0 0 .32rem;
  letter-spacing: -.008em;
}
.pub .authors { font-size: .9rem; color: var(--text-muted); margin: 0 0 .18rem; }
.pub .authors .me { color: var(--text); font-weight: 650; }
.pub .venue { font-size: .89rem; color: var(--text-muted); margin: 0 0 .6rem; }

.badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: .05rem .42rem;
  margin-left: .2rem;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
  vertical-align: 1px;
}

.pub-links { display: flex; flex-wrap: wrap; gap: .35rem; }
.pub-links a {
  font-size: .78rem;
  color: var(--text-muted);
  background: var(--bg-sunk);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: .08rem .48rem;
}
.pub-links a:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 30rem) {
  .pub { grid-template-columns: 1fr; gap: .3rem; }
  .pub-tag { padding-top: 0; }
}

/* one-sentence problem statement under a publication */
.pub .summary {
  font-size: .92rem;
  color: var(--text-muted);
  margin: 0 0 .6rem;
}

/* ---- skills: label / values rows ---- */
.skills { margin: 0; display: grid; gap: .55rem; }
.skills > div {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: .75rem;
  font-size: .93rem;
}
.skills dt { font-weight: 650; color: var(--text); }
.skills dd { margin: 0; color: var(--text-muted); }
@media (max-width: 32rem) {
  .skills > div { grid-template-columns: 1fr; gap: .05rem; }
}

/* ---- projects ---- */
.projects { display: grid; gap: .85rem; }
@media (min-width: 42rem) {
  .projects { grid-template-columns: 1fr 1fr; }
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.05rem 1.15rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card h3 {
  font-size: .95rem;
  font-weight: 650;
  margin: 0 0 .35rem;
  line-height: 1.35;
}
.card p { font-size: .9rem; color: var(--text-muted); margin: 0 0 .8rem; }
.card .stack {
  font-size: .78rem;
  color: var(--text-faint);
  margin-top: auto;
  margin-bottom: 0;
  border-top: 1px solid var(--border-soft);
  padding-top: .55rem;
}

/* ---- education / awards ---- */
.facts { display: grid; gap: 1.7rem; }
@media (min-width: 42rem) {
  .facts { grid-template-columns: 1.1fr 1fr; }
}
.facts h3 {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 .65rem;
}
.facts p { margin: 0 0 .3rem; font-size: .93rem; }
.facts .dim { color: var(--text-muted); font-size: .89rem; }
.facts ul { margin: 0; padding-left: 1.05rem; font-size: .93rem; }
.facts ul li { margin-bottom: .4rem; }
.facts ul li::marker { color: var(--text-faint); }

/* ---- footer ---- */
footer {
  border-top: 1px solid var(--border-soft);
  margin-top: 1.6rem;
  padding: 1.9rem 0 2.8rem;
  font-size: .86rem;
  color: var(--text-faint);
}
footer p { margin: 0 0 .3rem; }
footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent); }
