/* ═══════════════════════════════════════════════════════════
   How to Roll Out — Tabbed Interface Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Tab bar ── */
.rollout-tabs {
  position: sticky;
  top: 64px; /* nav height */
  z-index: 40;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}

.rollout-tabs.is-stuck {
  box-shadow: 0 2px 12px hsl(0 0% 0% / 0.06);
}

.rollout-tab-list {
  display: flex;
  justify-content: center;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.rollout-tab {
  position: relative;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted-foreground);
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.rollout-tab:hover {
  color: var(--foreground);
}

.rollout-tab[aria-selected="true"] {
  color: var(--primary);
  font-weight: 600;
}

.rollout-tab[aria-selected="true"]::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

/* ── Tab panels ── */
.rollout-panel {
  display: none;
  animation: rollout-fade 0.3s ease;
}

.rollout-panel[aria-hidden="false"] {
  display: block;
}

@keyframes rollout-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Perspective sub-tabs (buyer / participant toggle) ── */
.perspective-toggle {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: hsl(213 47% 29% / 0.06);
  border-radius: 0.625rem;
  margin-bottom: 2.5rem;
  width: fit-content;
}

.perspective-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.perspective-toggle-btn:hover {
  color: var(--foreground);
}

.perspective-toggle-btn[aria-selected="true"] {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  font-weight: 600;
}

.perspective-toggle-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.perspective-panel {
  display: none;
  animation: rollout-fade 0.3s ease;
}

.perspective-panel.is-active {
  display: block;
}

/* ── Phase steps ── */
.rollout-phase {
  margin-bottom: 2.5rem;
}

.rollout-phase-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.rollout-phase-heading .phase-num {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8125rem;
  border: 3px solid var(--background);
  box-shadow: 0 0 0 2px hsl(213 47% 29% / 0.2);
}

.rollout-phase-heading h3 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--primary);
}

.rollout-phase p,
.rollout-phase li {
  color: var(--muted-foreground);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-weight: 300;
}

.rollout-phase p + p {
  margin-top: 0.75rem;
}

.rollout-phase strong {
  color: var(--foreground);
  font-weight: 600;
}

/* ── Perspective cards (buyer / participant) ── */
.perspective-section {
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
}

.perspective-section.perspective-buyer {
  background: hsl(213 47% 29% / 0.04);
  border: 1px solid hsl(213 47% 29% / 0.08);
}

.perspective-section.perspective-participant {
  background: hsl(18 52% 55% / 0.04);
  border: 1px solid hsl(18 52% 55% / 0.08);
}

.perspective-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  padding: 0.25rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.perspective-buyer .perspective-label {
  background: hsl(213 47% 29% / 0.1);
  color: var(--primary);
}

.perspective-participant .perspective-label {
  background: hsl(18 52% 55% / 0.1);
  color: var(--accent);
}

.perspective-label svg {
  width: 14px;
  height: 14px;
}

/* ── Parallel list (AI coaching, human coaching, experiments) ── */
.parallel-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.parallel-item {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.parallel-item h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.375rem;
}

.parallel-item p {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  line-height: 1.7;
  font-weight: 300;
}

/* ── "What you" structured list ── */
.what-you-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.what-you-item h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.what-you-item p {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  line-height: 1.7;
  font-weight: 300;
}

/* ── Compare table ── */
.compare-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.compare-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.compare-table thead th {
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
  text-align: left;
  padding: 1rem 1.25rem;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.compare-table thead th:first-child {
  background: hsl(213 47% 24%);
  border-top-left-radius: var(--radius-lg);
}

.compare-table thead th:last-child {
  border-top-right-radius: var(--radius-lg);
}

.compare-table tbody td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid hsl(220 13% 91% / 0.5);
  vertical-align: top;
  line-height: 1.6;
  color: var(--muted-foreground);
  font-weight: 300;
}

.compare-table tbody td:first-child {
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
  background: hsl(220 14% 96% / 0.4);
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 170px;
}

.compare-table tbody tr:nth-child(even) td {
  background: hsl(220 14% 96% / 0.25);
}

.compare-table tbody tr:nth-child(even) td:first-child {
  background: hsl(220 14% 96% / 0.6);
}

.compare-table tbody tr:last-child td {
  border-bottom: none;
}

.compare-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--radius-lg);
}

.compare-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--radius-lg);
}

/* ── After-phase callout ── */
.cycle-callout {
  background: hsl(220 14% 96% / 0.4);
  border: 1px solid hsl(220 13% 91% / 0.5);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  margin-top: 2.5rem;
}

.cycle-callout h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
}

.cycle-callout p {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  line-height: 1.7;
  font-weight: 300;
}

.cycle-callout p + p {
  margin-top: 0.75rem;
}

.cycle-callout strong {
  color: var(--foreground);
  font-weight: 600;
}

/* ── Common section ── */
.rollout-common {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.common-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
}

.common-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.common-card p {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  line-height: 1.7;
  font-weight: 300;
}

/* ── Compare tab intro note ── */
.compare-note {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  font-style: italic;
  margin-bottom: 1.5rem;
}

/* ── Executive dashboard list ── */
.dashboard-list {
  list-style: none;
  padding: 0;
  margin-top: 0.75rem;
}

.dashboard-list li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0;
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  font-weight: 300;
  line-height: 1.5;
}

.dashboard-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ── Mobile accordion ── */
@media (max-width: 767px) {
  .rollout-tabs {
    display: none;
  }

  .rollout-panel {
    display: none !important;
  }

  .rollout-accordion {
    display: block;
  }

  .accordion-section {
    border-bottom: 1px solid var(--border);
  }

  .accordion-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--primary);
    padding: 1.25rem 0;
    cursor: pointer;
    transition: color 0.2s;
  }

  .accordion-trigger svg {
    width: 20px;
    height: 20px;
    color: var(--muted-foreground);
    transition: transform 0.3s ease;
  }

  .accordion-trigger[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }

  .accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }

  .accordion-body.is-open {
    max-height: none;
  }

  .accordion-body-inner {
    padding-bottom: 2rem;
  }

  .perspective-section {
    padding: 1.5rem;
  }

  .cycle-callout {
    padding: 1.5rem;
  }

  .compare-wrapper {
    margin: 0 -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* ── Desktop: hide accordion, show tabs ── */
@media (min-width: 768px) {
  .rollout-accordion {
    display: none;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .rollout-panel {
    animation: none;
  }
  .accordion-body {
    transition: none;
  }
}

/* ═══════════════════════════════════════════════════════════
   Rollout Timeline Visual
   ═══════════════════════════════════════════════════════════ */
.rollout-timeline {
  position: relative;
  margin-bottom: 2.5rem;
  padding: 0.5rem 0 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rollout-timeline-track {
  display: flex;
  align-items: flex-start;
  position: relative;
  min-width: max-content;
  padding: 0 0.5rem;
}

/* the connecting line behind nodes */
.rollout-timeline-track::before {
  content: '';
  position: absolute;
  top: 1.125rem; /* center of node */
  left: 1.625rem; /* center of first node */
  right: 1.625rem;
  height: 2px;
  background: linear-gradient(
    90deg,
    hsl(213 47% 29%) 0%,
    hsl(213 47% 45%) 60%,
    hsl(18 52% 55%) 100%
  );
  z-index: 0;
}

/* each milestone node */
.tl-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 6rem;
  position: relative;
  z-index: 1;
}

.tl-dot {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8125rem;
  color: #ffffff;
  background: var(--primary);
  border: 3px solid var(--background);
  box-shadow: 0 0 0 2px hsl(213 47% 29% / 0.2);
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tl-node:last-child .tl-dot {
  background: var(--accent);
  box-shadow: 0 0 0 2px hsl(18 52% 55% / 0.2);
}

.tl-label {
  margin-top: 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--foreground);
  text-align: center;
  line-height: 1.35;
  max-width: 7rem;
}

.tl-time {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--muted-foreground);
  text-align: center;
}

/* cycle arrow node at end */
.tl-cycle {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 5rem;
  position: relative;
  z-index: 1;
}

.tl-cycle-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(220 14% 96%);
  border: 2px dashed hsl(213 47% 29% / 0.3);
  color: var(--primary);
  flex-shrink: 0;
}

.tl-cycle-label {
  margin-top: 0.625rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-align: center;
  font-style: italic;
  max-width: 5.5rem;
  line-height: 1.3;
}

@media (max-width: 480px) {
  .tl-node {
    min-width: 4.75rem;
  }
  .tl-label {
    font-size: 0.6875rem;
    max-width: 5rem;
  }
}
