/* Sky look of the product guides (VOT-589): guide.html and estimation-guide.html load this after their own
   inline styles, so it wins at equal specificity. Same palette, fonts, header and footer as the
   homepage: the colours come from sky-tokens.css (.lp-sky on <html>, VOT-586), none are written here. The guides have no dark theme (VOT-648). */

:root {
  /* Height of the sticky site header plus a gap: where the contents list and the step numbers stick. */
  --guide-sticky-top: 84px;
  /* A contents link or #anchor jump stops below the sticky header instead of under it (VOT-611). */
  scroll-padding-top: var(--guide-sticky-top);
  --font: var(--font-text);
  --font-title: var(--font-display);
}

/* Smooth scrolling only after the visitor's first input (guide-toc.js adds guide-ready) so the first #anchor jump is instant, and never under reduced motion (VOT-616). */
@media (prefers-reduced-motion: no-preference) {
  html.guide-ready { scroll-behavior: smooth; }
}

/* At 480 px and below the header wraps to two rows (95 px tall). */
@media (max-width: 480px) {
  :root { --guide-sticky-top: 113px; }
}

/* ---- Light (default) theme: the homepage's sky palette ---- */
:root[data-theme="light"] {
  --bg-app: var(--lp-bg);
  --bg-panel: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: var(--lp-bg-soft);
  --primary: var(--lp-primary);
  --primary-hover: var(--lp-primary-deep);
  --primary-glow: var(--lp-tint);
  --text-main: var(--lp-ink);
  --text-muted: var(--lp-ink-soft);
  --border: var(--lp-border);
  --border-light: var(--lp-border);
  --grad-from: var(--lp-ink);
  --page-grad: none;
  --shadow-sm: 0 2px 8px -2px rgba(var(--lp-shade-rgb), 0.14);
}
/* Sky fills carry ink text, as on the homepage. */
:root[data-theme="light"] .num { background: var(--lp-highlight); color: var(--lp-on-highlight); box-shadow: 0 4px 14px var(--lp-tint); }
:root[data-theme="light"] .btn.primary,
:root[data-theme="light"] .vtabs .vt.active,
:root[data-theme="light"] .pc.sel { background: var(--lp-highlight); color: var(--lp-on-highlight); }
:root[data-theme="light"] .call .dot { border-color: var(--lp-primary); }
/* The › between the phases of the board mock's stepper: the dark theme's faint white is invisible on the light bar (VOT-646). */
:root[data-theme="light"] .stepper .sep { color: var(--lp-muted); }
:root[data-theme="light"] .screen { box-shadow: 0 18px 50px -20px rgba(var(--lp-shade-rgb), 0.25); }

/* ---- Fonts: Instrument Serif headings with one italic sky word, Inter text ---- */
h1.title, h2 { font-family: var(--font-title); font-weight: 400; letter-spacing: -0.01em; }
h1.title { font-size: 3.2rem; line-height: 1.1; }
h1.title b { font-weight: 400; font-style: italic; }
h2 { font-size: 2.1rem; }
:root[data-theme="light"] h1.title b { color: var(--lp-sky-deep); }

/* Readable measure: about 70 characters per line. */
.lead, .stepbody p, .tips li, .call { max-width: 70ch; }

/* ---- Footer: the sky tokens (the header is sky in site-nav.css itself, VOT-617) ---- */
:root[data-theme="light"] .lp-footer {
  --footer-ink: var(--lp-ink);
  --footer-ink-soft: var(--lp-ink-soft);
  --footer-muted: var(--lp-muted);
  --footer-primary: var(--lp-primary);
  --footer-border: var(--lp-border);
  --footer-bg: var(--lp-bg);
  font-family: var(--font-text);
}

/* ---- Sticky table of contents beside the text (desktop) ---- */
/* Underline, not bold: a bolder current item is wider and re-wraps the list at 320 px (VOT-614). */
.toc a[aria-current="location"] { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }
/* Phones and tablets: every contents link is a 44 px tap target (VOT-662). */
@media (max-width: 1099.98px) {
  .toc a { min-height: var(--nav-phone-tap-target); align-items: center; }
}
@media (min-width: 1100px) {
  .wrap { max-width: 1180px; display: grid; grid-template-columns: 250px minmax(0, 860px); column-gap: 40px; justify-content: center; }
  .wrap > * { grid-column: 2; }
  .wrap > .pagehead { grid-column: 1 / -1; }
  .wrap > .toc {
    grid-column: 1; grid-row: 2 / span 99; /* the contents list stays sticky next to every section below the page head (the grid has no explicit rows to count from) */ align-self: start; margin: 54px 0 0;
    position: sticky; top: var(--guide-sticky-top); max-height: calc(100vh - var(--guide-sticky-top) - 20px); overflow-y: auto;
    padding: 16px 18px;
  }
  .toc ol { grid-template-columns: 1fr; gap: 2px; }
  .toc a { font-size: 0.88rem; }
}

/* ---- Scroll reveal and pinned step numbers: only where scroll-driven animations exist and motion is
   welcome. Otherwise everything shows in its final state at once (and without JavaScript). ---- */
@keyframes guide-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes guide-glide { from { opacity: 0; transform: translateY(36px) scale(0.985); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    section .secline, section h2, section .lead { animation: guide-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
    section .step, section .calls .call, section .tips li { animation: guide-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 30%; }
    section .screen { animation: guide-glide linear both; animation-timeline: view(); animation-range: entry 0% entry 25%; }
    /* The number of a step stays in view while the step is on screen. */
    .step .num { position: sticky; top: var(--guide-sticky-top); align-self: flex-start; }
  }
}
