/* ==========================================================================
   LazyMemo landing page
   Tokens derive from the app's own palette (src/app/theme.css) so the site
   and the product read as one thing.

   Named colors: ink, paper, violet, amber, graphite, seam
   Type roles:   --font-ui   human voice
                 --font-read what the machine read (OCR output, step index,
                             timestamps)
   Signature:    ".seam" — the amber-to-violet scan pass that crosses the
                 demo frame and returns as the section separator.
   ========================================================================== */

:root {
  --paper: oklch(0.978 0.006 292);
  --paper-raised: #fff;
  --paper-sunk: oklch(0.955 0.007 292);

  --ink: oklch(0.22 0.02 292);
  --graphite: oklch(0.44 0.014 292);
  --graphite-soft: oklch(0.52 0.013 292);

  /* violet: action. Two stops — surface vs. text — so both clear AA. */
  --violet: oklch(0.47 0.19 295);
  --violet-deep: oklch(0.4 0.18 295);
  --violet-ink: oklch(0.44 0.18 295);
  --violet-wash: oklch(0.955 0.03 295);
  --violet-line: oklch(0.88 0.05 295);

  /* amber: the highlighter. Background only — never text on paper. */
  --amber: oklch(0.86 0.15 88);
  --amber-wash: oklch(0.955 0.055 92);
  --amber-line: oklch(0.87 0.09 90);
  --amber-ink: oklch(0.42 0.11 72);

  --rule: oklch(0.91 0.008 292);
  --rule-soft: oklch(0.94 0.006 292);

  --font-ui: 'Segoe UI Variable Text', 'Segoe UI', 'Microsoft YaHei UI',
    system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-read: 'Cascadia Mono', 'Cascadia Code', Consolas, 'SFMono-Regular',
    ui-monospace, 'Courier New', monospace;

  --shell: 68rem;
  --pad: clamp(1.25rem, 5vw, 2.5rem);
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;

  --shadow: 0 10px 26px -18px rgba(60, 40, 110, 0.5);
  --shadow-lg: 0 30px 60px -32px rgba(40, 20, 90, 0.45);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: oklch(0.18 0.014 292);
    --paper-raised: oklch(0.235 0.016 292);
    --paper-sunk: oklch(0.21 0.014 292);

    --ink: oklch(0.95 0.006 292);
    --graphite: oklch(0.79 0.01 292);
    --graphite-soft: oklch(0.68 0.012 292);

    --violet: oklch(0.68 0.16 295);
    --violet-deep: oklch(0.74 0.16 295);
    --violet-ink: oklch(0.8 0.13 295);
    --violet-wash: oklch(0.27 0.05 295);
    --violet-line: oklch(0.38 0.08 295);

    --amber: oklch(0.83 0.16 88);
    --amber-wash: oklch(0.3 0.05 88);
    --amber-line: oklch(0.42 0.08 88);
    --amber-ink: oklch(0.88 0.11 88);

    --rule: oklch(0.31 0.014 292);
    --rule-soft: oklch(0.26 0.014 292);

    --shadow: 0 10px 26px -18px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  }
}

/* --- base ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--violet-ink);
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  background: var(--paper-raised);
  color: var(--ink);
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 var(--r-sm) 0;
  border: 1px solid var(--rule);
}
.skip:focus {
  left: 0;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--pad);
}

section {
  padding-block: clamp(3.5rem, 9vw, 6.5rem);
}

/* clear the sticky masthead when the skip link jumps to content */
#main {
  scroll-margin-top: 5rem;
}

.eyebrow {
  font-family: var(--font-read);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite-soft);
  margin-bottom: 1rem;
}

/* --- the seam: signature element ---------------------------------------- */

.seam {
  height: 2px;
  border: 0;
  margin: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--amber) 18%,
    var(--violet) 62%,
    transparent 100%
  );
  opacity: 0.85;
}

.seam--notch {
  position: relative;
}
.seam--notch::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 62%;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--violet);
}

/* extracted text: what came out of the image */
.read {
  font-family: var(--font-read);
  font-size: 0.92em;
  background: linear-gradient(transparent 58%, var(--amber-wash) 58%);
  box-shadow: inset 0 -1px 0 var(--amber-line);
  padding: 0 0.15em;
}

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

.masthead {
  border-bottom: 1px solid var(--rule-soft);
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.masthead__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
}

.wordmark__glyph {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--violet);
  position: relative;
  flex: none;
}
.wordmark__glyph::before {
  content: '';
  position: absolute;
  inset: 6px 5px auto 5px;
  height: 2px;
  border-radius: 2px;
  background: var(--amber);
}
.wordmark__glyph::after {
  content: '';
  position: absolute;
  inset: auto 5px 7px 5px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 -4px 0 rgba(255, 255, 255, 0.45);
}

.masthead__link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--violet-ink);
}

/* --- buttons ------------------------------------------------------------- */

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--violet);
  color: #fff;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 0.95rem 1.5rem;
  border-radius: var(--r);
  border: 1px solid transparent;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: background 0.15s ease, transform 0.15s ease;
}
.cta:hover {
  background: var(--violet-deep);
  transform: translateY(-1px);
}
.cta:active {
  transform: translateY(0);
}
.cta svg {
  flex: none;
}

@media (prefers-color-scheme: dark) {
  .cta {
    color: oklch(0.16 0.02 292);
  }
  .cta svg {
    fill: currentColor;
  }
}

.cta__note {
  margin-top: 0.85rem;
  font-family: var(--font-read);
  font-size: 0.8rem;
  color: var(--graphite-soft);
}

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

.hero {
  padding-top: clamp(3rem, 7vw, 5rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.hero h1 {
  font-size: clamp(1.95rem, 5.4vw, 3.4rem);
  max-width: 21ch;
}

.hero__sub {
  margin-top: 1.35rem;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--graphite);
  max-width: 52ch;
}

.hero__actions {
  margin-top: 2rem;
}

/* Container for assets/demo.gif. --demo-ratio must match the recording's own
   dimensions, otherwise the frame letterboxes. */
.demo {
  --demo-ratio: 2451 / 1299;
  margin-top: clamp(2.5rem, 6vw, 4rem);
  position: relative;
  aspect-ratio: var(--demo-ratio);
  border-radius: var(--r-lg);
  border: 1px solid var(--rule);
  background: var(--paper-sunk);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* the <picture> wrapper must not become a box of its own */
.demo picture {
  display: contents;
}

/* contain, not cover: the Windows toast sits in the bottom-right corner and
   must never be cropped */
.demo__media {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* the scan pass — the extraction motion, held still under reduced-motion */
.demo::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: -2px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--amber) 20%,
    var(--violet) 70%,
    transparent
  );
  animation: scan 5.5s cubic-bezier(0.65, 0, 0.35, 1) infinite;
  pointer-events: none;
}

@keyframes scan {
  0% {
    top: -2px;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

.demo__caption {
  margin-top: 0.9rem;
  font-family: var(--font-read);
  font-size: 0.78rem;
  color: var(--graphite-soft);
}

/* --- problem ------------------------------------------------------------- */

.problem {
  background: var(--paper-raised);
  border-block: 1px solid var(--rule-soft);
}

.problem__lead {
  font-size: clamp(1.35rem, 3.4vw, 1.95rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  max-width: 28ch;
}

.problem__list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  max-width: 46ch;
}

.problem__list li {
  padding-left: 1.6rem;
  position: relative;
  color: var(--graphite);
}
.problem__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.85rem;
  height: 2px;
  background: var(--amber);
}

.problem__turn {
  margin-top: 2.25rem;
  font-size: 1.1rem;
  max-width: 46ch;
  color: var(--graphite);
}

/* the turn the section is built toward */
.problem__turn--last {
  margin-top: 1.5rem;
  color: var(--ink);
  font-weight: 600;
}

/* --- steps: real sequence ------------------------------------------------ */

.steps__grid {
  margin-top: 2.75rem;
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  counter-reset: step;
}

.step {
  counter-increment: step;
  position: relative;
  padding: 0 clamp(1rem, 2.5vw, 1.75rem);
}
.step:first-child {
  padding-left: 0;
}
.step:last-child {
  padding-right: 0;
}

/* the rail carries the order: filled up to and including this step */
.step__rail {
  height: 3px;
  background: var(--rule);
  border-radius: 3px;
  position: relative;
  margin-bottom: 1.35rem;
}
.step__rail::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--violet);
  border-radius: 3px;
}
.step:nth-child(1) .step__rail::before {
  width: 100%;
  background: var(--amber);
}
.step:nth-child(2) .step__rail::before {
  width: 100%;
  background: linear-gradient(90deg, var(--amber), var(--violet));
}
.step:nth-child(3) .step__rail::before {
  width: 100%;
}
.step__rail::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  translate: 0 -50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--violet);
}
.step:nth-child(1) .step__rail::after {
  border-color: var(--amber);
}

.step__index {
  font-family: var(--font-read);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--graphite-soft);
  display: block;
  margin-bottom: 0.55rem;
}
.step__index::before {
  content: 'STEP ' counter(step) ' / 3';
}

.step h3 {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
}

.step p {
  color: var(--graphite);
  font-size: 0.98rem;
}

/* --- comparison ---------------------------------------------------------- */

.compare {
  background: var(--paper-raised);
  border-block: 1px solid var(--rule-soft);
}

.compare__intro {
  margin-top: 1.1rem;
  color: var(--graphite);
  max-width: 54ch;
}

.table-wrap {
  margin-top: 2.5rem;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--paper);
}

table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  text-align: left;
}

/* the section heading already carries this; kept for screen readers only */
caption {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

th,
td {
  padding: 1rem 1.15rem;
  vertical-align: top;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.97rem;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

thead th {
  font-size: 0.78rem;
  font-family: var(--font-read);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--graphite-soft);
  font-weight: 600;
  border-bottom: 1px solid var(--rule);
}

tbody th {
  font-weight: 600;
  color: var(--ink);
  width: 12rem;
}

td.is-them {
  color: var(--graphite);
}

td.is-us {
  background: var(--violet-wash);
  color: var(--ink);
  font-weight: 600;
  border-left: 1px solid var(--violet-line);
}

thead th.is-us {
  background: var(--violet-wash);
  color: var(--violet-ink);
  border-left: 1px solid var(--violet-line);
}

/* --- privacy ------------------------------------------------------------- */

/* 6-column base so the five facts fill two complete rows: 3 + 2 */
.privacy__grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.85rem;
}

.privacy__grid .fact {
  grid-column: span 2;
}
.privacy__grid .fact:nth-child(4),
.privacy__grid .fact:nth-child(5) {
  grid-column: span 3;
}

.fact {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 1.5rem 1.4rem;
  position: relative;
  overflow: hidden;
}

/* each fact carries a short piece of the seam */
.fact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3.5rem;
  height: 3px;
  background: linear-gradient(90deg, var(--amber), var(--violet));
}

.fact h3 {
  font-size: 1rem;
  margin-bottom: 0.45rem;
}

.fact p {
  color: var(--graphite);
  font-size: 0.93rem;
}

.privacy__foot {
  margin-top: 1.6rem;
  font-size: 0.93rem;
  color: var(--graphite);
}

/* --- closing ------------------------------------------------------------- */

.closing {
  text-align: center;
}

.closing h2 {
  font-size: clamp(1.8rem, 4.6vw, 2.7rem);
  max-width: 20ch;
  margin-inline: auto;
}

.closing p {
  margin-top: 1.1rem;
  color: var(--graphite);
  max-width: 44ch;
  margin-inline: auto;
}

.closing .cta {
  margin-top: 2rem;
}

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

.footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.75rem 3.5rem;
  font-size: 0.92rem;
  color: var(--graphite);
}

.footer__maker {
  max-width: 52ch;
}

.footer__row {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  align-items: center;
}

.footer__legal {
  margin-top: 1.6rem;
  font-family: var(--font-read);
  font-size: 0.76rem;
  color: var(--graphite-soft);
}

/* --- responsive ---------------------------------------------------------- */

@media (max-width: 52rem) {
  body {
    font-size: 16px;
  }

  .steps__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .step {
    padding: 0;
  }

  .step__rail {
    width: 3px;
    height: auto;
    min-height: 0;
    margin-bottom: 0;
    position: absolute;
    left: 0;
    top: 0.35rem;
    bottom: -2rem;
  }
  .step:last-child .step__rail {
    bottom: 0.35rem;
  }
  .step__rail::before {
    inset: 0;
    width: 3px !important;
  }
  .step:nth-child(2) .step__rail::before {
    background: linear-gradient(180deg, var(--amber), var(--violet));
  }
  .step__rail::after {
    right: auto;
    left: 50%;
    top: 0;
    translate: -50% 0;
  }

  .step > *:not(.step__rail) {
    margin-left: 1.6rem;
  }

  .step {
    position: relative;
  }

  tbody th {
    width: auto;
  }

  .privacy__grid {
    grid-template-columns: 1fr;
  }
  .privacy__grid .fact,
  .privacy__grid .fact:nth-child(4),
  .privacy__grid .fact:nth-child(5) {
    grid-column: auto;
  }
}

@media (min-width: 52.01rem) and (max-width: 62rem) {
  /* two comfortable columns, last card spans the row */
  .privacy__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .privacy__grid .fact,
  .privacy__grid .fact:nth-child(4),
  .privacy__grid .fact:nth-child(5) {
    grid-column: auto;
  }
  .privacy__grid .fact:nth-child(5) {
    grid-column: 1 / -1;
  }
}

/* --- motion -------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .demo::after {
    animation: none;
    top: 38%;
    opacity: 0.9;
  }

  .cta {
    transition: none;
  }
  .cta:hover {
    transform: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --- legal page ---------------------------------------------------------- */

.doc {
  max-width: 44rem;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.doc h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
}

.doc__meta {
  margin-top: 0.9rem;
  font-family: var(--font-read);
  font-size: 0.8rem;
  color: var(--graphite-soft);
}

.doc h2 {
  font-size: 1.2rem;
  margin-top: 2.5rem;
}

.doc p,
.doc ul {
  margin-top: 0.9rem;
  color: var(--graphite);
}

.doc ul {
  padding-left: 1.2rem;
}

.doc li + li {
  margin-top: 0.4rem;
}

.doc strong {
  color: var(--ink);
}

.doc code {
  font-family: var(--font-read);
  font-size: 0.88em;
  background: var(--paper-sunk);
  border: 1px solid var(--rule-soft);
  border-radius: 5px;
  padding: 0.1em 0.35em;
}
