/*
 * The landing page (PLAN.md U7), after `LOF Landing.dc.html` and `landing-desktop`.
 * Every colour is a token from tokens.css; nothing here is the app's.
 *
 * The phone-width layout is not in the handoff (it was never screenshotted), so
 * it is derived in the same family and recorded as a departure: below 720px the
 * week card goes and the phone stands alone, the header drops its subtitle, and
 * the four points stack.
 */

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(60% 50% at 78% 30%, var(--lp-fallback-b), transparent 70%),
    radial-gradient(70% 60% at 20% 80%, var(--lp-fallback-a), transparent 70%), var(--lp-bg);
  background-attachment: fixed;
  color: var(--lp-ink);
  font-family: var(--lp-font-ui);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--lp-ink);
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--lp-focus);
  outline-offset: 3px;
}

/* The moving gradient: a fixed canvas behind the page. Without WebGL it is never made, and the body's own gradient shows. */
.lp-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.lp-page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px clamp(20px, 4vw, 48px) 48px;
  overflow: hidden;
}

/* ---- Glass ---- */

.lp-glass {
  background: var(--lp-panel-bg);
  border: 1px solid var(--lp-panel-border);
  box-shadow: var(--lp-panel-shadow);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  backdrop-filter: blur(30px) saturate(160%);
}

.lp-pill,
.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  background: var(--lp-btn-bg);
  border: 1px solid var(--lp-btn-border);
  box-shadow: var(--lp-btn-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  color: var(--lp-ink-strong);
  font: 500 14px/1 var(--lp-font-ui);
  white-space: nowrap;
}

.lp-pill {
  padding: 0 20px;
}

.lp-btn {
  padding: 0 28px;
  min-height: 52px;
  font-size: 16px;
}

.lp-pill:hover,
.lp-btn:hover {
  background: var(--lp-btn-bg-hover);
  color: #fff;
}

.lp-btn--quiet {
  background: var(--lp-btn2-bg);
  border-color: var(--lp-btn2-border);
  box-shadow: var(--lp-btn2-shadow);
  color: var(--lp-ink-secondary);
}

.lp-btn--quiet:hover {
  background: var(--lp-btn2-bg-hover);
}

/* ---- Header ---- */

.lp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.lp-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.lp-wordmark {
  font: 600 27px/1 var(--lp-font-display);
  letter-spacing: -0.02em;
}

.lp-brand-rule {
  width: 1px;
  height: 18px;
  background: var(--lp-hairline-strong);
}

.lp-brand-name {
  font: 500 10.5px/1.2 var(--lp-font-ui);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lp-ink-muted);
}

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

.lp-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: clamp(64px, 10vw, 120px) 0 clamp(48px, 6vw, 72px);
  text-align: center;
}

.lp-title {
  max-width: 880px;
  margin: 0;
  font: 500 clamp(46px, 7.4vw, 92px) / 0.98 var(--lp-font-display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lp-lede {
  max-width: 560px;
  margin: 0;
  font: 400 clamp(16px, 1.6vw, 19px) / 1.5 var(--lp-font-ui);
  color: var(--lp-ink-muted);
  text-wrap: pretty;
}

.lp-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding-top: 8px;
}

/* ---- The preview: a week card, and a phone over its right edge ---- */

.lp-preview {
  position: relative;
  margin-bottom: clamp(60px, 8vw, 110px);
  padding-right: clamp(0px, 6vw, 80px);
}

.lp-week {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: clamp(18px, 2.6vw, 30px);
  border-radius: 26px;
  overflow: hidden;
}

.lp-week-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.lp-week-title {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.lp-week-name {
  font: 500 clamp(26px, 3vw, 36px) / 1 var(--lp-font-display);
  letter-spacing: -0.02em;
}

.lp-week-dates {
  font: 400 13px/1 var(--lp-font-ui);
  color: var(--lp-ink-muted);
}

.lp-stats {
  display: flex;
  gap: 10px;
}

.lp-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 18px;
  background: var(--lp-card-bg);
  border: 1px solid var(--lp-panel-border);
  text-align: right;
}

.lp-stat-number {
  font: 500 30px/1 var(--lp-font-ui);
  font-variant-numeric: tabular-nums;
}

.lp-stat-number small {
  font-size: 16px;
}

.lp-stat-caption {
  font: 400 11.5px/1 var(--lp-font-ui);
  color: var(--lp-ink-muted);
}

.lp-stat--band {
  gap: 7px;
  min-width: 130px;
  background: var(--lp-band-bg);
  text-align: left;
}

.lp-stat-band {
  font: 600 10.5px/1 var(--lp-font-ui);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lp-band-label);
}

.lp-stat-guidance {
  font: 400 12.5px/1.3 var(--lp-font-ui);
  color: var(--lp-band-text);
}

.lp-grid {
  overflow: hidden;
  border-radius: 20px;
  background: var(--lp-well-bg);
  border: 1px solid var(--lp-well-border);
}

.lp-grid-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(7, minmax(28px, 54px));
  align-items: center;
  height: 48px;
  padding: 0 12px 0 18px;
  border-bottom: 1px solid rgba(242, 240, 234, 0.05);
}

.lp-grid-row:last-child {
  border-bottom: 0;
}

.lp-grid-row--head {
  height: 44px;
  border-bottom-color: var(--lp-hairline);
}

.lp-grid-label {
  font: 600 10.5px/1 var(--lp-font-ui);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lp-ink-muted);
  text-align: left;
}

.lp-grid-day {
  font: 500 12px/1 var(--lp-font-ui);
  color: var(--lp-ink-muted);
  text-align: center;
}

.lp-habit {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font: 500 14px/1.2 var(--lp-font-ui);
  text-align: left;
}

.lp-habit > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lp-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.lp-dot--1 {
  background: var(--lp-dot-1);
}
.lp-dot--2 {
  background: var(--lp-dot-2);
}
.lp-dot--3 {
  background: var(--lp-dot-3);
}
.lp-dot--4 {
  background: var(--lp-dot-4);
}
.lp-dot--5 {
  background: var(--lp-dot-5);
}
.lp-dot--6 {
  background: var(--lp-dot-6);
}
.lp-dot--7 {
  background: var(--lp-dot-7);
}

/* One cell, in the app's four states. The shapes carry the meaning, not the colour. */
.lp-cell {
  position: relative;
  display: grid;
  place-items: center;
  justify-self: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.lp-cell--target {
  background: var(--lp-ink);
}

.lp-cell--target::after {
  content: '';
  width: 5px;
  height: 10px;
  margin-top: -2px;
  border: solid var(--lp-on-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}

.lp-cell--floor {
  border: 1.5px solid var(--lp-ink);
  background: linear-gradient(to top, var(--lp-ink) 50%, var(--lp-cell-floor-bg) 50%);
}

.lp-cell--missed {
  border: 1.5px solid var(--lp-cell-missed-border);
  background: var(--lp-cell-missed-bg);
}

.lp-cell--notyet {
  border: 1.5px dashed var(--lp-cell-notyet-border);
}

/* ---- The phone ---- */

.lp-phone {
  position: absolute;
  right: 0;
  bottom: clamp(-60px, -4vw, -24px);
  width: clamp(170px, 23%, 250px);
  aspect-ratio: 9 / 18.5;
  padding: 8px;
  border-radius: 36px;
  background: var(--lp-phone-frame);
  border: 1px solid var(--lp-btn2-border);
  box-shadow: 0 40px 80px -24px rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}

.lp-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 14px 10px;
  overflow: hidden;
  border-radius: 29px;
  background: var(--lp-phone-screen);
  text-align: left;
}

.lp-screen-glow {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  pointer-events: none;
}

.lp-screen-glow::before,
.lp-screen-glow::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
}

.lp-screen-glow::before {
  width: 80%;
  height: 40%;
  left: -20%;
  top: -5%;
  background: var(--lp-phone-blob-a);
}

.lp-screen-glow::after {
  width: 70%;
  height: 40%;
  right: -25%;
  bottom: 10%;
  background: var(--lp-phone-blob-b);
}

.lp-screen > * {
  position: relative;
}

.lp-screen-glow {
  position: absolute;
}

.lp-screen-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 6px 4px 0;
}

.lp-screen-day {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lp-screen-name {
  font: 500 20px/1 var(--lp-font-display);
  letter-spacing: -0.02em;
}

.lp-screen-date {
  font: 400 9.5px/1 var(--lp-font-ui);
  color: var(--lp-ink-muted);
}

.lp-screen-score {
  font: 500 20px/1 var(--lp-font-ui);
  font-variant-numeric: tabular-nums;
}

.lp-screen-score small {
  font-size: 11px;
}

.lp-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 8px 6px;
  border-radius: 14px;
  background: var(--lp-panel-bg);
  border: 1px solid var(--lp-panel-border);
}

.lp-strip-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font: 500 8px/1 var(--lp-font-ui);
  color: var(--lp-ink-faint);
}

.lp-pip {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.lp-pip--full {
  background: var(--lp-ink);
}

.lp-pip--gap {
  border: 1.5px solid rgba(242, 240, 234, 0.45);
}

.lp-pip--today {
  background: var(--lp-ink);
  box-shadow:
    0 0 0 2.5px var(--lp-phone-screen),
    0 0 0 4px var(--lp-ink);
}

.lp-pip--future {
  border: 1.2px dashed rgba(242, 240, 234, 0.25);
}

.lp-screen-list {
  overflow: hidden;
  border-radius: 14px;
  background: var(--lp-panel-bg);
  border: 1px solid var(--lp-panel-border);
}

.lp-screen-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 30px;
  padding: 0 8px;
  border-top: 1px solid rgba(242, 240, 234, 0.05);
  font: 500 9.5px/1 var(--lp-font-ui);
}

.lp-screen-row:first-child {
  border-top: 0;
}

.lp-screen-row > span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.lp-screen-row .lp-dot {
  width: 5px;
  height: 5px;
}

.lp-screen-row .lp-cell {
  flex: none;
  width: 17px;
  height: 17px;
  border-radius: 5px;
}

.lp-screen-row .lp-cell--target::after {
  width: 3.5px;
  height: 7px;
  border-width: 0 1.6px 1.6px 0;
}

.lp-tabs {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 4px;
  border-radius: 18px;
  background: var(--lp-card-bg);
  border: 1px solid var(--lp-panel-border);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.lp-tab {
  padding: 7px 0;
  border-radius: 14px;
  font: 500 8px/1 var(--lp-font-ui);
  color: var(--lp-ink-muted);
  text-align: center;
}

.lp-tab--on {
  background: var(--lp-ink);
  color: var(--lp-on-ink);
}

/* ---- How it works ---- */

.lp-how {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(24px, 4vw, 48px);
  padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px);
  scroll-margin-top: 40px;
}

.lp-point {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lp-point h2 {
  margin: 0;
  font: 500 22px/1.15 var(--lp-font-display);
  letter-spacing: -0.01em;
}

.lp-point p {
  margin: 0;
  font: 400 14.5px/1.45 var(--lp-font-ui);
  color: var(--lp-ink-body);
  text-wrap: pretty;
}

/* ---- Footer ---- */

.lp-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(242, 240, 234, 0.08);
  font: 400 13px/1 var(--lp-font-ui);
  color: var(--lp-ink-faint);
}

.lp-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--lp-ink-muted);
}

/* ---- Phone width (derived: not in the handoff) ---- */

@media (max-width: 719px) {
  .lp-brand-name,
  .lp-brand-rule {
    display: none;
  }

  .lp-hero {
    padding-top: 56px;
  }

  .lp-preview {
    padding-right: 0;
    margin-bottom: 48px;
  }

  /* The week card does not fit a phone; the phone stands alone. */
  .lp-week {
    display: none;
  }

  .lp-phone {
    position: relative;
    right: auto;
    bottom: auto;
    width: min(260px, 72vw);
    margin: 0 auto;
  }
}

/* Reduce transparency, as the app's preference does: opaque panels, no blur. */
@media (prefers-reduced-transparency: reduce) {
  .lp-glass,
  .lp-pill,
  .lp-btn,
  .lp-phone,
  .lp-tabs {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .lp-glass,
  .lp-phone {
    background: var(--lp-solid);
  }
}

.lp-note {
  margin: 0;
  font: 400 13px/1 var(--lp-font-ui);
  color: var(--lp-ink-faint);
}
