/* WPMable landing page. Tokens and the plate shape come from app/ui.css.
   10-06: restyled to match the dashboard (Gus, 10-05: "take out all the bubbles"): flat plates with
   the cut top-right corner, square controls, Archivo with its wide cut for headings, no gradient type.
   10-27: anti-vibe pass (Gus's ANTI_VIBE_CODED rules): left-aligned hero and headings, one-colour headline,
   solid header, no glows, AA contrast (--fg3 lifted, dark ink on the blue button), reduced motion. */
:root { --lp-bg: #0a0d14; --lp-alt: #0d121b; }
html { scroll-padding-top: 70px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
/* --fg3 is 3.4:1 on the plates; the landing page's small print needs 4.5:1, so it gets a lighter step */
body.landing { --fg3: #7f8a9f; background: var(--lp-bg); font-size: 15px; overflow-x: hidden; }
::selection { background: var(--accent); color: var(--lp-bg); }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* header */
.nav { position: sticky; top: 0; z-index: 10; height: 60px; display: flex; align-items: center; gap: 22px; padding: 0 max(24px, calc((100vw - 1120px) / 2 + 24px));
  background: var(--lp-bg); box-shadow: inset 0 -1px 0 var(--line); }
.nav .logo { font-size: 19px; margin-right: auto; }
.nav .signin { color: var(--fg2); font-size: 14px; font-weight: 500; }
.nav .signin:hover { color: var(--fg); }
.nav a:focus-visible, footer a:focus-visible, .join-note a:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; }
/* the blue with white text is 3.2:1; dark ink on the same blue is 6.1:1 */
body.landing .btn.pri { color: var(--lp-bg); font-weight: 700; }
body.landing .btn.pri:focus-visible { box-shadow: inset 0 0 0 2px var(--lp-bg); }
.nav .btn { height: 36px; padding: 0 18px; font-size: 14px; }
.btn.xl { height: 50px; padding: 0 26px; font-size: 16px; --cut: 10px; }

/* hero: left-aligned, the headline in one colour, the email box right under it */
.hero { padding-top: 96px; }
.hero h1 { font: 800 clamp(42px, 6vw, 84px)/1.02 var(--display); font-stretch: var(--wide); letter-spacing: -.035em; margin: 0; max-width: 11em; text-wrap: balance; }
.lede { font-size: clamp(18px, 1.9vw, 22px); line-height: 1.45; color: var(--fg2); max-width: 31em; margin: 26px 0 0; text-wrap: pretty; }

/* the email box: makes your account or signs you in */
.join { width: min(560px, 100%); margin: 36px 0 0; }
.join-row { display: flex; gap: 8px; }
.join .field { flex: 1; min-width: 0; height: 50px; padding: 0 16px; font-size: 16px; border-radius: 0; }
.join-note { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--fg3); }
.join-note span { display: block; }
.join-note a { color: var(--fg2); text-decoration: underline; text-decoration-color: var(--line3); text-underline-offset: 2px; }
.join-err { margin: 10px 0 0; font-size: 14px; color: var(--red); }

/* screenshots in a flat frame */
.window { --cut: 18px; clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); background: var(--card); box-shadow: inset 0 0 0 1px var(--line2); }
.window .bar { height: 34px; display: flex; align-items: center; padding: 0 16px; box-shadow: inset 0 -1px 0 var(--line); }
.window .bar span { font-size: 12.5px; font-weight: 600; color: var(--fg3); }
.window img { display: block; width: 100%; height: auto; }
.hero-shot { margin: 72px 0 0; }

section { padding: 128px 0; }
.big { font: 800 clamp(32px, 4.4vw, 54px)/1.05 var(--display); font-stretch: var(--wide); letter-spacing: -.03em; margin: 0; max-width: 18em; text-wrap: balance; }
.sub { font-size: clamp(17px, 1.7vw, 20px); color: var(--fg2); margin: 18px 0 0; max-width: 34em; line-height: 1.45; text-wrap: pretty; }
.alt { background: var(--lp-alt); }

/* features: plates */
#features .grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 60px; }
.feature { --cut: 18px; --edge: var(--line2); clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  background: linear-gradient(225deg, var(--edge) calc(var(--cut) * .7071 + 1px), transparent 0), var(--card); box-shadow: inset 0 0 0 1px var(--edge); padding: 30px 30px 34px; min-width: 0; }
.feature .art { height: 96px; display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.feature .art.center { justify-content: center; height: auto; margin: 0; }
.feature h3 { font: 700 23px/1.15 var(--display); font-stretch: var(--wide); letter-spacing: -.02em; margin: 0 0 8px; }
.feature p { font-size: 16px; line-height: 1.5; color: var(--fg2); margin: 0; }
.feature.wide { grid-column: span 2; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 30px; padding: 40px 44px; }
.feature.wide h3 { font-size: 32px; }
.feature.wide p { font-size: 18px; }
.feature.dark { background: linear-gradient(225deg, var(--edge) calc(var(--cut) * .7071 + 1px), transparent 0), linear-gradient(160deg, #15213a, #0c121d 60%); }
.feature.wide3 { grid-column: 1 / -1; display: flex; align-items: center; gap: 30px; padding: 34px 44px; }
.feature.wide3 .art { margin: 0; height: auto; flex: none; }

/* daily goals */
.goal-art { width: min(100%, 360px); display: grid; gap: 18px; }
.goal-art div { display: grid; grid-template-columns: 1fr auto; align-items: baseline; row-gap: 8px; }
.goal-art span { color: var(--fg2); font-size: 15px; font-weight: 500; }
.goal-art b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--fg); }
.goal-art small { font-size: 14px; color: var(--fg3); font-weight: 500; }
.goal-art em { grid-column: 1 / -1; display: block; height: 8px; background: var(--fill2); overflow: hidden; }
.goal-art em i { display: block; height: 100%; background: var(--c); }

/* the meter, on a light page */
.mock-wall { width: 100%; height: 96px; display: grid; place-items: center; background: linear-gradient(135deg, #f1f0ec, #e2e8f0); }
.mock-hud { --cut: 10px; display: flex; align-items: center; gap: 9px; height: 48px; padding: 0 16px 0 8px; color: #f2f8ff;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); background: linear-gradient(180deg, #161e2e, #090d16); box-shadow: inset 0 0 0 1px var(--line3); }
.mock-hud b { font: 700 26px/1 var(--display); font-stretch: var(--wide); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.mock-hud .mg { width: 34px; height: 34px; overflow: visible; }
.mock-hud .mg .mt { fill: none; stroke: rgba(160, 200, 255, .28); stroke-width: 2.2; stroke-dasharray: .7 8.39; }
.mock-hud .mg .mr { fill: none; stroke: rgba(150, 180, 230, .14); stroke-width: 3; }
.mock-hud .mg .mv { fill: none; stroke: #5ee7ff; stroke-width: 3; }
.mock-hud .ms { display: flex; flex-direction: column; gap: 5px; }
.mock-hud .ms small { font-size: 12px; font-weight: 600; color: rgba(214, 226, 245, .62); line-height: 1; }
.mock-hud .meq { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.mock-hud .meq i { width: 3px; height: 16px; background: linear-gradient(180deg, #5ee7ff, var(--accent)); transform: scaleY(var(--h)); transform-origin: bottom; }

/* level */
.lvl-sq { width: 64px; height: 64px; flex: none; display: grid; place-items: center; font: 800 28px var(--display); font-stretch: var(--wide); color: var(--lp-bg); background: var(--accent);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); }
.lvl-txt { flex: 1; min-width: 0; }
.lvl-txt b { font-size: 17px; }
.lvl-txt .xp-bar { margin: 8px 0 5px; }
.lvl-txt small { color: var(--fg2); font-size: 13px; }
.art.medals > svg { margin-right: -18px; }
.art.medals > svg:nth-child(2) { transform: translateY(-6px); }

/* daily recap notification */
.mock-note { --cut: 10px; display: flex; gap: 11px; align-items: center; padding: 11px 14px 11px 11px; width: 100%;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); background: var(--card2); box-shadow: inset 0 0 0 1px var(--line2); }
.mock-note > span svg { width: 38px; height: 38px; display: block; }
.mock-note > div { flex: 1; min-width: 0; }
.mn-h { display: flex; justify-content: space-between; gap: 8px; }
.mn-h b { font-size: 13px; }
.mn-h time { font-size: 12px; color: var(--fg3); }
.mock-note p { margin: 1px 0 0; font-size: 12.5px; color: var(--fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* private */
.lock-art { width: 72px; height: 72px; display: grid; place-items: center; color: var(--fg); background: var(--fill2); box-shadow: inset 0 0 0 1px var(--line2);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
.lock-art svg { width: 32px; height: 32px; }

/* race your friends: a small board */
.feature.race { justify-content: space-between; }
.feature.race > div { max-width: 460px; }
.mock-board { list-style: none; margin: 0; padding: 0; width: min(100%, 440px); display: grid; gap: 6px; flex: none; }
.mock-board li { display: grid; grid-template-columns: 18px 30px 64px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 14px; background: var(--fill); font-size: 15px; }
.mock-board li.you { background: var(--accent-soft); }
.mb-p { color: var(--fg2); font-weight: 600; text-align: center; }
.mb-av { width: 30px; height: 30px; display: grid; place-items: center; color: var(--lp-bg); font-weight: 700; font-size: 14px; clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%); }
.mock-board em { height: 6px; background: var(--fill2); overflow: hidden; }
.mock-board em i { display: block; height: 100%; background: var(--accent); }
.mb-w { font: 700 18px var(--display); font-stretch: var(--wide); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mb-w small { font: 600 12px var(--font); color: var(--fg2); margin-left: 3px; letter-spacing: 0; }

.wide-shot { margin-top: 60px; }
.shots { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }

/* setup: three steps (a real sequence, so the numbers stay) */
.how { list-style: none; counter-reset: how; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 920px; margin: 40px 0 0; padding: 0; }
.how li { counter-increment: how; background: var(--card); padding: 20px 20px 18px; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); box-shadow: inset 0 0 0 1px var(--line2); }
.how li::before { content: counter(how); display: block; font: 700 26px var(--display); font-stretch: var(--wide); color: var(--accent2); margin-bottom: 8px; }
.how b { display: block; font-size: 17px; margin-bottom: 4px; }
.how span { color: var(--fg2); font-size: 14.5px; line-height: 1.45; }

footer { display: flex; align-items: center; gap: 22px; padding: 36px max(24px, calc((100vw - 1120px) / 2 + 24px)) 64px; color: var(--fg3); font-size: 13px; box-shadow: inset 0 1px 0 var(--line); }
footer a { color: var(--fg2); }
footer a:hover { color: var(--fg); }
footer .ks-brand { font-size: 15px; margin-right: 10px; }

@media (max-width: 900px) {
  #features .grid, .shots { grid-template-columns: minmax(0, 1fr); }
  .feature.wide, .feature.wide3 { grid-column: auto; grid-template-columns: minmax(0, 1fr); display: grid; padding: 30px; }
  section { padding: 88px 0; }
  .hero { padding-top: 64px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .nav { gap: 16px; padding: 0 16px; }
  footer { padding-left: 16px; padding-right: 16px; }
  .nav .signin { display: none; }
  .mock-board li { grid-template-columns: 18px 30px 52px minmax(0, 1fr) auto; padding: 8px 10px; gap: 8px; }
}
@media (max-width: 720px) { .how { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .join-row { flex-direction: column; }
  .join .field { flex: none; width: 100%; }
  .join .btn.xl { width: 100%; }
  .nav .logo .ks-name { display: none; }
}

/* phones (10-10): touch screens only, a mouse sees the page it always saw */
.phone-only { display: none; }
@media (pointer: coarse) {
  .phone-only { display: block; margin-top: 10px; font-size: clamp(16px, 4.2vw, 18px); color: var(--fg); }
  .nav .btn, .join-note a, footer a { min-height: 44px; display: inline-flex; align-items: center; }
  .nav .signin { display: inline-flex; align-items: center; min-height: 44px; } /* returning people: Sign In stays in the header on a phone */
  .nav { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  footer { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media (pointer: coarse) and (max-width: 520px) {
  /* 1440px screenshots shrunk to 361px cannot be read: the words and the plates say it better */
  .hero-shot, .wide-shot, .shots { display: none; }
  section { padding: 56px 0; }
  #features .grid { margin-top: 36px; }
}
@media (pointer: coarse) and (max-height: 520px) {
  /* landscape: the email box should be on the first screen */
  .nav { height: 44px; }
  .hero { padding-top: 22px; }
  .hero h1 { font-size: 34px; }
  .lede { margin-top: 10px; font-size: 16px; max-width: none; } /* full width: fewer lines, so the email box stays on screen */
  .phone-only { margin-top: 4px; font-size: 15px; }
  .join { margin-top: 14px; }
  html { scroll-padding-top: 54px; }
}
@media (pointer: coarse) and (max-width: 520px) and (max-height: 640px) {
  /* a small iPhone (SE): the email box and the button on the first screen */
  .hero { padding-top: 26px; }
  .hero h1 { font-size: 38px; }
  .lede { margin-top: 14px; font-size: 16px; }
  .phone-only { margin-top: 6px; font-size: 15px; }
  .join { margin-top: 16px; }
}

/* motion: honour the system setting (smooth scroll is already gated above) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
