/* MiniMe: "afternoon desk light". Kart's own colours set the palette:
   ink is his trousers, water blue is the habit he nags about most, sneaker
   yellow only ever appears in his speech bubble. */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --sky: #eaf1f7;
  --paper: #ffffff;
  --ink: #14213d;
  --slate: #5b6b82;
  --rule: #d3deea;
  --water: #1d66df;
  --water-deep: #1650c0;
  --sneaker: #f6c343;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --measure: 34rem;
  --page: 70rem;
  --gutter: clamp(1rem, 5vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { image-rendering: pixelated; max-width: 100%; }
a { color: var(--water-deep); text-underline-offset: 0.18em; }
p { margin: 0 0 1em; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 450;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.75rem, 6.6vw, 6.25rem); line-height: 1.02; letter-spacing: -0.03em; font-weight: 400; }
h2 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.08; margin-bottom: 0.6em; }
h3 { font-size: 1.5rem; line-height: 1.2; margin-bottom: 0.4em; }

:focus-visible { outline: 3px solid var(--water); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 30;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; border-radius: 8px;
}
.skip:focus { top: 1rem; }

/* Buttons: one solid action colour; a quiet outline variant for the nav. */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0 1.4rem;
  background: var(--water); color: #fff;
  font: 600 1rem/1 var(--sans); text-decoration: none; white-space: nowrap;
  border: 0; border-radius: 999px; cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn:hover { background: var(--water-deep); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); min-height: 2.5rem; }
.btn-quiet:hover { background: var(--ink); color: var(--paper); }
.btn-big { min-height: 3.5rem; padding: 0 2rem; font-size: 1.1rem; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 2rem;
  padding: 0.85rem max(var(--gutter), calc((100vw - var(--page)) / 2));
  background: color-mix(in srgb, var(--sky) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
}
.nav.scrolled { border-bottom-color: var(--rule); }
.brand { display: flex; align-items: center; gap: 0.55rem; font: 600 1.25rem/1 var(--serif); color: var(--ink); text-decoration: none; }
.nav nav { display: flex; gap: 1.6rem; margin-left: auto; }
.nav nav a { color: var(--slate); text-decoration: none; font-size: 0.95rem; }
.nav nav a:hover { color: var(--ink); }

/* Sections share one rhythm. */
main > section, #features > section { padding: clamp(4.5rem, 10vw, 8rem) var(--gutter); }
.page { max-width: var(--page); margin: 0 auto; }

/* Hero: type does the work; Kart arriving in the real corner is the picture. */
.hero { max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto; padding-top: clamp(4rem, 12vw, 9rem) !important; }
.hero h1 { max-width: 15ch; }
.lede { font-size: clamp(1.15rem, 1.6vw, 1.3rem); color: var(--slate); max-width: var(--measure); margin-top: 1.6rem; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.75rem; margin-top: 2.25rem; }
.hint { margin: 0; color: var(--slate); font-size: 0.95rem; }

/* How it works: a real sequence, so it gets numbers. */
.how { background: var(--paper); }
.how > h2, .steps { max-width: var(--page); margin-left: auto; margin-right: auto; }
.steps {
  list-style: none; padding: 0; margin-top: 3rem;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(2rem, 4vw, 4rem);
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step); display: block;
  font: 300 3.2rem/1 var(--serif); color: var(--rule); margin-bottom: 0.25rem;
}
.steps img { width: 12rem; height: auto; display: block; margin: 0 0 1rem -0.75rem; }
.steps p { color: var(--slate); max-width: 22rem; }
.soon { color: var(--ink); font-weight: 600; }

/* Features: alternating rows, art on one side, prose on the other. */
.feature {
  max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 6vw, 6rem); align-items: center;
}
.feature + .feature { border-top: 1px solid var(--rule); }
.feature-flip .feature-text { order: 2; }
.feature-text { max-width: var(--measure); }
.feature-text p { color: var(--slate); }
.aside { font-style: italic; font-family: var(--serif); font-size: 1.15rem; }
.habits {
  list-style: none; padding: 0; margin: 1.5rem 0;
  columns: 2; column-gap: 2rem;
}
.habits li { padding: 0.45rem 0; border-bottom: 1px solid var(--rule); break-inside: avoid; }
.feature-art {
  display: flex; justify-content: center; align-items: flex-end; gap: 0; margin: 0;
  /* A soft floor so the figures stand on something. */
  background: radial-gradient(ellipse 58% 9% at 50% 94%, rgba(20, 33, 61, 0.13), transparent 72%);
}
.feature-art img { width: clamp(9rem, 17vw, 15rem); height: auto; margin: 0 -0.75rem; }
.power { gap: clamp(0.25rem, 1.5vw, 1rem); }
.power > div { display: flex; flex-direction: column; align-items: center; }
.power img { width: clamp(6rem, 13vw, 13.5rem); margin: 0 -0.5rem; }
.power figcaption { font-size: 0.85rem; color: var(--slate); }

/* Privacy: a definition list on paper. */
.privacy { background: var(--paper); }
.privacy > h2, .privacy dl { max-width: var(--page); margin-left: auto; margin-right: auto; }
.privacy dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.25rem 4rem; margin-top: 2.5rem; }
.privacy dt { font: 500 1.3rem/1.3 var(--serif); margin-bottom: 0.35rem; }
.privacy dd { margin: 0; color: var(--slate); max-width: var(--measure); }

/* FAQ */
.faq > * { max-width: 46rem; margin-left: auto; margin-right: auto; }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.25rem 0;
  font: 500 1.2rem/1.35 var(--serif);
  display: flex; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 300 1.6rem/1 var(--sans); color: var(--slate); transition: transform 0.2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--slate); padding-bottom: 1.25rem; margin: 0; max-width: var(--measure); }

/* Get it */
.get { background: var(--ink); color: var(--paper); text-align: center; }
.get h2 { font-size: clamp(2.4rem, 5vw, 4rem); }
.get .lede { color: #b8c4d8; margin: 1rem auto 2.5rem; }
.get .btn-big { margin-bottom: 2rem; }
.notify { max-width: 36rem; margin: 0 auto; text-align: left; }
.notify label { display: block; font-size: 0.9rem; color: #b8c4d8; margin-bottom: 0.5rem; }
.notify-row { display: flex; gap: 0.6rem; }
.notify input[type="email"] {
  flex: 1; min-width: 0; min-height: 3rem; padding: 0 1.1rem;
  font: 400 1rem var(--sans); color: var(--ink);
  background: var(--paper); border: 2px solid transparent; border-radius: 999px;
}
.notify input[type="email"]:focus { outline: none; border-color: var(--sneaker); }
.notify input[aria-invalid="true"] { border-color: #ff8f8f; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.6em; margin: 0.75rem 0 0; color: #b8c4d8; }
.form-status.ok { color: #8be0b4; }
.form-status.err { color: #ffb3b3; }

footer {
  background: var(--ink); color: #8d9bb4; font-size: 0.9rem;
  padding: 0 var(--gutter) 2.5rem; text-align: center;
}
footer p { margin: 0; padding-top: 2rem; border-top: 1px solid #26355a; }
footer a { color: #b8c4d8; }

/* Kart, living in the corner of this page. */
.corner {
  position: fixed; right: clamp(0.25rem, 2vw, 1.5rem); bottom: 0; z-index: 25;
  width: clamp(5.5rem, 10vw, 10rem); padding: 0; border: 0; background: none; cursor: pointer;
  /* Starts just off screen; main.js walks him in. */
  transform: translateX(var(--corner-x, 115%));
}
.corner-kart { display: block; width: 100%; height: auto; transform-origin: bottom center; }
.corner.flip .corner-kart { transform: scaleX(-1); }
.corner-bubble {
  position: absolute; bottom: 92%; right: 10%;
  width: max-content; max-width: min(15rem, 70vw);
  background: var(--sneaker); color: var(--ink);
  font: 600 0.9rem/1.35 var(--sans); text-align: center;
  padding: 0.55rem 0.85rem; border-radius: 14px; text-wrap: balance;
  box-shadow: 0 6px 20px rgba(20, 33, 61, 0.18);
  animation: bubble-in 0.18s ease-out;
}
.corner-bubble::after {
  content: ""; position: absolute; top: 100%; right: 1.6rem;
  border: 8px solid transparent; border-top-color: var(--sneaker); border-bottom: 0;
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(4px) scale(0.96); } }

@media (max-width: 860px) {
  .nav nav { display: none; }
  .nav .btn { margin-left: auto; }
  .steps, .feature, .privacy dl { grid-template-columns: 1fr; }
  .feature-flip .feature-text { order: 0; }
  .feature-art { justify-content: flex-start; }
  .feature-art img { width: min(28vw, 11rem); }
  .steps { gap: 2.5rem; }
  .steps img { width: 9rem; margin-top: -1.5rem; }
  .power img { width: min(23vw, 8rem); }
  .corner { width: 4.75rem; }
}
@media (max-width: 520px) {
  .notify-row { flex-direction: column; }
  .habits { columns: 1; }
  .hero-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .corner { --corner-x: 0; }
  .corner-bubble { animation: none; }
  .btn, .faq summary::after { transition: none; }
}
