:root {
  color-scheme: dark;
  --bg: #14141c;
  --panel: #1c1c28;
  --text: #eaeaf0;
  --muted: #9797a8;
  --accent: #8a8aff;
  --accent-dark: #6363c9;
  --light-grey: #85858f;
  --border: #2b2b3a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
}

a { color: var(--accent); }

header.site {
  padding: 3rem 1.5rem 1.5rem;
  text-align: center;
}

header.site h1 {
  margin: 0 0 0.4rem;
  font-size: 2rem;
}

header.site p {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

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

.card-thumb {
  overflow: hidden;
}

.card-thumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: var(--border);
  transition: transform 0.3s ease;
}

.card:hover .card-thumb img {
  transform: scale(1.08);
}

.card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

/* text cursor only over elements that actually hold text — sized to their
   own content, not stretched to fill leftover card space (see .card-links'
   margin-top: auto below), so hovering empty space below short text doesn't
   show a text cursor */
.card-body > *:not(h2):not(.card-links) {
  cursor: text;
}

.card-body h2 {
  margin: 0;
  font-size: 1.1rem;
  cursor: pointer;
  transition: color 0.15s ease;
}

.card-body h2:hover {
  color: var(--light-grey);
}

.card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.card-links {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  margin-top: auto;
}

.writeup-link:hover {
  color: var(--accent-dark);
}

.writeup {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.writeup .back {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.writeup .back:hover { color: var(--accent); }

.writeup pre {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
}

.writeup code {
  background: var(--panel);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

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

.writeup img {
  max-width: 100%;
  border-radius: 8px;
}
