/* ============================================================
   glialfire.net — modern, slim, self-contained
   ============================================================ */

:root {
  --bg: #f6f4f0;
  --surface: #ffffff;
  --text: #191c20;
  --muted: #687077;
  --line: #e6e2da;
  --accent: #0b5e4c;
  --accent-strong: #08473a;
  --accent-soft: #e2efe9;
  --ink: #131719;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #bcd9cf; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  font-size: .9rem;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; text-decoration: none; }

.container {
  width: min(1120px, 100% - 48px);
  margin-inline: auto;
}

/* ------------------------------------------------------------
   Hero (Home)
   ------------------------------------------------------------ */

.hero {
  position: relative;
  min-height: max(600px, 86vh);
  display: flex;
  flex-direction: column;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg,
    rgba(9, 14, 12, .58) 0%,
    rgba(9, 14, 12, .30) 45%,
    rgba(9, 14, 12, .68) 100%);
}

.hero-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: #fff;
}
.brand:hover { text-decoration: none; opacity: .92; }

.brand-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .85);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 24px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.nav-links a { color: rgba(255, 255, 255, .82); padding-block: 4px; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-links a.active { color: #fff; border-bottom: 2px solid #fff; }

.hero-inner {
  margin-block: auto;
  padding-block: 60px;
  padding-inline: 24px;
  max-width: 720px;
  animation: hero-rise .7s ease both;
}

.hero-kicker {
  margin: 0 0 14px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .78);
}

.hero-title {
  margin: 0;
  font-size: clamp(3rem, 8vw, 5.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.hero-tagline {
  margin: 18px 0 0;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  font-weight: 400;
  color: rgba(255, 255, 255, .92);
  max-width: 40ch;
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------
   Slim header (subpages)
   ------------------------------------------------------------ */

.site-header.slim {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header.slim .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 14px;
}
.site-header.slim .brand { color: var(--text); }
.site-header.slim .nav-links a { color: var(--muted); }
.site-header.slim .nav-links a:hover { color: var(--accent); }
.site-header.slim .nav-links a.active { color: var(--accent); border-color: var(--accent); }

/* ------------------------------------------------------------
   Layout
   ------------------------------------------------------------ */

.wrapper {
  width: min(1120px, 100% - 48px);
  margin-inline: auto;
  padding-block: 64px 88px;
}

.section + .section { margin-top: 72px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  margin: 0;
}

.section-link {
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
}

.lede {
  font-size: 1.28rem;
  line-height: 1.55;
  color: #33383e;
  max-width: 58ch;
  margin: 0 0 40px;
  letter-spacing: -0.01em;
}

/* Quicklinks */
.quicklinks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.quicklink {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow);
  color: var(--text);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.quicklink:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 14px 32px rgba(16, 24, 40, .08);
  text-decoration: none;
}
.ql-label { display: block; font-weight: 750; font-size: 1.12rem; letter-spacing: -0.01em; }
.ql-desc { display: block; color: var(--muted); font-size: .92rem; margin-top: 5px; }

/* Post list */
.post-list { border-top: 1px solid var(--line); }

.post-item {
  display: flex;
  gap: 32px;
  padding: 30px 4px;
  border-bottom: 1px solid var(--line);
}

.post-date {
  flex: 0 0 132px;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--muted);
  padding-top: 7px;
}

.post-title { margin: 0 0 6px; font-size: 1.32rem; font-weight: 700; letter-spacing: -0.01em; }
.post-title a { color: var(--text); display: inline-flex; gap: 8px; align-items: baseline; }
.post-title a:hover { color: var(--accent); text-decoration: none; }

.post-title .arrow {
  display: inline-block;
  color: var(--accent);
  transform: translateX(-4px);
  opacity: 0;
  transition: transform .16s ease, opacity .16s ease;
}
.post-title a:hover .arrow { opacity: 1; transform: translateX(0); }

.post-excerpt { margin: 0; color: var(--muted); font-size: .98rem; max-width: 62ch; }

/* ------------------------------------------------------------
   Article / page
   ------------------------------------------------------------ */

.post, .page { max-width: 760px; margin-inline: auto; }

.post-header, .page-header { margin-bottom: 44px; }

.post-title,
.page-header h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: baseline;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--muted);
}

.post-tags a { color: var(--accent); font-weight: 600; }
.post-tags a:hover { text-decoration: underline; }
.post-tags { display: inline-flex; gap: 10px; flex-wrap: wrap; }

.post-content, .page-content { font-size: 1.06rem; }

.post-content h2, .page-content h2 {
  font-size: 1.5rem;
  margin: 2.2em 0 .8em;
  letter-spacing: -0.015em;
}
.post-content h3, .page-content h3 {
  font-size: 1.22rem;
  margin: 1.8em 0 .7em;
  letter-spacing: -0.01em;
}
.post-content p, .page-content p { margin: 0 0 1.35em; }
.post-content a, .page-content a { text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover, .page-content a:hover { text-decoration-thickness: 2px; }

.post-content img, .page-content img {
  border-radius: 12px;
  margin: 1.4em 0;
  border: 1px solid var(--line);
}

.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 1.8em 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.post-content blockquote, .page-content blockquote {
  margin: 1.8em 0;
  padding: .15em 0 .15em 1.3em;
  border-left: 3px solid var(--accent);
  color: #3a4046;
  font-style: italic;
}
.post-content blockquote p, .page-content blockquote p { margin-bottom: .4em; }

.post-content pre, .page-content pre {
  background: var(--ink);
  color: #e7e9eb;
  padding: 20px 22px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: .9rem;
  line-height: 1.6;
  font-family: var(--mono);
}
.post-content code, .page-content code { font-family: var(--mono); font-size: .9em; }
.post-content :not(pre) > code, .page-content :not(pre) > code {
  background: #ece9e2;
  padding: .15em .42em;
  border-radius: 6px;
}

.post-content ul, .page-content ul,
.post-content ol, .page-content ol { margin: 0 0 1.35em; padding-left: 1.4em; }
.post-content li, .page-content li { margin-bottom: .45em; }

.post-content hr, .page-content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.6em 0;
}

.post-content table, .page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: .95rem;
}
.post-content th, .page-content th {
  text-align: left;
  font-weight: 700;
  background: var(--surface);
  border-bottom: 2px solid var(--line);
  padding: 10px 12px;
}
.post-content td, .page-content td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

/* Publications callout (used on /publications/) */
.publ {
  background: var(--accent-soft);
  border: 1px solid #c7ddd4;
  border-radius: 12px;
  padding: 18px 22px;
  margin: 0 0 1.6em;
}
.publ a { font-weight: 600; }

.back-link {
  display: inline-block;
  margin-top: 56px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--muted);
}
.back-link:hover { color: var(--accent); text-decoration: none; }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, .72);
  padding-block: 56px 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}

.footer-brand .brand { margin-bottom: 14px; }
.footer-about { margin: 12px 0 0; font-size: .92rem; max-width: 42ch; }

.footer-nav,
.footer-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: .95rem;
}
.footer-nav a, .footer-social a { color: rgba(255, 255, 255, .72); }
.footer-nav a:hover, .footer-social a:hover { color: #fff; text-decoration: none; }
.footer-social .external { opacity: .6; font-size: .85em; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, .14);
  padding-top: 28px;
  font-size: .86rem;
}
.footer-bottom a { color: rgba(255, 255, 255, .72); }
.footer-bottom a:hover { color: #fff; }

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .hero { min-height: 560px; }
  .hero-nav { flex-direction: column; align-items: flex-start; }
  .nav-links { justify-content: flex-start; gap: 8px 18px; }
  .site-header.slim .container { flex-direction: column; align-items: flex-start; padding-block: 12px; }
  .site-header.slim .nav-links { gap: 6px 16px; }
  .wrapper { padding-block: 48px 64px; }
  .section + .section { margin-top: 56px; }
  .lede { font-size: 1.14rem; }
  .post-item { flex-direction: column; gap: 8px; padding-block: 24px; }
  .post-date { flex: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-brand { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-inner { animation: none; }
  .quicklink { transition: none; }
  .post-title .arrow { transition: none; }
}
