/* ── Custom properties ── */
:root {
  --bg: #f0f4f8;
  --bg-alt: #e2e8f0;
  --card-bg: #ffffff;
  --card-border: #1e40af;
  --text: #1a2a3a;
  --text-muted: #5a6a7a;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --heading: #1e40af;
  --favicon-bg: #e2e8f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --card-bg: #1e293b;
    --card-border: #60a5fa;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --link: #60a5fa;
    --link-hover: #93c5fd;
    --heading: #93c5fd;
    --favicon-bg: #334155;
  }
}

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

/* ── Base ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

h1, h3 {
  color: var(--heading);
}

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

ul {
  padding-left: 1.5rem;
}

/* ── Layout ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-header,
.section-sites,
.section-footer {
  padding: 3rem 0;
}

.section-header {
  background: var(--bg);
}

.section-sites {
  background: var(--bg-alt);
}

.section-footer {
  background: var(--bg);
}

/* ── Header ── */
.section-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.fun-fact {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.updated {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ── Sites section ── */
.section-sites h3 {
  margin-bottom: 1.5rem;
}

/* ── Card grid ── */
.josh-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .josh-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .josh-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* ── Card ── */
.card {
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-right: 5px solid var(--card-border);
  border-bottom: 5px solid var(--card-border);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.15s ease;
}

.card:hover {
  color: var(--text);
  text-decoration: none;
  transform: translateY(-2px);
}

.card-screenshot {
  position: relative;
  height: 140px;
  overflow: hidden;
  background: var(--favicon-bg);
}

.card-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.card-screenshot::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--card-bg));
}

.card-screenshot.no-screenshot img {
  display: none;
}

.card-favicon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  vertical-align: text-bottom;
  margin-right: 0.25rem;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.85rem 1rem;
  min-width: 0;
}

.card-body h4 {
  color: var(--heading);
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.card-url {
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--link);
}

/* ── Footer section ── */
.section-footer h3 {
  margin-bottom: 0.75rem;
}

.section-footer p {
  margin-bottom: 0.75rem;
}

.section-footer ul {
  margin-bottom: 1.5rem;
}

.section-footer li {
  margin-bottom: 0.25rem;
}

.badge-img {
  image-rendering: pixelated;
  margin-bottom: 0.25rem;
}

.badge-note {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.cta-section {
  margin-bottom: 2rem;
}

.credits {
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--bg-alt);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

