/* Eli Krasnoff — personal site. Styled after bernardomelotti.com */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");

:root {
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Times New Roman", Times, serif;
  --ink: #000;
  --ink-2: #333;
  --muted: #666;
  --line: #e0e0e0;
  --soft: #f5f5f5;
  --bg: #fff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { color: var(--ink); background: var(--bg); font-family: var(--serif); line-height: 1.6; }
img { max-width: 100%; display: block; }

/* ---------- Nav ---------- */
nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 2rem 3rem; background: var(--bg);
  transition: box-shadow .3s, background-color .3s;
}
nav.scrolled { background: rgba(255,255,255,.95); backdrop-filter: blur(10px); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.logo { color: var(--ink); font: 600 1.8rem var(--sans); text-decoration: none; white-space: nowrap; }
.nav-links { display: flex; gap: 2.5rem; list-style: none; }
.nav-links a { position: relative; color: var(--ink); font-size: 1rem; text-decoration: none; transition: opacity .3s; }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px; background: var(--ink); transition: width .3s; }
.nav-links a:hover { opacity: .5; }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { width: 100%; }

/* ---------- Links ---------- */
.text-link, .prose a { color: inherit; text-decoration: underline 1.5px; text-underline-offset: 2px; }
.text-link:hover, .prose a:hover { opacity: .7; }

/* ---------- Hero (home) ---------- */
.hero { display: flex; align-items: center; min-height: 85vh; padding: 0 3rem; }
.hero-container { display: grid; grid-template-columns: 450px 1fr; gap: 6rem; align-items: center; width: 100%; max-width: 1400px; margin: 0 auto; }
.hero-image img { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.1); }
.hero-right { display: flex; flex-direction: column; gap: 2rem; }
.hero-text { font-size: 1.5rem; line-height: 1.4; animation: fadeIn 1s ease-in; }
.hero-text p + p { margin-top: 1.4em; }
.hero-bio { font-size: 1.2rem; line-height: 1.6; color: var(--ink-2); }
.contact-info { font-size: 1.15rem; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ---------- Page shell ---------- */
.page { padding: 4rem 3rem 6rem; min-height: 70vh; }
.container { max-width: 1400px; margin: 0 auto; }
.narrow { max-width: 860px; margin: 0 auto; }
.page-title { font: 600 3rem/1.15 var(--sans); margin-bottom: 1rem; }
.page-intro { font-size: 1.25rem; color: var(--ink-2); max-width: 860px; margin-bottom: 3rem; }
.epigraph { font-style: italic; color: var(--muted); font-size: 1.15rem; margin-bottom: 3rem; }
.epigraph cite { font-style: normal; display: block; margin-top: .25rem; font-size: 1rem; }

/* section headings (home + publications) */
.section { padding: 4rem 3rem; }
.section-title { font: 600 1.6rem var(--sans); border-bottom: 2px solid var(--ink); padding-bottom: .5rem; margin-bottom: 1.5rem; }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; }
.card {
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
  color: inherit; text-decoration: none; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; transition: all .3s;
}
.card:hover { transform: translateY(-5px); border-color: #d0d0d0; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.card-img { height: 220px; background: var(--soft); border-bottom: 1px solid #eee; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card-img.contain img { object-fit: contain; padding: 1.5rem; background: #fff; }
.card:hover .card-img img { transform: scale(1.05); }
.card-body { padding: 1.5rem; display: flex; flex-direction: column; gap: .5rem; flex-grow: 1; }
.card-title { font: 600 1.2rem/1.35 var(--sans); }
.card-meta { font: .9rem var(--sans); color: var(--muted); }
.card-desc { color: var(--ink-2); font-size: 1.05rem; }
.badge { align-self: flex-start; font: 500 .75rem var(--sans); letter-spacing: .04em; text-transform: uppercase; border: 1px solid var(--ink); border-radius: 999px; padding: .15rem .6rem; }
.card-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, #f0f0f0, #e0e0e0); }

/* ---------- Lists (scholarships, citations) ---------- */
.item-list { list-style: none; }
.item-list li { padding: 1.25rem 0; border-bottom: 1px solid #ddd; font-size: 1.1rem; }
.item-list li:first-child { padding-top: 0; }
.item-list strong { font-family: var(--sans); font-weight: 600; font-size: 1.05rem; }
.item-list .meta { display: block; color: var(--muted); font-size: 1rem; }
.cite { font-size: 1.08rem; line-height: 1.7; }
.cite a { word-break: break-word; }
.note { color: var(--muted); font-size: .95rem; font-style: italic; }

/* ---------- Quotes ---------- */
.quote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2.5rem 3rem; }
.quote blockquote { font-size: 1.3rem; line-height: 1.45; }
.quote figcaption { margin-top: .6rem; font: .9rem var(--sans); color: var(--muted); }

/* ---------- Detail pages ---------- */
.back { display: inline-block; font: .95rem var(--sans); color: var(--muted); text-decoration: none; margin-bottom: 2rem; }
.back:hover { color: var(--ink); }
.detail-title { font: 600 2.4rem/1.2 var(--sans); margin-bottom: .5rem; }
.detail-meta { font: 1rem var(--sans); color: var(--muted); margin-bottom: 2.5rem; }
.prose { font-size: 1.15rem; line-height: 1.8; color: #111; }
.prose p { margin-bottom: 1.25rem; }
.prose h3 { font: 600 1.6rem var(--sans); border-bottom: 2px solid var(--ink); padding-bottom: .5rem; margin: 3rem 0 1.5rem; }
.prose h4 { font: 600 1.25rem var(--sans); margin: 2rem 0 1rem; color: #222; }
.prose ul { margin: 0 0 1.5rem 1.25rem; }
.prose li { margin-bottom: .5rem; }
.callout { background: #fafafa; border-left: 4px solid var(--ink); border-radius: 4px; padding: 1.5rem; margin: 1.5rem 0; }
.callout strong { display: block; font-family: var(--sans); margin-bottom: .5rem; }
.todo { background: #fff8e1; border-left-color: #c79100; }

.figure { margin: 2rem 0; }
.figure img { border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.06); width: 100%; }
.figure figcaption { font-size: .95rem; color: var(--muted); margin-top: .5rem; text-align: center; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin: 2rem 0; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; height: 260px; object-fit: cover; border-radius: 8px; }
.gallery figcaption { font-size: .9rem; color: var(--muted); margin-top: .4rem; line-height: 1.4; }

/* PDF viewer — replaces ISSUU embeds */
.pdf { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 1.5rem 0 2rem; }
.pdf-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.25rem; background: #fafafa; border-bottom: 1px solid var(--line); font-family: var(--sans); }
.pdf-head span { font-weight: 500; font-size: 1rem; }
.pdf-head a { font-size: .9rem; color: var(--ink); white-space: nowrap; }
.pdf iframe { display: block; width: 100%; height: 640px; border: 0; }
.pdf.missing iframe { display: none; }
.pdf.missing .pdf-head a { display: none; }
.pdf.missing .pdf-head::after { content: "PDF coming soon"; font-size: .85rem; color: var(--muted); }

/* ---------- Footer ---------- */
footer { padding: 3rem; border-top: 1px solid #eee; font: .9rem var(--sans); color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
footer a { color: inherit; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hero-container { grid-template-columns: 360px 1fr; gap: 3.5rem; }
}
@media (max-width: 860px) {
  nav { position: static; flex-direction: column; align-items: flex-start; gap: .9rem; padding: 1.25rem 16px; }
  .logo { font-size: 1.5rem; }
  .nav-links { gap: .5rem 1.25rem; flex-wrap: wrap; }
  .hero { padding: 1.5rem 16px 3rem; min-height: 0; }
  .hero-container { grid-template-columns: 1fr; gap: 2rem; }
  .hero-image { max-width: 420px; }
  .hero-text { font-size: 1.3rem; }
  .page, .section { padding-left: 16px; padding-right: 16px; }
  .page { padding-top: 2rem; }
  .page-title { font-size: 2.2rem; }
  .detail-title { font-size: 1.8rem; }
  .card-grid { grid-template-columns: 1fr; }
  .pdf iframe { height: 480px; }
  footer { padding: 2rem 16px; }
}

/* Video */
.video { display: block; width: 100%; border-radius: 8px; background: #000; margin: 1.5rem 0 2rem; }
.video-portrait { max-width: 360px; margin-left: auto; margin-right: auto; }
