/* -------- Tokens -------- */
:root {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #666;
  --accent: #0057ff;
  --border: #e5e5e5;
  --card-bg: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --radius: 8px;
  --max-width: 64rem;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f10;
    --fg: #ececec;
    --muted: #999;
    --accent: #66aaff;
    --border: #262628;
    --card-bg: #18181a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  }
}

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

html {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main.container {
  flex: 1;
}

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

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin-top: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--card-bg);
  padding: 0.15em 0.35em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* -------- Header -------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--fg);
}

.site-header nav {
  position: relative;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 1.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}

.nav-list a {
  color: var(--fg);
}

.nav-list a:hover {
  color: var(--accent);
}

@media (max-width: 640px) {
  .menu-toggle {
    display: inline-block;
  }

  .nav-list {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow);
    min-width: 10rem;
  }

  .nav-list.open {
    display: flex;
  }
}

/* -------- Intro / sections -------- */
.intro {
  padding: 3rem 0 1.5rem;
}

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

section {
  margin-bottom: 2.5rem;
}

/* -------- Filter bar -------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-bar button {
  font: inherit;
  cursor: pointer;
  background: var(--card-bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-bar button:hover {
  border-color: var(--accent);
}

.filter-bar button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* -------- Project grid -------- */
.project-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}

.project-grid li {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.project-grid li:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.project-grid a {
  display: block;
  padding: 1.1rem 1.25rem;
  color: var(--fg);
}

.project-grid a:hover {
  text-decoration: none;
}

.project-grid h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.project-grid p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tags span {
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}

/* -------- Single pages -------- */
.single,
.project,
.list {
  padding: 2.5rem 0;
  max-width: 42rem;
}

.single header,
.project header,
.list header {
  margin-bottom: 1.5rem;
}

.single h1,
.project h1,
.list h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.single time,
.project time {
  color: var(--muted);
  font-size: 0.9rem;
}

.project-footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* -------- Footer -------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card-bg);
  padding: 1.5rem 0;
  margin-top: 3rem;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.footer-links {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--fg);
}

.footer-links a:hover {
  color: var(--accent);
}
