:root{
  --ink:#0f172a;
  --muted:#64748b;
  --accent:#1d4ed8;
  --bg:#f8fafc;
  --card:#ffffff;
  --border:#e2e8f0;
}

/* Scope everything to home content only */
.home-wrap, .home-wrap *{box-sizing:border-box}

.home-wrap{
  max-width:1200px;
  margin:0 auto;
  padding:0;
  color:var(--ink);
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial;
}

.home-wrap a{color:var(--accent)}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  padding:18px;
  box-shadow:0 8px 18px rgba(15,23,42,.05);
}

.hero{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(280px,360px);
  gap:20px;
  align-items:stretch;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:22px;
  box-shadow:0 12px 26px rgba(15,23,42,.08);
}

.hero h1{margin:0 0 6px}

.hero-title{
  font-size:clamp(26px,3.4vw,42px);
  letter-spacing:-0.02em;
  line-height:1.06;
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:10px;
}

.hero-title__prefix{
  font-size:.72em;
  font-weight:650;
  color:var(--muted);
  letter-spacing:.02em;
}

.hero-title__name{
  font-size:1em;
  font-weight:850;
  color:var(--ink);
}

.name-row{
  display:flex;
  align-items:baseline;
  flex-wrap:wrap;
  gap:10px;
}

.cv-badge{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:750;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:rgba(15,23,42,.78);
  background:rgba(15,23,42,.04);
  border:1px solid rgba(15,23,42,.12);
}

.hero p{margin:8px 0;color:var(--muted)}

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

.hero-links{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
  color:var(--muted);
  font-weight:650;
}

.hero-links a{
  color:var(--muted);
  text-decoration:none;
  border-bottom:1px solid rgba(100,116,139,.35);
}

.hero-links a:hover{color:var(--accent); border-bottom-color:rgba(29,78,216,.45)}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:9px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--ink);
  text-decoration:none;
  font-weight:650;
}

.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}

.btn:hover{
  text-decoration:none;
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(29,78,216,.14);
}

.chips{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 0;padding:0;list-style:none}
.chips li{background:rgba(15,23,42,.03);border:1px solid rgba(15,23,42,.10);color:#0f172a;border-radius:999px;padding:4px 10px;font-size:12px}

.topic-block{margin-top:12px}

.topic-label{
  font-size:12px;
  font-weight:750;
  letter-spacing:.10em;
  text-transform:uppercase;
  color:var(--muted);
  margin:0 0 6px;
}

.chips--primary{margin-top:0}
.chips--primary li{font-size:12px;padding:5px 11px}

.chips--secondary{margin-top:10px}
.chips--secondary li{font-size:11.5px;padding:4px 10px;opacity:.92}

.topic-more{margin-top:10px}
.topic-more summary{
  cursor:pointer;
  color:var(--muted);
  font-weight:650;
  list-style:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.topic-more summary::-webkit-details-marker{display:none}

.topic-more summary:after{content:"▾"; font-size:12px;}

.topic-more[open] summary:after{content:"▴"}

.past-emails{
  margin:10px 0 0;
  padding-top:10px;
  border-top:1px dashed rgba(15,23,42,.16);
}

.past-emails-label{
  font-size:12px;
  font-weight:750;
  letter-spacing:.10em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:6px;
}

/* Collapsible blocks (e.g., Past emails) */
.collapsible summary{
  cursor:pointer;
  list-style:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.collapsible summary::-webkit-details-marker{display:none}

.collapsible summary:after{content:"▾"; font-size:12px; color:var(--muted)}
.collapsible[open] summary:after{content:"▴"}

.past-emails-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.profile-links{
  list-style:none;
  margin:8px 0 0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.profile-links a{
  text-decoration:none;
  font-weight:650;
}

.profile-links a:hover{text-decoration:underline}

/* Tagline (keep it light; avoid competing with chips) */
.tagline{
  margin:10px 0 0;
  display:flex;
  flex-direction:column;
  gap:4px;
  align-items:flex-start;
}

.tagline-badge{
  display:block;
  max-width:100%;
  padding:0;
  border:0;
  border-radius:0;
  background:none;
  box-shadow:none;
  font-size:14px;
  font-weight:650;
  color:rgba(15,23,42,.78);
  line-height:1.35;
}

.tagline-badge:before{content:none}

.tagline-badge--sub{
  font-size:13px;
  font-weight:600;
  color:var(--muted);
}

.grid{
  display:grid;
  grid-template-columns:minmax(240px,300px) minmax(0,1fr);
  gap:20px;
  margin-top:20px;
  align-items:start;
}

.toc{position:sticky; top:18px}
.toc h3{margin:0 0 10px;font-size:14px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.toc ul{margin:0;padding-left:18px}
.toc li{margin:6px 0}
.toc a{color:var(--ink);text-decoration:none}
.toc a:hover{text-decoration:underline}

.section h2{margin:26px 0 8px;font-size:clamp(18px,2.4vw,22px);color:var(--ink)}
.section h3{margin:18px 0 6px;font-size:clamp(14px,2vw,16px);color:var(--ink)}
.section p{margin:0 0 12px}
.section ul{margin:0 0 14px}

.about-box{
  margin:10px 0 18px;
  padding:14px 16px;
  border:1px solid rgba(15,23,42,.08);
  border-radius:14px;
  background:linear-gradient(180deg, rgba(29,78,216,.03), rgba(248,250,252,.92));
}

.soft-box{
  margin:10px 0 18px;
  padding:14px 16px;
  border:1px solid rgba(15,23,42,.08);
  border-radius:14px;
  background:linear-gradient(180deg, rgba(29,78,216,.02), rgba(248,250,252,.94));
}

.visitor-map__embed{
  margin-top:6px;
  min-height: 120px;
}

.about-box h3:first-child{margin-top:0}
.about-box ul:last-child{margin-bottom:0}

.about-summary{
  list-style:none;
  margin:8px 0 14px;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.about-summary li{
  padding-left:12px;
  position:relative;
  color:rgba(15,23,42,.86);
}

.about-summary li:before{
  content:"";
  position:absolute;
  left:0;
  top:10px;
  width:6px;
  height:6px;
  border-radius:50%;
  background:rgba(29,78,216,.45);
}

/* Timeline (Education) */
.timeline{
  position:relative;
  margin:10px 0 18px;
  padding-left:26px;
}

.timeline:before{
  content:"";
  position:absolute;
  left:10px;
  top:6px;
  bottom:6px;
  width:2px;
  background:rgba(15,23,42,.14);
  border-radius:2px;
}

.timeline-item{
  position:relative;
  margin:0 0 16px;
}

.timeline-item:before{
  content:"";
  position:absolute;
  left:-21px;
  top:6px;
  width:10px;
  height:10px;
  border-radius:50%;
  background:#fff;
  border:2px solid rgba(29,78,216,.55);
  box-shadow:0 6px 14px rgba(29,78,216,.14);
}

.timeline-meta{
  font-size:12px;
  font-weight:750;
  letter-spacing:.10em;
  text-transform:uppercase;
  color:var(--muted);
  margin:0 0 6px;
}

.timeline-item p{margin:0 0 6px}
.timeline-item ul{margin:0 0 2px}

.pdf-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-top:26px;
}

.pdf-head h2{margin:0}

.pdf-embed{margin-top:12px;border:1px solid var(--border);border-radius:12px;overflow:hidden}
.pdf-embed iframe{width:100%;height:clamp(420px,70vh,780px);border:0;display:block}

/* Responsive improvements */
@media (max-width:980px){
  .hero{grid-template-columns:1fr}
  .grid{grid-template-columns:1fr}
  .toc{position:static}
}

@media (max-width:820px){
  .btn{flex:1 1 auto}
}

@media (max-width:560px){
  .home-wrap{margin:18px auto 60px;padding:0 14px}
  .card{padding:14px}
  .hero{padding:16px;border-radius:12px}
  .pdf-embed iframe{height:clamp(360px,60vh,560px)}
}

/* Print / Save as PDF */
@media print {
  /* Keep the same layout as screen */
  .home-wrap{
    max-width:none;
    margin:0 auto;
    padding:0;
  }

  /* Make long strings wrap instead of clipping */
  .home-wrap,
  .home-wrap *{
    overflow-wrap:anywhere;
    word-break:break-word;
    hyphens:auto;
  }

  .hero{
    display:grid;
    /* Allow columns to shrink on paper to avoid horizontal clipping */
    grid-template-columns:minmax(0,1fr) minmax(0,320px);
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Printing + CSS grid fragmentation is unreliable in Chromium.
     Use block flow so content can start on the same page after hero. */
  .grid{
    display:block;
    margin-top:20px;
  }

  .grid:after{
    content:"";
    display:block;
    clear:both;
  }

  .grid > aside.card.toc{
    float:left;
    width:240px;
    margin-right:20px;
  }

  .grid > .card.section{
    margin-left:260px;
  }

  /* Sticky doesn't make sense on paper */
  .toc{position:static; top:auto;}

  /* Slightly tighten spacing for paper */
  .card{padding:14px;}
  .hero{padding:18px;}
  .section h2{margin:18px 0 6px;}
  .section h3{margin:14px 0 6px;}

  /* Avoid splitting key blocks across pages */
  .timeline-item, .about-box, .toc{
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Allow the main content card to flow across pages */
  .grid > .card.section{
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  #visitors,
  .visitor-map{
    display:none !important;
  }
}
