/* ===================================================================
   Brief Research Page — rp-* prefixed styles
   =================================================================== */

/* === HERO ANIMATIONS ============================================= */
.rp-hero-animate {
  opacity: 0; transform: translateY(18px);
  animation: rp-hero-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--delay, 0ms);
}
@keyframes rp-hero-in { to { opacity: 1; transform: translateY(0); } }

/* === HERO ========================================================= */
.rp-hero {
  position: relative;
  padding: clamp(64px, 8vw, 100px) 0 48px;
  text-align: center;
  background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
}
.rp-hero .aurora-glow {
  top: -80px;
}
.rp-hero-heading {
  font-family: var(--font-head);
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 500; letter-spacing: -2.5px; line-height: 1.08;
  color: var(--text);
  margin-bottom: 18px;
}
.rp-hero-sub {
  font-size: clamp(15px, 1.5vw, 17px);
  color: var(--text-2);
  line-height: 1.7;
  max-width: 580px;
  margin: 0 auto 32px;
}

/* Hero stats */
.rp-hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}
.rp-stat {
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  position: relative;
}
.rp-stat + .rp-stat::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}
.rp-stat-num {
  font-family: var(--font-head);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text);
  line-height: 1;
}
.rp-stat-label {
  font-size: 13px;
  color: var(--text-muted);
}
/* Accent stat */
.rp-stat-accent .rp-stat-num {
  color: var(--accent);
}
.rp-stat-accent .rp-stat-label {
  color: var(--accent);
  opacity: 0.7;
}
.rp-stat-dot {
  display: none;
}

/* === SECTIONS ===================================================== */
.rp-section {
  padding: 64px 0;
}
.rp-section-alt {
  background: transparent;
  border-top: none;
  border-bottom: none;
}
.rp-section + .rp-section::before {
  content: '';
  display: block;
  height: 1px;
  max-width: 1100px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
}
.rp-section-header {
  margin-bottom: 16px;
}
.rp-section-title {
  font-family: var(--font-head);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -1.5px;
  line-height: 1.15;
  color: var(--text);
}

/* Prose */
.rp-prose {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-2);
  max-width: 680px;
  margin-bottom: 24px;
}
.rp-prose-sm {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 640px;
  margin-bottom: 20px;
}

/* Subsection titles */
.rp-subsection {
  margin-top: 36px;
}
.rp-subsection-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 10px;
}

/* === SHARED CARD STYLE ============================================ */
.rp-mode-card,
.rp-strat-card,
.rp-rubric-card,
.rp-infra-item,
.rp-insight-card,
.rp-change-card,
.rp-podium-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  transition: border-color 0.2s, box-shadow 0.2s, opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.rp-mode-card:hover,
.rp-strat-card:hover,
.rp-rubric-card:hover,
.rp-infra-item:hover,
.rp-insight-card:hover,
.rp-change-card:hover,
.rp-podium-item:hover {
  border-color: rgba(37,99,235,0.2);
  box-shadow: 0 0 24px -8px rgba(37,99,235,0.06), var(--shadow-md);
}

/* === MODE GRID (test cases) ======================================= */
.rp-mode-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.rp-mode-card {
  padding: 18px 14px;
}
.rp-mode-name {
  display: block;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.rp-mode-desc {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === STRATEGY GRID ================================================ */
.rp-strat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.rp-strat-card {
  padding: 18px;
}
.rp-strat-label {
  display: block;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.rp-strat-detail {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
}

/* === RUBRIC GRID ================================================== */
.rp-rubric-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.rp-rubric-card {
  padding: 20px 16px;
}
.rp-rubric-score {
  display: none;
}
.rp-rubric-name {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}
.rp-rubric-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}

/* === PODIUM (top 5 results) ======================================= */
.rp-podium {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}
.rp-podium-item {
  display: grid;
  grid-template-columns: 48px 72px 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
}
.rp-podium-gold {
  background: linear-gradient(135deg, rgba(37,99,235,0.04) 0%, rgba(37,99,235,0.01) 100%);
  border-color: var(--accent-border);
}
.rp-podium-gold:hover {
  border-color: rgba(37,99,235,.35);
  box-shadow: 0 0 0 1px rgba(37,99,235,.15), var(--shadow-md);
}
.rp-podium-rank {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}
.rp-podium-gold .rp-podium-rank {
  color: var(--accent);
}
.rp-podium-score {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.rp-podium-gold .rp-podium-score {
  color: var(--accent);
}
.rp-podium-name {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
}
.rp-podium-gold .rp-podium-name {
  color: var(--text);
  font-weight: 600;
}

/* === EXPAND (full rankings) ======================================= */
.rp-expand {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 36px;
}
.rp-expand-toggle {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  background: var(--surface);
  transition: background 0.15s;
}
.rp-expand-toggle::-webkit-details-marker { display: none; }
.rp-expand-toggle:hover { background: var(--surface-2); }
.rp-expand-toggle svg {
  transition: transform 0.2s ease;
}
.rp-expand[open] .rp-expand-toggle svg {
  transform: rotate(180deg);
}

/* Table */
.rp-table-wrap {
  overflow-x: auto;
}
.rp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.rp-table th {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.rp-table th:last-child {
  text-align: right;
}
.rp-table td {
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.rp-table td:first-child {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--text-muted);
  width: 48px;
}
.rp-table td:last-child {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--text);
  text-align: right;
  width: 100px;
}
.rp-row-top td {
  color: var(--text);
  font-weight: 500;
}
.rp-row-top td:last-child {
  color: var(--accent);
}
.rp-row-bottom td {
  color: var(--text-muted);
}
.rp-row-bottom td:last-child {
  color: var(--error);
}
.rp-table tbody tr:hover {
  background: var(--surface);
}

/* === BAR CHART ==================================================== */
.rp-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
}
.rp-bar-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 16px;
}
.rp-bar-label {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}
.rp-bar-track {
  height: 36px;
  background: var(--surface);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border);
}
.rp-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent) 0%, #60a5fa 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.rp-bar-val {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
/* Bars expand when their row is in view */
.rp-bar-row.in-view .rp-bar-fill { width: var(--pct); }
.rp-bar-row:nth-child(1) .rp-bar-fill { transition-delay: 0ms; }
.rp-bar-row:nth-child(2) .rp-bar-fill { transition-delay: 100ms; }
.rp-bar-row:nth-child(3) .rp-bar-fill { transition-delay: 200ms; }
.rp-bar-row:nth-child(4) .rp-bar-fill { transition-delay: 300ms; }
.rp-bar-row:nth-child(5) .rp-bar-fill { transition-delay: 400ms; }

/* === INSIGHTS GRID ================================================ */
.rp-insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.rp-insight-card {
  padding: 24px 22px;
}
/* Featured insight — lead card with accent treatment */
.rp-insight-card-lg {
  grid-column: 1 / -1;
  padding: 32px 28px;
  border-left: 3px solid var(--accent);
  background: linear-gradient(135deg, rgba(37,99,235,0.025) 0%, var(--surface) 50%);
}
.rp-insight-card-lg:hover {
  border-left-color: var(--accent-hover);
}
.rp-insight-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}
.rp-insight-card-lg .rp-insight-title {
  font-size: 18px;
  margin-bottom: 10px;
}
.rp-insight-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
}

/* Temperature comparison (featured insight) */
.rp-insight-comparison {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: fit-content;
}
.rp-insight-before, .rp-insight-after {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.rp-insight-temp {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.rp-insight-val {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.rp-insight-val-accent {
  color: var(--accent);
}
.rp-insight-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* === CHANGES GRID ================================================= */
.rp-changes-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}
.rp-change-card {
  padding: 24px 22px;
}
.rp-change-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  margin-bottom: 12px;
}
.rp-change-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
  margin-bottom: 14px;
}
.rp-change-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rp-change-list li {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}
.rp-change-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.rp-change-list li strong {
  color: var(--text);
  font-weight: 600;
}

/* Parameters */
.rp-param-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rp-param {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.rp-param:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.rp-param-name {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.rp-param-change {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rp-param-old {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: line-through;
}
.rp-param-new {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}
.rp-param-change svg {
  color: var(--text-muted);
}
.rp-param-unchanged {
  font-size: 13px;
  color: var(--text-muted);
}

/* === RESULT BANNER ================================================ */
.rp-result-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px;
}
.rp-result-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  flex-wrap: wrap;
}
.rp-result-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.rp-result-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.rp-result-score {
  font-family: var(--font-head);
  font-size: 48px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1.5px;
  line-height: 1;
}
.rp-result-score-accent {
  color: var(--accent);
}
.rp-result-arrow {
  flex-shrink: 0;
}
.rp-result-delta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.rp-result-delta-num {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  color: var(--success);
  letter-spacing: -0.5px;
  line-height: 1;
}
.rp-result-delta-label {
  font-size: 11px;
  color: var(--success);
  font-weight: 500;
}

/* === SCROLL ANIMATIONS ============================================ */
[data-animate] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-animate].in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered card animations — mode cards */
.rp-mode-card[data-animate]:nth-child(1) { transition-delay: 0ms; }
.rp-mode-card[data-animate]:nth-child(2) { transition-delay: 60ms; }
.rp-mode-card[data-animate]:nth-child(3) { transition-delay: 120ms; }
.rp-mode-card[data-animate]:nth-child(4) { transition-delay: 180ms; }
.rp-mode-card[data-animate]:nth-child(5) { transition-delay: 240ms; }

/* Staggered — strategy cards */
.rp-strat-card[data-animate]:nth-child(1) { transition-delay: 0ms; }
.rp-strat-card[data-animate]:nth-child(2) { transition-delay: 60ms; }
.rp-strat-card[data-animate]:nth-child(3) { transition-delay: 120ms; }
.rp-strat-card[data-animate]:nth-child(4) { transition-delay: 180ms; }
.rp-strat-card[data-animate]:nth-child(5) { transition-delay: 240ms; }
.rp-strat-card[data-animate]:nth-child(6) { transition-delay: 300ms; }

/* Staggered — rubric cards */
.rp-rubric-card[data-animate]:nth-child(1) { transition-delay: 0ms; }
.rp-rubric-card[data-animate]:nth-child(2) { transition-delay: 60ms; }
.rp-rubric-card[data-animate]:nth-child(3) { transition-delay: 120ms; }
.rp-rubric-card[data-animate]:nth-child(4) { transition-delay: 180ms; }
.rp-rubric-card[data-animate]:nth-child(5) { transition-delay: 240ms; }

/* Staggered — podium items */
.rp-podium-item[data-animate]:nth-child(1) { transition-delay: 0ms; }
.rp-podium-item[data-animate]:nth-child(2) { transition-delay: 70ms; }
.rp-podium-item[data-animate]:nth-child(3) { transition-delay: 140ms; }
.rp-podium-item[data-animate]:nth-child(4) { transition-delay: 210ms; }
.rp-podium-item[data-animate]:nth-child(5) { transition-delay: 280ms; }

/* Staggered — bar rows */
.rp-bar-row[data-animate]:nth-child(1) { transition-delay: 0ms; }
.rp-bar-row[data-animate]:nth-child(2) { transition-delay: 70ms; }
.rp-bar-row[data-animate]:nth-child(3) { transition-delay: 140ms; }
.rp-bar-row[data-animate]:nth-child(4) { transition-delay: 210ms; }
.rp-bar-row[data-animate]:nth-child(5) { transition-delay: 280ms; }

/* Staggered — insight cards */
.rp-insight-card[data-animate]:nth-child(2) { transition-delay: 80ms; }
.rp-insight-card[data-animate]:nth-child(3) { transition-delay: 120ms; }
.rp-insight-card[data-animate]:nth-child(4) { transition-delay: 160ms; }
.rp-insight-card[data-animate]:nth-child(5) { transition-delay: 200ms; }
.rp-insight-card[data-animate]:nth-child(6) { transition-delay: 240ms; }
.rp-insight-card[data-animate]:nth-child(7) { transition-delay: 280ms; }

/* Staggered — change cards */
.rp-change-card[data-animate]:nth-child(1) { transition-delay: 0ms; }
.rp-change-card[data-animate]:nth-child(2) { transition-delay: 100ms; }

/* === RESPONSIVE =================================================== */
@media (max-width: 1024px) {
  .rp-rubric-grid { grid-template-columns: repeat(3, 1fr); }
  .rp-mode-grid { grid-template-columns: repeat(3, 1fr); }
  .rp-insights-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .rp-section { padding: 48px 0; }
  .rp-rubric-grid { grid-template-columns: repeat(2, 1fr); }
  .rp-mode-grid { grid-template-columns: repeat(2, 1fr); }
  .rp-strat-grid { grid-template-columns: 1fr; }
  .rp-insights-grid { grid-template-columns: 1fr; }
  .rp-changes-grid { grid-template-columns: 1fr; }
  .rp-podium-item { grid-template-columns: 40px 60px 1fr; gap: 12px; padding: 14px 18px; }
  .rp-hero-stats { gap: 24px; }
  .rp-stat + .rp-stat::before { display: none; }
  .rp-result-inner { gap: 20px; }
  .rp-result-score { font-size: 36px; }
  .rp-result-delta-num { font-size: 22px; }
  .rp-result-banner { padding: 32px 24px; }
  .rp-insight-comparison { flex-direction: column; gap: 12px; }
  .rp-insight-arrow { transform: rotate(90deg); }
}
@media (max-width: 480px) {
  .rp-rubric-grid { grid-template-columns: 1fr; }
  .rp-mode-grid { grid-template-columns: 1fr; }
  .rp-hero-heading { letter-spacing: -1.5px; }
  .rp-stat-num { font-size: 28px; }
  .rp-bar-row { grid-template-columns: 60px 1fr; gap: 10px; }
  .rp-result-score { font-size: 28px; }
  .rp-result-banner { padding: 28px 20px; }
}
