/* Planora home page. Builds on the tokens and components in styles.css (sheet, quick, task-row,
   ribbon, flaps, hbars, seg) so the tour looks exactly like the app it is showing.

   Motion has one voice: things land like a stamp on paper. They drop a few pixels with a slight
   overshoot and their hard shadow appears under them. Loops (the day ribbon, ticker, focus timer)
   pause when off screen, and none of them run with reduced motion. */

:root { --gutter: clamp(16px, 4vw, 48px); --land: cubic-bezier(0.25, 1.35, 0.5, 1); --out: cubic-bezier(0.2, 0.8, 0.2, 1); }
body.lp { overflow-x: clip; }
.lp-wrap { width: min(1200px, calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.touch-only { display: none; }
@media (pointer: coarse) { .touch-only { display: inline; } }

/* Shared keyframes. `translate` is used instead of `transform` so these never fight a component's own transform. */
@keyframes lp-rise { from { opacity: 0; translate: 0 0.4em; } }
@keyframes lp-drop { from { opacity: 0; translate: 0 -14px; } }
@keyframes lp-stamp { from { opacity: 0; translate: 6px 10px; } }
@keyframes lp-swap { from { opacity: 0; translate: 0 6px; } }
@keyframes lp-draw { to { stroke-dashoffset: 0; } }

/* ---------- Top bar ---------- */
.lp-top {
  position: sticky; top: 0; z-index: 20;
  border-bottom: 2px solid transparent;
  transition: background-color 0.2s, border-color 0.2s;
}
.lp-top.scrolled { background: var(--ground); border-color: var(--edge); }
.lp-top-in { display: flex; align-items: center; gap: 8px; height: 64px; }
.lp-top .brand { padding: 0; margin-right: auto; }
.lp-nav { display: flex; gap: 4px; margin-right: 10px; }
.lp-nav a {
  position: relative; padding: 8px 10px; font-size: 14px; font-weight: 550; color: var(--ink-2); text-decoration: none;
}
/* The underline is drawn from the left on hover, like a pen stroke */
.lp-nav a::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 4px; height: 2px; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform 0.25s var(--out);
}
.lp-nav a:hover { color: var(--ink); }
@media (hover: hover) { .lp-nav a:hover::after { transform: scaleX(1); } }

/* Arrow icons in buttons lean forward on hover */
.btn .ic { transition: translate 0.2s var(--out); }
@media (hover: hover) { .btn:hover .ic:last-child:not(:first-child) { translate: 3px 0; } }

/* ---------- Hero ---------- */
.lp-hero {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: end; gap: 28px 56px;
  padding-block: clamp(36px, 7vw, 96px) 40px;
}
.lp-title {
  font-size: clamp(2.7rem, 1.1rem + 5.4vw, 5.8rem); font-weight: 850; font-stretch: var(--wide);
  line-height: 0.96; letter-spacing: -0.035em;
}
.lp-title .w { display: inline-block; }
.js .lp-title .w { animation: lp-rise 0.7s var(--out) backwards; animation-delay: calc(var(--i) * 55ms + 80ms); }
.lp-mark { position: relative; display: inline-block; white-space: nowrap; }
.lp-scribble {
  position: absolute; left: -2%; bottom: -0.16em; width: 104%; height: 0.24em; overflow: visible;
  fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 310; stroke-dashoffset: 310; animation: lp-draw 0.8s 0.8s cubic-bezier(0.6, 0, 0.3, 1) forwards;
}
.lp-hero-side { display: grid; gap: 18px; padding-bottom: 6px; }
.js .lp-hero-side > * { animation: lp-rise 0.6s var(--out) backwards; }
.js .lp-hero-side > :nth-child(2) { animation-delay: 0.45s; }
.js .lp-hero-side > :nth-child(1) { animation-delay: 0.35s; }
.js .lp-hero-side > :nth-child(3) { animation-delay: 0.55s; }
.lp-lede { max-width: 46ch; font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.lp-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* The sample day */
.lp-board {
  --sx: 0px; --sy: 0px;
  padding: 18px 22px 16px;
  box-shadow: calc(8px + var(--sx)) calc(8px + var(--sy)) 0 var(--drop);
  transition: box-shadow 0.25s var(--out);
}
.js .lp-board { animation: lp-stamp 0.6s 0.25s var(--land) backwards; }
.lp-board-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.lp-board-day { font-size: 1.6rem; font-weight: 800; font-stretch: var(--wide); letter-spacing: -0.02em; }
.lp-board-tools { display: flex; align-items: center; gap: 10px; }
.lp-clock { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.5rem); font-weight: 800; line-height: 1; }
.lp-ribbon-scroll { overflow-x: auto; margin: 0 -6px; padding: 4px 6px 8px; scrollbar-width: thin; }
.lp-ribbon { min-width: 640px; user-select: none; -webkit-user-select: none; }
@media (pointer: fine) { .lp-ribbon { cursor: ew-resize; } }
.lp-ribbon .rb { transition: translate 0.2s var(--out), box-shadow 0.2s var(--out), background-color 0.2s; }
.js .lp-ribbon .rb, .js .lp-ribbon .rb-pin { animation: lp-drop 0.5s var(--land) backwards; animation-delay: calc(var(--n) * 70ms + 450ms); }
.lp-ribbon .rb.is-now { translate: -1px -2px; box-shadow: 3px 4px 0 var(--sub-edge); background-color: color-mix(in oklab, var(--sub) 30%, var(--paper)); }
.lp-ribbon .rb-pin { transition: color 0.2s; }
.lp-ribbon .rb-pin.is-past { color: var(--ink-3); border-color: var(--rule-strong); }

/* The yellow "now" marker can be dragged; its hit area is wider than it looks */
.lp-now { left: 0; z-index: 3; pointer-events: auto; cursor: grab; touch-action: none; opacity: 0.85; will-change: transform; }
.lp-now::after { content: ""; position: absolute; inset: -18px -14px 0; }
.lp-now span { transition: scale 0.15s var(--out); }
.lp-board.dragging .lp-now { cursor: grabbing; opacity: 1; }
.lp-board.dragging .lp-now span, .lp-now:focus-visible span { scale: 1.15; }
.lp-now:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lp-board.rewind .lp-now { transition: transform 0.6s var(--out); }
.js .lp-now { animation: lp-swap 0.4s 1.2s var(--out) backwards; }

.lp-readout { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin: 6px 0 0; padding-top: 12px; border-top: 1px dashed var(--rule); }
.lp-readout dt { font-size: 12.5px; color: var(--ink-3); }
.lp-readout dd { margin: 2px 0 0; font-weight: 650; font-size: 15px; }
.lp-readout dd.swap { animation: lp-swap 0.25s var(--out); }

/* ---------- Ticker ---------- */
.lp-ticker { margin-top: clamp(48px, 7vw, 88px); padding: 14px 0 16px; overflow: hidden; background: var(--paper); border-block: 2px solid var(--edge); }
.lp-ticker-track { display: flex; width: max-content; animation: lp-ticker 55s linear infinite; }
@keyframes lp-ticker { to { transform: translateX(-50%); } }
@media (hover: hover) { .lp-ticker:hover .lp-ticker-track { animation-play-state: paused; } }
.lp-chip {
  display: inline-flex; align-items: center; gap: 9px; height: 42px; margin-right: 16px; padding: 0 16px 0 12px; white-space: nowrap;
  font-size: 15px; font-weight: 750; font-stretch: var(--semi-wide);
  background: var(--sub-soft); border: 2px solid var(--sub-edge); border-radius: var(--r); box-shadow: 3px 3px 0 var(--sub-edge);
  rotate: -1.2deg;
}
.lp-chip:nth-child(even) { rotate: 1deg; }
.lp-chip i { width: 10px; height: 20px; border-radius: 2px; background: var(--sub); box-shadow: inset 0 0 0 1.5px var(--sub-edge); }

/* ---------- Sections ---------- */
.lp-section { padding-top: clamp(72px, 10vw, 128px); scroll-margin-top: 40px; }
.lp-section-head { display: grid; gap: 4px; margin-bottom: 32px; }
.lp-h2 {
  max-width: 19ch; font-size: clamp(1.95rem, 1.1rem + 2.8vw, 3.2rem); font-weight: 850; font-stretch: var(--wide);
  line-height: 1.02; letter-spacing: -0.03em; text-wrap: balance;
}
.js [data-reveal] { transition: opacity 0.6s var(--out), translate 0.6s var(--out); transition-delay: calc(var(--d, 0) * 110ms); }
.js [data-reveal]:not(.in) { opacity: 0; translate: 0 22px; }

/* ---------- Feature tour ---------- */
.lp-tour { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 28px; align-items: start; }
.lp-tour-tabs { display: grid; gap: 6px; }
.lp-tour-tabs button {
  position: relative; display: grid; gap: 0; padding: 14px 16px 16px; overflow: hidden; text-align: left;
  color: var(--ink-2); background: none; border: 2px solid transparent; border-radius: var(--r-lg);
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s var(--out), translate 0.2s var(--out), color 0.2s;
}
.lp-tour-tabs b { font-size: 1.08rem; font-weight: 750; font-stretch: var(--semi-wide); }
.lp-tour-tabs button > span {
  max-height: 0; opacity: 0; font-size: 14px; line-height: 1.45;
  transition: max-height 0.35s var(--out), opacity 0.25s, margin 0.35s var(--out);
}
.lp-tour-tabs button:hover { color: var(--ink); background: var(--paper-2); }
.lp-tour-tabs [aria-selected="true"] { color: var(--ink); background: var(--paper); border-color: var(--edge); box-shadow: var(--shadow); translate: -2px -2px; }
.lp-tour-tabs [aria-selected="true"] > span { max-height: 5em; opacity: 1; margin-top: 4px; color: var(--ink-2); }
.lp-tab-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.lp-tour.autoplay [aria-selected="true"] .lp-tab-bar { animation: lp-tab 8s linear forwards; }
.lp-tour.autoplay:hover .lp-tab-bar, .lp-tour.paused .lp-tab-bar { animation-play-state: paused !important; }
@keyframes lp-tab { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.lp-stage { min-height: 400px; padding: 22px; box-shadow: var(--lift-lg); }
.lp-demo.enter { animation: lp-stamp 0.4s var(--land); }
.lp-demo-hint { margin-top: 10px; }
.lp-demo-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.lp-list { list-style: none; margin: 14px 0 0; padding: 0; }
.lp-list .task-row { padding-right: 10px; }
.lp-list .task-row.drop { animation: lp-drop 0.5s var(--land); }

/* Quick add */
.lp-quick { margin-bottom: 0; }
.lp-quick .quick-preview { min-height: 36px; }
.lp-bit { display: inline-flex; align-items: center; gap: 5px; }
.lp-bit .inline { display: inline-flex; align-items: center; gap: 6px; }
.lp-quick .lp-bit { animation: lp-swap 0.25s var(--out) backwards; animation-delay: calc(var(--n) * 30ms); }
.lp-quick.ghost input { caret-color: transparent; }
.lp-quick.ghost .quick-ic { animation: lp-blink 1s steps(1) infinite; }
@keyframes lp-blink { 50% { opacity: 0.3; } }
.btn.pressed { animation: lp-press 0.22s ease-out; }
@keyframes lp-press { 40% { transform: translate(2px, 2px); box-shadow: none; } }

/* Tasks */
.lp-progress { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; margin-bottom: 10px; font-size: 14px; font-weight: 650; }
.lp-progress-bar { height: 12px; background: var(--paper-2); border: 1.5px solid var(--edge); border-radius: 3px; overflow: hidden; }
.lp-progress-bar i { display: block; height: 100%; background: var(--ink); transform-origin: left; transition: transform 0.5s var(--land); }
.lp-list .task-name { position: relative; }

/* Study planner week */
.lp-week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.lp-day {
  display: grid; grid-template-rows: auto auto 1fr; gap: 8px; min-height: 270px; padding: 10px 8px;
  background: var(--paper-2); border: 1.5px solid var(--rule-strong); border-radius: var(--r);
}
.lp-day header b { font-size: 13px; font-weight: 700; }
.lp-day.is-today header b { padding: 1px 6px; color: var(--hl-ink); background: var(--hl); border-radius: 3px; }
.lp-wk-dues { display: grid; gap: 4px; }
.lp-due { padding-left: 7px; font-size: 12px; font-weight: 650; border-left: 2px solid var(--ink); }
.lp-wk-blocks { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.lp-wk-block {
  display: grid; align-content: center; gap: 0; height: calc(var(--h) * 38px); min-height: 34px; padding: 4px 7px; overflow: hidden;
  font-size: 12.5px; line-height: 1.2; border: 1.5px dashed var(--sub-edge); border-radius: 3px;
}
.lp-wk-block b, .lp-wk-block small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-wk-block small { color: var(--ink-2); font-stretch: var(--narrow); }
.lp-wk-block.drop { animation: lp-drop 0.5s var(--land) backwards; animation-delay: calc(var(--n) * 80ms); }

/* Focus */
.lp-focus { display: grid; gap: 18px; padding-top: 6px; }
.lp-focus-sub { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.lp-focus-note { margin-left: auto; }

/* Grades */
.lp-term { margin-bottom: 18px; }
.lp-bars .hbars { gap: 12px; }
.lp-bars .hbars li { grid-template-columns: 140px minmax(0, 1fr) 82px; }
.lp-bars .hb-track { height: 18px; }
.lp-bars .hb-track i { transform: scaleX(0); transform-origin: left; transition: transform 0.7s var(--out); transition-delay: calc(var(--n) * 50ms); }
.lp-bars b { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; font-size: 15px; }
.lp-delta { font-size: 12px; font-weight: 600; }
.lp-delta.up { color: var(--ok); }
.lp-delta.down { color: var(--ink-3); }

/* ---------- How it works ---------- */
.lp-steps { position: relative; --p: 0; }
.lp-steps ol { position: relative; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin: 0; padding: 0; }
.lp-steps-track { position: absolute; left: 0; right: 0; top: 30px; height: 3px; background: var(--rule); }
.lp-steps-track i { display: block; height: 100%; background: var(--ink); transform: scaleX(var(--p)); transform-origin: left; }
.lp-step-n { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.lp-steps h3 { margin: 18px 0 6px; font-size: 1.3rem; font-weight: 800; font-stretch: var(--semi-wide); letter-spacing: -0.01em; }
.lp-steps p { max-width: 34ch; color: var(--ink-2); }

/* ---------- Keyboard ---------- */
.lp-keyboard { display: grid; gap: 22px; }
.lp-caps { display: flex; flex-wrap: wrap; gap: 14px; }
.lp-cap {
  display: grid; justify-items: start; gap: 6px; min-width: 112px; padding: 14px 16px 12px; text-align: left;
  color: var(--ink); background: var(--paper); border: 2px solid var(--edge); border-radius: var(--r-lg);
  box-shadow: 0 5px 0 var(--drop);
  transition: translate 0.08s ease-out, box-shadow 0.08s ease-out, background-color 0.2s;
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.lp-cap.wide { min-width: 160px; }
.lp-cap kbd { padding: 0; font-family: inherit; font-size: 1.7rem; font-weight: 800; line-height: 1; color: inherit; background: none; border: 0; box-shadow: none; }
.lp-cap span { font-size: 13px; color: var(--ink-2); }
@media (hover: hover) { .lp-cap:hover { translate: 0 -1px; box-shadow: 0 6px 0 var(--drop); } }
.lp-cap.down { translate: 0 4px; box-shadow: 0 1px 0 var(--drop); }
.lp-cap.lit { background: var(--paper-2); }
.lp-says {
  display: flex; align-items: center; gap: 4px; min-height: 54px; padding: 12px 16px;
  font-size: 1.05rem; font-weight: 600; font-stretch: var(--narrow); color: var(--flap-ink);
  background: var(--flap); border: 2px solid var(--edge); border-radius: var(--r); box-shadow: var(--shadow);
}
.lp-says::after { content: ""; width: 0.55em; height: 1.1em; margin-left: 2px; background: currentColor; animation: lp-blink 1s steps(1) infinite; }
.lp-caret { opacity: 0.6; }

/* ---------- Closing band ---------- */
.lp-end { position: relative; overflow: hidden; margin-top: clamp(88px, 11vw, 150px); padding-block: clamp(64px, 9vw, 120px); color: var(--rail-ink); background: var(--rail); }
/* Exercise-book rules drifting up behind the text */
.lp-end-lines {
  position: absolute; inset: -32px 0 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 31px, color-mix(in oklab, var(--rail-ink) 9%, transparent) 31px 32px);
  animation: lp-lines 5s linear infinite;
}
.lp-end-lines::before { content: ""; position: absolute; top: 0; bottom: 0; left: clamp(24px, 9vw, 120px); width: 2px; background: color-mix(in oklab, var(--rail-ink) 14%, transparent); }
@keyframes lp-lines { to { transform: translateY(-32px); } }
.lp-end-in { position: relative; display: grid; gap: 28px; }
.lp-end-title { max-width: 14ch; font-size: clamp(2.3rem, 1.1rem + 4.4vw, 4.8rem); font-weight: 850; font-stretch: var(--wide); line-height: 0.98; letter-spacing: -0.035em; }
.lp-end-btn { color: var(--rail); background: var(--rail-ink); border-color: var(--rail-ink); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45); }
@media (hover: hover) { .lp-end-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.45); } }
.lp-end-btn:active { transform: translate(3px, 3px); box-shadow: none; }
.lp-end-link { color: var(--rail-ink-2); font-weight: 600; }
.lp-end-link:hover { color: var(--rail-ink); }

.lp-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 26px 0 40px; font-size: 13.5px; color: var(--ink-3); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .lp-tour { grid-template-columns: minmax(0, 1fr); }
  .lp-tour-tabs { display: flex; gap: 8px; overflow-x: auto; margin: -4px -6px 0; padding: 4px 6px 8px; scrollbar-width: none; }
  .lp-tour-tabs button { flex: none; padding: 10px 14px 12px; }
  .lp-tour-tabs b { font-size: 15px; }
  .lp-tour-tabs button > span { display: none; }
}

@media (max-width: 860px) {
  .lp-nav { display: none; }
  .lp-hero { grid-template-columns: minmax(0, 1fr); padding-top: 28px; }
  .lp-steps ol { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .lp-steps-track { top: 0; bottom: 0; left: 21px; right: auto; width: 3px; height: auto; }
  .lp-steps-track i { height: 100%; width: 100%; transform: scaleY(var(--p)); transform-origin: top; }
  .lp-steps li { position: relative; padding-left: 68px; min-height: 52px; }
  .lp-step-n { position: absolute; left: 0; top: 0; }
  .lp-steps h3 { margin-top: 4px; }
}

@media (max-width: 640px) {
  .lp-board { padding: 14px 14px 12px; }
  .lp-board-day { font-size: 1.3rem; }
  .lp-readout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .lp-stage { min-height: 0; padding: 16px 14px; }
  .lp-week { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .lp-day { grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto; gap: 4px 8px; min-height: 0; padding: 8px; }
  .lp-day header { grid-row: span 2; align-self: center; }
  .lp-wk-dues { grid-auto-flow: column; justify-content: start; gap: 10px; }
  .lp-wk-dues:empty { display: none; }
  .lp-wk-blocks { flex-direction: row; justify-content: flex-start; }
  .lp-wk-block { flex: var(--h) 1 0; height: 40px; min-width: 0; }
  .lp-bars .hbars li { grid-template-columns: 104px minmax(0, 1fr) 70px; gap: 8px; }
  .lp-bars .tag { overflow: hidden; text-overflow: ellipsis; }
  .lp-focus-note { margin-left: 0; }
  .lp-cap, .lp-cap.wide { min-width: 0; flex: 1 1 calc(33% - 14px); }
}

@media (max-width: 480px) {
  .lp-signin { display: none; }
  .lp-top .btn.primary { height: 36px; padding: 0 12px; font-size: 13.5px; }
  .lp-cta .btn { flex: 1 1 100%; }
  .lp-cap, .lp-cap.wide { flex-basis: calc(50% - 14px); }
}

@media (prefers-reduced-motion: reduce) {
  .lp-scribble { stroke-dashoffset: 0; }
  .lp-ticker-track, .lp-end-lines { animation: none; }
  .js [data-reveal]:not(.in) { opacity: 1; translate: none; }
}

.lp-phone {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; margin-left: 4px;
  font: inherit; font-weight: 600; color: var(--ink); background: none; border: 0; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px;
}
.lp-phone .ic { width: 15px; height: 15px; }
@media (hover: hover) { .lp-phone:hover { text-decoration-color: var(--ink); } }

.lp-gone { margin-top: 16px; padding: 12px 16px; font-weight: 600; background: var(--paper-2); border: 2px solid var(--edge); border-radius: var(--r); box-shadow: var(--shadow-sm); }

.lp-foot a { display: inline-flex; align-items: center; min-height: 32px; }
