@font-face {
  font-family: 'Geist';
  src: url('/fonts/GeistVF.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

/* ── Variables ─────────────────────────────────────────── */

:root {
  --bg:       #ffffff;
  --text:     #333333;
  --muted:    #767676;
  --accent:   #b85c38;
  --border:   #e5e5e5;
  --max-w:    680px;
  --font:     'Geist', system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #111111;
    --text:   #dddddd;
    --muted:  #888888;
    --accent: #d4724f;
    --border: #2a2a2a;
  }
}

/* ── Reset ─────────────────────────────────────────────── */

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

/* ── Base ──────────────────────────────────────────────── */

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  padding: 0 20px;
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ── Typography ────────────────────────────────────────── */

h1 { font-size: 1.6rem;  font-weight: 600; line-height: 1.2; margin-top: 1.5rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin: 2rem 0 0.5rem; }
h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.4; margin: 1.5rem 0 0.4rem; }

p  { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; }
em     { font-style: italic; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease-out, text-decoration-thickness 0.15s ease-out;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
  text-decoration: none;
}

ul, ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}
li { margin-bottom: 0.25rem; }

blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1rem;
  color: var(--muted);
  margin: 1.5rem 0;
  font-style: italic;
}

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

code {
  font-family: 'Geist Mono', 'Fira Code', monospace;
  font-size: 0.88em;
  background: var(--border);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre {
  background: var(--border);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}
/* Shiki dual-theme: switch background and token colours in dark mode */
@media (prefers-color-scheme: dark) {
  pre.astro-code {
    background-color: var(--shiki-dark-bg) !important;
    color: var(--shiki-dark) !important;
  }
  pre.astro-code span {
    color: var(--shiki-dark) !important;
  }
}
pre code { background: none; padding: 0; tab-size: 2; }

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

/* ── Header ────────────────────────────────────────────── */

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 2rem 0 2.5rem;
  gap: 1rem;
}

header .site-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
}
header .site-name:hover { color: var(--accent); }

header nav {
  display: flex;
  gap: 1.25rem;
}

header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 1rem;
}
header nav a:hover { color: var(--accent); }
header nav a.active { color: var(--accent); }

/* ── Footer ────────────────────────────────────────────── */

footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

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

.footer-links {
  display: flex;
  gap: 1rem;
}

/* ── Page content ──────────────────────────────────────── */

.page-content { padding-bottom: 1rem; }

/* ── Post / work list ──────────────────────────────────── */

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list {
  margin-top: 1.5rem;
}

.post-list li {
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
  padding: 0.3rem 0;
  margin: 0;
}

.post-list time {
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
  min-width: 95px;
  font-variant-numeric: tabular-nums;
}

.post-list a {
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
}
.post-list a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ── Homepage intro ────────────────────────────────────── */

.home-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.home-header h1 {
  margin: 0;
}

.role {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0.2rem 0 0;
}

/* ── About ─────────────────────────────────────────────── */

.profile-image {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ── Work item / gallery ───────────────────────────────── */

.work-image {
  width: 100%;
  margin: 1.5rem 0;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 1.5rem;
}

.work-gallery {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.work-gallery .work-image {
  margin: 0;
}

.work-link {
  margin-top: 2rem;
}

.tag {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--border);
  padding: 0.2em 0.55em;
  border-radius: 3px;
}

/* ── Article prose ─────────────────────────────────────── */

.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 2rem; }
.prose p  { margin-bottom: 1.1rem; }
.prose ul, .prose ol { margin-bottom: 1.1rem; }

/* ── Caption ───────────────────────────────────────────── */

.caption {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ── Article page header ────────────────────────────────── */

.post-date {
  margin-top: 0.25rem;
  margin-bottom: 2rem;
}

.work-description {
  margin-top: 0.25rem;
  margin-bottom: 1rem;
}

/* ── Skip link ──────────────────────────────────────────── */

.skip-link {
  position: absolute;
  left: -9999px;
  color: var(--text);
  text-decoration: none;
}
.skip-link:focus {
  left: 50%;
  transform: translateX(-50%);
  top: 0.5rem;
  z-index: 100;
  padding: 0.4em 0.9em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.875rem;
}

/* ── Motion ─────────────────────────────────────────────── */

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