/* ============================================================
   startersss — editorial reference library
   Design system (converged direction: warm paper · ink accent)
   ============================================================ */

:root {
  /* surfaces */
  --paper:      #faf8f4;
  --paper-alt:  #f4f0e8;
  --panel:      #ffffff;
  --chrome:     #f0ece4;

  /* ink + text */
  --ink:        #1a1815;
  --text:       #3a352c;
  --muted:      #5c574d;
  --muted-2:    #7a7365;
  --faint:      #8a8172;
  --fainter:    #a49b8a;

  /* lines */
  --line:       #ece7dd;
  --line-2:     #e6e0d5;
  --line-3:     #ddd9d1;
  --line-in:    #f0ece4;

  /* accent — single ink accent (indigo) */
  --accent:        oklch(0.50 0.11 262);
  --accent-strong: oklch(0.45 0.11 262);
  --accent-tint:   oklch(0.96 0.02 262);
  --accent-line:   oklch(0.88 0.04 262);

  /* type */
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans:  'Instrument Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* shape */
  --r-sm: 6px;
  --r:    9px;
  --r-lg: 12px;
  --r-xl: 18px;

  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

/* ---------- wordmark ---------- */
.wordmark {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--accent);
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
  white-space: nowrap;
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.nav-links a { transition: color .15s ease; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.active {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}
.nav-links a.active:hover { color: var(--accent-strong); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-dark   { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #322d26; }
.btn-outline{ background: transparent; color: var(--ink); border-color: var(--line-3); }
.btn-outline:hover { border-color: var(--ink); }
.btn-sm { padding: 8px 16px; font-size: 14px; }

/* ---------- shared type helpers ---------- */
.eyebrow {
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.eyebrow-muted { color: var(--faint); }
.serif { font-family: var(--serif); }
.mono  { font-family: var(--mono); }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.02em; margin: 0; }

.section-line { border-top: 1px solid var(--line); }

.accent-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap .15s ease;
}
.accent-link:hover { gap: 8px; }

.pill {
  font-size: 12px;
  color: var(--accent-strong);
  background: var(--accent-tint);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-weight: 500;
}
.tag {
  font-size: 12px;
  color: var(--muted);
  background: #f3efe6;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-weight: 500;
}

/* ---------- cards ---------- */
.card {
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: var(--panel);
  padding: 24px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -26px rgba(0,0,0,.35);
  border-color: var(--line-3);
}

/* ---------- inputs ---------- */
.field {
  width: 100%;
  border: 1px solid #d8d3c8;
  border-radius: var(--r);
  padding: 12px 16px;
  font-size: 15px;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--panel);
}
.field::placeholder { color: var(--fainter); }
.field:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

/* ---------- deck thumbnail ---------- */
.deck-thumb {
  aspect-ratio: 16 / 10;
  background: repeating-linear-gradient(135deg,#f2eee5,#f2eee5 8px,#f6f2ea 8px,#f6f2ea 16px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.deck-thumb span { font-family: var(--mono); font-size: 11px; color: #b5ab98; letter-spacing: .04em; }

/* ---------- real logo box (+ fallback) ---------- */
.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: #fff;
  border-bottom: 1px solid var(--line-2);
}
/* Fixed logo box: small source images scale UP, large ones scale down —
   so every card shows a consistently sized mark instead of tiny specks. */
.logo-wrap img { width: 72%; height: 52px; object-fit: contain; }
.logo-fallback {
  background: repeating-linear-gradient(135deg,#f4f0e8,#f4f0e8 8px,#f8f4ec 8px,#f8f4ec 16px);
}
.logo-fallback span {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  color: #a99d86;
  text-align: center;
  padding: 0 12px;
  line-height: 1.15;
}

/* ---------- removable filter chips ---------- */
.chip {
  font-size: 12.5px;
  color: var(--accent-strong);
  background: var(--accent-tint);
  border: 1px solid var(--accent-line);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .12s ease;
}
.chip span { opacity: .6; }
.chip:hover { background: color-mix(in srgb, var(--accent-tint) 70%, var(--accent-line)); }

/* ---------- category + pattern links ---------- */
.cat-chip {
  font-size: 14px;
  color: var(--text);
  border: 1px solid var(--line-3);
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 500;
  transition: border-color .15s ease, color .15s ease;
}
.cat-chip:hover { border-color: var(--ink); }
.pattern-opt {
  font-size: 15px;
  color: var(--text);
  padding: 8px 0;
  border-bottom: 1px solid var(--line-in);
  transition: color .15s ease;
}
.pattern-opt { display: block; }

/* ---------- load more ---------- */
.load-more-wrap { display: flex; justify-content: center; margin-top: 32px; }

/* ============================================================
   Roundup posts (guides) — Turn 3 editorial listicle
   ============================================================ */
.roundup { max-width: 840px; margin: 0 auto; padding: 40px 32px 88px; }
.roundup .rp-lede { font-family: var(--serif); font-size: 21px; line-height: 1.5; color: var(--muted); margin: 18px 0 22px; }
.roundup h2.rp-h2 { font-size: 30px; margin: 36px 0 12px; }
.roundup p.rp-body { font-size: 17px; line-height: 1.7; color: var(--text); margin: 0 0 28px; }

.rp-meta { font-size: 14px; color: var(--faint); border-bottom: 1px solid var(--line); padding-bottom: 32px; }
.rp-pillrow { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.rp-region {
  font-size: 13px; color: var(--text); border: 1px solid var(--line-3);
  padding: 6px 14px; border-radius: 999px; font-weight: 500;
}

/* TOC */
.rp-toc { border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 8px; }
.rp-toc-head {
  background: var(--paper-alt); padding: 12px 22px; font-size: 13px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted-2); font-weight: 600; border-bottom: 1px solid var(--line-2);
}
.rp-toc-list { padding: 8px 6px; }
.rp-toc-item {
  display: grid; grid-template-columns: 34px 1fr; align-items: baseline;
  padding: 8px 16px; font-size: 16px; color: #2a261f; transition: color .12s ease;
}
.rp-toc-item:hover { color: var(--accent); }
.rp-toc-item .n { font-family: var(--mono); font-size: 13px; color: var(--accent); }

/* entries */
.rp-entries { margin-top: 24px; }
.rp-entry {
  display: grid; grid-template-columns: 64px 1fr; gap: 24px;
  padding: 40px 0; border-top: 1px solid var(--line);
}
.rp-num { font-family: var(--serif); font-size: 38px; font-weight: 500; color: #cfc4ad; line-height: 1; }
.rp-name { font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.15; margin: 0 0 8px; }
.rp-tagline { font-size: 16px; line-height: 1.6; color: var(--muted); margin: 0 0 22px; max-width: 620px; }
.rp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 22px; }
.rp-lbl {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--fainter); font-weight: 600; margin-bottom: 10px;
}
.rp-kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 18px; font-size: 14px; }
.rp-vtag { font-size: 13px; color: var(--text); border: 1px solid var(--line-3); padding: 5px 12px; border-radius: var(--r-sm); }

/* deck entry (two-up with preview) */
.rp-deck { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.rp-preview { border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; background: #fff; }

/* guides index cards */
.guide-card {
  border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--panel);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 6px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.guide-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px -26px rgba(0,0,0,.35); border-color: var(--line-3); }
.guide-card .g-title { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.guide-card .g-sub { font-size: 13.5px; color: var(--muted-2); }
.guide-card .g-count { font-size: 12.5px; color: var(--accent); font-weight: 600; margin-top: 4px; }

@media (max-width: 720px) {
  .rp-cols { grid-template-columns: 1fr; gap: 18px; }
  .rp-deck { grid-template-columns: 1fr; }
  .rp-preview { max-width: 320px; }
  .rp-entry { grid-template-columns: 44px 1fr; gap: 16px; }
  .rp-num { font-size: 30px; }
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--paper-alt);
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  padding: 56px 0 48px;
}
.footer h4 {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  margin: 0 0 14px;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer a { font-size: 14px; color: var(--muted); }
.footer a:hover { color: var(--ink); }
.footer-note {
  border-top: 1px solid var(--line);
  padding: 20px 0 40px;
  font-size: 13px;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- checkbox filter ---------- */
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--muted);
  padding: 5px 0;
  cursor: pointer;
  user-select: none;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  width: 16px; height: 16px;
  border: 1px solid #cfc8ba;
  border-radius: 4px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: background .12s ease, border-color .12s ease;
}
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box::after {
  content: "";
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-0.5px,-1px);
}
.check:hover { color: var(--ink); }

/* ---------- utilities ---------- */
.hidden { display: none !important; }

/* ============================================================
   Responsive
   ============================================================ */
/* Tablet: collapse the wide 3/4-col grids and filter sidebars */
@media (max-width: 1000px) {
  #decks-teaser { grid-template-columns: repeat(2,1fr) !important; }
  #deck-grid    { grid-template-columns: repeat(2,1fr) !important; }
  /* filter-sidebar layouts (aside 210px + results) → stacked */
  .wrap[style*="210px"] { grid-template-columns: 1fr !important; }
}

@media (max-width: 820px) {
  .nav-links { gap: 18px; font-size: 13px; }
  .hide-sm { display: none !important; }
  /* featured story + subscribe two-up → single column */
  .card[style*="1.05fr"],
  .card[style*="1.1fr"] { grid-template-columns: 1fr !important; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 20px; }
  #stories-grid, #more-stories, #patterns-grid,
  #decks-teaser, #deck-grid, #accel-grid {
    grid-template-columns: 1fr !important;
  }
  .article { padding-left: 20px !important; padding-right: 20px !important; }
  .footer-inner { gap: 28px; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .nav-inner { flex-wrap: wrap; row-gap: 12px; padding: 16px 0; }
  .nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a.btn-sm { padding: 7px 14px; margin-left: auto; }
}
