:root {
  --bg: #FBF7EF;
  --paper: #FFFFFF;
  --ink: #2A2A2A;
  --ink-soft: #5A5A5A;
  --line: #E8E1D2;
  --accent: #2D5BBA;
  --accent-soft: #DCE6F8;
  --gold: #FFB400;
  --shadow: 0 6px 24px rgba(42, 42, 42, 0.06);
  --radius: 12px;
  --max-w: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ──────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.92);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.site-header__logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}
.site-header__nav {
  display: flex;
  gap: 24px;
  font-size: 14px;
}

/* ── Hero ─────────────────────────────────── */
.hero {
  padding: 64px 0 48px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.15;
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero .tagline {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto 28px;
}
.hero__badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 0 24px;
}
.badge {
  display: inline-block;
  padding: 5px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

/* ── Stats strip ──────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 24px 0 48px;
}
.stat {
  background: var(--paper);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  text-align: center;
}
.stat__num {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}
.stat__label {
  font-size: 13px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* ── Section ──────────────────────────────── */
section { padding: 32px 0; }
.section-title {
  font-size: 24px;
  margin: 0 0 24px;
  font-weight: 700;
}
.section-intro {
  color: var(--ink-soft);
  margin: -8px 0 24px;
  max-width: 640px;
}

/* ── Filter bar (gallery) ─────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}
.filter-bar button {
  font: inherit;
  padding: 8px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
}
.filter-bar button:hover {
  border-color: var(--accent);
}
.filter-bar button.is-active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ── Card grid ────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.card {
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.card__thumb {
  aspect-ratio: 3 / 4;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card__thumb--placeholder {
  color: var(--ink-soft);
  font-size: 12px;
  padding: 16px;
  text-align: center;
}
.card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.3;
}
.card__meta {
  font-size: 11px;
  color: var(--ink-soft);
  display: flex;
  gap: 8px;
  align-items: center;
}
.card__format {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

/* ── Template page ────────────────────────── */
.template-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 32px 0;
}
@media (max-width: 720px) {
  .template-page { grid-template-columns: 1fr; gap: 24px; }
}
.template-page__preview {
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  align-self: start;
  position: sticky;
  top: 80px;
}
.template-page__preview img {
  width: 100%;
  display: block;
}
.template-page__placeholder {
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  background: var(--bg);
  padding: 24px;
  text-align: center;
}
.template-page__info h1 {
  font-size: 32px;
  line-height: 1.2;
  margin: 0 0 12px;
  font-weight: 800;
}
.template-page__info .description {
  color: var(--ink-soft);
  margin: 0 0 24px;
}
.template-page__meta {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px 16px;
  font-size: 14px;
  margin: 0 0 28px;
}
.template-page__meta dt {
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
  align-self: center;
}
.template-page__meta dd { margin: 0; }
.template-page__downloads {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 28px;
}
.btn {
  display: inline-block;
  padding: 12px 20px;
  font-weight: 600;
  border-radius: 8px;
  font-size: 14px;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: #1F45A0; text-decoration: none; }
.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.cta-box {
  background: linear-gradient(135deg, var(--accent-soft), var(--paper));
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--accent-soft);
  margin: 0 0 24px;
}
.cta-box p { margin: 0 0 12px; font-size: 14px; }

/* ── Footer ───────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  margin-top: 64px;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}
.site-footer a { color: var(--ink-soft); text-decoration: underline; }
.site-footer__divider { margin: 0 10px; opacity: 0.5; }

/* ── Code block ───────────────────────────── */
pre {
  background: var(--paper);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}
code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
}
