/* Landing page for signed-out visitors (home.html, OBSERVE_LANDING_PAGE).
   Colours come from the dashboard's tokens in app.css, so both themes follow. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------------ view switch */
html[data-view="app"] #landing { display: none; }
html:not([data-view="app"]) #app { display: none; }

:root { --lp-light: block; --lp-dark: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --lp-light: none; --lp-dark: block; }
}
:root[data-theme="dark"] { --lp-light: none; --lp-dark: block; }

/* ------------------------------------------------------------------ page */
.lp {
  --lp-display: "Bricolage Grotesque", var(--font);
  --lp-gutter: 28px;
  font-size: 17px;
  line-height: 1.55;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--lp-gutter);
}
.lp p { margin: 0; }
.lp code { font-size: 0.86em; }
.lp h1, .lp h2 { font-family: var(--lp-display); text-wrap: balance; }
.lp h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); font-weight: 650; line-height: 1.05; letter-spacing: -0.025em; }
.lp h3 { font-size: 1.06rem; font-weight: 650; letter-spacing: -0.01em; line-height: 1.3; }
.lp-btn.btn { height: 44px; padding: 0 20px; font-size: 15.5px; border-radius: 9px; }

/* ------------------------------------------------------------------ top bar */
.lp-top { display: flex; align-items: center; gap: 28px; padding: 20px 0; }
.lp-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; font-size: 16px; letter-spacing: -0.01em; }
.lp-brand:hover { text-decoration: none; }
.lp-nav { display: flex; gap: 24px; font-size: 14.5px; }
.lp-nav a { color: var(--text-2); }
.lp-nav a:hover { color: var(--text); text-decoration: none; }
.lp-top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lp-top-actions .btn { height: 36px; padding: 0 14px; font-size: 14px; }

/* ------------------------------------------------------------------ hero */
.lp-hero {
  display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 12fr); gap: 56px; align-items: center;
  padding: 56px 0 88px;
}
.lp h1 {
  font-size: clamp(2.7rem, 6.1vw, 4.9rem); font-weight: 700; line-height: 0.96; letter-spacing: -0.04em;
  font-variation-settings: "wdth" 100;
}
.lp-lede { margin-top: 26px !important; font-size: 1.16rem; line-height: 1.5; color: var(--text-2); max-width: 34em; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.lp-note { margin-top: 18px !important; font-size: 14.5px; color: var(--text-3); }

/* The replay: one session, shown the way the dashboard shows it. */
.lp-replay {
  margin: 0; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: var(--shadow-pop); overflow: hidden; font-size: 13.5px; line-height: 1.4; min-width: 0;
}
.lp-replay-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.lp-avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #1c8a3c; color: #fff; font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.lp-replay-who { min-width: 0; font-size: 14.5px; }
.lp-replay-who code { font-size: 13px; }
.lp-replay-sub { font-size: 12.5px; color: var(--text-3); }
.lp-risk { margin-left: auto; flex: none; display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-3); }
.lp-risk b { font-size: 17px; color: var(--text); font-variant-numeric: tabular-nums; }
.lp-risk i { width: 30px; height: 5px; border-radius: 3px; background: var(--sev-critical); }

.lp-rows { list-style: none; margin: 0; padding: 0; }
.lp-row {
  position: relative; display: grid; grid-template-columns: 50px 52px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.lp-row time { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.lp-row b { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.lp-row code, .lp-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-row code { font-size: 12.5px; }
.lp-row em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--good-ink); white-space: nowrap; }
.lp-row em::before { content: ""; display: inline-block; width: 4px; height: 8px; margin: 0 7px 1px 0; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.lp-row em.is-denied { color: var(--danger-ink); }
.lp-row em.is-denied::before { width: 9px; height: 2px; margin: 0 6px 3px 0; border: 0; background: currentColor; transform: none; }
.lp-row.is-prompt { background: var(--accent-wash); }
.lp-row.is-prompt b { font-family: var(--font); font-size: 12.5px; }
.lp-row.is-flagged { background: color-mix(in srgb, var(--sev-critical) 8%, var(--surface)); border-bottom-color: transparent; }
.lp-row.is-flagged::before, .lp-finding::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--sev-critical); }
.lp-finding { position: relative; padding: 4px 16px 16px 76px; background: color-mix(in srgb, var(--sev-critical) 8%, var(--surface)); }
.lp-finding-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14.5px; }
.lp-finding p { margin-top: 6px; color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.lp-finding code { font-size: 12px; }
.lp-replay figcaption { padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); }

/* The page's one piece of motion: the session plays back once on arrival. */
@media (prefers-reduced-motion: no-preference) {
  html[data-view="landing"] .lp-row,
  html[data-view="landing"] .lp-finding { animation: lp-play 0.34s ease-out both; }
  html[data-view="landing"] .lp-row:nth-child(1) { animation-delay: 0.25s; }
  html[data-view="landing"] .lp-row:nth-child(2) { animation-delay: 0.75s; }
  html[data-view="landing"] .lp-row:nth-child(3) { animation-delay: 1.1s; }
  html[data-view="landing"] .lp-row:nth-child(4) { animation-delay: 1.45s; }
  html[data-view="landing"] .lp-row:nth-child(5) { animation-delay: 1.8s; }
  html[data-view="landing"] .lp-finding { animation-delay: 2.35s; animation-duration: 0.5s; }
}
@keyframes lp-play { from { opacity: 0; } }

/* ------------------------------------------------------------------ sections */
.lp-section { padding: 88px 0; border-top: 1px solid var(--border); }
.lp-section-lede { margin-top: 14px !important; color: var(--text-2); max-width: 36em; }

/* What you get: pick a page of the dashboard and see it. Radio inputs carry
   the state, so it works from the keyboard and without scripts. */
.lp-tour { margin-top: 40px; }
.lp-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; width: fit-content; max-width: 100%; border-radius: 12px; background: var(--surface-3); }
.lp-tabs label { padding: 9px 16px; border-radius: 9px; font-size: 15px; font-weight: 550; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.lp-tabs label:hover { color: var(--text); }
.lp-shot { display: none; margin: 28px 0 0; min-width: 0; }
.lp-shot figcaption { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 12px 44px; align-items: start; margin-bottom: 26px; }
.lp-shot h3 { font-family: var(--lp-display); font-size: 1.6rem; font-weight: 650; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
.lp-shot p { color: var(--text-2); max-width: 38em; }
.lp-shot img { width: 100%; height: auto; border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-pop); background: var(--surface); }
.lp-light { display: var(--lp-light); }
.lp-dark { display: var(--lp-dark); }

#lp-t-trail:checked ~ .lp-s-trail,
#lp-t-findings:checked ~ .lp-s-findings,
#lp-t-policies:checked ~ .lp-s-policies,
#lp-t-leaders:checked ~ .lp-s-leaders,
#lp-t-bugs:checked ~ .lp-s-bugs { display: block; }

#lp-t-trail:checked ~ .lp-tabs [for="lp-t-trail"],
#lp-t-findings:checked ~ .lp-tabs [for="lp-t-findings"],
#lp-t-policies:checked ~ .lp-tabs [for="lp-t-policies"],
#lp-t-leaders:checked ~ .lp-tabs [for="lp-t-leaders"],
#lp-t-bugs:checked ~ .lp-tabs [for="lp-t-bugs"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: default; }

#lp-t-trail:focus-visible ~ .lp-tabs [for="lp-t-trail"],
#lp-t-findings:focus-visible ~ .lp-tabs [for="lp-t-findings"],
#lp-t-policies:focus-visible ~ .lp-tabs [for="lp-t-policies"],
#lp-t-leaders:focus-visible ~ .lp-tabs [for="lp-t-leaders"],
#lp-t-bugs:focus-visible ~ .lp-tabs [for="lp-t-bugs"] { outline: 2px solid var(--focus); outline-offset: 2px; }

/* How it works: a real sequence, so it is numbered. */
.lp-steps { list-style: none; margin: 44px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr); gap: 40px; counter-reset: lp-step; }
.lp-steps > li { counter-increment: lp-step; border-top: 2px solid var(--text); padding-top: 16px; min-width: 0; }
.lp-steps > li::before { content: counter(lp-step); display: block; font-family: var(--lp-display); font-size: 2.6rem; font-weight: 650; line-height: 1; letter-spacing: -0.03em; margin-bottom: 14px; }
.lp-steps p { margin-top: 8px; color: var(--text-2); font-size: 15.5px; }
.lp-code { margin-top: 14px; padding: 12px 14px; background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; }
.lp-code code { font-size: 12.5px; line-height: 1.7; }

/* Get started */
.lp-start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 56px; align-items: start; }
.lp-start-copy p { margin-top: 14px; color: var(--text-2); max-width: 32em; }
.lp-start-copy .lp-start-alt { font-size: 15px; color: var(--text-3); }
.lp-form { display: flex; flex-direction: column; gap: 14px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); font-size: 14px; }
.lp-form .input { height: 42px; font-size: 15px; }
.lp-form .field > label { font-size: 13px; }
.lp-form .form-error:empty { display: none; }
.lp-form h3 { font-size: 1.15rem; }
.lp-form p { color: var(--text-2); font-size: 15px; }

/* Footer */
.lp-foot { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; padding: 26px 0 40px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-3); }
.lp-foot nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.lp-foot a { color: var(--text-2); }

/* ------------------------------------------------------------------ smaller screens */
@media (max-width: 1000px) {
  .lp-hero { grid-template-columns: minmax(0, 1fr); gap: 44px; padding: 36px 0 72px; }
  .lp-section { padding: 64px 0; }
  /* No tabs on small screens: every page is shown, one after another. */
  .lp-tour { margin-top: 32px; }
  .lp-tabs, .lp-tour > input { display: none; }
  .lp-shot { display: block; margin: 0 0 48px; }
  .lp-shot:last-child { margin-bottom: 0; }
  .lp-shot figcaption { grid-template-columns: minmax(0, 1fr); margin-bottom: 18px; }
  .lp-shot h3 { font-size: 1.35rem; }
  .lp-steps { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .lp-start { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 720px) {
  .lp { --lp-gutter: 16px; font-size: 16px; }
  .lp-nav { display: none; }
  .lp-top { padding: 14px 0; }
  .lp-finding { padding-left: 16px; }
  .lp-cta .lp-btn { flex: 1 1 150px; }
  /* A whole dashboard page is unreadable this small: show its main column. */
  .lp-shot img { aspect-ratio: 1 / 1; object-fit: cover; object-position: 50% 0; }
}
@media (max-width: 460px) {
  .lp-row { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .lp-row time { display: none; }
  .lp-replay-sub { display: none; }
}
