/* Locker Mate support site. Palette lifted from the app's DesignSystem.swift
   (LM.*) so the pages and the app are recognisably the same product. The app
   is light-first with a derived dark variant; so is this. */
:root {
  --ground: #ffffff;
  --ground-2: #f1f6fe;
  --surface: #ffffff;
  --line: #dce7f8;
  --line-strong: #b9cdec;
  --text: #0e1b33;
  --dim: #42597e;
  /* LM.ink3. Kept for parity with the app, but not used for text here: on
     these backgrounds it is 3.6-3.9:1, under the 4.5:1 WCAG AA needs. */
  --faint: #6b82a8;
  --accent: #116ad5;
  --accent-2: #3d9bf5;
  /* LM.accentText — the app's accent restated at text contrast. */
  --accent-text: #0b4fa8;
  --tint: #e8f1fe;
  --shadow: rgba(14, 58, 122, 0.10);
  --shadow-lift: rgba(14, 58, 122, 0.16);

  /* Motion. Built-in CSS easings are too weak for UI; these are the
     standard strong curves. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-hover: 160ms;
  --dur-accordion: 240ms;
  --dur-reveal: 420ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0a1120;
    --ground-2: #111b2e;
    --surface: #131c2e;
    --line: #213048;
    --line-strong: #33486b;
    --text: #edf3ff;
    --dim: #afc4e4;
    --faint: #8398ba;
    --accent: #4a9bf0;
    --accent-2: #8fc4ff;
    --accent-text: #8fc4ff;
    --tint: #1b2942;
    --shadow: rgba(0, 0, 0, 0.35);
    --shadow-lift: rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  padding: 0 24px 96px;
  background: linear-gradient(180deg, var(--ground) 0%, var(--ground-2) 100%);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 680px; margin: 0 auto; }

/* ---------- Reading progress -------------------------------------------
   Scroll-driven where the engine has scroll timelines — Chrome and Safari
   both do — so it runs off the main thread with no scroll listener at all.
   Firefox has none yet; there site.js drives the identical transform from a
   passive, rAF-throttled listener instead.

   The animation is declared inside @supports on purpose. Left unguarded, an
   engine without scroll timelines ignores `animation-timeline`, falls back to
   the document timeline at the default 0s duration, and `both` fill paints a
   permanently full bar. Guarded, it simply stays at scaleX(0) and paints
   nothing until JS takes over. */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 20;
}
@supports (animation-timeline: scroll(root block)) {
  .progress {
    animation: progress-grow linear both;
    animation-timeline: scroll(root block);
  }
}
@keyframes progress-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* ---------- Header ------------------------------------------------------ */
header { text-align: center; padding: 72px 0 8px; }
header img {
  width: 108px; height: 108px; border-radius: 26px;
  box-shadow: 0 8px 26px var(--shadow);
}

h1 {
  font-size: 30px; font-weight: 600; letter-spacing: -0.4px;
  margin: 22px 0 6px;
}
.tagline { color: var(--dim); margin: 0 0 8px; }

h2 {
  font-size: 19px; font-weight: 600; margin: 44px 0 12px;
  padding-top: 26px; border-top: 1px solid var(--line);
  scroll-margin-top: 84px;
}
h3 { font-size: 16px; font-weight: 600; margin: 26px 0 6px; color: var(--text); }

p, li { color: var(--dim); }
p { margin: 0 0 14px; }
ul { padding-left: 22px; margin: 0 0 14px; }
li { margin-bottom: 7px; }
strong { color: var(--text); font-weight: 600; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: border-bottom-color var(--dur-hover) ease,
              color var(--dur-hover) ease;
}
/* Hover deepens the link in light mode and lifts it in dark, rather than
   washing it out: --accent-2 is a fill tint and only reaches 2.9:1 on white. */
@media (hover: hover) and (pointer: fine) {
  a:hover { border-bottom-color: var(--accent); color: var(--accent-text); }
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 22px;
  margin: 0 0 14px;
  box-shadow: 0 2px 10px var(--shadow);
}
.card p:last-child { margin-bottom: 0; }

.nav { text-align: center; margin: 18px 0 0; font-size: 15px; }
.nav a { margin: 0 10px; }

footer {
  margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line);
  color: var(--dim); font-size: 14px; text-align: center;
}

code {
  background: rgba(17, 106, 213, .09); padding: 2px 6px;
  border-radius: 5px; font-size: 14px; color: var(--accent);
}

/* ---------- FAQ accordion ----------------------------------------------
   Native <details>, so it opens and closes with no JS at all; the
   transition is progressive enhancement on top. */
.faq {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 0 0 10px;
  box-shadow: 0 2px 10px var(--shadow);
  transition: box-shadow var(--dur-hover) ease,
              border-color var(--dur-hover) ease;
}
@media (hover: hover) and (pointer: fine) {
  .faq:hover { border-color: var(--line-strong); }
}
.faq[open] { box-shadow: 0 6px 20px var(--shadow-lift); }

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 52px 16px 22px;
  position: relative;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  border-radius: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Chevron, drawn in CSS so there's no asset to load. */
.faq summary::after {
  content: "";
  position: absolute;
  right: 22px; top: 50%;
  width: 9px; height: 9px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-70%) rotate(45deg);
  transform-origin: center;
  transition: transform var(--dur-accordion) var(--ease-out);
}
.faq[open] summary::after { transform: translateY(-25%) rotate(225deg); }

/* The panel is a one-row grid animated 0fr -> 1fr. That interpolates in
   Chrome, Safari and Firefox alike. The obvious alternative — transitioning
   ::details-content's block-size to `auto` — additionally needs
   `interpolate-size: allow-keywords`, which Safari and Firefox do not
   support, so there the accordion silently snapped open with no transition.

   The row is minmax(0, Nfr) rather than a bare Nfr on purpose. A bare `0fr`
   means minmax(auto, 0fr), and that auto floor is the item's own padding —
   measured at 18px in both Chrome and Safari, so every closed question kept a
   visible strip. An explicit 0 minimum removes the floor; .faq-panel then
   clips the padding that overflows it. */
.faq-panel {
  display: grid;
  grid-template-rows: minmax(0, 0fr);
  overflow: hidden;
  transition: grid-template-rows var(--dur-accordion) var(--ease-out);
}
.faq[open] > .faq-panel { grid-template-rows: minmax(0, 1fr); }
/* site.js sets these while it drives a transition, so the row has a value to
   travel from. Same specificity as the [open] rule above, so order decides. */
.faq.is-collapsed > .faq-panel { grid-template-rows: minmax(0, 0fr); }
.faq.is-expanded > .faq-panel { grid-template-rows: minmax(0, 1fr); }

.faq-body { min-height: 0; padding: 0 22px 18px; }
.faq-body p { margin: 0 0 12px; }
.faq-body p:last-child { margin-bottom: 0; }

/* ---------- Table of contents ------------------------------------------ */
.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 22px;
  margin: 32px 0 0;
  box-shadow: 0 2px 10px var(--shadow);
}
.toc h2 {
  border: 0; padding: 0; margin: 0 0 10px;
  font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--dim);
}
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 5px; }
.toc a {
  border-bottom: 0;
  color: var(--dim);
  transition: color var(--dur-hover) ease;
}
@media (hover: hover) and (pointer: fine) {
  .toc a:hover { color: var(--accent); }
}
.toc a[aria-current="true"] { color: var(--accent); font-weight: 600; }

/* ---------- Scroll reveal ----------------------------------------------
   Only applied when JS is running, so the pages are fully readable with
   scripting off — which matters for a legal document. */
.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--dur-reveal) var(--ease-out),
              transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--reveal-i, 0) * 55ms);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  /* Keep the fade — it still signals arrival — but drop the movement. */
  .js .reveal { transform: none; transition: opacity 200ms ease; }
  .faq summary::after,
  .faq-panel { transition: none; }
  .progress { display: none; }
}

@media (max-width: 520px) {
  header { padding-top: 48px; }
  h1 { font-size: 25px; }
  .faq summary { padding: 15px 46px 15px 18px; font-size: 15.5px; }
  .faq-body { padding: 0 18px 16px; }
  .toc { padding: 14px 18px; }
}
