:root {
  --bg: #f3f7f2;
  --surface: #fffdf8;
  --surface-soft: #edf4ee;
  --text: #20342a;
  --muted: #526259;
  --line: #cbdacc;
  --accent: #3a7a5f;
  --accent-2: #74a982;
  --card-shadow: 0 18px 44px rgba(43, 55, 48, .12);
  --font-ui: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-ui);
}

button,
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 9px 13px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button.secondary,
a.button.secondary {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
}

.themes-page {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 54px;
}

.topbar,
.section-header,
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: grid;
  gap: 3px;
}

.brand strong {
  font-family: var(--font-serif);
  font-size: 30px;
}

.brand span,
.lede,
.muted {
  color: var(--muted);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: end;
  padding: 58px 0 36px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  width: min(760px, 100%);
  font-family: var(--font-serif);
  font-size: clamp(46px, 8vw, 86px);
  line-height: .94;
  letter-spacing: 0;
}

.lede {
  width: min(620px, 100%);
  margin-top: 20px;
  font-size: 18px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.import-note {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.import-note h2 {
  font-size: 16px;
  margin-bottom: 8px;
}

.import-note p {
  color: var(--muted);
  line-height: 1.5;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.theme-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
}

.theme-preview {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  min-height: 230px;
  color: var(--theme-text);
  background: var(--theme-bg);
}

.theme-sidebar {
  padding: 14px;
  background: var(--theme-panel);
  border-right: 1px solid var(--theme-border);
}

.theme-sidebar span {
  display: block;
  height: 9px;
  margin-bottom: 9px;
  border-radius: 999px;
  background: var(--theme-muted);
  opacity: .45;
}

.theme-paper-wrap {
  position: relative;
  display: grid;
  place-items: center;
  padding: 22px;
  background: var(--theme-canvas);
}

.theme-paper-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .18;
  background-image: var(--theme-wallpaper);
  background-size: var(--theme-wallpaper-size);
}

.theme-paper {
  position: relative;
  width: min(210px, 100%);
  min-height: 160px;
  padding: 24px;
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  background: var(--theme-paper);
  font-family: var(--font-serif);
}

.theme-paper h3 {
  margin-bottom: 10px;
  color: var(--theme-heading);
  font-size: 22px;
}

.theme-paper p {
  color: var(--theme-ink);
  font-size: 12px;
  line-height: 1.55;
}

.theme-meta {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.theme-meta h2 {
  font-size: 18px;
}

.theme-meta p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.swatches {
  display: flex;
  gap: 6px;
}

.swatches span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .12);
}

.svg-help {
  margin-top: 42px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.svg-help h2 {
  margin-bottom: 12px;
}

.svg-help ol {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.7;
}

.svg-help a {
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .themes-page {
    width: min(100% - 24px, 1180px);
  }

  .topbar,
  .section-header,
  .hero-actions,
  .card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .theme-grid {
    grid-template-columns: 1fr;
  }
}
