:root {
  color-scheme: light;
  --bg: #f8fafc;
  --bg-elevated: rgba(255, 255, 255, 0.94);
  --bg-soft: #f8fbff;
  --border: rgba(148, 163, 184, 0.28);
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --shadow: 0 18px 45px rgba(148, 163, 184, 0.16);
  --radius: 20px;
  --radius-sm: 14px;
  --container: 72rem;
}

* {
  box-sizing: border-box;
}

html {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(13, 148, 136, 0.1), transparent 30%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

body {
  margin: 0;
  color: var(--text);
  background: transparent;
  line-height: 1.7;
}

body.post-page,
body.post-page .site-shell {
  background: #ffffff;
}

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

a:hover {
  color: var(--accent-strong);
}

.site-shell {
  min-height: 100vh;
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(16px);
  background: rgba(248, 250, 252, 0.88);
  border-bottom: 1px solid var(--border);
}

.site-header-inner,
.site-footer-inner,
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header-inner,
.site-footer-inner {
  padding: 1rem 0;
}

.site-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.nav-list,
.plain-list,
.tag-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list {
  display: flex;
  gap: 1rem;
}

.nav-list a {
  color: var(--text-soft);
  font-weight: 500;
}

.nav-list a[aria-current="page"] {
  color: var(--text);
}

.page-content {
  padding: 4rem 0 5rem;
}

.hero,
.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../images/hero-embedded-bg.svg") center center / cover no-repeat;
  opacity: 0.38;
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1,
.panel h1,
.panel h2,
.card h3,
.post-preview h2,
.post-preview h3,
.post-article h1 {
  margin-top: 0;
}

.hero h1 {
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  line-height: 1;
  margin-bottom: 1rem;
}

.eyebrow,
.post-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.lead {
  font-size: 1.125rem;
  max-width: 46rem;
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #f8fafc;
  font-weight: 700;
}

.button:hover {
  color: #f8fafc;
  background: var(--accent-strong);
}

.button-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.button-secondary:hover {
  color: var(--text);
  border-color: rgba(15, 118, 110, 0.4);
}

.grid-two,
.card-grid,
.post-list {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.grid-two,
.card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  padding: 1.75rem;
  margin-top: 1.5rem;
}

.card,
.post-preview,
.empty-state {
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.cv-item + .cv-item {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.post-list {
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.tag-list li {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-soft);
  background: #ffffff;
}

.post-article {
  max-width: 50rem;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.98);
}

body.post-page .site-header,
body.post-page .site-footer {
  background: #ffffff;
}

body.post-page .page-content {
  padding-top: 3rem;
}

body.post-page .post-article {
  max-width: 55rem;
  background: #ffffff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin-top: 0;
}

.post-article header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.prose {
  color: var(--text-soft);
  font-size: 1.05rem;
}

.prose h2,
.prose h3 {
  color: var(--text);
  margin-top: 2.5rem;
}

.prose p,
.prose li {
  line-height: 1.85;
}

.prose a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
  margin: 2rem auto;
}

.prose figure {
  margin: 2rem 0;
  text-align: center;
}

.prose figure img {
  margin: 0 auto 0.5rem;
}

.prose figcaption {
  font-size: 0.9rem;
  color: var(--muted);
}

.prose strong {
  color: var(--text);
}

.table-of-contents {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.table-of-contents h2 {
  margin: 0;
  font-size: 1rem;
}

.table-of-contents ul {
  margin: 0.9rem 0 0 1.25rem;
  padding: 0;
}

.table-of-contents ul ul {
  margin-top: 0.45rem;
}

.table-of-contents li + li {
  margin-top: 0.3rem;
}

.table-of-contents a {
  text-decoration: none;
}

.table-of-contents a:hover {
  text-decoration: underline;
}

.prose code {
  padding: 0.15rem 0.4rem;
  border-radius: 0.35rem;
  background: #e2e8f0;
  color: #0f172a;
}

.prose pre {
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: #e2e8f0;
  overflow-x: auto;
  border: 1px solid var(--border);
}

.prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.prose .highlighter-rouge {
  margin: 1.75rem 0;
  border: 1px solid #dbe3ec;
  background: #f8fafc;
  overflow-x: auto;
}

.prose .highlighter-rouge .highlight,
.prose .highlighter-rouge .highlight pre,
.prose .highlighter-rouge .highlight code {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.prose .highlighter-rouge .highlight pre {
  color: #0f172a;
}

.prose .rouge-table {
  width: 100%;
  border-collapse: collapse;
}

.prose .rouge-gutter {
  width: 1%;
  white-space: nowrap;
  vertical-align: top;
  background: #f1f5f9;
  border-right: 1px solid #dbe3ec;
}

/* Code line numbers add noise to prose snippets, especially terminal output. */
.post-page .prose .rouge-gutter {
  display: none;
}

.prose .rouge-gutter .lineno {
  margin: 0;
  padding: 1rem 0.85rem;
  color: #94a3b8;
  text-align: right;
  line-height: 1.65;
}

.prose .rouge-code {
  vertical-align: top;
}

.prose .rouge-code pre {
  margin: 0;
  padding: 1rem 1.25rem;
  line-height: 1.65;
  color: #0f172a;
}

.prose .highlight .k,
.prose .highlight .kd,
.prose .highlight .kt,
.prose .highlight .kr {
  color: #7c3aed;
}

.prose .highlight .nf,
.prose .highlight .nc {
  color: #0f766e;
}

.prose .highlight .s,
.prose .highlight .sa,
.prose .highlight .se,
.prose .highlight .sb,
.prose .highlight .sc {
  color: #b45309;
}

.prose .highlight .c,
.prose .highlight .c1,
.prose .highlight .cm {
  color: #64748b;
}

.prose .highlight .cp,
.prose .highlight .cpf {
  color: #2563eb;
}

/* Table styling */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: 0.95rem;
}

.prose thead th {
  background: var(--bg-soft);
  border-bottom: 2px solid var(--accent);
  color: var(--text);
  font-weight: 600;
  padding: 0.75rem 1rem;
  text-align: left;
}

.prose tbody td {
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 1rem;
  vertical-align: top;
}

.prose tbody tr:hover {
  background: var(--bg-soft);
}

.prose tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.5);
}

.prose tbody tr:nth-child(even):hover {
  background: var(--bg-soft);
}

.site-footer {
  border-top: 1px solid var(--border);
}

.site-footer-inner {
  color: var(--muted);
}

@media (max-width: 720px) {
  .site-header-inner,
  .site-footer-inner,
  .section-header,
  .nav-list {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding: 2rem;
  }

  .grid-two,
  .card-grid {
    grid-template-columns: 1fr;
  }
}
