:root {
  --bg: #ffffff;
  --fg: #111113;
  --muted: #6b6b73;
  --rule: #e7e7ea;
  --accent: #d8500c;
  --code-bg: #f5f5f6;
  --max: 640px;
  --gap: 1.25rem;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0b0c;
  --fg: #e9e9ec;
  --muted: #8a8a92;
  --rule: #1f1f22;
  --accent: #ff7a3d;
  --code-bg: #161618;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family:
    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 120ms ease, text-decoration-color 120ms ease,
    text-decoration-thickness 120ms ease;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

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

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0;
}

h1 {
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1rem;
}

p {
  margin: 0 0 var(--gap);
}

section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
}

section:first-of-type {
  border-top: none;
}

/* header */

.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  letter-spacing: -0.005em;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: inline-block;
}

/* intro */

.intro {
  padding-top: 1.5rem;
}

.intro h1 {
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 1.05rem;
  color: var(--fg);
  max-width: 36rem;
  margin-bottom: 0.5rem;
}

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

/* entries */

.entry {
  margin-bottom: 1.75rem;
}

.entry:last-child {
  margin-bottom: 0;
}

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

.entry-head h3 {
  margin: 0;
}

.role {
  color: var(--muted);
  font-weight: 400;
}

.when {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.entry p {
  margin-bottom: 0.5rem;
}

.entry .aside {
  color: var(--muted);
  font-size: 0.88rem;
}

/* hero project */

.entry.hero {
  padding: 1.25rem;
  margin: 0 -1.25rem 1.75rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.stack span {
  background: var(--code-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.75rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.links a {
  font-size: 0.92rem;
}

/* skills */

.skills {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.6rem 1.25rem;
  margin: 0;
}

.skills dt {
  color: var(--muted);
  font-size: 0.9rem;
}

.skills dd {
  margin: 0;
}

@media (max-width: 540px) {
  .skills {
    grid-template-columns: 1fr;
    gap: 0.25rem 0;
  }
  .skills dt {
    margin-top: 0.5rem;
  }
  .skills dt:first-child {
    margin-top: 0;
  }
}

/* contact */

.contact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* footer */

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--rule);
}

.site-footer p {
  margin: 0;
}

@media print {
  .theme-toggle, .site-footer { display: none; }
  a { color: var(--fg); text-decoration: none; }
  section { border-top: 1px solid #ccc; }
}
