/*
 * Paperscope — Additional Improvements v1.0
 *
 * Third CSS layer, loaded after styles.css and polish.css.
 * Addresses: skip-link, hero copy, section labels, page headers,
 * agent cards, how-it-works, footer, newsletter inline, and a11y.
 * Does NOT override the polish.css editorial system — only adds to it.
 */

/* ─────────────────────────────────────────────────────────
 *  1. Accessibility utilities
 * ───────────────────────────────────────────────────────── */

.skip-link {
  position: absolute;
  top: -9999px;
  left: 1rem;
  z-index: 9999;
  padding: 0.6rem 1.2rem;
  background: var(--accent, #e4ac5c);
  color: #1a120a;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 0 0 var(--r-md, 12px) var(--r-md, 12px);
  text-decoration: none;
  transition: top 0s;
}

.skip-link:focus {
  top: 0;
}

.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;
}


/* ─────────────────────────────────────────────────────────
 *  2. Hero copy improvements
 * ───────────────────────────────────────────────────────── */

.hero-title em {
  font-style: normal;
  color: var(--accent, #e4ac5c);
}

.hero-promise {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: var(--text-3, #8a8780);
  margin-top: 0.9rem;
}

.hero-promise-dot {
  color: var(--accent, #e4ac5c);
  font-size: 0.55rem;
  flex-shrink: 0;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.4rem;
}

.hero-disambiguation {
  margin-top: 1.4rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--r-sm, 8px);
  border: 1px solid var(--rule-1, rgba(242, 237, 225, 0.08));
  background: var(--surface-2, rgba(22, 25, 34, 0.78));
  font-size: 0.82rem;
  color: var(--text-3, #8a8780);
  line-height: 1.55;
}

.hero-disambiguation strong {
  color: var(--text-2, #c9c5bb);
}

/* ─────────────────────────────────────────────────────────
 *  3. Primary buttons
 * ───────────────────────────────────────────────────────── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.35rem;
  border-radius: var(--r-pill, 999px);
  border: 1px solid color-mix(in srgb, var(--accent, #e4ac5c) 55%, transparent);
  background: var(--accent, #e4ac5c);
  color: #1a120a;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent-hover, #f0bc76);
  border-color: var(--accent-hover, #f0bc76);
  transform: translateY(-1px);
}

.btn-primary.btn-compact {
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.35rem;
  border-radius: var(--r-pill, 999px);
  border: 1px solid var(--rule-2, rgba(242, 237, 225, 0.14));
  background: transparent;
  color: var(--text-1, #f2ede1);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--rule-3, rgba(242, 237, 225, 0.22));
  background: var(--surface-2, rgba(22, 25, 34, 0.78));
  color: var(--text-1, #f2ede1);
}

/* ─────────────────────────────────────────────────────────
 *  4. How it works — improved icons
 * ───────────────────────────────────────────────────────── */

.how-it-works {
  margin: clamp(1.5rem, 3vw, 2.5rem) 0;
  padding: clamp(1.5rem, 3vw, 2.5rem) 0;
  border-top: 1px solid var(--rule-1, rgba(242, 237, 225, 0.08));
  border-bottom: 1px solid var(--rule-1, rgba(242, 237, 225, 0.08));
}

.how-title {
  font-family: var(--font-display, 'Fraunces', serif);
  font-weight: 500;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: -0.02em;
  color: var(--text-1, #f2ede1);
  margin-bottom: 1.5rem;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.4rem;
}

.how-card {
  padding: 1.25rem 1.3rem;
  border-radius: var(--r-lg, 18px);
  border: 1px solid var(--rule-1, rgba(242, 237, 225, 0.08));
  background: var(--surface-1, rgba(16, 18, 24, 0.86));
  box-shadow: var(--shadow-1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.how-card:hover {
  border-color: color-mix(in srgb, var(--accent, #e4ac5c) 30%, transparent);
  box-shadow: var(--shadow-2);
}

.how-icon {
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: var(--r-sm, 8px);
  border: 1px solid color-mix(in srgb, var(--accent, #e4ac5c) 30%, transparent);
  background: var(--accent-softer, rgba(228, 172, 92, 0.07));
  font-size: 1.2rem;
  margin-bottom: 0.85rem;
}

.how-card h3 {
  font-family: var(--font-sans);
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text-1, #f2ede1);
  margin-bottom: 0.45rem;
  letter-spacing: -0.01em;
}

.how-card p {
  font-size: 0.87rem;
  color: var(--text-2, #c9c5bb);
  line-height: 1.6;
}

.how-disclaimer {
  font-size: 0.8rem;
  color: var(--text-3, #8a8780);
  line-height: 1.55;
  padding: 0.85rem 1rem;
  border-radius: var(--r-sm, 8px);
  border: 1px solid var(--rule-1, rgba(242, 237, 225, 0.08));
  background: var(--surface-2, rgba(22, 25, 34, 0.78));
  margin-top: 1rem;
}

/* ─────────────────────────────────────────────────────────
 *  5. Topics strip improvements
 * ───────────────────────────────────────────────────────── */

.topics-strip {
  margin: clamp(1.2rem, 2.5vw, 2rem) 0;
}

.topics-strip-header {
  margin-bottom: 0.85rem;
}

.topics-strip-title {
  font-family: var(--font-display, 'Fraunces', serif);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
  color: var(--text-1, #f2ede1);
  margin-bottom: 0.25rem;
}

.topics-strip-sub {
  font-size: 0.82rem;
  color: var(--text-3, #8a8780);
}

.topics-strip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.85rem;
  border-radius: var(--r-pill, 999px);
  border: 1px solid var(--rule-2, rgba(242, 237, 225, 0.14));
  background: var(--surface-1, rgba(16, 18, 24, 0.86));
  color: var(--text-2, #c9c5bb);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.005em;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.topic-chip:hover {
  border-color: color-mix(in srgb, var(--accent, #e4ac5c) 40%, transparent);
  color: var(--accent-hover, #f0bc76);
  background: var(--accent-softer, rgba(228, 172, 92, 0.07));
}

.topic-chip-more {
  color: var(--text-3, #8a8780);
  font-style: italic;
}


/* ─────────────────────────────────────────────────────────
 *  6. Newsletter inline (near-top promo strip)
 * ───────────────────────────────────────────────────────── */

.newsletter-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  padding: 0.9rem 1.2rem;
  border-radius: var(--r-md, 12px);
  border: 1px solid color-mix(in srgb, var(--accent, #e4ac5c) 22%, transparent);
  background: var(--accent-softer, rgba(228, 172, 92, 0.07));
  margin-bottom: clamp(1.2rem, 2.5vw, 2rem);
}

.newsletter-inline-copy {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.newsletter-inline-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.newsletter-inline-title {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text-1, #f2ede1);
  margin-bottom: 0.15rem;
}

.newsletter-inline-sub {
  font-size: 0.8rem;
  color: var(--text-3, #8a8780);
  line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────
 *  7. Section labels — cleaner text, deemphasize emoji
 * ───────────────────────────────────────────────────────── */

.section-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3, #8a8780);
  display: inline-block;
  margin-bottom: 0.4rem;
}

/* ─────────────────────────────────────────────────────────
 *  8. Related critiques list
 * ───────────────────────────────────────────────────────── */

.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.related-link {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--r-sm, 8px);
  border: 1px solid var(--rule-1, rgba(242, 237, 225, 0.08));
  background: var(--surface-2, rgba(22, 25, 34, 0.78));
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.related-link:hover {
  border-color: color-mix(in srgb, var(--accent, #e4ac5c) 30%, transparent);
  background: var(--accent-softer, rgba(228, 172, 92, 0.07));
}

.related-agent {
  flex-shrink: 0;
  font-size: 0.85rem;
  margin-top: 0.05rem;
}

.related-title {
  font-size: 0.83rem;
  color: var(--text-2, #c9c5bb);
  line-height: 1.4;
  flex: 1;
}

.related-meta {
  font-size: 0.72rem;
  color: var(--text-3, #8a8780);
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
  margin-left: auto;
  padding-left: 0.5rem;
  flex-shrink: 0;
}


/* ─────────────────────────────────────────────────────────
 *  9. Inner page structure (about, agents, topics, etc.)
 * ───────────────────────────────────────────────────────── */

.page-content {
  max-width: var(--shell-narrow, 860px);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 0 4rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-3, #8a8780);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.75rem;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--accent-hover, #f0bc76);
}

.page-header {
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  padding-bottom: clamp(1.2rem, 2.5vw, 2rem);
  border-bottom: 1px solid var(--rule-1, rgba(242, 237, 225, 0.08));
}

.page-header h1 {
  font-family: var(--font-display, 'Fraunces', serif);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.025em;
  color: var(--text-1, #f2ede1);
  line-height: 1.1;
  margin-bottom: 0.6rem;
}

.page-header p {
  font-size: 1.05rem;
  color: var(--text-2, #c9c5bb);
  line-height: 1.65;
  max-width: 56ch;
}


/* ─────────────────────────────────────────────────────────
 *  10. Agent profile cards (agents.html)
 * ───────────────────────────────────────────────────────── */

.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 1.1rem;
  margin-bottom: 2.5rem;
}

.agent-profile-card {
  padding: 1.35rem 1.4rem 1.4rem;
  border-radius: var(--r-lg, 18px);
  border: 1px solid var(--rule-1, rgba(242, 237, 225, 0.08));
  background: var(--surface-1, rgba(16, 18, 24, 0.86));
  box-shadow: var(--shadow-2);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border-left-width: 3px;
}

.agent-profile-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-3);
}

.agent-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.agent-avatar-large {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--r-md, 12px);
  border: 1px solid var(--rule-2, rgba(242, 237, 225, 0.14));
  background: var(--surface-3, rgba(29, 33, 44, 0.72));
  font-size: 1.5rem;
  flex-shrink: 0;
}

.agent-title h2 {
  font-family: var(--font-display, 'Fraunces', serif);
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 0.15rem;
}

.agent-tagline {
  display: block;
  font-size: 0.78rem;
  color: var(--text-3, #8a8780);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.agent-bio {
  font-size: 0.88rem;
  color: var(--text-2, #c9c5bb);
  line-height: 1.65;
}

.agent-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.agent-stat {
  font-size: 0.78rem;
  color: var(--text-3, #8a8780);
  padding: 0.28rem 0.65rem;
  border-radius: var(--r-pill, 999px);
  border: 1px solid var(--rule-1, rgba(242, 237, 225, 0.08));
  background: var(--surface-2, rgba(22, 25, 34, 0.78));
}

.agent-stat strong {
  color: var(--text-1, #f2ede1);
  font-weight: 600;
}

.agent-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.topic-tag {
  font-size: 0.74rem;
  color: var(--text-3, #8a8780);
  padding: 0.22rem 0.6rem;
  border-radius: var(--r-pill, 999px);
  border: 1px solid var(--rule-2, rgba(242, 237, 225, 0.14));
  background: transparent;
}

.agent-cta-row { margin-top: auto; padding-top: 0.25rem; }


/* ─────────────────────────────────────────────────────────
 *  11. Legal / about sections
 * ───────────────────────────────────────────────────────── */

.legal-section,
.methodology-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule-1, rgba(242, 237, 225, 0.08));
}

.legal-section:last-child,
.methodology-section:last-child {
  border-bottom: 0;
}

.legal-section h2,
.methodology-section h2 {
  font-family: var(--font-display, 'Fraunces', serif);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: -0.015em;
  color: var(--text-1, #f2ede1);
  margin-bottom: 0.85rem;
}

.legal-section p,
.methodology-section p {
  font-size: 0.93rem;
  color: var(--text-2, #c9c5bb);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.legal-section ul {
  margin: 0.5rem 0 0 0;
  padding-left: 1.2rem;
}

.legal-section ul li {
  font-size: 0.93rem;
  color: var(--text-2, #c9c5bb);
  line-height: 1.7;
  margin-bottom: 0.4rem;
}

.legal-section a,
.methodology-section a {
  color: var(--link, #86b7e0);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--link, #86b7e0) 30%, transparent);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.legal-section a:hover,
.methodology-section a:hover {
  color: var(--link-hover, #a5cff1);
  border-color: var(--link-hover, #a5cff1);
}

.agent-disclaimer {
  font-size: 0.82rem;
  color: var(--text-3, #8a8780);
  padding: 0.85rem 1rem;
  border-radius: var(--r-sm, 8px);
  border: 1px solid var(--rule-1, rgba(242, 237, 225, 0.08));
  background: var(--surface-2, rgba(22, 25, 34, 0.78));
  line-height: 1.55;
  margin-top: 0.75rem;
}

/* ─────────────────────────────────────────────────────────
 *  12. Footer improvements
 * ───────────────────────────────────────────────────────── */

.site-footer {
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(1.5rem, 3vw, 2.5rem);
  border-top: 1px solid var(--rule-1, rgba(242, 237, 225, 0.08));
  margin-top: clamp(2rem, 5vw, 4rem);
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-display, 'Fraunces', serif);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  color: var(--text-1, #f2ede1);
  background: none;
  -webkit-text-fill-color: currentColor;
}

.footer-note {
  font-size: 0.82rem;
  color: var(--text-3, #8a8780);
  max-width: 52ch;
  line-height: 1.55;
  margin: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 1.5rem;
  margin-top: 0.5rem;
}

.footer-link {
  font-size: 0.82rem;
  color: var(--text-3, #8a8780);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--accent-hover, #f0bc76);
}

/* ─────────────────────────────────────────────────────────
 *  13. Light theme overrides for new elements
 * ───────────────────────────────────────────────────────── */

[data-theme="light"] .how-card {
  background: var(--surface-1);
}

[data-theme="light"] .newsletter-inline {
  background: rgba(139, 96, 16, 0.05);
  border-color: rgba(139, 96, 16, 0.18);
}

[data-theme="light"] .topic-chip:hover {
  color: var(--accent-hover);
  background: var(--accent-softer);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

[data-theme="light"] .related-link {
  background: var(--surface-2);
  border-color: var(--rule-1);
}

[data-theme="light"] .agent-profile-card {
  background: var(--surface-1);
}

[data-theme="light"] .btn-primary {
  color: #fbf7ee;
}

/* ─────────────────────────────────────────────────────────
 *  14. Small responsive fixes
 * ───────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .hero-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .newsletter-inline {
    flex-direction: column;
    align-items: flex-start;
  }

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

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

  .page-header h1 {
    font-size: 1.8rem;
  }
}
