/* Tetracom in-app help — shared stylesheet
 *
 * Brand palette (matches the tetracom.me landing page exactly):
 *   --brand-blue   #0057B7   primary action, headers, links
 *   --brand-dark   #003E82   hover, darker text, hero gradient end
 *   --brand-accent #FFD700   gold: pills, key callouts, CTA accents
 *   --text         #1a1a1a   primary text
 *   --muted        #555      secondary text
 *   --bg           #ffffff   page background
 *   --bg-muted     #f4f6fa   card fills, section bg
 *   --border       #dde1ea   soft borders
 *
 * Typography is the system stack so the help page renders instantly
 * and feels native — no web-fonts to download.  Fluid clamp() sizing
 * and a gradient hero mirror the marketing landing page so a visitor
 * clicking from tetracom.me into /help/ feels zero style discontinuity.
 */

:root {
  --brand-blue: #0057B7;
  --brand-dark: #003E82;
  --brand-accent: #FFD700;
  --text: #1a1a1a;
  --muted: #555;
  --bg: #ffffff;
  --bg-muted: #f4f6fa;
  --border: #dde1ea;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               system-ui, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ *
 *  HERO  —  gradient banner matching the landing page header.        *
 *  Full-bleed; sits OUTSIDE the .tetracom-help readable column so    *
 *  the page chrome feels as wide as the marketing site.              *
 * ------------------------------------------------------------------ */
.hero {
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}
.hero .logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin: 0 0 .5rem;
}
.hero .logo-lockup img {
  /* The logo SVG is brand-blue — same as the gradient — so it would
     vanish against the hero.  Sit it on a white disk so the mark
     stays brand-coloured AND visible. */
  width: 56px; height: 56px;
  background: #fff;
  border-radius: 50%;
  padding: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.hero h1 {
  margin: 0 0 .5rem;
  font-size: clamp(2rem, 6vw, 3.5rem);
  letter-spacing: -.02em;
  line-height: 1.1;
  font-weight: 700;
}
.hero .logo-lockup h1 { margin: 0; }
.hero p.tagline {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  margin: 0 auto;
  max-width: 40rem;
  opacity: .95;
}
/* Gold version/"new" pill, used in the hero next to the wordmark. */
.hero .version-pill,
.ver-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--brand-accent);
  color: #1a1a1a;
  font-size: .75em;
  font-weight: 700;
  letter-spacing: .03em;
  vertical-align: middle;
  font-family: ui-monospace, "Menlo", "Consolas", monospace;
}
.hero .version-pill { margin-left: .4rem; font-size: .45em; }

/* ------------------------------------------------------------------ *
 *  READABLE COLUMN  —  the help body sits in a narrower, comfortable *
 *  measure inside the full-width shell.                              *
 * ------------------------------------------------------------------ */
.tetracom-help {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* Legacy plain header (header.brand) is still supported for any page
   not yet migrated to the hero, refreshed to the brand vars. */
header.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
header.brand img { width: 40px; height: 40px; }
header.brand h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0;
  font-weight: 700;
  color: var(--brand-blue);
}
header.brand .subtitle { color: var(--muted); font-size: 0.9em; }

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-top: 2.4rem; margin-bottom: .5rem;
  color: var(--brand-blue);
  letter-spacing: -.01em;
}
h3 {
  font-size: clamp(1.15rem, 2.5vw, 1.3rem);
  margin-top: 1.6rem; margin-bottom: .3rem;
  color: var(--brand-dark);
}
h4 { font-size: 1em; margin-top: 1rem; margin-bottom: .25rem; color: var(--muted); }

p { margin: .5rem 0 .9rem; }

/* ------------------------------------------------------------------ *
 *  CARDS  —  base .card uses the muted surface; .card.premium (and   *
 *  the grid cards) get the white, lifting, hover-shadow treatment    *
 *  from the landing page's .shot grid.                               *
 * ------------------------------------------------------------------ */
.card {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0;
}
.card h3 { margin-top: 0; }

.card.premium,
.detected {
  /* premium = white card that lifts on hover (matches .shot) */
}
.card.premium {
  background: #fff;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card.premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

/* Detected-phone banner on the help index — gradient like the hero. */
.detected {
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-dark) 100%);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 1.4rem 1.5rem;
  margin: 1.5rem 0;
}
.detected h2 { color: #fff; margin: 0 0 .5rem; font-size: 1.15em; }
.detected .device-meta {
  font-family: ui-monospace, "Menlo", "Consolas", monospace;
  background: rgba(255,255,255,0.18);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  font-size: 0.85em;
}
.detected a.cta {
  display: inline-block;
  margin-top: 12px;
  background: var(--brand-accent);
  color: #1a1a1a;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 700;
}
.detected a.cta:hover { text-decoration: none; filter: brightness(.96); }

/* ------------------------------------------------------------------ *
 *  BUTTONS / CTAs  —  match the landing page .install-btn:            *
 *  rounded-rect (6px), 2px border, solid-blue primary.               *
 * ------------------------------------------------------------------ */
.cta {
  display: inline-block;
  background: var(--brand-blue);
  color: #fff;
  padding: .7rem 1.2rem;
  border: 2px solid var(--brand-blue);
  border-radius: 6px;
  font-weight: 600;
  margin: 8px 8px 8px 0;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.cta:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; text-decoration: none; }
.cta.gold {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #1a1a1a;
}
.cta.gold:hover { background: var(--brand-accent); border-color: var(--brand-accent); filter: brightness(.96); color: #1a1a1a; }
.cta.outline {
  background: transparent;
  color: var(--brand-blue);
}
.cta.outline:hover { background: var(--brand-blue); color: #fff; }

/* Page footer link-row buttons (lighter, secondary). */
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.2rem 0; }

/* ------------------------------------------------------------------ *
 *  DOWNLOAD BAR  —  gold-tinted call-to-download strip.              *
 * ------------------------------------------------------------------ */
.download-bar {
  background: #fff8dc;
  border: 1px solid #e0d080;
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin: 1.5rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.download-bar .label { flex: 1 1 240px; font-weight: 600; }
.download-bar .version {
  font-family: ui-monospace, "Menlo", "Consolas", monospace;
  color: var(--muted);
  font-size: 0.9em;
  font-weight: 400;
  display: block;
  margin-top: 2px;
}

/* ------------------------------------------------------------------ *
 *  PREMIUM GRID CARDS  —  manufacturer / topic / model tiles.        *
 *  White, rounded-12, lift + shadow on hover (landing .shot feel).   *
 * ------------------------------------------------------------------ */
.manufacturer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.2rem 0;
}
.mfr-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.mfr-card:hover {
  border-color: var(--brand-blue);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  text-decoration: none;
}
.mfr-card .mfr-name {
  display: block;
  font-weight: 700;
  font-size: 1em;
  color: var(--brand-dark);
}
.mfr-card .mfr-note {
  display: block;
  font-size: 0.8em;
  color: var(--muted);
  margin-top: 4px;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .8rem;
  margin: .8rem 0 1.6rem;
}
.model-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .9rem 1rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.95em;
  font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.model-card:hover {
  border-color: var(--brand-blue);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  text-decoration: none;
}
.model-card .model-note {
  font-size: 0.78em;
  color: var(--muted);
  display: block;
  margin-top: 2px;
  font-weight: 400;
}

/* ------------------------------------------------------------------ *
 *  NUMBERED STEPS  —  blue circular counters.                        *
 * ------------------------------------------------------------------ */
.steps {
  counter-reset: step;
  margin: 1rem 0 1.2rem;
  padding: 0;
}
.steps > li {
  list-style: none;
  counter-increment: step;
  position: relative;
  padding: 4px 0 4px 38px;
  margin-bottom: 10px;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 2px;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.85em;
}

/* Feature lists with gold/blue checkmark bullets (landing feel). */
.feature-list { list-style: none; padding: 0; margin: .5rem 0; }
.feature-list li { padding: .35rem 0; padding-left: 1.7rem; position: relative; }
.feature-list li::before {
  content: "\2713";
  color: var(--brand-blue);
  font-weight: 700;
  position: absolute;
  left: 0;
}

/* ------------------------------------------------------------------ *
 *  INLINE CODE / PATHS                                               *
 * ------------------------------------------------------------------ */
.path,
code, kbd {
  font-family: ui-monospace, "Menlo", "Consolas", monospace;
  background: rgba(0,0,0,.05);
  padding: .1rem .4rem;
  border-radius: 4px;
  font-size: 0.93em;
}
pre {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  padding: .8rem 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9em;
}
pre code { background: transparent; padding: 0; }

/* ------------------------------------------------------------------ *
 *  CALLOUTS  —  warn (gold), note (blue), danger (red).             *
 * ------------------------------------------------------------------ */
.warn {
  background: #fff8dc;
  border-left: 4px solid var(--brand-accent);
  padding: .7rem 1rem;
  margin: 1rem 0;
  border-radius: 6px;
}
.note {
  background: #eef4fc;
  border-left: 4px solid #4d8ee0;
  padding: .7rem 1rem;
  margin: 1rem 0;
  border-radius: 6px;
  font-size: 0.96em;
}
.danger {
  background: #ffeaea;
  border-left: 4px solid #c00;
  padding: .7rem 1rem;
  margin: 1rem 0;
  border-radius: 6px;
}

/* A page-section block on a muted surface (used to group content). */
.section-card {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1.6rem;
  margin: 1.4rem 0;
}
.section-card > h2:first-child,
.section-card > h3:first-child { margin-top: 0; }

/* Pill-style in-page table of contents. */
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.2rem 0 1.8rem;
  padding: 0;
  list-style: none;
}
.toc a {
  display: inline-block;
  padding: .35rem .85rem;
  border-radius: 999px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--brand-dark);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.toc a:hover {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
  text-decoration: none;
}

/* ------------------------------------------------------------------ *
 *  FAQ                                                               *
 * ------------------------------------------------------------------ */
.faq dt {
  font-weight: 700;
  margin-top: 1rem;
  color: var(--brand-dark);
}
.faq dd { margin: .3rem 0 .6rem 0; }

/* Back-link with a leading arrow. */
.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.95em;
  font-weight: 600;
}
.back-link::before { content: "\2190 "; }

/* ------------------------------------------------------------------ *
 *  FOOTER  —  matches the landing page footer.                      *
 * ------------------------------------------------------------------ */
footer.help-footer {
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 2rem 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}
footer.help-footer a { color: var(--muted); }
footer.help-footer p { margin: .3rem 0; }
