/* ============================================================
   Benjamin A. Lebovitz — personal website stylesheet
   ------------------------------------------------------------
   EDIT COLORS HERE: change the values below and the whole
   site updates. The site supports light + dark mode.
   ============================================================ */

:root {
  --accent: #5044df;          /* primary accent (links, buttons) — vivid indigo */
  --accent-soft: #5044df14;   /* accent at low opacity (tags, hovers) */
  --bg: #fbfaff;              /* page background — faint lavender white */
  --surface: #ffffff;         /* cards / panels */
  --text: #141414;            /* body text — near-black ink */
  --text-muted: #5f5c6b;      /* secondary text */
  --border: #e7e4f4;          /* hairlines */
  --shadow: 0 1px 3px rgba(20, 20, 20, 0.06), 0 8px 24px rgba(80, 68, 223, 0.07);
  --radius: 14px;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* supporting palette — used for the pride hairline & card accents */
  --c-coral: #ff5f56;
  --c-yellow: #ffd000;
  --c-green: #30c77a;
  --c-cyan: #07b3e3;
  --c-indigo: #5044df;
  --c-pink: #ffb6ef;
  --pride: linear-gradient(90deg, var(--c-coral), var(--c-yellow), var(--c-green),
           var(--c-cyan), var(--c-indigo), var(--c-pink));
}

[data-theme="dark"] {
  --accent: #948cff;
  --accent-soft: #948cff21;
  --bg: #131218;
  --surface: #1d1c25;
  --text: #edecf3;
  --text-muted: #a5a1b3;
  --border: #312e3f;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --c-coral: #ff7a72;
  --c-yellow: #ffd84d;
  --c-green: #4cd592;
  --c-cyan: #3cc6ec;
  --c-indigo: #948cff;
  --c-pink: #ffc4f2;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background 0.3s ease, color 0.3s ease;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; font-weight: 600; }
h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); margin: 0 0 0.4rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 1rem; }
h3 { font-size: 1.15rem; margin: 1.6rem 0 0.6rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1rem; }
.container { max-width: 980px; margin: 0 auto; padding: 0 1.4rem; }
.muted { color: var(--text-muted); }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
/* pride hairline under the header */
.site-header::after {
  content: ""; display: block; height: 3px; background: var(--pride);
}
.nav-wrap {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 980px; margin: 0 auto; padding: 0.7rem 1.4rem;
}
.brand {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.35rem; color: var(--text);
}
.brand:hover { text-decoration: none; color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 0.2rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 0.45rem 0.85rem; border-radius: 999px;
  color: var(--text-muted); font-size: 0.95rem; font-weight: 500;
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); text-decoration: none; }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.theme-toggle, .nav-toggle {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; cursor: pointer; font-size: 1rem;
  width: 2.3rem; height: 2.3rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease;
}
.theme-toggle:hover, .nav-toggle:hover { transform: scale(1.08); }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem 1rem; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { border-radius: 10px; padding: 0.7rem 0.9rem; }
}

/* ---------- hero (home) ---------- */
.hero { padding: 4.5rem 0 3rem; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 2.5rem; align-items: center; }
@media (max-width: 760px) { .hero-grid { grid-template-columns: 1fr; } .hero-photo { order: -1; justify-self: center; } }
.hero .kicker {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem;
  font-weight: 600; color: var(--accent); margin-bottom: 0.8rem;
}
.hero .pronouns { font-size: 1.05rem; color: var(--text-muted); font-family: var(--font-body); font-weight: 400; }
.hero .tagline { font-size: 1.15rem; color: var(--text-muted); max-width: 38rem; }
.hero-photo img {
  width: 250px; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.6rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.6rem 1.25rem; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; box-shadow: var(--shadow); }
.btn-primary { background: var(--accent); color: #fff; }
[data-theme="dark"] .btn-primary { color: #131218; }
.btn-outline { border-color: var(--border); background: var(--surface); color: var(--text); }

/* ---------- sections & cards ---------- */
.section { padding: 2.5rem 0; }
.section + .section { border-top: 1px solid var(--border); }
/* short pride underline beneath section headings */
.section > h2::after, .page-head > h1::after {
  content: ""; display: block; width: 3.2rem; height: 4px;
  border-radius: 999px; background: var(--pride); margin-top: 0.55rem;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; margin-top: 1.4rem; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem 1.4rem; box-shadow: var(--shadow);
  transition: transform 0.2s ease;
  border-top: 4px solid var(--c-indigo);
}
.card:hover { transform: translateY(-3px); }
.card h3 { margin-top: 0; }
.card .card-label {
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem;
  font-weight: 700; color: var(--accent); display: block; margin-bottom: 0.4rem;
}
/* cards cycle through the supporting palette */
.card-grid .card:nth-child(3n+1) { border-top-color: var(--c-coral); }
.card-grid .card:nth-child(3n+2) { border-top-color: var(--c-green); }
.card-grid .card:nth-child(3n+3) { border-top-color: var(--c-cyan); }
.card-grid .card:nth-child(3n+1) .card-label { color: color-mix(in srgb, var(--c-coral) 85%, var(--text)); }
.card-grid .card:nth-child(3n+2) .card-label { color: color-mix(in srgb, var(--c-green) 75%, var(--text)); }
.card-grid .card:nth-child(3n+3) .card-label { color: color-mix(in srgb, var(--c-cyan) 80%, var(--text)); }

/* ---------- page intro banner ---------- */
.page-head { padding: 3.2rem 0 1rem; }
.page-head p { max-width: 44rem; color: var(--text-muted); font-size: 1.08rem; }

/* ---------- publication lists ---------- */
.filter-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.2rem 0 1.6rem; }
.filter-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  padding: 0.4rem 0.95rem; border-radius: 999px; font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] .filter-btn.active { color: #131218; }

.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-list li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.2rem; margin-bottom: 0.8rem; box-shadow: var(--shadow);
}
.pub-list li.hidden { display: none; }
.pub-list .venue { font-style: italic; }
.pub-list .pub-links { margin-top: 0.4rem; font-size: 0.88rem; }
.tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 0.15rem 0.65rem; margin-bottom: 0.45rem;
}

/* ---------- accordions (details/summary) ---------- */
details.accordion {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 0.7rem; box-shadow: var(--shadow);
  overflow: hidden;
}
details.accordion summary {
  cursor: pointer; padding: 1rem 1.2rem; font-weight: 600; font-size: 1.02rem;
  font-family: var(--font-display); list-style: none; position: relative;
}
details.accordion summary::-webkit-details-marker { display: none; }
details.accordion summary::after {
  content: "+"; position: absolute; right: 1.2rem; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-size: 1.3rem; font-weight: 400; transition: transform 0.2s ease;
}
details.accordion[open] summary::after { content: "–"; }
details.accordion summary:hover { background: var(--accent-soft); }
details.accordion .accordion-body { padding: 0 1.2rem 1.1rem; }
details.accordion .accordion-body ul { margin: 0.3rem 0 0; padding-left: 1.1rem; }
details.accordion .accordion-body li { margin-bottom: 0.7rem; }
summary .count { color: var(--text-muted); font-weight: 400; font-size: 0.85rem; margin-left: 0.4rem; }

/* ---------- timeline (teaching & service) ---------- */
.timeline { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.timeline li {
  display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem;
  padding: 0.55rem 0; border-bottom: 1px dashed var(--border);
}
.timeline li:last-child { border-bottom: none; }
.timeline .when { color: var(--text-muted); font-size: 0.88rem; font-weight: 600; white-space: nowrap; }
@media (max-width: 600px) { .timeline li { grid-template-columns: 1fr; gap: 0.1rem; } }

/* ---------- photos ----------
   Each photo is a <figure class="photo" data-file="assets/...">.
   If the image file is missing, a labeled drop-zone appears instead,
   so placeholders stay presentable until you add the real photo.   */
.photo { margin: 0; }
.photo img {
  display: block; width: 100%; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.photo figcaption {
  font-size: 0.85rem; color: var(--text-muted);
  margin-top: 0.55rem; line-height: 1.45;
}
.photo-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem; align-items: start;
}
.photo.missing img { display: none; }
.photo.missing::before {
  content: "📷  Add a photo here — save it as  " attr(data-file);
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 230px; padding: 1.2rem;
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-muted); font-size: 0.9rem;
}

/* ---------- newsletter (QueerED) page ---------- */
.substack-embed {
  width: 100%; max-width: 480px; height: 320px; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface);
  margin-top: 0.6rem;
}

/* ---------- CV page ---------- */
.cv-frame {
  width: 100%; height: 78vh; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface);
}
.cv-fallback { padding: 2rem; text-align: center; }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.1rem; margin-top: 1.4rem; }
.contact-card { text-align: left; }
.contact-card .big { font-size: 1.06rem; font-weight: 600; word-break: break-all; }
.copy-btn { margin-top: 0.7rem; }
.social-list { list-style: none; padding: 0; margin: 0.4rem 0 0; }
.social-list li { margin-bottom: 0.45rem; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 3rem;
  padding: 0 0 2.6rem; color: var(--text-muted); font-size: 0.9rem;
}
/* matching pride hairline bookends the page */
.site-footer::before {
  content: ""; display: block; height: 3px; background: var(--pride);
  margin-bottom: 2rem;
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }

/* ---------- scroll-reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
