:root {
  color-scheme: light dark;
  --bg: #eef1e8;
  --bg-accent: rgba(31, 143, 114, 0.08);
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --text: #162219;
  --muted: #476254;
  --accent: #1f8f72;
  --accent-strong: #0e6b63;
  --accent-soft: rgba(31, 143, 114, 0.12);
  --border: rgba(22, 34, 25, 0.18);
  --shadow: 0 18px 48px rgba(8, 15, 12, 0.12);
  --focus: #0b6dff;
  --texture: linear-gradient(rgba(22, 34, 25, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 34, 25, 0.045) 1px, transparent 1px);
}

:root[data-theme='dark'] {
  --bg: #07110d;
  --bg-accent: rgba(109, 255, 189, 0.08);
  --panel: rgba(7, 17, 13, 0.84);
  --panel-strong: rgba(10, 24, 18, 0.96);
  --text: #e8fff2;
  --muted: #8fb6a0;
  --accent: #6dffbd;
  --accent-strong: #b6ffe2;
  --accent-soft: rgba(109, 255, 189, 0.12);
  --border: rgba(109, 255, 189, 0.24);
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
  --focus: #f5ff78;
  --texture: linear-gradient(rgba(109, 255, 189, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109, 255, 189, 0.045) 1px, transparent 1px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(circle at top, var(--bg-accent), transparent 34%),
    var(--texture),
    var(--bg);
  background-size: auto, 26px 26px, auto;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0));
  mix-blend-mode: soft-light;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
  text-underline-offset: 0.18em;
}

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

img {
  max-width: 100%;
  display: block;
}

button,
a {
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease,
    box-shadow 160ms ease, transform 160ms ease;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 20;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  text-decoration: none;
}

.skip-link:focus-visible {
  top: 1rem;
}

.site-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.page-stack {
  display: grid;
  gap: 1.25rem;
  padding-bottom: 3rem;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.125rem;
  margin: 1rem auto 1.25rem;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.18em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex: 1 1 18rem;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  min-width: 0;
}

.site-nav a {
  text-decoration: none;
  font-weight: 600;
}

.theme-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-left: auto;
  max-width: 100%;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-strong);
}

.theme-switcher button {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}

.theme-switcher button:hover {
  color: var(--text);
}

.theme-switcher button[data-active='true'] {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--border);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.hero,
.section-block,
.archive-header,
.post-layout {
  padding: 1.5rem;
}

.hero {
  overflow: hidden;
  position: relative;
}

.hero::before,
.post-layout::before,
.archive-header::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.65;
}

.hero-grid,
.archive-list,
.post-grid,
.resume-grid,
.link-grid,
.contact-list {
  display: grid;
  gap: 1rem;
}

.hero-grid {
  align-items: start;
}

.hero-copy {
  max-width: 42rem;
}

.hero-copy h1,
.section-heading h2,
.archive-header h1,
.post-layout h1 {
  margin: 0;
  line-height: 1.06;
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  max-width: 11ch;
}

.lead,
.section-intro,
.post-summary {
  font-size: 1.05rem;
  color: var(--muted);
}

.eyebrow,
.meta-label,
.post-meta,
.detail-list li::marker {
  font-family: 'Courier New', monospace;
}

.eyebrow,
.meta-label,
.post-meta {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--accent-strong);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.button-link.primary {
  background: var(--accent);
  color: #04110c;
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
}

.button-link.secondary {
  background: transparent;
}

.button-link:hover {
  transform: translateY(-1px);
}

.signal-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 1rem;
  background: color-mix(in srgb, var(--panel-strong) 70%, transparent);
}

.stat-chip {
  padding: 0.95rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
}

.stat-chip strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.05rem;
}

.section-heading {
  margin-bottom: 1rem;
}

.section-heading p {
  margin-top: 0;
}

.resume-grid,
.link-grid,
.post-grid,
.archive-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.resume-card,
.link-card,
.post-card,
.archive-card {
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-strong) 65%, transparent);
}

.resume-card h3,
.link-card h3,
.post-card h3,
.archive-card h2 {
  margin-top: 0;
  margin-bottom: 0.45rem;
}

.detail-list {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
}

.link-card p,
.post-card p,
.archive-card p,
.resume-card p,
.contact-copy {
  margin: 0;
  color: var(--muted);
}

.link-grid a.card-link,
.post-card a,
.archive-card a,
.back-link {
  text-decoration-thickness: 2px;
}

.post-card,
.archive-card,
.link-card {
  position: relative;
}

.post-card:hover,
.post-card:focus-within,
.archive-card:hover,
.archive-card:focus-within,
.link-card:hover,
.link-card:focus-within {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.contact-list li {
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-strong) 65%, transparent);
}

.site-footer {
  color: var(--muted);
  padding-bottom: 2rem;
  text-align: center;
}

.archive-header {
  position: relative;
}

.archive-intro,
.post-content p {
  color: var(--muted);
}

.post-layout {
  position: relative;
}

.post-content {
  max-width: 44rem;
}

.post-content h2 {
  margin-top: 1.75rem;
}

.back-link {
  display: inline-flex;
  margin-top: 1rem;
}

@media (min-width: 760px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
  }
}

@media (max-width: 820px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .theme-switcher {
    align-self: flex-start;
  }
}

@media (max-width: 540px) {
  .site-shell {
    width: min(100% - 1rem, 1120px);
  }

  .hero,
  .section-block,
  .archive-header,
  .post-layout {
    padding: 1.15rem;
  }

  .signal-board {
    grid-template-columns: 1fr;
  }

  .cta-row {
    flex-direction: column;
  }

  .button-link {
    width: 100%;
  }
}

/* Markdown content defaults for generated blog posts. */
.post-content > * + * {
  margin-top: 1rem;
}

.post-content ul,
.post-content ol {
  padding-left: 1.25rem;
  color: var(--muted);
}

.post-content li + li {
  margin-top: 0.35rem;
}

.post-content blockquote {
  margin: 1.5rem 0;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: color-mix(in srgb, var(--accent-soft) 40%, transparent);
  color: var(--muted);
}

.post-content pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-strong) 80%, transparent);
}

.post-content code {
  font-family: 'Courier New', monospace;
  font-size: 0.95em;
}

.post-content pre code {
  display: block;
  white-space: pre;
}

.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}
