/* Letterbox — editorial directory mockup
   Fraunces + Source Sans 3, paper / ink / forest. Gold is reserved for Featured. */

:root {
  --paper: #f3eee4;
  --paper-deep: #ebe4d6;
  --cream: #faf7f1;
  --card: #fcfaf5;
  --ink: #1a1914;
  --ink-soft: #3d3a32;
  --muted: #5a5448;
  --line: #ddd4c4;
  --line-strong: #cfc5b3;
  --forest: #1e4a38;
  --forest-deep: #16382b;
  --forest-soft: #e4eee8;
  --gold: #8a6718;
  --gold-bright: #b8892a;
  --gold-bg: #f6edd4;
  --gold-line: #e2cfa0;
  --ours-bg: #2c2a26;
  --ours-fg: #f4efe6;
  --danger: #7a3b2e;
  --shadow: 0 1px 2px rgba(26, 25, 20, 0.04), 0 8px 24px rgba(26, 25, 20, 0.05);
  --shadow-hover: 0 2px 4px rgba(26, 25, 20, 0.06), 0 14px 32px rgba(26, 25, 20, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", Georgia, serif;
  --sans: "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
  --max: 1120px;
  --header-h: 68px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1200px 500px at 50% -80px, #f8f4ec 0%, transparent 70%),
    linear-gradient(180deg, #f6f1e8 0%, var(--paper) 280px);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: var(--forest);
  text-underline-offset: 3px;
}

a:hover { color: var(--forest-deep); }

:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: var(--cream);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(243, 238, 228, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand:hover { color: var(--ink); }

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-kicker {
  display: block;
  margin-top: 3px;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 999px;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--paper-deep);
}

.nav a.nav-cta {
  background: var(--forest);
  color: var(--cream);
  padding: 8px 16px;
  margin-left: 6px;
}

.nav a.nav-cta:hover {
  background: var(--forest-deep);
  color: var(--cream);
}

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 28px;
}

.hero-kicker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
  margin: 0 0 14px;
}

.hero h1 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 14px;
  max-width: 16ch;
}

.hero-pitch {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 42ch;
  margin: 0 0 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  line-height: 1.2;
  background: var(--forest);
  color: var(--cream);
}

.btn:hover {
  background: var(--forest-deep);
  color: var(--cream);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Match banner ---------- */
.match-banner {
  display: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: var(--forest-soft);
  border: 1px solid color-mix(in srgb, var(--forest) 18%, var(--line));
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 8px 0 28px;
}

.match-banner.is-on { display: flex; }

.match-banner p {
  margin: 0;
  color: var(--ink-soft);
}

.match-banner strong {
  color: var(--forest-deep);
  font-weight: 700;
}

.match-banner .match-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.match-banner button {
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 650;
  border: 0;
  background: transparent;
  color: var(--forest);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}

.match-banner button:hover { background: #fff; }

/* ---------- Filters ---------- */
.filters {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 16px;
  margin-bottom: 36px;
}

.filters-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.search {
  flex: 1;
  position: relative;
}

.search input {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 16px 11px 42px;
}

.search input::placeholder { color: #938c7e; }

.search input:focus {
  border-color: var(--forest);
  background: #fff;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chip-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}

.chip {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  line-height: 1.2;
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.chip[aria-pressed="true"] {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--cream);
}

.chip-clear {
  margin-left: auto;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chip-clear:hover {
  color: var(--ink);
  background: transparent;
  border-color: transparent;
}

.results-meta {
  margin: 12px 2px 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.results-meta strong { color: var(--ink-soft); font-weight: 650; }

/* ---------- Sections ---------- */
.section {
  margin-bottom: 48px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.eyebrow-gold {
  color: var(--gold);
}

.section-note {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

/* ---------- Cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

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

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  min-height: 100%;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--line-strong);
  color: inherit;
}

.card-featured {
  background: linear-gradient(180deg, #fbf6e8 0%, var(--card) 56%);
  border-color: var(--gold-line);
  box-shadow: 0 1px 2px rgba(138, 103, 24, 0.06), 0 10px 28px rgba(138, 103, 24, 0.08);
}

.card-featured:hover {
  border-color: var(--gold-bright);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.03em;
  flex: none;
}

.tone-forest { background: #dce8e2; color: #1e4a38; }
.tone-navy { background: #dce3ea; color: #24364a; }
.tone-olive { background: #e4e6d4; color: #3d4a24; }
.tone-rust { background: #eddcd4; color: #6a3224; }
.tone-slate { background: #e2e0db; color: #3a3a38; }
.tone-gold { background: #f0e4c4; color: #6e5214; }

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 8px;
  line-height: 1;
}

.badge-ours {
  background: var(--ours-bg);
  color: var(--ours-fg);
}

.badge-featured {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--gold-line);
}

.card h2,
.card-title {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 8px;
}

.card-pitch {
  color: var(--ink-soft);
  margin: 0 0 16px;
  flex: 1;
  font-size: 0.98rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.card-meta span::before {
  content: "·";
  margin-right: 12px;
  color: var(--line-strong);
}

.card-meta span:first-child::before { content: none; margin: 0; }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}

.empty {
  background: var(--card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  color: var(--muted);
}

.empty h2 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 560;
  margin: 0 0 8px;
}

.empty p { margin: 0; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}

.site-footer strong {
  color: var(--ink-soft);
  font-weight: 650;
}

/* ---------- Detail ---------- */
.detail-page .hero { padding-bottom: 8px; }

.detail-page #letter-root {
  padding-top: 32px;
}

.side .tag-row { margin-top: 8px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
  color: var(--muted);
  margin-bottom: 22px;
}

.back-link:hover { color: var(--ink); }

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
  padding-bottom: 56px;
}

.detail-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.detail h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 10px;
}

.lede {
  font-size: 1.18rem;
  color: var(--ink-soft);
  margin: 0 0 22px;
}

.prose p {
  margin: 0 0 1em;
  color: var(--ink-soft);
  max-width: 62ch;
}

.sample {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-top: 28px;
}

.sample h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 560;
  letter-spacing: -0.02em;
  margin: 4px 0 8px;
}

.sample-date {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 12px;
}

.sample ul {
  margin: 0;
  padding-left: 1.15em;
  color: var(--ink-soft);
}

.sample li { margin-bottom: 6px; }

.side {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.side.featured-side {
  background: linear-gradient(180deg, #fbf6e8 0%, var(--card) 50%);
  border-color: var(--gold-line);
}

.side dl {
  margin: 0 0 18px;
}

.side dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 12px;
}

.side dt:first-child { margin-top: 0; }

.side dd {
  margin: 3px 0 0;
  font-weight: 600;
}

.side .btn { width: 100%; }

.side-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 10px 0 0;
}

.not-found {
  padding: 48px 0 80px;
}

/* ---------- Quiz ---------- */
.quiz-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 0 80px;
}

.progress {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.progress span {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background: var(--line);
}

.progress span.is-on { background: var(--forest); }

.quiz-step h1 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 8px;
}

.quiz-step .hint {
  color: var(--muted);
  margin: 0 0 22px;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  text-align: left;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.option small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  margin-top: 3px;
}

.option:hover { border-color: var(--line-strong); }

.option[aria-pressed="true"] {
  background: var(--forest-soft);
  border-color: var(--forest);
  box-shadow: none;
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.quiz-step[hidden] { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid-featured { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .side { position: static; }
  .brand-kicker { display: none; }
}

@media (max-width: 560px) {
  .wrap { width: min(var(--max), calc(100% - 28px)); }
  .hero { padding-top: 32px; }
  .nav a { padding: 8px 10px; font-size: 0.88rem; }
  .nav a.nav-cta { padding: 8px 12px; margin-left: 0; }
  .filters-top { flex-direction: column; align-items: stretch; }
  .chip-clear { margin-left: 0; }
  .match-banner { flex-direction: column; }
  .hero h1 { max-width: none; }
}

@media (min-width: 1280px) {
  .hero { padding-top: 72px; }
}

/* Site additions */
.card-placeholder { border-style: dashed; cursor: default; }
.card-placeholder:hover { transform: none; }
.breadcrumbs { font-size: 14px; margin: 20px 0 4px; color: #6b665c; }
.link-list { columns: 2; padding-left: 18px; }
@media (max-width: 640px) { .link-list { columns: 1; } }
.faq h3 { margin: 18px 0 4px; font-size: 18px; }
.about { max-width: 760px; padding: 32px 0 48px; }
.disclosure { max-width: 820px; }
.site-footer a { color: inherit; text-decoration: underline; }
.detail h2 { margin-top: 32px; }
.nav a { white-space: nowrap; } @media (max-width: 420px) { .brand-kicker { display:none; } .nav { gap: 8px; } }
.site-header .wrap { flex-wrap: nowrap; }
.nav { flex-wrap: nowrap; flex-shrink: 0; }
.nav a.nav-cta { white-space: nowrap; }
@media (max-width: 520px) { .brand-kicker { display: none; } .nav { gap: 4px; } .nav a { padding-left: 8px; padding-right: 8px; font-size: 14px; } }
@media (max-width: 360px) { .nav a[href$="about.html"] { display: none; } }
.browse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 24px; }
.browse-grid ul { list-style: none; padding: 0; margin: 0; }
.browse-grid li { margin: 4px 0; }
.browse-by h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; margin: 12px 0 6px; }
.count { color: #8a8478; font-size: 13px; }
.nojs-note { font-size: 14px; color: #6b665c; margin: 16px 0; }
.coming { background: #f3ecdc; border-radius: 10px; padding: 12px 16px; }
.footer-links { font-size: 14px; margin: 4px 0; }
.glossary dt { font-weight: 700; margin-top: 14px; }
.glossary dd { margin: 2px 0 0; }
.cmp { border-collapse: collapse; width: 100%; } .cmp td, .cmp th { border: 1px solid #ddd5c4; padding: 6px 8px; text-align: left; }
.apply-form label { display: block; margin: 10px 0; font-weight: 600; }
.apply-form input, .apply-form textarea { display: block; width: 100%; max-width: 520px; padding: 8px; margin-top: 4px; font: inherit; }
