/* ════════════════════════════════════════════════
   PERFORMANCE SECTION — Scroll Sync Layout
   ════════════════════════════════════════════════ */

/* ── SECTION WRAPPER ── */
#performance {
  width: 100%;
  /* clip = same visual as hidden BUT doesn't create scroll container
     → position:sticky on descendants still works! */
  overflow-x: clip;
  padding-bottom: 2rem !important;
}

/* ── STICKY SECTION HEADER ── */
.perf-header-sticky {
  position: sticky;
  top: 72px;
  z-index: 50;
  background: var(--bg);
  padding: 1.5rem 0 1rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px -10px var(--bg);
  border-bottom: 1px solid var(--border);
}

/* ── MAIN LAYOUT: sidebar + scrollable content ── */
.perf-layout {
  display: flex;
  align-items: flex-start;
  gap: 4rem;
  position: relative;
  width: 100%;
  /* NO overflow here — let sticky work naturally */
}

/* ══════════════════════════════════════════════════
   DESKTOP STICKY LEFT NAV (~25% width)
   ══════════════════════════════════════════════════ */
.sticky-nav {
  position: sticky;
  top: 30vh;
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.nav-tabs-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1rem 0 1rem 1.5rem;
  margin-top: 1rem;
}

/* Vertical progress line */
.progress-line {
  position: absolute;
  top: 1.5rem;
  bottom: 1.5rem;
  left: 0;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  background: var(--accent);
  width: 100%;
  height: 0%;
  transition: height 0.15s linear;
  border-radius: 2px;
}

/* Tab buttons */
.sticky-tab {
  position: relative;
  background: none;
  border: none;
  color: var(--muted);
  padding: 1.5rem 0;
  text-align: left;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 500;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  outline: none;
  line-height: 1.3;
}

.sticky-tab:hover {
  color: var(--text);
}

.sticky-tab.active {
  color: var(--text);
  font-weight: 700;
}

/* Dot indicator */
.tab-dot {
  position: absolute;
  left: calc(-1.5rem - 6px);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  transition: border-color 0.3s, background 0.3s, transform 0.3s;
  z-index: 2;
  flex-shrink: 0;
}

.sticky-tab.active .tab-dot {
  border-color: var(--accent);
  background: var(--accent);
  transform: scale(1.25);
}

/* ── SCROLLABLE CONTENT AREA ── */
.scroll-content {
  flex: 1;
  min-width: 0;
}

/* Each platform content block */
.scroll-block {
  padding-top: 3rem;
  padding-bottom: 3rem;
  scroll-margin-top: 160px;
  border-top: 1px solid var(--border);
}

.scroll-block:first-child {
  padding-top: 0;
  border-top: none;
}

.scroll-block:last-child {
  padding-bottom: 1rem;
}

/* Ensure child margin doesn't add to parent padding */
.scroll-block> :last-child {
  margin-bottom: 0 !important;
}

/* Fade-in on reveal */
.scroll-block.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.scroll-block.reveal.revealed {
  opacity: 1;
  transform: none;
}

/* ══════════════════════════════════════════════════
   HAMBURGER (hidden on desktop)
   ══════════════════════════════════════════════════ */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}

/* ══════════════════════════════════════════════════
   MOBILE (≤ 768px) — Horizontal fixed tabs
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .perf-header-sticky {
    position: relative;
    top: auto;
    padding-top: 0;
    margin-bottom: 1rem;
    border-bottom: none;
    box-shadow: none;
  }

  .perf-layout {
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 0;
  }

  /* Sidebar becomes static placeholder (hidden, tabs go fixed) */
  .sticky-nav {
    position: sticky;
    top: 63px;
    z-index: 500;
    width: 100%;
  }

  /* Horizontal tab bar: FIXED under navbar */
  .nav-tabs-wrapper {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0 1rem;
    margin-top: 0;
    gap: 0;
    overflow-x: auto;
    white-space: nowrap;
    background: rgba(var(--bg-rgb, 10, 10, 15), 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-sizing: border-box;
    /* Hide scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .nav-tabs-wrapper::-webkit-scrollbar {
    display: none;
  }

  /* Horizontal progress line at bottom of tab bar */
  .progress-line {
    position: absolute;
    top: auto;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 0;
  }

  .progress-fill {
    width: 0%;
    height: 100%;
    transition: width 0.15s linear;
  }

  .sticky-tab {
    padding: 0.9rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    border-bottom: 2px solid transparent;
    transition: color 0.3s, border-color 0.3s;
  }

  .sticky-tab.active {
    border-bottom-color: var(--accent);
  }

  .tab-dot {
    display: none;
  }

  /* Push content below fixed tab bar */
  .scroll-content {
    width: 100%;
    min-width: 0;
  }

  .scroll-block {
    min-height: unset;
    padding: 3rem 1.25rem;
    border-top: 1px solid var(--border);
    margin-top: 0;
    scroll-margin-top: 130px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  .scroll-block:first-child {
    border-top: none;
    padding-top: 0;
  }
}

/* ══════════════════════════════════════════════════
   GENERAL METRICS BLOCK STYLES
   ══════════════════════════════════════════════════ */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  width: 100%;
}

@media (max-width: 480px) {
  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }
}

.metric-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  text-align: center;
  transition: border-color var(--transition), transform 0.2s;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
  width: 100%;
}

.metric-card:hover {
  border-color: rgba(var(--accent-rgb), .3);
  transform: translateY(-3px);
}

.metric-val {
  font-family: var(--font-head);
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  font-weight: 800;
  color: var(--accent);
  margin-bottom: .4rem;
  line-height: 1;
  overflow-wrap: normal;
}

@media (max-width: 480px) {
  .metric-val {
    font-size: 1.25rem;
  }

  .metric-card {
    padding: 1.25rem 0.5rem;
  }
}

.metric-key {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text);
  font-weight: 600;
  margin-bottom: .25rem;
}

.metric-delta {
  font-size: .75rem;
  color: var(--muted);
}

.tab-note {
  font-size: .95rem;
  color: var(--muted);
  line-height: 1.7;
  /* max-width: 680px; */
  margin-bottom: 2rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
}

/* ══════════════════════════════════════════════════
   GOOGLE PLATFORM TABLE
   ══════════════════════════════════════════════════ */
.google-wrapper {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 10px 40px var(--shadow);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 768px) {
  .google-wrapper {
    padding: 1.25rem;
  }
}

.g-note {
  font-size: .95rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 2.5rem;
  max-width: 700px;
}

.kpi-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.kpi-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.kpi-table th {
  text-align: left;
  padding: 1rem 1.25rem;
  background: var(--bg3);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.kpi-table td {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  vertical-align: middle;
}

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

.kpi-table tbody tr:hover {
  background: rgba(var(--accent-rgb), 0.02);
}

.kpi-table td:first-child {
  font-weight: 600;
  color: var(--text);
}

.kpi-table td:nth-child(2) {
  color: var(--muted);
}

.kpi-table td:nth-child(3) {
  color: var(--text);
  font-style: italic;
}

@media (max-width: 768px) {
  .kpi-table {
    min-width: unset;
  }

  .kpi-table th {
    padding: 0.75rem 0.5rem;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
  }

  .kpi-table td {
    padding: 0.85rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1.4;
  }
}

.kpi-badge {
  display: inline-block;
  padding: .3rem .75rem;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 600;
}

.kpi-green {
  background: rgba(77, 255, 145, .15);
  color: #4dff91;
  border: 1px solid rgba(77, 255, 145, .3);
}

.kpi-yellow {
  background: rgba(255, 214, 0, .15);
  color: #ffd600;
  border: 1px solid rgba(255, 214, 0, .3);
}

.kpi-orange {
  background: rgba(255, 138, 0, .15);
  color: #ff8a00;
  border: 1px solid rgba(255, 138, 0, .3);
}

.bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  width: var(--bar-w, 0%);
  border-radius: 4px;
}

/* ══════════════════════════════════════════════════
   OTHER PLATFORMS GRID
   ══════════════════════════════════════════════════ */
.platforms-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  width: 100%;
}

@media (min-width: 640px) {
  .platforms-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .platforms-grid {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    width: auto;
  }
}

@media (min-width: 1024px) {
  .platforms-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

.platform-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: transform 0.3s, box-shadow 0.3s;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "icon title"
    "desc desc"
    "pills pills";
  gap: 0.2rem 1rem;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

@media (max-width: 480px) {
  .platform-card {
    padding: 1rem;
  }
}

.platform-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px var(--shadow);
}

.platform-icon {
  grid-area: icon;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.platform-icon--snap {
  background: rgba(255, 252, 0, .15);
  color: #fffc00;
}

.platform-icon--tiktok {
  background: rgba(0, 242, 254, .15);
  color: #00f2fe;
}

.platform-icon--linkedin {
  background: rgba(10, 102, 194, .15);
  color: #0a66c2;
}

.platform-icon--x {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.platform-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.platform-name {
  grid-area: title;
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  align-self: center;
}

.platform-desc {
  grid-area: desc;
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.platform-pills {
  grid-area: pills;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: auto;
  width: 100%;
}

.pill {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--bg3);
  padding: .3rem .75rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  word-break: break-word;
}