/* ====================================================================
   Mehdi Esmaeilzadeh — Academic Portfolio
   ==================================================================== */

:root {
  --bg:      #f5f5f5;
  --text:    #1a1a1a;
  --muted:   #666;
  --accent:  #1772d0;
  --accent-h:#f09228;
  --border:  #ddd;
  --font: "Source Sans 3", system-ui, -apple-system, sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); text-decoration: underline; }
sup { font-size: 0.7em; }


/* ================================================================
   HOMEPAGE — Jon Barron style
   ================================================================ */

.jb-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* ── Header ── */
.jb-header {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}
.jb-bio-col { flex: 1; }

.jb-name {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.9rem;
}

.jb-bio {
  font-size: 1rem;
  line-height: 1.72;
  margin: 0 0 0.9rem;
}

.jb-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem;
  font-size: 1rem;
  margin: 0;
}

.jb-contact-sep { color: var(--muted); margin: 0 0.2rem; user-select: none; }

.jb-icon-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.jb-icon-link:hover { color: var(--accent-h); text-decoration: none; }
.jb-icon-link svg { display: block; flex-shrink: 0; opacity: 0.85; }

.jb-photo-col { flex-shrink: 0; }
.jb-photo {
  width: 175px;
  height: 175px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid #ccc;
}

/* ── Section heading ── */
.jb-section-h {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
  margin: 0 0 1.75rem;
}

/* ── Publication row ── */
.jb-pub {
  display: flex;
  gap: 1.75rem;
  margin-bottom: 2.25rem;
  align-items: flex-start;
}

.jb-pub-thumb {
  width: 210px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #111;
  line-height: 0;
}
.jb-pub-thumb video,
.jb-pub-thumb img { width: 100%; height: auto; display: block; }

.jb-pub-info { flex: 1; }

.jb-pub-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  margin: 0 0 0.3rem;
}
.jb-pub-title a { color: var(--text); }
.jb-pub-title a:hover { color: var(--accent); text-decoration: underline; }

.jb-pub-authors,
.jb-pub-venue { font-size: 0.95rem; margin: 0 0 0.25rem; }
.jb-pub-authors strong { font-weight: 700; }
.jb-pub-venue { color: var(--muted); font-style: italic; margin-bottom: 0.5rem; }

.jb-pub-links { font-size: 0.9rem; }
.jb-pub-links a { font-weight: 600; margin-right: 0.55rem; }
.jb-pub-links a:hover { color: var(--accent-h); text-decoration: underline; }

/* ── Citation — smooth reveal on click ── */
.jb-citation {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  transition: max-height 0.42s ease, opacity 0.3s ease, margin-top 0.3s ease;
}
.jb-citation.is-open {
  max-height: 800px;
  opacity: 1;
  margin-top: 2rem;
}

.jb-bibtex {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  margin: 0 0 0.5rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.jb-btn {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid #888;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text);
}
.jb-btn:hover { background: #f0f0f0; }

.jb-hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.jb-footer { font-size: 0.82rem; color: var(--muted); text-align: center; margin: 0; }
.jb-footer a { color: var(--muted); font-weight: 600; }
.jb-footer a:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 620px) {
  .jb-header { flex-direction: column-reverse; gap: 1.25rem; }
  .jb-photo { width: 130px; height: 130px; }
  .jb-pub { flex-direction: column; }
  .jb-pub-thumb { width: 100%; max-width: 320px; }
}


/* ================================================================
   PROJECT PAGE — PAPR-style centered header
   ================================================================ */

.pp-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.pp-back { font-size: 0.9rem; color: var(--muted); margin: 0 0 2rem; }
.pp-back a { color: var(--muted); font-weight: 600; }
.pp-back a:hover { color: var(--accent); }

/* ── Centered hero header ── */
.pp-hero-header { text-align: center; margin-bottom: 2.25rem; }

.pp-title-lg {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 1.1rem;
}

.pp-authors-row { font-size: 1.05rem; margin: 0 0 0.35rem; }
.pp-authors-row a { color: var(--text); font-weight: 600; }
.pp-authors-row a:hover { color: var(--accent); text-decoration: underline; }
.pp-authors-row strong { font-weight: 800; }

.pp-affiliations { font-size: 0.9rem; color: var(--muted); margin: 0 0 1rem; }

.pp-badge-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.pp-badge {
  display: inline-block;
  padding: 0.22rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: #b31b1b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
}

a.pp-badge:hover { color: #fff; opacity: 0.92; }

.pp-link-btns {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.pp-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1.1rem;
  border-radius: 5px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.pp-link-btn:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* ── Hero image ── */
.pp-hero {
  margin: 0 0 0.5rem;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  line-height: 0;
  border: 1px solid var(--border);
}
.pp-hero img,
.pp-hero video { width: 100%; display: block; }

/* ── Section headings ── */
.pp-section-h {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.3rem;
  margin: 2.5rem 0 1rem;
}

.pp-prose {
  font-size: 0.98rem;
  line-height: 1.72;
  margin: 0 0 1.1rem;
}

.pp-method-fig {
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  line-height: 0;
  margin: 0 0 0.5rem;
  border: 1px solid var(--border);
}
.pp-method-fig img { width: 100%; display: block; }

.pp-caption {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0.3rem 0 1.5rem;
}

/* ── Video comparison: same seed, RTM | Baseline side by side ── */
.pp-result-group { margin-bottom: 2.25rem; }

.pp-example-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 0.55rem;
}

.pp-video-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.pp-video-compare-col video {
  width: 100%;
  display: block;
  border-radius: 5px;
  background: #111;
}
.pp-video-caption {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  margin: 0.3rem 0 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Frame analysis: start → end progression ── */
.pp-frame-analysis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  background: #ececec;
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  margin: 0 0 0.75rem;
}
.pp-frame-col-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.4rem;
  text-align: center;
}
.pp-frames-row {
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
  justify-content: center;
}
.pp-frame-img { flex: 1; min-width: 0; }
.pp-frame-img img {
  width: 100%;
  display: block;
  border-radius: 3px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.pp-frame-sublabel {
  font-size: 0.62rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.2rem;
}
.pp-frame-arrow {
  font-size: 1rem;
  color: var(--muted);
  flex-shrink: 0;
  margin-bottom: 0.6rem;
}

/* ── Citation ── */
.pp-citation { scroll-margin-top: 1.5rem; }

.pp-bibtex {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  margin: 0.5rem 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.pp-hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.pp-footer { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 2rem; }
.pp-footer a { color: var(--muted); font-weight: 600; }
.pp-footer a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .pp-video-compare { grid-template-columns: 1fr; }
  .pp-frame-analysis { grid-template-columns: 1fr; }
  .pp-title-lg { font-size: 1.35rem; }
}
