/*
 * miplann landing page.
 *
 * The same ground as the app, not a brochure about it. Clicking through should
 * feel like walking further into the same place — same near-black, same ice
 * blue, same type. A bright marketing page that opens into a dark app always
 * reads as two products.
 *
 * Apple's page grammar — huge tight headlines, short centred lines, generous
 * space, filled/outlined pill buttons — but their pages are mostly photography,
 * and we have none. So the product shot is the product: a live, running copy of
 * the app in the hero, and the two features that make it different are things
 * you press rather than things you read about.
 */

:root {
  --bg: #0b1219;
  --bg-alt: #101a23;
  --surface: #16212c;
  --ink: #e9f2f9;
  --ink-2: #8ba1b4;
  --line: #24313e;
  --accent: #58c8f0;
  --accent-press: #74d4f5;
  --on-accent: #05202c;

  --dark-bg: #070c11;
  --dark-surface: #131c25;
  --dark-line: #22303c;
  --dark-ink: #e9f2f9;
  --dark-ink-2: #8ba1b4;
  --dark-accent: #58c8f0;

  --radius: 18px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.47 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.035em; line-height: 1.07; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; }

/* ------------------------------------------------------------------ nav -- */

.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 48px; padding: 0 22px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; font-size: 17px; }
/* A wordmark, set properly. The only styling it needs is the right typeface,
   tight tracking and enough weight to hold its own. */
.wordmark {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, 'Segoe UI', sans-serif;
  font-weight: 600; letter-spacing: -0.03em; text-transform: lowercase;
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px;
  border: 1px solid transparent; border-radius: 980px;
  font-size: 16px; font-weight: 400; letter-spacing: -0.01em; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .12s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-press); }
.btn-ghost { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-ghost:hover { background: var(--accent); color: var(--on-accent); }
.btn-sm { min-height: 32px; padding: 0 15px; font-size: 14px; }
.btn-lg { min-height: 50px; padding: 0 28px; font-size: 17px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px; }

.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.centred .actions, .centred-actions { justify-content: center; }

/* --------------------------------------------------------------- layout -- */

section { padding: clamp(64px, 9vw, 112px) 22px; }
.inner { max-width: 1040px; margin: 0 auto; }
.centred { text-align: center; }
.band { background: var(--bg-alt); }

.band-dark {
  background:
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 62%),
    var(--dark-bg);
  color: var(--dark-ink);
}
.band-dark .section-sub, .band-dark .feature p, .band-dark .stat span { color: var(--dark-ink-2); }
.band-dark .feature { background: var(--dark-surface); border-color: var(--dark-line); }
.band-dark .btn-ghost { border-color: var(--dark-accent); color: var(--dark-accent); }
.band-dark .btn-ghost:hover { background: var(--dark-accent); color: #04202b; }

.section-head { font-size: clamp(30px, 5vw, 50px); margin-bottom: 16px; }
.section-sub {
  font-size: clamp(17px, 1.9vw, 20px); color: var(--ink-2);
  max-width: 54ch; margin: 0 auto; letter-spacing: -0.015em;
}

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

.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(78% 62% at 22% -8%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 66%),
    radial-gradient(64% 54% at 88% 8%, color-mix(in srgb, #7b6bf0 13%, transparent), transparent 64%),
    var(--bg);
  padding-top: clamp(48px, 7vw, 84px);
}
.hero-grid {
  display: grid; gap: clamp(36px, 6vw, 64px); align-items: center;
  grid-template-columns: 1.05fr .95fr;
}
.hero h1 { font-size: clamp(36px, 5.2vw, 62px); margin-bottom: 20px; }
.hero em { color: var(--accent); }
.lede {
  font-size: clamp(17px, 1.8vw, 21px); line-height: 1.45;
  color: var(--ink-2); max-width: 40ch; margin-bottom: 28px; letter-spacing: -0.015em;
}
.micro { margin-top: 18px; font-size: 13px; color: var(--ink-2); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero .lede { margin-left: auto; margin-right: auto; }
  .hero .actions { justify-content: center; }
}

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

.hero-phone { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.phone {
  width: min(300px, 78vw);
  aspect-ratio: 9 / 19.2;
  padding: 11px;
  border-radius: 46px;
  background: linear-gradient(160deg, #3a3f46, #16191d 55%, #303539);
  box-shadow:
    0 2px 3px rgba(0, 0, 0, .3),
    0 30px 60px -20px rgba(0, 0, 0, .45),
    inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.phone-screen {
  height: 100%; border-radius: 36px; overflow: hidden;
  background: radial-gradient(120% 60% at 50% -10%, rgba(88, 200, 240, .09), transparent 70%), #0d151d;
  color: #e9f2f9;
  display: flex; flex-direction: column; gap: 10px;
  padding: 26px 14px 16px;
}
.app-bar { font-size: 19px; font-weight: 600; letter-spacing: -0.03em; padding: 0 4px 4px; }
.app-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 18px 12px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #1e2b38, #16212c);
  border: 1px solid #29394a;
}
.app-name { font-size: 15px; font-weight: 600; margin-top: 6px; }
.app-sub { font-size: 12px; color: #8ba1b4; }
.app-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pill {
  display: grid; place-items: center; height: 38px; border-radius: 11px;
  font-size: 13px; font-weight: 600;
  background: #1e2b38; border: 1px solid #29394a; color: #e9f2f9;
}
.pill-fill { background: #58c8f0; border-color: #58c8f0; color: #04202b; }
.app-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.app-tiles div {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 10px 4px; border-radius: 12px;
  background: #16212c; border: 1px solid #29394a;
}
.app-tiles strong { font-size: 14px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.app-tiles span { font-size: 9.5px; color: #8ba1b4; }
.phone-note { font-size: 13px; color: var(--ink-2); }

/* ----------------------------------------------------------------- ring -- */

.ring-wrap { position: relative; display: grid; place-items: center; --mix: 100%; }
.ring { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255, 255, 255, .09); }
.ring-value {
  fill: none;
  stroke: color-mix(in srgb, var(--dark-accent) var(--mix), #6b7c8a);
  transition: stroke-dasharray .5s var(--ease), stroke .5s var(--ease);
}
.ring-centre {
  position: absolute; display: flex; flex-direction: column; align-items: center;
  color: #e9f2f9;
}
.ring-centre strong {
  font-size: 44px; font-weight: 600; letter-spacing: -0.05em; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, #e9f2f9 var(--mix), #7c8b98);
}
.ring-centre span { font-size: 11.5px; color: #8ba1b4; margin-top: 3px; }
.ring-clock { font-variant-numeric: tabular-nums; color: var(--dark-accent) !important; font-size: 11px !important; }

/* ----------------------------------------------------------- slip demo -- */

.demo {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(28px, 5vw, 56px);
  align-items: center; justify-content: center;
  max-width: 720px; margin: 52px auto 0; text-align: left;
}
.demo-side { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.demo-total strong {
  display: block; font-size: 52px; font-weight: 600; letter-spacing: -0.045em;
  line-height: 1; color: var(--dark-accent); font-variant-numeric: tabular-nums;
}
.demo-total span { display: block; margin-top: 8px; font-size: 14px; color: var(--dark-ink-2); max-width: 26ch; }
.demo-state { font-size: 15px; color: var(--dark-ink); min-height: 3em; max-width: 30ch; }
.demo-note { font-size: 12.5px; color: var(--dark-ink-2); }
@media (max-width: 700px) {
  .demo { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .demo-side { align-items: center; }
  .demo-total span, .demo-state { margin-inline: auto; }
}

/* --------------------------------------------------------- target slider -- */

.target {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(28px, 5vw, 56px);
  align-items: center; justify-content: center;
  max-width: 680px; margin: 48px auto 0;
}
.target .ring-track { stroke: rgba(255, 255, 255, .08); }
.target .ring-value { stroke: var(--accent); }
.target .ring-centre strong { color: var(--ink); }
.target .ring-centre span { color: var(--ink-2); }
.target-controls { display: flex; flex-direction: column; gap: 16px; }
#target-slider { width: 100%; accent-color: var(--accent); height: 28px; }
.target-label { font-size: 18px; color: var(--ink-2); letter-spacing: -0.015em; }
@media (max-width: 700px) { .target { grid-template-columns: 1fr; justify-items: center; } }

/* ---------------------------------------------------------------- stats -- */

.stat-band {
  display: grid; gap: 34px; margin-top: 46px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.stat strong {
  display: block; font-size: clamp(32px, 4.8vw, 50px); font-weight: 600;
  letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums;
}
.stat span { display: block; margin-top: 8px; font-size: 14.5px; color: var(--ink-2); }

/* -------------------------------------------------------------- features -- */

.features {
  display: grid; gap: 20px; margin-top: 48px; text-align: left;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.feature {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 70%, var(--bg)), var(--bg));
  border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 28px;
}
.feature h3 { font-size: 21px; margin-bottom: 10px; letter-spacing: -0.025em; }
.feature p { font-size: 15.5px; color: var(--ink-2); line-height: 1.55; }

/* -------------------------------------------------------------- install -- */

.steps {
  display: grid; gap: 20px; margin-top: 44px; text-align: left;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.steps article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.steps h3 { font-size: 19px; margin-bottom: 12px; letter-spacing: -0.025em; }
.steps ol { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 15px; line-height: 1.7; }
.steps strong { color: var(--ink); font-weight: 600; }

footer {
  padding: 34px 22px calc(34px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-alt); border-top: 1px solid var(--line); text-align: center;
}
footer p { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }

/* --------------------------------------------------------------- reveal -- */
/*
 * Progressive enhancement, the hard way round. These used to be opacity:0 and
 * revealed by script — so when the script was blocked the whole page rendered
 * blank. Content is visible by default now, and the script adds .js to the root
 * to opt in to animating. No script, no animation, but the page still reads.
 */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal:nth-child(2) { transition-delay: .06s; }
.js .reveal:nth-child(3) { transition-delay: .12s; }
.js .reveal:nth-child(4) { transition-delay: .18s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
