/* ============================================================
   STACK BENCHMARK EMBED — style.css
   Embed-ready: no site header, iframe-friendly sizing
   Brand: STACK green #33B270, dark #393939, Proxima Nova typeface
   ============================================================ */

:root {
  --green: #33B270;
  --green-hover: #2da362;
  --green-active: #008E4A;
  --green-light: #e8f5ee;
  --green-mid: #b8e8cc;
  --dark: #393939;
  --dark-surface: #1c1c1c;
  --dark-border: #4c4c4c;
  --text: #393939;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --bg: #ffffff;
  --bg-off: #f9fafb;
  --bg-subtle: #f3f4f6;
  --border: #e5e7eb;
  --border-focus: #33B270;
  --red: #ef4444;
  --red-light: #fef2f2;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);
  --trans: 160ms cubic-bezier(0.16, 1, 0.3, 1);

  --text-xs: clamp(0.75rem, 0.7rem + 0.2vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.82rem + 0.25vw, 0.9375rem);
  --text-base: clamp(0.9375rem, 0.875rem + 0.3vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
  --text-2xl: clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: 'Proxima Nova', Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

img, svg { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   LAYOUT
   ============================================================ */

.container {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 5vw, 3rem);
}

.container--narrow {
  max-width: 680px;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.55em 1.25em;
  border-radius: var(--radius-md);
  transition: background var(--trans), color var(--trans), border-color var(--trans), box-shadow var(--trans), transform var(--trans);
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--green);
  color: #393939;
}
.btn-primary:hover { background: var(--green-hover); }
.btn-primary:active { background: var(--green-active); }

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--green); color: var(--green); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 0.5em 0.75em;
}
.btn-ghost:hover { color: var(--text); }

.btn-lg {
  font-size: var(--text-base);
  padding: 0.75em 1.75em;
}

/* ============================================================
   QUIZ SECTION
   ============================================================ */

.quiz-section {
  background: var(--bg-off);
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

/* Progress */
.progress-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 9999px;
  margin-bottom: 0.6rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--green);
  border-radius: 9999px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

/* Steps */
.step { display: none; }
.step.active { display: block; }

.step-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  animation: fadeSlideIn 0.3s ease forwards;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-question {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.step-hint {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Choice grid */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.choice-grid--2col {
  grid-template-columns: repeat(2, 1fr);
}

.choice-grid--4col {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 520px) {
  .choice-grid { grid-template-columns: repeat(2, 1fr); }
  .choice-grid--2col { grid-template-columns: 1fr; }
  .choice-grid--4col { grid-template-columns: repeat(2, 1fr); }
}

.choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  padding: 0.9rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg);
  text-align: center;
  transition: border-color var(--trans), background var(--trans), box-shadow var(--trans), transform var(--trans);
}

.choice-btn:hover {
  border-color: var(--green);
  background: var(--green-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.choice-btn.selected {
  border-color: var(--green);
  background: var(--green-light);
  box-shadow: 0 0 0 3px rgba(51,178,112,0.2);
}

.choice-icon { font-size: 1.4rem; line-height: 1; }
.choice-icon > svg { width: 1.4rem; height: 1.4rem; fill: var(--text-muted); transition: fill var(--trans); }
.choice-btn:hover .choice-icon > svg,
.choice-btn.selected .choice-icon > svg { fill: var(--green-active); }

.choice-label { font-size: var(--text-sm); font-weight: 600; color: var(--text); line-height: 1.3; }
.choice-sub { font-size: var(--text-xs); color: var(--text-muted); font-weight: 400; }

/* Nav */
.quiz-nav { margin-top: 1.25rem; }

/* ============================================================
   RESULTS
   ============================================================ */

.results-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: fadeSlideIn 0.4s ease forwards;
}

.results-header {
  background: var(--dark);
  color: #fff;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2.5rem);
  position: relative;
  overflow: hidden;
}

.results-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 50% 100%, rgba(51,178,112,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.results-eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.5rem;
  position: relative;
}

.results-title {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.5rem;
  position: relative;
}

.results-subtitle {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.65);
  max-width: 50ch;
  position: relative;
}

/* Metrics grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}

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

.metric-cell {
  background: var(--bg);
  padding: 1.25rem 1rem;
  text-align: center;
}

.metric-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.metric-your { font-size: var(--text-xs); color: var(--text-muted); margin-bottom: 0.15rem; }
.metric-your-val { font-size: var(--text-base); font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.metric-benchmark { font-size: var(--text-xs); color: var(--text-muted); margin-bottom: 0.15rem; }
.metric-benchmark-val { font-size: var(--text-lg); font-weight: 800; color: var(--green); }

.metric-gap {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.2em 0.6em;
  border-radius: 9999px;
}

.metric-gap.gap-positive { background: var(--green-light); color: var(--green-active); }

/* Benchmark table */
.benchmark-table-wrap {
  padding: clamp(1.25rem, 4vw, 1.75rem) clamp(1.25rem, 4vw, 2rem);
  border-bottom: 1px solid var(--border);
}

.table-heading {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: 0.85rem;
  color: var(--text);
}

.benchmark-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bench-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-off);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
  transition: background var(--trans);
}

.bench-row:hover { background: var(--green-light); border-color: var(--green-mid); }
.bench-company { font-weight: 600; color: var(--text); }
.bench-metric { color: var(--text-muted); font-size: var(--text-xs); }
.bench-result { font-weight: 700; color: var(--green-active); text-align: right; font-size: var(--text-xs); }

.bench-header {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-inline: 0.85rem;
}

/* Insights */
.results-insights {
  padding: clamp(1.25rem, 4vw, 1.75rem) clamp(1.25rem, 4vw, 2rem);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.insight-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--green-light);
  border: 1px solid var(--green-mid);
}

.insight-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 0.05em; }
.insight-text { font-size: var(--text-sm); color: var(--text); line-height: 1.5; }
.insight-text strong { font-weight: 700; }

.restart-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  width: 100%;
  padding: 0.75rem;
  font-size: var(--text-xs);
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  transition: color var(--trans), background var(--trans);
}

.restart-btn:hover { color: var(--text); background: var(--bg-subtle); }

