/* ==========================================================================
   NODEWAVE REFINEMENT LAYER (round 2, 2026-11-12)
   Loaded LAST, after styles.css and polish.css. Fixes layout and type
   issues found in a desktop + phone review. Several rules need !important
   because styles.css pins its mobile overrides with !important.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DISPLAY TYPE — keep the tight Archivo look without words colliding
   -------------------------------------------------------------------------- */

.hero-title,
.hero-title em,
.section-intro h1,
.section-intro h1 em,
.section-intro h2,
.section-intro h2 em,
.closing-inner h2,
.closing-inner h2 em {
  letter-spacing: -0.038em;
  word-spacing: 0.06em;
}

/* seo.js promotes each tool's intro heading to <h1> on its own URL;
   mirror the <h2> styles from styles.css so it looks identical */
.section-intro h1 {
  font: 550 clamp(34px, 4vw, 52px) / 1.13 var(--nw-font);
  text-transform: none;
  text-wrap: balance;
  color: var(--ink-heading);
  margin-bottom: 14px;
  font-synthesis: none;
}

.section-intro h1 em {
  font-style: normal;
  font-weight: 550;
  color: #efad82;
}

.as-path-head h1 {
  font: 550 26px var(--nw-font);
  letter-spacing: -0.035em;
  color: var(--ink-heading);
}

/* polish.css glows the accent line; at display size it just reads as blur */
.hero-title em {
  text-shadow: none;
}

/* --------------------------------------------------------------------------
   2. HEADER — tablet widths: the full nav no longer fits beside the badge
   -------------------------------------------------------------------------- */

@media (min-width: 769px) and (max-width: 1080px) {
  .site-header {
    padding: 0 28px;
  }

  .brand-divider,
  .tool-badge {
    display: none;
  }

  .nav-feature-link {
    padding: 8px 11px;
  }
}

/* --------------------------------------------------------------------------
   3. SECTION RHYTHM — trim the dead air between stacked sections
   -------------------------------------------------------------------------- */

.isp-latency-section {
  padding-bottom: 64px;
}

.how-it-works-section {
  padding-top: 72px;
}

.as-path-section {
  margin-top: 56px;
  padding-bottom: 64px;
}

/* --------------------------------------------------------------------------
   4. TERMINALS — wrap at word boundaries, only split long tokens if needed
   -------------------------------------------------------------------------- */

.terminal-body,
.gp-row-terminal-output {
  word-break: normal;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   5. LATENCY MATRIX — the swipe hint is a phone affordance only
   -------------------------------------------------------------------------- */

.mobile-table-hint {
  display: none;
}

/* --------------------------------------------------------------------------
   6. PHONES & SMALL TABLETS
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .section-shell {
    width: calc(100% - 40px) !important;
  }

  .terminal-body,
  .gp-row-terminal-output {
    word-break: normal !important;
    overflow-wrap: anywhere !important;
  }

  .mobile-table-hint {
    display: block !important;
  }

  /* Eyebrow: keep the dot beside the first line instead of orphaned above */
  .eyebrow {
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    line-height: 1.6;
  }

  .eyebrow-dot {
    margin-top: 0.55em;
  }

  /* polish.css runway line floats beside wrapped eyebrows on phones */
  .eyebrow::after {
    display: none;
  }

  /* ISP map: status above the latency scale instead of squeezed beside it */
  .gp-map-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Probe cards: keep the expand chevron on the pills row */
  .gp-card-controls-bar {
    flex-direction: row !important;
    align-items: center !important;
  }

  .gp-pills-row {
    flex: 1;
    min-width: 0;
  }

  /* AS path: stack hops vertically rather than a clipped sideways scroller */
  .as-path-section {
    margin-top: 16px;
  }

  .topology-canvas-wrap {
    flex-direction: column;
    align-items: stretch;
    overflow-x: visible !important;
  }

  .topo-node {
    min-width: 0;
    text-align: center;
  }

  .topo-connector {
    justify-content: center;
  }

  .topo-connector-line {
    width: 2px;
    height: 18px;
  }

  .topo-connector-line::after {
    content: "▼";
    right: auto;
    left: -4px;
    top: auto;
    bottom: -9px;
  }

  /* Meta strip: the decorative rule just pushes the LED onto its own row */
  .hero-note .note-line {
    display: none;
  }

  /* Proof strip: aligned 2x2 grid instead of an indented single column */
  .proof-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0 20px !important;
    padding: 8px 20px !important;
  }

  .proof-strip div {
    padding: 16px 0 !important;
  }

  .isp-latency-section {
    padding-bottom: 48px !important;
  }

  .how-it-works-section {
    padding-top: 48px !important;
  }
}

@media (max-width: 480px) {
  .section-shell {
    width: calc(100% - 32px) !important;
  }

  .site-header {
    padding: 0 16px !important;
  }

  .proof-strip {
    padding: 8px 16px !important;
  }
}

/* --------------------------------------------------------------------------
   7. FAQ BLOCKS — crawlable Q&A under each tool
   -------------------------------------------------------------------------- */

.faq-section {
  padding: 8px 0 88px;
}

.faq-list {
  display: grid;
  gap: 10px;
  max-width: 880px;
}

.faq-item {
  background: linear-gradient(145deg, #171f28, #131920);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.2s ease;
}

.faq-item[open] {
  border-color: rgba(239, 173, 130, 0.28);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  font: 550 15.5px / 1.45 var(--nw-font);
  letter-spacing: -0.01em;
  color: var(--ink-heading);
  transition: color 0.2s ease;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  font: 400 20px / 1 var(--font-mono);
  color: var(--peach);
  transition: transform 0.25s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item summary:hover {
  color: #fff;
}

.faq-item p {
  padding: 0 22px 20px;
  max-width: 760px;
  font: 400 14.5px / 1.75 var(--nw-font);
  color: var(--muted);
}

.faq-item code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: #efad82;
  background: rgba(239, 173, 130, 0.08);
  padding: 1px 6px;
  border-radius: 5px;
}

@media (max-width: 768px) {
  .section-intro h1 {
    font-size: clamp(22px, 6vw, 32px) !important;
    line-height: 1.2 !important;
    margin-bottom: 10px !important;
  }

  .faq-section {
    padding: 0 0 56px;
  }

  .faq-item summary {
    padding: 16px;
    font-size: 14.5px;
  }

  .faq-item p {
    padding: 0 16px 16px;
    font-size: 13.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-item,
  .faq-item summary,
  .faq-item summary::after {
    transition: none;
  }
}
