/* ============================================================
   Esdras Paravizo — shared site stylesheet
   Used by: index.html, about.html, resources.html, projects/*.html
   ============================================================ */

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

:root {
  --bg:       #0f172a;
  --surface:  #1e293b;
  --surface2: #253449;
  --border:   #334155;
  --muted:    #475569;
  --subtle:   #64748b;
  --body:     #cbd5e1;
  --heading:  #f8fafc;
  --accent:   #3b82f6;
  --accent2:  #22c55e;
}

html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--body); line-height: 1.6;
}

h1, h2, h3, .nav-brand, .tl-title, .proj-name, .pub-title, .award-name,
.resource-title, .project-hero h1 {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Nav ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(15,23,42,0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 56px;
}
.nav-brand { font-size: 15px; font-weight: 700; color: var(--heading); letter-spacing: -0.02em; text-decoration: none; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 500;
  color: var(--subtle); text-decoration: none; transition: background 0.12s, color 0.12s;
}
.nav-links a:hover { background: var(--surface); color: var(--heading); }
.nav-links a.active { color: var(--heading); background: var(--surface); }
.nav-links a.nav-tree { border: 1px solid var(--border); color: var(--body); }
.nav-links a.nav-tree:hover { border-color: var(--accent); color: var(--heading); background: var(--surface); }

/* ── Sections ── */
section { padding: 96px 32px 64px; max-width: 900px; margin: 0 auto; }
section:first-of-type { padding-top: 120px; }

h2 {
  font-size: 24px; font-weight: 800; color: var(--heading);
  letter-spacing: -0.03em; margin-bottom: 32px;
  display: flex; align-items: center; gap: 10px;
}
h2::after { content:''; flex: 1; height: 1px; background: var(--border); }

h2.collapsible { cursor: pointer; user-select: none; }
h2.collapsible .chevron {
  font-size: 14px; color: var(--subtle); margin-right: 4px;
  transition: transform 0.2s; display: inline-block;
}
h2.collapsible:not(.open) .chevron { transform: rotate(-90deg); }
.collapsible-body.collapsed { display: none; }

/* ── Scroll reveal ── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Hero ── */
#hero { padding-top: 128px; }
.hero-tag { font-size: 12px; font-weight: 700; text-transform: uppercase;
            letter-spacing: .1em; color: var(--accent); margin-bottom: 14px; }
#hero h1 {
  font-size: clamp(36px, 5vw, 56px); font-weight: 700; color: var(--heading);
  letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 20px;
}
.hero-bio {
  font-size: 16px; color: var(--body); max-width: 640px; line-height: 1.75;
  margin-bottom: 28px;
}
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 32px; }
.stat { text-align: center; }
.stat-n { font-size: 28px; font-weight: 800; color: var(--heading); letter-spacing: -0.03em; }
.stat-l { font-size: 11px; font-weight: 600; text-transform: uppercase;
          letter-spacing: .07em; color: var(--subtle); margin-top: 2px; }
.hero-links { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-hero {
  padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: all 0.12s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-hero.primary { background: var(--accent); color: white; }
.btn-hero.primary:hover { background: #2563eb; }
.btn-hero.outline { border: 1px solid var(--border); color: var(--body); background: var(--surface); }
.btn-hero.outline:hover { border-color: var(--accent); color: var(--heading); }

/* ── Hero split (photo + text) ── */
.hero-split {
  display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center;
}
.hero-photo {
  width: 200px; height: 200px; border-radius: 20px; flex-shrink: 0;
  overflow: hidden;
}
.hero-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
@media (max-width: 720px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-photo { order: -1; width: 140px; height: 140px; margin-bottom: 8px; }
}

/* ── Image placeholders ── */
.img-placeholder {
  background:
    repeating-linear-gradient(135deg, var(--surface) 0px, var(--surface) 10px, var(--surface2) 10px, var(--surface2) 20px);
  border: 1px dashed var(--border); border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--subtle); text-align: center; padding: 16px; gap: 4px;
}
.img-placeholder .ph-icon { font-size: 24px; opacity: .8; }
.img-placeholder .ph-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--subtle); }
.img-placeholder .ph-sub { font-size: 10px; color: var(--muted); max-width: 180px; }

/* ── Publications ── */
.pub-subtitle { font-size: 13px; color: var(--subtle); margin: -8px 0 18px; }
.pub-subtitle a { color: var(--accent); text-decoration: none; }
.pub-subtitle a:hover { text-decoration: underline; }
.pub-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }
.filt {
  padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); color: var(--subtle); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.12s; user-select: none;
}
.filt:hover { border-color: var(--accent); color: var(--heading); }
.filt.on { background: var(--accent); border-color: var(--accent); color: white; }

.pub-list { display: flex; flex-direction: column; gap: 10px; }
.pub {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
  transition: border-color 0.15s;
  display: flex; gap: 14px; align-items: flex-start;
}
.pub:hover { border-color: var(--accent); }
.pub.pub-linked { cursor: pointer; }
.pub.pub-linked:hover { background: var(--surface2); }
.pub.hidden { display: none; }
.pub-year {
  font-size: 11px; font-weight: 800; color: var(--subtle);
  min-width: 36px; text-align: right; margin-top: 2px; flex-shrink: 0;
}
.pub-body { flex: 1; min-width: 0; }
.pub-title { font-size: 14px; font-weight: 700; color: var(--heading); line-height: 1.4; margin-bottom: 4px; }
.pub-title a { color: inherit; text-decoration: none; }
.pub-title a:hover { color: var(--accent); text-decoration: underline; }
.pub-venue { font-size: 12px; color: var(--subtle); margin-bottom: 6px; }
.pub-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pub-tag {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: .04em;
}
.pub-tag.journal  { background: #1e3a5f; color: #93c5fd; }
.pub-tag.conf     { background: #1c3a2a; color: #86efac; }
.pub-tag.dataset  { background: #2e1f5e; color: #c4b5fd; }
.pub-tag.resource { background: #1a2e3b; color: #67e8f9; }
.pub-tag.thesis   { background: #2d1a00; color: #fcd34d; }
.pub-cites { font-size: 11px; color: var(--subtle); display: flex; align-items: center; gap: 3px; }
.pub-cites b { color: var(--body); }

/* ── Timeline ── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.tl-item:last-child { border-bottom: none; }
.tl-year { font-size: 12px; font-weight: 800; color: var(--subtle); min-width: 80px; flex-shrink: 0; padding-top: 2px; }
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-size: 15px; font-weight: 700; color: var(--heading); margin-bottom: 3px; }
.tl-sub { font-size: 13px; color: var(--subtle); margin-bottom: 6px; }
.tl-desc { font-size: 13px; color: var(--body); line-height: 1.6; margin-bottom: 8px; }
.tl-bullets { list-style: none; display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.tl-bullets li { font-size: 13px; color: var(--body); line-height: 1.6; padding-left: 14px; position: relative; }
.tl-bullets li::before { content: '·'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.tl-badge {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 10px; text-transform: uppercase; letter-spacing: .04em;
}
.tl-badge.phd     { background: #1e3a5f; color: #93c5fd; }
.tl-badge.master  { background: #1c3a2a; color: #86efac; }
.tl-badge.bachelor{ background: #2e1f5e; color: #c4b5fd; }
.tl-badge.tech    { background: #1a2e3b; color: #67e8f9; }

/* ── Student rating + quote gallery (Teaching) ── */
.tl-rating {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border);
}
.tl-rating-stars { font-size: 13px; letter-spacing: 1px; color: #fbbf24; }
.tl-rating-score { font-size: 14px; font-weight: 800; color: var(--heading); }
.tl-rating-label { font-size: 12px; color: var(--subtle); }

.quote-gallery { margin-top: 14px; max-width: 100%; }
.quote-track {
  display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px;
  scroll-snap-type: x proximity; max-width: 100%;
  scrollbar-width: thin; scrollbar-color: rgba(148,163,184,0.25) transparent;
}
.quote-track::-webkit-scrollbar { height: 6px; }
.quote-track::-webkit-scrollbar-track { background: transparent; }
.quote-track::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 6px; }
.quote-track::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.4); }
.quote-card {
  flex: 0 0 260px; scroll-snap-align: start; margin: 0;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px;
}
.quote-card p {
  font-size: 12.5px; color: var(--body); line-height: 1.6; font-style: italic;
  margin: 0 0 8px;
}
.quote-card cite {
  font-size: 11px; font-weight: 700; color: var(--subtle); font-style: normal;
}

/* ── Projects grid ── */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.proj {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px; transition: border-color 0.15s, transform 0.12s;
  display: flex; flex-direction: column;
}
.proj:hover { border-color: var(--accent); transform: translateY(-2px); }
.proj-icon { font-size: 26px; margin-bottom: 12px; }
.proj-name { font-size: 15px; font-weight: 800; color: var(--heading); margin-bottom: 6px; }
.proj-desc { font-size: 13px; color: var(--body); line-height: 1.6; margin-bottom: 14px; flex: 1; }
.proj-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ptag {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
  background: rgba(59,130,246,0.12); color: #93c5fd; border: 1px solid rgba(59,130,246,0.25);
}
.proj-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.proj-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--accent); text-decoration: none; }
.proj-link:hover { text-decoration: underline; }
.proj-link.secondary { color: var(--subtle); }
.proj-link.secondary:hover { color: var(--body); }

/* Featured project cards (have a dedicated case-study page) */
.proj.featured { border-color: rgba(59,130,246,0.35); }
.proj-thumb {
  height: 110px; border-radius: 8px; margin-bottom: 14px; overflow: hidden;
}
.proj-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proj-thumb .ph-icon { font-size: 20px; }
.proj-thumb .ph-label { font-size: 10px; }
.case-study-badge {
  align-self: flex-start; font-size: 10px; font-weight: 700; color: var(--accent2);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px;
  display: flex; align-items: center; gap: 4px;
}

/* ── Awards ── */
.awards-list { display: flex; flex-direction: column; gap: 12px; }
.award {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
  display: flex; gap: 14px; align-items: flex-start;
  transition: border-color 0.15s;
}
.award:hover { border-color: var(--accent); }
.award-year { font-size: 11px; font-weight: 800; color: var(--subtle); min-width: 36px; text-align: right; margin-top: 2px; flex-shrink: 0; }
.award-body { flex: 1; }
.award-name { font-size: 14px; font-weight: 700; color: var(--heading); margin-bottom: 3px; }
.award-org { font-size: 12px; color: var(--subtle); }

/* ── Research interests ── */
.interests-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.interest-tag {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); color: var(--body); font-size: 13px; font-weight: 500;
}

/* ── Workshops stat line ── */
.workshop-stat {
  font-size: 15px; color: var(--body); line-height: 1.75; max-width: 680px; margin-bottom: 24px;
}
.workshop-stat strong { color: var(--heading); font-weight: 700; }
.workshop-link {
  margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--accent);
  text-decoration: none; white-space: nowrap;
}
.workshop-link:hover { text-decoration: underline; }

/* ── Bento photo gallery (About page workshops) ── */
.bento-gallery {
  display: grid; grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 130px; grid-auto-flow: dense; gap: 14px;
}
.bento-item {
  position: relative; grid-column: span 1; grid-row: span 1;
  border-radius: 16px; overflow: hidden; border: 1px solid var(--border);
  display: block; text-decoration: none;
}
.bento-item.big  { grid-column: span 2; grid-row: span 2; }
.bento-item.wide { grid-column: span 2; }
.bento-item.tall { grid-row: span 2; }
.bento-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: grayscale(35%) brightness(0.9);
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1), filter 0.4s ease;
}
.bento-item::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(15,23,42,0.95) 0%, rgba(15,23,42,0.25) 50%, rgba(15,23,42,0) 72%);
  opacity: 0.6; transition: opacity 0.3s ease;
}
.bento-item:hover img { transform: scale(1.08); filter: grayscale(0%) brightness(1); }
.bento-item:hover::after { opacity: 0.95; }
.bento-caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 3px;
  transform: translateY(65%); opacity: 0;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), opacity 0.3s ease;
}
.bento-item:hover .bento-caption { transform: translateY(0); opacity: 1; }
.bento-kicker {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #93c5fd;
}
.bento-title { font-size: 13px; font-weight: 700; color: #fff; line-height: 1.3; }

@media (max-width: 640px) {
  .bento-gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 120px; }
  .bento-item.big { grid-column: span 2; grid-row: span 2; }
  .bento-item.wide { grid-column: span 2; }
  .bento-caption { transform: translateY(0); opacity: 1; background: linear-gradient(to top, rgba(15,23,42,0.9), transparent); }
}

/* ── Commissioned reports (A4-proportioned thumbnails) ── */
.reports-subheading {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent); margin: 28px 0 14px;
}
.reports-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 160px)); gap: 22px; }
.report-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.report-thumb { aspect-ratio: 210 / 297; border-radius: 10px; overflow: hidden; transition: border-color 0.15s; }
.report-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.report-thumb .ph-icon { font-size: 20px; }
.report-thumb .ph-label { font-size: 10px; }
.report-caption { font-size: 12px; font-weight: 600; color: var(--body); line-height: 1.4; transition: color 0.15s; }
.report-card:hover .report-thumb { border-color: var(--accent); }
.report-card:hover .report-caption { color: var(--heading); }

/* ── Contact grid ── */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.contact-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
  text-decoration: none; transition: border-color 0.15s, transform 0.12s;
  display: flex; flex-direction: column; gap: 4px;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--subtle); }
.contact-value { font-size: 13px; font-weight: 600; color: var(--accent); }

/* ── Project detail pages ── */
.back-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  color: var(--subtle); text-decoration: none; margin-bottom: 20px;
}
.back-link:hover { color: var(--heading); }
.project-hero-img { height: 280px; border-radius: 16px; margin-top: 28px; }
.project-hero-img .ph-icon { font-size: 32px; }
.project-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 0; }
.project-section { margin-bottom: 40px; }
.project-section h3 {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent); margin-bottom: 14px;
}
.project-section p { font-size: 15px; color: var(--body); line-height: 1.8; margin-bottom: 14px; max-width: 720px; }
.project-section ul.plain { list-style: none; display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.project-section ul.plain li { font-size: 14px; color: var(--body); line-height: 1.7; padding-left: 16px; position: relative; }
.project-section ul.plain li::before { content: '·'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.project-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 8px; }
.project-gallery .img-placeholder { aspect-ratio: 4 / 3; }
.project-links { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Resources page ── */
.resource-list { display: flex; flex-direction: column; gap: 24px; }
.resource-row {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; display: grid; grid-template-columns: 320px 1fr; gap: 28px;
  transition: border-color 0.15s;
}
.resource-row:hover { border-color: var(--accent); }
@media (max-width: 720px) {
  .resource-row { grid-template-columns: 1fr; }
}

.resource-carousel { position: relative; }
.carousel-track {
  position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
}
.carousel-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.35s ease;
  pointer-events: none;
}
.carousel-slide.active { opacity: 1; pointer-events: auto; }
.carousel-slide .img-placeholder { width: 100%; height: 100%; border-radius: 12px; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block; }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(15,23,42,0.75); border: 1px solid var(--border); color: var(--heading);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 14px; transition: background 0.12s, border-color 0.12s;
}
.carousel-btn:hover { background: var(--accent); border-color: var(--accent); }
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }
.carousel-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.carousel-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--border);
  cursor: pointer; transition: background 0.12s, transform 0.12s;
}
.carousel-dot.active { background: var(--accent); transform: scale(1.3); }

.resource-info { display: flex; flex-direction: column; }
.resource-kicker { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 8px; }
.resource-title { font-size: 19px; font-weight: 700; color: var(--heading); margin-bottom: 10px; letter-spacing: -0.01em; }
.resource-desc { font-size: 14px; color: var(--body); line-height: 1.75; margin-bottom: 16px; flex: 1; }
.resource-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.resource-links { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Footer ── */
footer {
  text-align: center; padding: 32px; font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--border); margin-top: 64px;
}
footer a { color: var(--subtle); text-decoration: none; }
footer a:hover { color: var(--accent); }

@media (max-width: 640px) {
  nav { padding: 0 16px; }
  .nav-brand { font-size: 13px; }
  .nav-links a { padding: 5px 8px; font-size: 12px; }
  section { padding: 80px 16px 48px; }
  #hero { padding-top: 96px; }
  .hero-stats { gap: 20px; }
  .tl-year { min-width: 60px; font-size: 11px; }
}
