:root {
  --bg: #ffffff;
  --fg: #1f2328;
  --muted: #656d76;
  --accent: #d1242f;
  --border: #d8dee4;
  --code-bg: #f6f8fa;
  --measure: 42rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16181d;
    --fg: #e6e6e6;
    --muted: #9198a1;
    --accent: #ff6b6b;
    --border: #30363d;
    --code-bg: #22262e;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #16181d;
  --fg: #e6e6e6;
  --muted: #9198a1;
  --accent: #ff6b6b;
  --border: #30363d;
  --code-bg: #22262e;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 0.95rem/1.7 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.site-header, main, .site-footer {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (max-width: 480px) {
  .site-header, main, .site-footer { padding-inline: 1.5rem; }
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}

.site-header nav { display: flex; gap: 1rem; align-items: center; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--fg); }

#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg);
  cursor: pointer;
  font-size: 1rem;
  width: 2rem;
  height: 2rem;
}

main { padding-block: 2rem; }

h1, h2, h3 { line-height: 1.25; text-wrap: balance; }
h1 { font-size: 2rem; margin-top: 0; }

a { color: var(--accent); text-underline-offset: 0.15em; }

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

blockquote {
  margin-inline: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

code {
  font: 0.9em "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--code-bg);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

pre code { background: none; padding: 0; }

hr { border: 0; border-top: 1px solid var(--border); margin-block: 2rem; }

table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; }

.links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-block: 1rem; }
.links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.links .contact { padding-left: 1.25rem; border-left: 1px solid var(--border); }
@media (max-width: 480px) {
  .links { flex-direction: column; align-items: flex-start; }
  .links .contact { padding-left: 0; border-left: 0; }
}
.links a { display: inline-flex; align-items: center; gap: 0.4rem; }
.links .icon { width: 16px; height: 16px; border-radius: 3px; transform: rotate(-6deg); }
.links li:nth-child(even) .icon { transform: rotate(5deg); }

.timeline {
  list-style: none;
  padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--border);
}
.timeline > li { position: relative; padding-bottom: 1.75rem; }
.timeline > li::before {
  content: "";
  position: absolute;
  left: calc(-1.25rem - 6px);
  top: 0.45rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline > li:has(.logo)::before { display: none; }
.timeline .logo {
  position: absolute;
  left: calc(-1.25rem - 13px);
  top: 0.1rem;
  width: 24px;
  height: 24px;
  padding: 2px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
  transform: rotate(-6deg);
}
.timeline > li:nth-child(even) .logo { transform: rotate(5deg); }

.timeline time { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.timeline h3 { margin: 0.1rem 0 0.4rem; font-size: 1.1rem; }
.timeline p { margin: 0; }
.timeline summary {
  display: block;
  margin-top: 0.1rem;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}
.timeline summary::-webkit-details-marker { display: none; }
.timeline summary h3 { display: inline; font-size: 1.1rem; }
.timeline summary h3::after {
  content: "";
  display: inline-block;
  width: 0.38em;
  height: 0.38em;
  margin-left: 0.5em;
  vertical-align: 0.18em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.timeline details[open] > summary h3::after { transform: rotate(45deg); vertical-align: 0.3em; }
.timeline details[open] > summary { margin-bottom: 0.4rem; }

.timeline .desc {
  margin-top: 0.8rem;
  padding: 0.6rem 0.85rem;
  background: var(--code-bg);
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.65;
}
.timeline .desc ul { margin-top: 0.4rem; }

.timeline ul { margin: 0.5rem 0 0; padding-left: 1.1rem; }

.site-footer {
  padding-block: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer a { color: var(--muted); }
