/* ==========================================================================
   Bhuvnesh Brawar — personal academic website
   One stylesheet for every page. Light and dark themes via CSS variables.
   ========================================================================== */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #182033;
  --muted: #5a6478;
  --border: #e1e6ef;
  --accent: #0a6c94;
  --accent-strong: #08506e;
  --accent-soft: #e2f1f8;
  --sun: #e8890c;
  --sun-soft: #fdf1e1;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .06);
  --shadow-lg: 0 10px 40px rgba(16, 24, 40, .12);
  --radius: 14px;
  --radius-sm: 8px;
  --max: 1120px;
  --prose: 72ch;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0c111c;
  --surface: #141b2a;
  --surface-2: #1b2436;
  --text: #e5e9f2;
  --muted: #9aa5ba;
  --border: #253048;
  --accent: #4fb6e3;
  --accent-strong: #7fcbec;
  --accent-soft: #13314a;
  --sun: #f5a623;
  --sun-soft: #3a2a12;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background-color .2s ease, color .2s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: #fff; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--accent); color: #fff; padding: .5rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { left: 8px; color: #fff; }

.container { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-sm { padding: 2.5rem 0; }
.muted { color: var(--muted); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 66px; }
.brand { display: flex; align-items: center; gap: .65rem; color: var(--text); text-decoration: none; font-weight: 700; }
.brand:hover { color: var(--text); }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #2a9d8f 55%, var(--sun));
  color: #fff; font-size: .9rem; letter-spacing: .02em;
}
.brand small { display: block; font-weight: 500; font-size: .75rem; color: var(--muted); line-height: 1.1; }
.brand-text { line-height: 1.2; }

.nav-links { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: .45rem .8rem; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.nav-actions { display: flex; align-items: center; gap: .4rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--text); cursor: pointer; font-size: 1rem;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .fa-sun { display: none; }
[data-theme="dark"] .theme-toggle .fa-sun { display: inline-block; }
[data-theme="dark"] .theme-toggle .fa-moon { display: none; }
.menu-toggle { display: none; }

@media (max-width: 880px) {
  .menu-toggle { display: inline-grid; }
  .nav-links {
    position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: .5rem 1.25rem 1rem; box-shadow: var(--shadow-lg);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { border-radius: var(--radius-sm); padding: .75rem 1rem; }
  .brand small { display: none; }
}

/* ---------- Buttons, chips, badges ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.2rem; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
[data-theme="dark"] .btn-primary { color: #06141d; }
[data-theme="dark"] .btn-primary:hover { color: #06141d; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: .35rem .8rem; font-size: .85rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

.chip-list { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .75rem; border-radius: 999px; font-size: .875rem; font-weight: 500;
  background: var(--accent-soft); color: var(--accent-strong);
}
[data-theme="dark"] .chip { color: var(--accent); }
.chip-plain { background: var(--surface-2); color: var(--text); }

.badge {
  display: inline-block; padding: .15rem .55rem; border-radius: 6px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.badge-journal { background: var(--accent-soft); color: var(--accent-strong); }
.badge-book { background: var(--sun-soft); color: var(--sun); }
.badge-conference { background: #e8f5ef; color: #1c7c54; }
[data-theme="dark"] .badge-journal { color: var(--accent); }
[data-theme="dark"] .badge-conference { background: #12352a; color: #5fd3a2; }

.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .75rem;
}

/* ---------- Cards & grids ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.feature .feature-icon {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); font-size: 1.15rem; margin-bottom: 1rem;
}
.feature h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.feature p { color: var(--muted); margin: 0; font-size: .97rem; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.section-head h2 { margin: 0; }
.section-head p { margin: .35rem 0 0; color: var(--muted); }
.link-arrow { font-weight: 600; text-decoration: none; white-space: nowrap; }
.link-arrow i { transition: transform .15s ease; }
.link-arrow:hover i { transform: translateX(3px); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding: clamp(2.5rem, 6vw, 4rem) 0 2rem; border-bottom: 1px solid var(--border); background:
  radial-gradient(900px 300px at 85% -20%, var(--accent-soft), transparent 70%),
  radial-gradient(600px 240px at 0% 120%, var(--sun-soft), transparent 70%); }
.page-hero h1 { margin-bottom: .4rem; }
.page-hero p { color: var(--muted); max-width: 62ch; margin: 0; font-size: 1.1rem; }
.breadcrumb { font-size: .875rem; color: var(--muted); margin-bottom: .9rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; opacity: .6; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- Home hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 6rem) 0; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(700px 380px at 90% 10%, var(--accent-soft), transparent 70%),
    radial-gradient(520px 320px at 5% 95%, var(--sun-soft), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.5vw, 3.6rem); margin-bottom: .3rem; }
.hero .role { font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: var(--muted); margin-bottom: 1.25rem; }
.hero .role strong { color: var(--text); font-weight: 600; }
.hero .lead { font-size: 1.12rem; max-width: 58ch; margin-bottom: 1.5rem; }
.hero .chip-list { margin-bottom: 1.75rem; }
.rotator { color: var(--accent); font-weight: 600; display: inline-block; min-width: 12ch; }

.hero-photo { position: relative; justify-self: center; width: min(360px, 80vw); }
.hero-photo::before {
  content: ""; position: absolute; inset: -14px; border-radius: 30px; z-index: -1;
  background: conic-gradient(from 200deg, var(--accent), #2a9d8f, var(--sun), var(--accent));
  opacity: .85; filter: blur(.5px);
}
.hero-photo img { border-radius: 24px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; border: 6px solid var(--surface); box-shadow: var(--shadow-lg); }
.hero-photo .affil {
  position: absolute; left: -18px; bottom: 22px; display: flex; align-items: center; gap: .6rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: .55rem .85rem; box-shadow: var(--shadow-lg); font-size: .85rem; line-height: 1.25;
}
.hero-photo .affil i { color: var(--accent); font-size: 1.2rem; }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; width: min(260px, 70vw); }
  .hero-photo .affil { left: 50%; transform: translateX(-50%); bottom: -18px; white-space: nowrap; }
}

.social { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.social a {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); text-decoration: none;
}
.social a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: 1.4rem 1rem; text-align: center; }
.stat strong { display: block; font-size: 2rem; line-height: 1.1; color: var(--accent); }
.stat span { color: var(--muted); font-size: .9rem; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Info list ---------- */
.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li { display: grid; grid-template-columns: 110px 1fr; gap: 1rem; padding: .75rem 0; border-bottom: 1px dashed var(--border); }
.info-list li:last-child { border-bottom: 0; }
.info-list .label { color: var(--muted); font-weight: 500; font-size: .95rem; }
.info-list a { word-break: break-word; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 1.6rem 2.1rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent);
}
.timeline .when { display: inline-block; font-size: .8rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: .1rem .55rem; border-radius: 6px; margin-bottom: .35rem; }
.timeline h3 { font-size: 1.05rem; margin: 0 0 .2rem; }
.timeline p { color: var(--muted); margin: 0; font-size: .95rem; }

/* ---------- Skills ---------- */
.skill { margin-bottom: 1rem; }
.skill-head { display: flex; justify-content: space-between; font-weight: 600; font-size: .95rem; margin-bottom: .35rem; }
.skill-head span:last-child { color: var(--muted); font-weight: 500; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #2a9d8f); }

/* ---------- Workshops ---------- */
.event { display: flex; gap: 1rem; align-items: flex-start; }
.event .event-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--sun-soft); color: var(--sun); }
.event h3 { font-size: 1rem; margin: 0 0 .25rem; }
.event p { margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- Publications ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.filter-btn {
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted);
}
.filter-btn:hover { color: var(--text); border-color: var(--accent); }
.filter-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] .filter-btn[aria-pressed="true"] { color: #06141d; }
.filter-btn .count { opacity: .7; margin-left: .25rem; font-weight: 500; }

.pub-year { font-size: 1.1rem; color: var(--muted); margin: 2rem 0 1rem; display: flex; align-items: center; gap: .75rem; }
.pub-year::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.pub-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.pub { padding: 1.25rem 1.4rem; }
.pub-title { font-size: 1.05rem; margin: .5rem 0 .35rem; line-height: 1.4; }
.pub-authors { font-size: .93rem; color: var(--muted); margin: 0 0 .25rem; }
.pub-authors strong { color: var(--text); }
.pub-venue { font-size: .93rem; margin: 0 0 .85rem; }
.pub-venue em { color: var(--text); }
.pub-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.pub[hidden], .pub-group[hidden] { display: none; }

/* ---------- Blog cards ---------- */
.post-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.post-card .thumb { aspect-ratio: 1200 / 630; overflow: hidden; background: var(--surface-2); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .thumb img { transform: scale(1.04); }
.post-card .body { padding: 1.25rem 1.35rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.post-card .meta { font-size: .82rem; color: var(--muted); display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.post-card h3 { font-size: 1.15rem; margin: 0 0 .5rem; }
.post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h3 a::after { content: ""; position: absolute; inset: 0; }
.post-card { position: relative; }
.post-card p { color: var(--muted); font-size: .95rem; margin: 0 0 1rem; }
.post-card .tag { margin-top: auto; align-self: flex-start; }

/* ---------- Article ---------- */
.article-header { padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem; }
.article-header .wrap, .prose, .article-footer { max-width: var(--prose); margin-inline: auto; }
.article-header h1 { font-size: clamp(2rem, 4.5vw, 2.75rem); }
.article-header .standfirst { font-size: 1.2rem; color: var(--muted); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; color: var(--muted); font-size: .9rem; margin-top: 1.25rem; }
.article-meta img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.article-meta .author { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 600; }
.article-cover { max-width: 960px; margin: 0 auto 2.5rem; }
.article-cover img { border-radius: var(--radius); width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; box-shadow: var(--shadow); }

.prose { font-size: 1.1rem; line-height: 1.75; }
.prose h2 { font-size: 1.6rem; margin: 2.2em 0 .6em; }
.prose h3 { font-size: 1.25rem; margin: 1.8em 0 .5em; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.2em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.5em 0; padding: 1rem 1.25rem; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose blockquote p:last-child { margin: 0; }
.prose code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-2); padding: .12em .4em; border-radius: 5px; }
.prose pre { background: var(--surface-2); padding: 1rem 1.2rem; border-radius: var(--radius-sm); overflow-x: auto; font-size: .92rem; }
.prose pre code { background: none; padding: 0; }
.prose figure { margin: 2em 0; }
.prose figure img { border-radius: var(--radius-sm); margin-inline: auto; }
.prose figcaption { font-size: .88rem; color: var(--muted); text-align: center; margin-top: .6rem; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }
.callout { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 1.5em 0; display: flex; gap: .9rem; }
.callout i { color: var(--sun); margin-top: .3rem; }
.callout p:last-child { margin: 0; }
.formula { font-family: var(--font-mono); font-size: 1rem; background: var(--surface-2); border-radius: var(--radius-sm); padding: .9rem 1.1rem; overflow-x: auto; }

.table-wrap { overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .93rem; line-height: 1.5; }
.table-wrap th, .table-wrap td { text-align: left; padding: .65rem .85rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-wrap thead th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }

.toc { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; background: var(--surface); margin: 0 0 2rem; font-size: .95rem; }
.toc strong { display: block; margin-bottom: .4rem; }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { margin: .2rem 0; }

.refs { font-size: .9rem; color: var(--muted); word-break: break-word; }

.article-footer { padding: 2rem 0 0; }
.share { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; padding: 1.25rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.share span { font-weight: 600; margin-right: .25rem; }
.author-box { display: flex; gap: 1.1rem; align-items: center; margin: 2rem 0; }
.author-box img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; }
.author-box p { margin: .2rem 0 0; color: var(--muted); font-size: .95rem; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2rem 0 0; }
.post-nav a { display: block; padding: 1rem 1.2rem; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; background: var(--surface); }
.post-nav a:hover { border-color: var(--accent); }
.post-nav small { display: block; color: var(--muted); font-size: .8rem; }
.post-nav .next { text-align: right; grid-column: 2; }
@media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } .post-nav .next { grid-column: auto; } }

.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: linear-gradient(90deg, var(--accent), var(--sun)); }

/* ---------- Tools ---------- */
.tool { display: grid; gap: .9rem; }
.tool label { font-weight: 600; }
.tool input, .tool textarea {
  font: inherit; width: 100%; padding: .7rem .9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.tool input:focus, .tool textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.tool-output { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.tool-output div { background: var(--surface-2); border-radius: var(--radius-sm); padding: .75rem .9rem; }
.tool-output small { display: block; color: var(--muted); font-size: .8rem; }
.tool-output strong { font-family: var(--font-mono); font-size: 1.05rem; }
pre.bibtex { white-space: pre-wrap; word-break: break-word; min-height: 4rem; margin: 0; }

/* ---------- Contact ---------- */
.contact-item { display: flex; gap: 1rem; align-items: flex-start; }
.contact-item i { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.contact-item h3 { font-size: 1rem; margin: 0 0 .15rem; }
.contact-item p { margin: 0; color: var(--muted); word-break: break-word; }
.map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); min-height: 380px; height: 100%; }
.map iframe { width: 100%; height: 100%; min-height: 380px; border: 0; display: block; }

/* ---------- CTA ---------- */
.cta {
  border-radius: calc(var(--radius) + 6px); padding: clamp(2rem, 5vw, 3rem);
  background: linear-gradient(135deg, var(--accent), #1f7a8c 60%, #2a9d8f);
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.cta h2 { margin: 0 0 .3rem; }
.cta p { margin: 0; opacity: .9; }
.cta .btn { background: #fff; color: #0a4f6c; }
.cta .btn:hover { color: #0a4f6c; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 3rem; padding: 3rem 0 1.5rem; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem; }
.footer-grid h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .8rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: .35rem 0; }
.footer-grid a { color: var(--text); text-decoration: none; }
.footer-grid a:hover { color: var(--accent); }
.footer-grid p { color: var(--muted); max-width: 40ch; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; border-top: 1px solid var(--border); margin-top: 2rem; padding-top: 1.25rem; color: var(--muted); font-size: .85rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--text); color: var(--bg); padding: .6rem 1.1rem; border-radius: 999px;
  font-size: .9rem; font-weight: 600; transition: all .25s ease; pointer-events: none; z-index: 80;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .site-footer, .share, .post-nav, .progress, .theme-toggle, .menu-toggle, .filters, .pub-actions { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; }
}
