/* Reading and connection-guide refinements, shared by every page. */
:root { --guide-measure: 68ch; }
main { overflow-wrap: break-word; }
main p, main dd { font-size: 1.125rem !important; line-height: 1.65 !important; }
main li { font-size: 1.0625rem !important; line-height: 1.65; }
main h1 { overflow-wrap:normal; word-break:normal; hyphens:none; letter-spacing: -.055em !important; line-height: 1.01 !important; }
main h2 { letter-spacing: -.04em !important; line-height: 1.08 !important; }
main h3 { letter-spacing: -.025em !important; line-height: 1.18 !important; }
main h1 em, main h2 em, main h2 span { line-height: 1.08; }
.hero-copy { font-size: 1.12rem !important; line-height: 1.65 !important; }
.section-label, .eyebrow { font-size: .72rem; letter-spacing: .12em; }
.intro-copy, .guide-prose { max-width: var(--guide-measure); }
.guide-prose p { max-width: var(--guide-measure); }
main p a, main dd a, .guide-prose a { text-underline-offset: .18em; text-decoration-thickness: 1px; }
.format-detail dt { font-size: .74rem; line-height: 1.4; }
.format-detail dd { min-width: 0; }
.format-card .format-next, .guide-next { margin-top: auto; padding-top: 18px; font-weight: 700; }
.format-card-top { flex-wrap: wrap; }
.format-card.reel .format-image { max-height: 720px; }
.credit-list li, .credit-list a { overflow-wrap: anywhere; }
.table-scroll { max-width: 100%; margin-right: 0 !important; padding-right: 0 !important; }

/* Keep the desktop links on one row and the mobile menu scrollable. */
.header-inner { gap: 16px; }
.header-inner > .primary-nav { gap: clamp(8px, .85vw, 13px); flex-wrap: nowrap; }
.header-inner > .primary-nav a { white-space: nowrap; font-size: .68rem; letter-spacing: .035em; }
.header-inner .brand-logo { width: 185px; height: auto; }
.header-social a { min-width: 28px; min-height: 28px; }
.primary-nav a[aria-current="page"] { color: var(--acid); text-decoration: underline; text-underline-offset: 6px; }
@media (min-width: 1101px) and (max-width: 1280px) {
  .header-inner { width: calc(100% - 32px); gap: 10px; }
  .header-inner .brand-logo { width: 150px; }
  .header-inner > .primary-nav { gap: 7px; }
  .header-inner > .primary-nav a { font-size: .62rem; letter-spacing: .015em; }
  .header-inner > .header-social { gap: 4px; }
  .header-social a { min-width: 24px; min-height: 24px; }
}
@media (max-width: 1100px) {
  .header-inner { min-height: 72px; }
  .header-inner > .primary-nav, .header-inner > .header-social { display: none; }
  .header-inner > .mobile-nav { display: block; margin-left: auto; }
  .mobile-nav summary { min-height: 42px; display: flex; align-items: center; padding: 9px 14px; font-size: .76rem; }
  .mobile-nav[open] .mobile-links { width: min(330px, calc(100vw - 32px)); max-height: calc(100svh - 94px); overflow-y: auto; padding: 12px; }
  .mobile-links > a { min-height: 43px; display: flex; align-items: center; font-size: .8rem; letter-spacing: .035em; }
  .mobile-links a[aria-current="page"] { color: var(--acid); background: rgba(255,255,255,.07); }
  .mobile-links .mobile-social a { min-height: 42px; font-size: .62rem; }
}

/* Short routes into the longer guides keep the information easy to scan. */
.guide-page-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 22px; padding-block: 22px; border-bottom: 1px solid var(--line); }
.guide-page-nav > span { color: var(--blue); font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.guide-page-nav a { padding-block: 6px; font-size: .9rem; font-weight: 700; text-decoration: none; }
.guide-page-nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
.guide-paths { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 30px 0; }
.guide-paths > a { padding: 18px; border: 1px solid var(--line); text-decoration: none; background: rgba(255,255,255,.35); }
.guide-paths > a:hover { background: var(--paper-deep); }
.guide-paths span { display: block; font-size: .8rem; line-height: 1.5; color: var(--blue); }
.guide-paths strong { display: block; margin-top: 5px; font-size: .98rem; line-height: 1.4; }
.guide-paths strong span { display: inline; color: inherit; }
.guide-format-nav { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 28px; }
.guide-format-nav a { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 15px; border: 1px solid var(--line); font-size: .9rem; font-weight: 700; text-decoration: none; }
.guide-format-nav a:hover { color: var(--paper); background: var(--ink); }

/* Diagrams keep the palette but preserve connector colours and clear labels. */
.guide-explainer { padding-block: clamp(48px, 6vw, 80px); }
.guide-explainer h2 { max-width: 22ch; }
.guide-diagram { min-width: 0; margin: 28px 0; padding: clamp(8px, 2vw, 22px); border: 1px solid var(--line); background: #f8f5ed; }
.guide-diagram picture { display: block; width: 100%; }
.guide-diagram img, .guide-diagram svg { display: block; width: 100% !important; height: auto !important; max-height: none !important; object-fit: contain !important; filter: none !important; }
.guide-diagram figcaption { padding: 14px 7px 4px; max-width: 85ch; color: var(--ink-soft); font-size: .88rem; line-height: 1.6; }
.guide-flow { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 15px; margin: 24px 0; padding: 0; list-style: none; }
.guide-flow-step { position: relative; min-width: 0; padding: 23px; border: 1px solid var(--line); background: var(--paper); }
.guide-flow-step h3 { font-size: 1.15rem; }
.guide-flow-step p:last-child { margin-bottom: 0; }
.guide-flow-port { display: inline-block; margin: 8px 0; padding: 5px 9px; background: var(--paper-deep); color: var(--ink); font: 700 .8rem/1.5 ui-monospace,Consolas,monospace; letter-spacing: .015em; }
.guide-note { margin: 24px 0; padding: 21px 24px; border-left: 4px solid var(--orange); background: rgba(255,255,255,.48); }
.guide-note p:last-child { margin-bottom: 0; }
.guide-checklist { margin: 22px 0; padding-left: 25px; }
.guide-checklist li { margin: 0 0 18px; padding-left: 5px; }
.guide-checklist strong { color: inherit; }
.guide-table-wrap { width: 100%; max-width: 100%; margin-block: 25px; overflow-x: auto; border: 1px solid var(--line); }
.guide-table { width: 100%; min-width: 560px; border-collapse: collapse; text-align: left; font-size: .94rem; }
.guide-table th, .guide-table td { padding: 15px; border-bottom: 1px solid var(--line); vertical-align: top; }
.guide-table th { background: var(--paper-deep); font-size: .8rem; letter-spacing: .03em; }
.guide-table tr:last-child td { border-bottom: 0; }
.guide-table caption { padding: 16px; text-align: left; font-weight: 700; }
.term { scroll-margin-top: 180px; }
.term[hidden], .glossary-category[hidden] { display: none !important; }
.skip-link { position: fixed; left: 16px; top: -90px; z-index: 999; padding: 12px 18px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); font-weight: 700; }
.skip-link:focus { top: 12px; }
@media (max-width: 760px) {
  main h1 { font-size: clamp(2.6rem, 12vw, 4.8rem) !important; letter-spacing: -.04em !important; line-height: 1.04 !important; }
  main h2, .intro-grid h2, .stream-title h2 { font-size: clamp(2rem, 8.4vw, 3.1rem) !important; letter-spacing: -.035em !important; line-height: 1.1 !important; }
  main h3 { line-height: 1.2 !important; }
  main p, main dd { font-size: 1.0625rem !important; line-height: 1.65 !important; }
  .hero-inner { min-height: 0; gap: 28px; }
  .hero-copy { font-size: 1.04rem !important; }
  .guide-page-nav { gap: 4px 16px; padding-block: 16px; }
  .guide-page-nav > span { flex-basis: 100%; }
  .guide-page-nav a { min-height: 38px; display: inline-flex; align-items: center; font-size: .85rem; }
  .guide-paths { grid-template-columns: minmax(0,1fr); }
  .guide-flow { grid-template-columns: minmax(0,1fr); }
  .guide-diagram { padding: 6px; }
  .guide-diagram figcaption { font-size: .85rem; }
  .guide-checklist { padding-left: 22px; }
  .search-panel { position: relative; top: auto; }
  .term { scroll-margin-top: 95px; }
  .format-details .format-detail { grid-template-columns: minmax(0,1fr); gap: 5px; }
  .format-card.reel .format-image { max-height: 560px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Captions explain the photograph to the reader; alt text describes it separately. */
main figure figcaption {
  font-size: .875rem !important;
  line-height: 1.55 !important;
  font-weight: 400 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}
main figure figcaption strong { font-size: inherit; letter-spacing: inherit; }

/* Keep small labels and reading text legible on the site's light and dark panels. */
main .section-label, main .eyebrow { color:#43564a !important; }
main :is(.type-section,.stream-section,.recording-promo,.md-copy,.buy-feature-copy,.how-section,.chain-section,.amplifier-example,.vintage-section,.test-playlists-section,.jack-section,.speaker-section,.personal-panel,.battery-example,.changer-section,.headunit-example-section,.closing-panel,.personal-system-copy,.vhs-note) .section-label,
main .connector-card:nth-child(2) .section-label,
main .build-card:nth-child(3) .section-label { color:var(--paper) !important; }
main :is(.recording-method,.headunit-copy,.guide-flow-step) .section-label { color:#43564a !important; }
main .guide-flow-step, main .guide-flow-step :is(h3,p) { color:var(--ink) !important; }
main .guide-note { background:var(--paper); color:var(--ink) !important; }
/* Paragraph colours from dark sections must not override the light note panel. */
main .guide-note :is(p,li,dd,h2,h3,h4,strong,em,a) { color:var(--ink) !important; }
main :is(.chain-item,.chain-step) small,
main .pathway-flow { color:var(--paper) !important; }
main :is(p,li,dd,figcaption) a:not(.button),
main .resource-note a { color:inherit !important; }
main .resource-card a, main .playlist-link, main .video-reference-links a,
main .portable-system-note > a, main .legal-links a,
main .choice-card:not(.choice-card--featured) .choice-link { color:#43564a !important; }
main .format-card.md .format-tag { color:#171b16; }
main .vintage-callout p { color:var(--ink); }
main .how-section .mix-photo { color:var(--paper); }
main .artwork-copy .section-label, main .video-guide-return .section-label { color:var(--paper) !important; }
main .spotify-note a { color:inherit !important; }
main .speaker-quote p { color:var(--ink); }

/* Size long hero words from the column they actually occupy. */
.hero-inner > div:has(> h1) { min-width:0; container-type:inline-size; }
body[data-page="about"] .hero #page-title { font-size:clamp(1.5rem,11.1cqi,6.2rem) !important; }
body[data-page="about"] .hero-title-line { display:block; white-space:nowrap; }
body[data-page="about"] .hero h1 em { display:block; }
body[data-page="car-audio"] .hero #page-title { font-size:clamp(2rem,15cqi,6.5rem) !important; }
.hero h1 .title-word { white-space:nowrap; }

/* Links from the short FAQs to the complete overview. */
.faq-more { margin:18px 0 0; }
.faq-more a { font-weight:750; text-underline-offset:.18em; }
