/*
 * The public landing page, and nothing else. Every selector is under .lp so the
 * app chrome cannot be reached from here by accident.
 *
 * DESIGN.md gives the landing page variance 7 / motion 6 / density 3 against the
 * app's 4 / 3 / 5: bigger type, more air, the same tokens. No colour is written
 * out here, so both themes and all six accents follow without another rule.
 */

.lp {
  /*
   * A landing-only scale. The product tokens stop at --text-3xl and are
   * deliberately fixed, because product UI must not reflow as a window is
   * resized. A page read once, at whatever width the visitor happens to have,
   * has the opposite problem, so these few values are fluid.
   */
  --lp-max: 1080px;
  --lp-gutter: clamp(1.25rem, 0.75rem + 2.5vw, 3rem);
  --lp-display: clamp(2.125rem, 1.5rem + 2.8vw, 3.25rem);
  --lp-title: clamp(1.4375rem, 1.2rem + 1.2vw, 2rem);
  --lp-lede: clamp(1.0625rem, 1rem + 0.45vw, 1.25rem);
  --lp-body: 1.0625rem;
  --lp-section-y: clamp(2.75rem, 1.5rem + 4.5vw, 4.75rem);

  background: var(--bg);
  color: var(--ink);
}

/* No global anchor rule exists in the app stylesheet, so links here would
   otherwise arrive underlined in browser blue. */
.lp a {
  color: inherit;
  text-decoration: none;
}

.lp p {
  color: var(--ink-muted);
  font-size: var(--lp-body);
  line-height: var(--leading-body);
}

.lp mark {
  background: var(--primary-soft);
  color: var(--ink);
  border-radius: 3px;
  padding: 0 3px;
}

/* ---------------------------------------------------------------- scaffold */

.lp-inner {
  width: 100%;
  max-width: var(--lp-max);
  margin-inline: auto;
}

.lp-band {
  padding: var(--lp-section-y) var(--lp-gutter);
}

/* Two tints, used sparingly. The pale accent closes the page; the neutral one
   holds the middle so the accent does not appear twice in a row. */
.lp-band-soft { background: var(--primary-soft); }

.lp-band-tint {
  background: var(--surface-2);
  border-block: 1px solid var(--border-subtle);
}

.lp-band-ruled { border-top: 1px solid var(--border-subtle); }

.lp-measure { max-width: 58ch; }

.lp-quiet {
  color: var(--ink-faint);
  font-size: var(--text-sm);
}

/* ---------------------------------------------------------------- headings */

.lp-display {
  font-size: var(--lp-display);
  line-height: 1.04;
  letter-spacing: -0.028em;
  font-weight: var(--weight-semibold);
  max-width: 20ch;
  text-wrap: balance;
}

.lp-h2 {
  font-size: var(--lp-title);
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 24ch;
  text-wrap: balance;
  /* The hero links to #today; without this the heading lands under the top of
     the viewport with nothing above it. */
  scroll-margin-top: var(--space-8);
}

.lp-h3 {
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
}

/* Headings carry no margin of their own anywhere in this codebase, and most
   sections here sit in a grid that spaces itself. This one does not, because
   the lists below it need a wider container than the prose. */
.lp-band-ruled .lp-h2 + p { margin-top: var(--space-4); }

/* ---------------------------------------------------------------- header */

.lp-top {
  padding-inline: var(--lp-gutter);
  border-bottom: 1px solid var(--border-subtle);
}

.lp-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 64px;
}

.lp-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
}

/* The same mark the sign-in screen and the boot shell use. */
.lp-mark {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
}

.lp-textlink {
  color: var(--ink-muted);
  font-size: var(--text-sm);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease-out);
}

.lp-textlink:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

/* ---------------------------------------------------------------- hero */

.lp-hero {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  align-items: start;
}

.lp-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-6);
  max-width: 46ch;
}

.lp-lede {
  font-size: var(--lp-lede);
  line-height: 1.5;
  color: var(--ink);
}

.lp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
}

.lp-fineprint {
  font-size: var(--text-sm);
  color: var(--ink-faint);
}

@media (min-width: 900px) {
  .lp-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    column-gap: clamp(2.5rem, 5vw, 4.5rem);
    align-items: center;
  }

  .lp-display {
    grid-column: 1 / -1;
    max-width: 26ch;
  }
}

/* ---------------------------------------------------------------- call to action */

.lp-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding-inline: var(--space-6);
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--on-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-sm);
  transition:
    background-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.lp-cta:hover { background: var(--primary-hover); }

.lp-cta:active { transform: translateY(1px); }

/* Full width on a phone, the same as the submit button on the sign-in screen
   this leads to. */
@media (max-width: 479px) {
  .lp-cta { width: 100%; }
}

/* ---------------------------------------------------------------- hero preview */

.lp-preview { min-width: 0; }

.lp-frame {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
}

.lp-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding-inline: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.lp-glyph {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--ink-faint);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
}

.lp-query {
  font-size: var(--text-sm);
  color: var(--ink);
}

.lp-caret {
  width: 1.5px;
  height: 15px;
  margin-left: -2px;
  background: var(--primary);
  animation: lp-blink 1.1s steps(1, end) infinite;
}

@keyframes lp-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* The motion tokens shorten transitions under a reduced-motion preference, but a
   looping keyframe has to be stopped by name. */
@media (prefers-reduced-motion: reduce) {
  .lp-caret { animation: none; }
}

/* Hairlines drawn by the gap rather than by borders, so the first and last rows
   do not need exceptions. */
.lp-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.lp-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg);
}

.lp-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--ink-muted);
}

.lp-kind svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lp-result-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.lp-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
}

.lp-result-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--ink);
}

.lp-result-kindword {
  font-size: var(--text-2xs);
  color: var(--ink-faint);
}

.lp-result-snip {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- steps */

.lp-steps {
  list-style: none;
  margin: var(--space-8) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-8);
}

/* One rule per step, and at three across they read as a single ruled line under
   the heading. */
.lp-step {
  display: grid;
  gap: var(--space-2);
  align-content: start;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-strong);
}

.lp-step-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.lp-step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

@media (min-width: 760px) {
  .lp-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
  }
}

/* ---------------------------------------------------------------- split rows */

.lp-split {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}

.lp-split-copy {
  display: grid;
  gap: var(--space-4);
  align-content: start;
  max-width: 52ch;
}

@media (min-width: 880px) {
  .lp-split {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  }

  /* Only once there are columns to swap. Reordering a single column would put
     the picture before the sentence explaining it. The proportions swap with
     the order, so the illustration keeps the wider column either way. */
  .lp-split-flip { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); }

  .lp-split-flip .lp-split-copy { order: 2; }
}

/* ---------------------------------------------------------------- figures */

/* Capped rather than fluid: once the columns collapse, a drawing stretched the
   full width of a tablet stops looking like a thing on a screen. */
.lp-figure {
  margin: 0;
  min-width: 0;
  max-width: 34rem;
}

.lp-figure-panel {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}

.lp-tape {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.lp-tape-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
}

.lp-tape-play svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.lp-tape-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.lp-tape-time {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

.lp-wave {
  display: block;
  width: 100%;
  height: auto;
}

.lp-wave rect { fill: var(--border-strong); }

.lp-wave rect.is-played { fill: var(--primary); }

.lp-transcript,
.lp-extract {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--ink);
}

.lp-transcript-label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-2xs);
  color: var(--ink-faint);
}

.lp-board {
  display: block;
  width: 100%;
  height: auto;
}

.lp-board-face {
  fill: var(--surface-3);
  stroke: var(--border);
  stroke-width: 1;
}

.lp-board-scrawl path {
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.lp-board-shapes {
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lp-board-word {
  fill: var(--ink);
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: var(--weight-semibold);
}

/* The recognised line, marked the way the app marks a search hit. */
.lp-board-read {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.lp-board-tick {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------- ledger */

.lp-ledger {
  margin-top: var(--space-8);
  display: grid;
  gap: var(--space-8);
}

.lp-has,
.lp-hasnt {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.lp-has li,
.lp-hasnt li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: var(--space-2);
  align-items: center;
  font-size: var(--text-sm);
}

/* A tick and a dash drawn from borders: no icon file, and both follow the
   theme without a second copy for dark. */
.lp-has li::before {
  content: "";
  width: 6px;
  height: 11px;
  margin-top: -3px;
  justify-self: center;
  border: solid var(--primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.lp-hasnt li {
  color: var(--ink-faint);
}

.lp-hasnt li::before {
  content: "";
  width: 10px;
  height: 2px;
  justify-self: center;
  background: var(--ink-faint);
}

.lp-hasnt + .lp-quiet { margin-top: var(--space-4); }

@media (min-width: 560px) {
  .lp-has { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 860px) {
  .lp-ledger {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4rem);
  }
}

/* ---------------------------------------------------------------- free tier */

.lp-tier {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
}

.lp-tier-copy {
  display: grid;
  gap: var(--space-4);
  align-content: start;
  max-width: 46ch;
}

.lp-stats {
  margin: 0;
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.lp-stat {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-6) var(--space-4);
  background: var(--bg);
}

.lp-stat dt {
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.lp-stat dd {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
}

.lp-unit {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  letter-spacing: 0;
  color: var(--ink-faint);
}

@media (min-width: 560px) {
  .lp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 860px) {
  .lp-tier {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    column-gap: clamp(2.5rem, 5vw, 4rem);
  }
}

/* ---------------------------------------------------------------- close */

.lp-close {
  display: grid;
  justify-items: start;
  gap: var(--space-6);
}

/* ---------------------------------------------------------------- footer */

.lp-foot {
  padding: var(--space-8) var(--lp-gutter);
  border-top: 1px solid var(--border-subtle);
}

.lp-foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
