/*
 * The landing page, in the app's own type, colours, cards and buttons (application.css loads first); the yellow price tag is the one
 * loud thing. Everything is scoped under .lp so none of it can reach the app's own screens.
 */

.lp {
  --paper: var(--bg); --ink-soft: var(--ink-2); --tag: oklch(0.88 0.17 95); --live: var(--good);
  --lp-tint: oklch(0.945 0.012 135); --lp-ink-line: var(--line-2);
  font-size: 16px; line-height: 1.55; scroll-behavior: smooth;
}
html:has(.lp) { scroll-padding-top: 4.5rem; }

.lp-wrap { max-width: 76rem; margin-inline: auto; padding-inline: var(--gutter); }

/* Top bar -------------------------------------------------------------------------------------- */

.lp-bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--lp-ink-line); }
.lp-bar-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 3.5rem; }
.lp-mark i { font-style: normal; color: oklch(0.82 0.17 92); }
.lp-mark { font: 700 22px/1 var(--display); letter-spacing: calc(-0.04em + var(--lt)); color: var(--ink); text-decoration: none; }
.lp-links { display: flex; gap: 0.15rem; margin-right: auto; }
.lp-links a { padding: 0.35rem 0.7rem; border-radius: var(--radius); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.lp-links a:hover { background: rgba(18, 53, 36, 0.08); }
.lp-links a[aria-current="true"] { background: var(--tag); }
.lp-signin { margin-left: auto; }
@media (max-width: 52rem) { .lp-links { display: none; } }

/* Hero ----------------------------------------------------------------------------------------- */

.lp-hero { padding-block: clamp(2.5rem, 6vw, 5.5rem) clamp(3rem, 7vw, 6rem); overflow: hidden; }
.lp-hero-grid { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 52rem) { .lp-hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(16rem, 0.75fr); gap: 3rem; } }

.lp-hero-copy h1 { font-size: clamp(2.6rem, 1.4rem + 4.8vw, 5.4rem); line-height: 0.98; font-weight: 700; letter-spacing: -0.04em; text-wrap: balance; max-width: 14ch; }
.lp-lede { margin-top: 1.5rem; max-width: 36rem; font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem); line-height: 1.55; color: var(--ink-soft); }
.lp-hero-copy .actions { margin-top: 2rem; }
.lp-cta { min-height: 3rem; padding-inline: 1.4rem; font-size: 1rem; }

/* Entrance: the headline and tag arrive once, together. Nothing else on the page slides in. */
.lp-hero-copy > * { animation: lp-rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.lp-hero-copy > :nth-child(2) { animation-delay: 90ms; }
.lp-hero-copy > :nth-child(3) { animation-delay: 180ms; }
@keyframes lp-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.lp-hero-visual { display: grid; justify-items: center; gap: 1.25rem; padding-top: 0; }
.lp-hang { position: relative; transform-origin: 50% 0; animation: lp-sway 6.5s ease-in-out infinite alternate; }
@keyframes lp-sway { from { transform: rotate(-3.2deg); } to { transform: rotate(3.2deg); } }
.lp-string { position: relative; z-index: 1; display: block; width: 2.5rem; height: 6rem; margin: 0 auto -2.15rem; color: var(--ink); } /* the end of the string sits in the tag's hole */

.lp-tag {
  position: relative; display: grid; align-content: start; gap: 0.35rem; justify-items: start;
  width: clamp(13.5rem, 22vw, 17rem); min-height: 21rem; padding: 3.2rem 1.4rem 1.4rem;
  background: var(--tag); color: var(--ink);
  clip-path: polygon(14% 0, 86% 0, 100% 11%, 100% 100%, 0 100%, 0 11%);
}
.lp-tag-hole { position: absolute; top: 1.15rem; left: 50%; width: 1.2rem; height: 1.2rem; margin-left: -0.6rem; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px rgba(18, 53, 36, 0.45); }
.lp-tag-label { font-size: 0.95rem; font-weight: 500; min-height: 1.5em; }
.lp-tag-price { font-size: clamp(3.2rem, 2rem + 3.4vw, 4.6rem); font-weight: 700; letter-spacing: -0.045em; line-height: 1; white-space: nowrap; }
.lp-tag-item { margin-top: 0.4rem; font-size: 0.9rem; line-height: 1.3; max-width: 13rem; }
.lp-barcode {
  align-self: end; margin-top: 1.4rem; width: 100%; height: 3rem;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 9px, var(--ink) 9px 12px, transparent 12px 14px);
  opacity: 0.85;
}

.lp-ledger { display: grid; gap: 0.15rem; width: min(100%, 17rem); }
.lp-ledger div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0.6rem; border-radius: 4px; color: var(--ink-soft); transition: background 250ms, color 250ms; }
.lp-ledger dd { font-weight: 700; }
.lp-ledger .is-now { background: var(--card); color: var(--ink); box-shadow: inset 3px 0 0 var(--tag); }

/* Chapters ------------------------------------------------------------------------------------- */

.lp-chapter { padding-block: clamp(3.5rem, 7vw, 6rem); }
.lp-chapter-tint { background: var(--lp-tint); }
.lp-chapter-grid { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 56rem) {
  .lp-chapter-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 4rem; }
  .lp-chapter-grid:has(.lp-demo-wide) { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
}

.lp-text h2, .lp-more h2 { font-size: clamp(1.8rem, 1.25rem + 2vw, 2.75rem); line-height: 1.05; font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; }
.lp-text p { margin-top: 1rem; max-width: 34rem; font-size: 1.05rem; line-height: 1.6; }
.lp-text p:first-of-type { margin-top: 1.25rem; }
.lp-facts { margin-top: 1.5rem; display: grid; gap: 0.5rem; max-width: 34rem; }
.lp-facts li { position: relative; padding-left: 1.5rem; font-weight: 500; }
.lp-facts li::before { content: ""; position: absolute; left: 0; top: 0.42em; width: 0.8rem; height: 0.8rem; background: var(--tag); clip-path: polygon(30% 0, 100% 0, 100% 100%, 30% 100%, 0 50%); }

/* Demos: the app's own cards ------------ */

.lp-demo { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 18px 44px -26px oklch(0.27 0.055 158 / 0.35); padding: 1.1rem 1.2rem 1.2rem; min-width: 0; }
.lp-demo > * + * { margin-top: 0.9rem; }
.lp-demo-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; font-weight: 700; padding-bottom: 0.7rem; border-bottom: 1px solid var(--lp-ink-line); }
.lp-demo-head .muted { font-weight: 400; }

.lp-mini { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
.lp-mini th, .lp-mini td { padding: 0.45rem 0.55rem; text-align: left; border-bottom: 1px solid var(--lp-ink-line); vertical-align: middle; }
.lp-mini th { font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); }
.lp-mini .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lp-mini tr:last-child td { border-bottom: 0; }
.lp-money { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* Quick add demo */
.lp-typed { margin: 0; min-height: 5.4rem; padding: 0.7rem 0.85rem; background: var(--paper); border-radius: var(--radius); font-size: 0.85rem; line-height: 1.55; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.lp-caret { display: inline-block; width: 0.5ch; height: 1.05em; margin-left: 1px; vertical-align: text-bottom; background: var(--ink); animation: lp-blink 1s steps(1) infinite; }
@keyframes lp-blink { 50% { opacity: 0; } }
[data-lp-typing-target="row"] { opacity: 0; transform: translateY(6px); transition: opacity 320ms, transform 320ms; }
[data-lp-typing-target="row"].is-in { opacity: 1; transform: none; }

/* Bundle demo */
.lp-controls { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); align-items: end; }
.lp-controls .field > span { font-weight: 600; font-size: 0.9rem; }
.lp-controls input[type="range"] { width: 100%; min-height: 2.2rem; accent-color: var(--ink); padding: 0; }
.lp-shares { display: grid; gap: 0.35rem; }
.lp-shares li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; gap: 0.7rem; align-items: center; font-size: 0.9rem; }
.lp-shares .stack-bars { display: flex; height: 0.9rem; background: var(--paper); border-radius: 3px; overflow: hidden; }
.lp-shares .stack-bars span { display: block; height: 100%; transition: width 260ms ease; }
.lp-shares .bar-fee { background: var(--ink); }
.lp-shares .bar-delivery { background: var(--tag); box-shadow: inset 0 0 0 1px rgba(18, 53, 36, 0.35); }
.lp-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font-size: 0.8rem; color: var(--ink-soft); }
.lp-legend span::before { content: ""; display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: 0.35rem; border-radius: 2px; vertical-align: -1px; }
.lp-legend .l-fee::before { background: var(--ink); }
.lp-legend .l-delivery::before { background: var(--tag); box-shadow: inset 0 0 0 1px rgba(18, 53, 36, 0.35); }

/* Details demo */
.lp-kind { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 40rem) { .lp-kind { grid-template-columns: minmax(0, 2fr) minmax(0, 5fr); } }
.lp-kind[hidden] { display: none; }
.lp-kind-photo { margin: 0; min-height: 9rem; padding: 0.8rem; display: grid; align-content: space-between; border-radius: var(--radius); background: repeating-linear-gradient(135deg, var(--paper) 0 8px, var(--lp-tint) 8px 16px); border: 1px dashed var(--lp-ink-line); }
.lp-kind-photo span { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.lp-kind-photo b { font-size: 0.95rem; line-height: 1.25; }
.lp-specs th { width: 38%; font-weight: 600; color: var(--ink-soft); font-size: 0.85rem; }
.lp-chip-row .chip[aria-selected="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Shop demo */
.lp-shop-grid { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.lp-shop-grid li { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.6rem; border: 1px solid var(--lp-ink-line); border-radius: var(--radius); background: var(--paper); }
.lp-shop-photo { aspect-ratio: 1; border-radius: 4px; background: repeating-linear-gradient(135deg, var(--lp-tint) 0 8px, var(--card) 8px 16px); }
.lp-shop-grid .btn { margin-top: auto; justify-content: center; pointer-events: none; }
.lp-foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }

/* Pricing demo */
.lp-comps { display: grid; gap: 0.1rem; }
.lp-comps li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--lp-ink-line); font-size: 0.925rem; }
.lp-comps li:has(input:not(:checked)) { color: var(--ink-soft); }
.lp-comps li:has(input:not(:checked)) .lp-money { text-decoration: line-through; }
.lp-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.8rem 1.4rem; align-items: end; }
.lp-figures dt { font-size: 0.85rem; color: var(--ink-soft); }
.lp-figures dd { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; transition: color 200ms; }
.lp-figure-main dd { font-size: 1.9rem; }
.lp-figures dd.is-changed { animation: lp-pop 360ms ease-out; }
@keyframes lp-pop { 0% { transform: translateY(3px); opacity: 0.4; } 100% { transform: none; opacity: 1; } }

/* Listing demo */
.lp-rows li { display: grid; grid-template-columns: minmax(7rem, 1fr) auto auto; gap: 0.6rem 1rem; align-items: center; padding: 0.55rem 0; border-bottom: 1px solid var(--lp-ink-line); }
.lp-rows li:last-child { border-bottom: 0; }
@media (max-width: 40rem) { .lp-rows li { grid-template-columns: 1fr auto; } .lp-rows li .muted { grid-column: 1 / -1; } }
.lp-snippet { background: var(--paper); border-radius: var(--radius); padding: 0.9rem 1rem; }
.lp-snippet > * + * { margin-top: 0.6rem; }
.lp-snippet-item { padding: 0.5rem 0.7rem; background: var(--card); border-left: 3px solid var(--tag); }

/* Items demo */
.lp-chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.lp-chip-row .chip { font: inherit; font-size: 0.875rem; cursor: pointer; }
.lp-chip-row .chip[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.lp-demo .table-scroll { min-height: 12.5rem; } /* the card keeps its size when a filter hides rows */
.lp-mini-table tbody tr { transition: opacity 200ms; }
.lp-mini-table tbody tr[hidden] { display: none; }
.lp-edit { font: inherit; font-weight: 600; color: inherit; background: transparent; border: 0; cursor: text; }
.lp-edit .lp-edit-input { width: 5.5rem; min-height: 1.9rem; padding: 0.15rem 0.4rem; text-align: right; font: inherit; }
.lp-sort { font: inherit; font-weight: 600; font-size: 0.8rem; color: var(--ink-soft); background: transparent; border: 0; cursor: pointer; padding: 0; }
.lp-sort:hover { color: var(--ink); text-decoration: underline; }
.lp-margin { font-weight: 700; }
.lp-margin.is-updated { animation: lp-pop 360ms ease-out; }

/* Dashboard demo */
.lp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 0.8rem; }
.lp-stats dt { font-size: 0.85rem; color: var(--ink-soft); }
.lp-stats dd { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); font-weight: 700; letter-spacing: -0.03em; }
.lp-lenses { display: grid; gap: 0.55rem; }
.lp-lenses li { display: grid; grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr) 5rem; gap: 0.8rem; align-items: center; font-size: 0.9rem; }
.lp-lenses strong { text-align: right; }
@media (max-width: 40rem) { .lp-lenses li { grid-template-columns: 1fr auto; } .lp-lenses .lp-bar-track { grid-column: 1 / -1; order: 3; } }
.lp-bar-track { display: block; height: 0.9rem; background: var(--paper); border-radius: 3px; overflow: hidden; }
.lp-bar-fill { display: block; height: 100%; width: 0; background: var(--live); border-radius: 3px; transition: width 900ms cubic-bezier(0.2, 0.7, 0.2, 1); }

/* Also built in -------------------------------------------------------------------------------- */

.lp-more { padding-block: clamp(3.5rem, 7vw, 6rem); }
.lp-more-list { margin-top: 2rem; display: grid; gap: 1.1rem 3rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 52rem) { .lp-more-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lp-more-list li { padding-top: 0.9rem; border-top: 1px solid var(--line-3); line-height: 1.5; max-width: 36rem; }
.lp-more-list strong { font-weight: 700; }

.lp-final { background: var(--tag); padding-block: clamp(3rem, 6vw, 5rem); }
.lp-final-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.lp-final h2 { font-size: clamp(2rem, 1.3rem + 3vw, 3.6rem); line-height: 1; font-weight: 700; letter-spacing: -0.035em; }
.lp-cta-ink { background: var(--ink); color: var(--card); border-color: var(--ink); }
.lp-cta-ink:hover { background: oklch(0.27 0.014 135); color: var(--card); }
.lp-foot { padding-block: 1.5rem 2.5rem; color: var(--ink-soft); }

/* Motion is decoration here, so it goes when asked ----------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .lp { scroll-behavior: auto; }
  .lp-hang, .lp-hero-copy > *, .lp-caret { animation: none !important; }
  [data-lp-typing-target="row"] { opacity: 1; transform: none; }
  .lp-bar-fill, .lp-shares .stack-bars span { transition: none; }
}

/* Short sections, with the detail behind a Read more ------------------------------------------------ */

.lp-hero-copy h1 span { display: block; }
.lp-hero-copy h1 { font-size: clamp(2.2rem, 1.2rem + 3.4vw, 4rem); max-width: none; line-height: 1.04; }
.lp-aim { margin-top: 0.8rem; font-weight: 600; color: var(--ink); }

.lp-pillar { padding-block: clamp(3rem, 6vw, 5rem); }
.lp-pillar-grid { display: grid; gap: 1.75rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 56rem) { .lp-pillar-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 4rem; } }
.lp-pillar .lp-text h2 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.5rem); }
.lp-pillar-facts { margin-top: 0; max-width: none; padding: 1.1rem 1.25rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.lp-pillar-facts li { font-weight: 600; }

.lp-read { margin-top: 2rem; }
.lp-read > summary { display: inline-flex; align-items: center; gap: 0.5rem; height: 2.4rem; padding: 0 1rem; list-style: none; cursor: pointer; font-weight: 700; font-size: 0.95rem; color: var(--acc-text); background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); }
.lp-read > summary::-webkit-details-marker { display: none; }
.lp-read > summary::after { content: "▾"; font-size: 0.8em; }
.lp-read[open] > summary::after { content: "▴"; }
.lp-read > summary:hover { background: var(--sunk); }
.lp-read-less, .lp-read[open] .lp-read-more { display: none; }
.lp-read[open] .lp-read-less { display: inline; }
.lp-read[open] > summary { margin-bottom: 0.5rem; }
.lp-read .lp-chapter { padding-block: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--line-2); }
.lp-read .lp-chapter-tint { background: transparent; }
.lp-read .lp-wrap { padding-inline: 0; }
.lp-read .lp-more-list { margin-top: 1.5rem; }

.lp-more-lede { margin-top: 0.75rem; max-width: 36rem; color: var(--ink-soft); }
.lp-more .lp-read { margin-top: 1.25rem; }
