/* ============================================================
   Anish Choudhury - portfolio stylesheet
   A small design system: tokens, layout primitives, components.
   Legacy pages (journals, older detail pages) inherit readable
   defaults from the "base elements" block below.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #0d0f13;
  --surface: #171b22;
  --surface-2: #1d222b;
  --line: #2a303b;
  --line-soft: #222833;

  --text: #e8eaee;
  --text-muted: #a3acba;
  --text-dim: #7d8797;

  --accent: #c8102e;
  --accent-soft: #e0475f;
  --accent-dim: rgba(200, 16, 46, 0.14);

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);

  --header-h: 72px;
  --maxw: 1080px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(200, 16, 46, 0.16), transparent 60%),
    radial-gradient(700px 400px at 0% 0%, rgba(80, 0, 0, 0.28), transparent 55%);
  background-attachment: fixed;
  padding-top: var(--header-h);
  -webkit-font-smoothing: antialiased;
}

/* ---------- base elements (these also carry the legacy pages) ---------- */

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.15rem; }

p { color: var(--text-muted); }

a { color: var(--accent-soft); }
a:hover { color: var(--text); }

img { max-width: 100%; border-radius: var(--radius-sm); }

ul, ol { color: var(--text-muted); }
li { margin: 6px 0; }

code, kbd, pre { font-family: var(--mono); font-size: 0.92em; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}

/* Legacy pages put content straight in <body> with no wrapper, so give
   those direct children a readable measure automatically. */
body > h1, body > h2, body > h3, body > h4,
body > p, body > ul, body > ol, body > center,
body > table, body > pre, body > blockquote, body > img, body > iframe {
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}
body > h1 { margin-top: 48px; margin-bottom: 8px; }
body > h2 { margin-top: 32px; margin-bottom: 8px; }
body > h3 { margin-top: 20px; margin-bottom: 8px; font-weight: 500; color: var(--text-muted); }
body > p  { margin-bottom: 12px; }
body > ul, body > ol { padding-left: 48px; margin-bottom: 16px; }
body > center { display: block; margin-top: 24px; margin-bottom: 24px; }

/* ---------- header / navigation ---------- */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  padding: 0 32px;
  background-color: rgba(13, 15, 19, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  z-index: 100;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.logo::before {
  content: "AC";
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), #6d0715);
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.navbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 6px;
}

.navbar a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.navbar a:hover { color: var(--text); background-color: var(--surface-2); }
.navbar a.active { color: var(--text); background-color: var(--accent-dim); }

.navbar a.nav-cta {
  color: var(--text);
  border: 1px solid var(--line);
  background-color: var(--surface);
}
.navbar a.nav-cta:hover { border-color: var(--accent); }

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

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

.section { padding: 64px 0; }

.section-head { margin-bottom: 32px; }

.eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 10px;
}

.lede {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 70ch;
}

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

.hero { padding: 72px 0 48px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.4rem);
  margin: 10px 0 6px;
}

.hero .role {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 600;
  color: var(--accent-soft);
  margin-bottom: 18px;
}

.hero p { font-size: 1.05rem; max-width: 60ch; }

.hero-photo {
  justify-self: center;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 0;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 20px;
  font-size: 14.5px;
  color: var(--text-dim);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background-color: var(--surface);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(140deg, var(--accent), #8d0a20);
  border-color: transparent;
  color: #fff;
}
.btn-primary:hover { color: #fff; box-shadow: 0 10px 24px rgba(200, 16, 46, 0.3); }

/* ---------- stats ---------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 48px;
}

.stat {
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.stat strong {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat span { font-size: 13.5px; color: var(--text-dim); }

/* ---------- experience entries ---------- */

.timeline { display: grid; gap: 18px; }

.entry {
  padding: 26px 28px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background-color: var(--surface);
  border-left: 3px solid var(--accent);
  transition: transform 0.18s ease, border-color 0.2s ease;
}

.entry:hover { transform: translateY(-3px); border-color: var(--line); border-left-color: var(--accent-soft); }

.entry-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 20px;
}

.entry-head h3 { font-size: 1.2rem; }

.entry .org {
  font-weight: 600;
  color: var(--accent-soft);
  font-size: 0.98rem;
  margin-top: 2px;
}

.entry .when {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
}

.entry ul {
  margin: 14px 0 0;
  padding-left: 20px;
}

.entry li { color: var(--text-muted); }
.entry .tag-row { margin-top: 16px; }

/* ---------- cards ---------- */

.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  align-items: stretch;
}

.card {
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.2s ease;
}

.card:hover { transform: translateY(-4px); border-color: var(--accent); }

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background-color: #fff;
  border-radius: 0;
}

.card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px;
}

.card-content h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.card-content p {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.card-content .tag-row { margin: 14px 0 18px; }

.card-content .btn {
  align-self: flex-start;
  margin-top: auto;
  padding: 9px 16px;
}

/* ---------- tags / skills ---------- */

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background-color: var(--surface-2);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-muted);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.skill-group {
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.skill-group h3 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

/* ---------- detail pages ---------- */

.page-header {
  padding: 48px 0 8px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 32px;
}

.page-header p { margin-top: 12px; }
.page-header .tag-row { margin-top: 18px; }

.prose { max-width: 72ch; }
.prose p { margin-bottom: 16px; }
.prose h2 { margin: 36px 0 12px; }
.prose h3 { margin: 26px 0 10px; font-size: 1.1rem; }
.prose ul { margin: 0 0 16px 20px; }

.panel {
  padding: 24px 26px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.doc-grid img {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background-color: #fff;
}

.researchContainer,
.cyberScholarsContainer { padding: 16px 0; }

/* ---------- pdf viewer (resume page) ---------- */

.pdf-viewer {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background-color: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.pdf-viewer iframe {
  display: block;
  width: 100%;
  height: min(1100px, 125vh);
  border: 0;
}

.pdf-note {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-dim);
}

/* Mobile browsers routinely refuse to render a PDF in an iframe, so the
   preview steps aside there and the written-out resume below carries it. */
@media (max-width: 700px) {
  .pdf-viewer { display: none; }
  .pdf-note { font-size: 14.5px; color: var(--text-muted); }
}

/* ---------- embedded video ---------- */

.presentation-videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  max-width: var(--maxw);
  margin: 32px auto;
  padding: 0 24px;
}

.presentation-video-left,
.presentation-video-right { text-align: left; }

.presentation-video-left h3,
.presentation-video-right h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.presentation-video-left iframe,
.presentation-video-right iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- footer ---------- */

.footer {
  margin-top: 64px;
  padding: 36px 0;
  border-top: 1px solid var(--line-soft);
  background-color: rgba(0, 0, 0, 0.25);
}

.footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.footer p { font-size: 14px; color: var(--text-dim); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--accent-soft); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  :root { --header-h: 116px; }

  .header {
    height: auto;
    min-height: var(--header-h);
    flex-direction: column;
    justify-content: center;
    padding: 12px 18px;
    gap: 8px;
  }

  .navbar { justify-content: center; }
  .navbar a { padding: 6px 10px; font-size: 14px; }

  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-photo { order: -1; max-width: 220px; }
  .section { padding: 48px 0; }
  .hero { padding: 40px 0 28px; }
}

@media (max-width: 520px) {
  .btn-row .btn { flex: 1 1 100%; text-align: center; }
  .entry { padding: 20px; }
}

/* ---------- scroll reveal (see reveal.js) ---------- */
/* The hidden state only exists once reveal.js has added .js-reveal to <html>,
   so the page stays fully visible when JavaScript is off. */

.js-reveal .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.75s cubic-bezier(0.22, 0.61, 0.36, 1) var(--reveal-delay, 0s),
    transform 0.75s cubic-bezier(0.22, 0.61, 0.36, 1) var(--reveal-delay, 0s);
  will-change: opacity, transform;
}

.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* the photo and card art settle in with a touch of scale */
.js-reveal .hero-photo.reveal,
.js-reveal .gallery img.reveal,
.js-reveal .doc-grid img.reveal {
  transform: translateY(20px) scale(0.97);
}

.js-reveal .hero-photo.reveal.is-visible,
.js-reveal .gallery img.reveal.is-visible,
.js-reveal .doc-grid img.reveal.is-visible {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .js-reveal .reveal,
  .js-reveal .reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
