/* ---------- Theme ---------- */
:root {
  --bg: #0e1116;
  --surface: #151a21;
  --border: #262d37;
  --text: #dde3ea;
  --muted: #8a94a1;
  --accent: #7ce38b;
  --link: #8ab4f8;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #faf9f7;
  --surface: #ffffff;
  --border: #e2ded6;
  --text: #1f2328;
  --muted: #59616b;
  --accent: #116329;
  --link: #0b57d0;
  color-scheme: light;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.925em;
}

.accent { color: var(--accent); }
.dim { color: var(--muted); }
.small { font-size: 0.85rem; }

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 0 0 6px 6px;
  z-index: 10;
  transition: top 120ms ease;
}
.skip-link:focus { top: 0; }

/* ---------- Layout ---------- */
.site-header,
main,
.site-footer {
  max-width: 44rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.25rem;
}

#theme-toggle {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
#theme-toggle:hover { border-color: var(--muted); }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }

section { margin-block: 3.5rem; }

h1 {
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.05rem;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

h3 { font-size: 1.05rem; margin: 0; }
h3 a { color: inherit; }

p { margin: 0.5rem 0 0; }

/* ---------- Hero ---------- */
.hero { margin-top: 2.5rem; }

.tagline { font-size: 1.15rem; margin: 0; }
.tagline .mono { white-space: nowrap; }

.subtitle { color: var(--muted); margin-top: 0.5rem; }

.fetch {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.55;
  overflow-x: auto;
}

.fetch-art {
  margin: 0;
  font-weight: 600;
  line-height: 1.25;
  flex-shrink: 0;
}

.fetch-title { font-weight: 600; }
.fetch-rule { display: block; color: var(--muted); }

.fetch-rows {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 1.25rem;
}
.fetch-rows .k { color: var(--accent); font-weight: 600; }

@media (max-width: 34rem) {
  .fetch { gap: 1.25rem; padding: 1rem 1.15rem; }
  .fetch-art { display: none; }
}

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
}
.card h3 { color: var(--accent); }
.card p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Work & projects ---------- */
.entries { display: grid; gap: 1.75rem; }

.entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.when { color: var(--muted); font-size: 0.85rem; }

.badge {
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  white-space: nowrap;
}

.entry p { color: var(--muted); }
.more { margin-top: 1.75rem; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 4rem;
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--border);
}
.site-footer p { margin: 0.35rem 0 0; white-space: pre-line; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
