/* ═══════════════════════════════════════════════════════════════
   PeakPulse Feature Pages — extends ../style.css base tokens
   Layouts for nav bar, tagline hero, mechanism, details, FAQ,
   related links, and embed-mode (in-app WebView) hiding.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Embed mode: hide marketing chrome when loaded in iOS WebView ─ */
/* Toggled by ?embed=1 query flag via inline script in <head>. */
html.embed .site-nav,
html.embed .site-footer,
html.embed .embed-hide {
  display: none !important;
}

html.embed body {
  padding-top: 0;
}

html.embed .feature-hero {
  padding-top: 48px;
}

/* ─── Site nav (subpages only — home page has no global nav) ──── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(6, 5, 4, 0.85);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-nav-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.site-nav-brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.site-nav-brand .text-teal { color: var(--teal); }
.site-nav-brand .text-orange { color: var(--orange); }

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.15s var(--ease-out);
}

.site-nav-links a:hover,
.site-nav-links a:focus-visible {
  color: var(--text);
}

.site-nav-links a.current {
  color: var(--orange);
}

@media (max-width: 600px) {
  .site-nav-inner { padding: 12px 20px; }
  .site-nav-links { gap: 16px; }
  .site-nav-links a { font-size: 0.85rem; }
}

/* ─── Feature hero ────────────────────────────────────────── */
.feature-hero {
  padding: 96px 0 64px;
  position: relative;
}

.feature-hero-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.feature-hero-eyebrow a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s var(--ease-out);
}

.feature-hero-eyebrow a:hover { color: var(--orange); }

.feature-hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}

.feature-hero-title .text-orange { color: var(--orange); }
.feature-hero-title .text-teal { color: var(--teal); }

.feature-hero-sub {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-muted);
  max-width: 60ch;
  line-height: 1.5;
}

.feature-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.feature-hero-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feature-hero-stat .label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.feature-hero-stat .value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text);
}

.feature-hero-stat .value.text-orange { color: var(--orange); }
.feature-hero-stat .value.text-teal { color: var(--teal); }

/* ─── Section primitives ──────────────────────────────────── */
.feature-section {
  padding: 64px 0;
  position: relative;
}

.feature-section + .feature-section {
  border-top: 1px solid var(--border);
}

.feature-section h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.feature-section h2 .text-orange { color: var(--orange); }
.feature-section h2 .text-teal { color: var(--teal); }

.feature-section .lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 65ch;
  margin-bottom: 32px;
  line-height: 1.55;
}

.feature-section p {
  max-width: 65ch;
  margin-bottom: 16px;
  color: var(--text);
}

.feature-section p + p { margin-top: 0; }

/* Inline emphasis */
.feature-section strong {
  color: var(--text);
  font-weight: 700;
}

/* ─── Mechanism: numbered steps ───────────────────────────── */
.mechanism {
  display: grid;
  gap: 32px;
  margin-top: 32px;
}

@media (min-width: 720px) {
  .mechanism.mechanism-cols {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 40px;
  }
}

.mechanism-step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.mechanism-num {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--orange);
  line-height: 1;
  padding-top: 4px;
  width: 32px;
}

.mechanism-num.text-teal { color: var(--teal); }

.mechanism-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.mechanism-body p {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.55;
  margin: 0;
  max-width: none;
}

/* ─── Detail bullet grid ──────────────────────────────────── */
.detail-grid {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

@media (min-width: 720px) {
  .detail-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px 32px;
  }
}

.detail-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.detail-item-marker {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  margin-top: 8px;
}

.detail-item.teal .detail-item-marker { background: var(--teal); }

.detail-item-body strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 4px;
  color: var(--text);
}

.detail-item-body span {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ─── Data callout (monospace stat card) ──────────────────── */
.data-callout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  margin: 32px 0;
}

@media (min-width: 600px) {
  .data-callout { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}

.data-callout-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
}

.data-callout-field .label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.data-callout-field .value {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
}

.data-callout-field .value.text-orange { color: var(--orange); }
.data-callout-field .value.text-teal { color: var(--teal); }
.data-callout-field .value.text-red { color: var(--red); }

.data-callout-field .value small {
  font-size: 0.7em;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 2px;
}

/* ─── Pull-quote / emphasis block ─────────────────────────── */
.pull-quote {
  margin: 36px 0;
  padding: 28px 32px;
  border-left: 3px solid var(--orange);
  background: var(--bg-elevated);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.pull-quote.teal { border-left-color: var(--teal); }

.pull-quote p {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.4;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0;
  max-width: none;
}

/* ─── FAQ accordion ───────────────────────────────────────── */
.faq {
  margin-top: 24px;
  border-top: 1px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  cursor: pointer;
  padding: 20px 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: color 0.15s var(--ease-out);
}

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

.faq-item summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--orange);
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-out);
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item summary:hover { color: var(--orange); }

.faq-item-body {
  padding: 0 0 22px;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.faq-item-body p {
  margin-bottom: 12px;
  max-width: none;
  color: var(--text-muted);
}

.faq-item-body p:last-child { margin-bottom: 0; }

/* ─── Related features ────────────────────────────────────── */
.related-features {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.related-grid {
  display: grid;
  gap: 16px;
  margin-top: 28px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.related-card {
  display: block;
  padding: 22px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.related-card:hover,
.related-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--orange);
  outline: none;
}

.related-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.related-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  max-width: none;
}

.related-card .arrow {
  display: inline-block;
  margin-left: 4px;
  color: var(--orange);
  transition: transform 0.2s var(--ease-out);
}

.related-card:hover .arrow { transform: translateX(3px); }

/* ─── Footer CTA (subpages) ───────────────────────────────── */
.feature-cta {
  padding: 96px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.feature-cta h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.feature-cta p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 auto 28px;
  max-width: 48ch;
}

/* ─── Site footer ─────────────────────────────────────────── */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  text-align: center;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 12px;
}

.site-footer a:hover { color: var(--orange); }

/* ─── Features hub (index of features) ────────────────────── */
.hub-category {
  margin-top: 56px;
}

.hub-category-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.hub-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.hub-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 26px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s var(--ease-out), border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
  position: relative;
}

.hub-card:hover,
.hub-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--orange);
  background: var(--bg-surface);
  outline: none;
}

.hub-card-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.hub-card-eyebrow.teal { color: var(--teal); }
.hub-card-eyebrow.orange { color: var(--orange); }

.hub-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.hub-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.hub-card-arrow {
  font-family: var(--font-mono);
  color: var(--orange);
  margin-top: 4px;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  transition: transform 0.2s var(--ease-out);
}

.hub-card:hover .hub-card-arrow {
  transform: translateX(4px);
}

/* ─── Inline links in body copy ───────────────────────────── */
.feature-section a:not(.btn-primary):not(.related-card):not(.hub-card),
.feature-cta a:not(.btn-primary) {
  color: var(--orange);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 145, 0, 0.25);
  transition: border-color 0.15s var(--ease-out);
}

.feature-section a:not(.btn-primary):not(.related-card):not(.hub-card):hover {
  border-bottom-color: var(--orange);
}

/* ─── Mobile tweaks ───────────────────────────────────────── */
@media (max-width: 600px) {
  .feature-hero { padding: 72px 0 48px; }
  .feature-section { padding: 48px 0; }
  .related-features, .feature-cta { padding: 56px 0; }
  .data-callout { padding: 22px; }
  .pull-quote { padding: 22px 24px; }
}
