/* Sales page for Mi Control. Flat colour, heavy type, the app's own palette. */

@font-face {
  font-family: 'Figtree';
  src: url('fonts/figtree-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --bg: #0d1412;
  --surface: #151e1b;
  --surface-2: #1e2a26;
  --field: #17503f;
  --ink: #eef3f0;
  --muted: #b3bfb9;
  --accent: #3fcf9d;
  --accent-dark: #2fae82;
  --on-accent: #06281d;
  --coral: #ff8a7a;
  --amber: #f5b955;

  --m: clamp(16px, 2.2vw, 28px); /* the one pair of page margins */
  --r: 24px; /* the one corner radius */
  --gap: clamp(120px, 14vw, 200px); /* between sections */

  --display: clamp(64px, 9vw, 140px);
  --title: clamp(36px, 4.6vw, 76px);
  --big: clamp(20px, 2vw, 28px);
  --text: 18px;
  --small: 15px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p,
ul,
figure {
  margin: 0;
}
ul {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
::selection {
  background: var(--accent);
  color: var(--on-accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 140ms var(--ease-out), background 140ms;
}
.btn:active {
  transform: scale(0.96);
}
.btn-dark {
  background: var(--on-accent);
  color: var(--ink);
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    background: var(--ink);
    color: var(--on-accent);
  }
  .btn-dark:hover {
    background: var(--bg);
    color: var(--accent);
  }
}

/* ---------- Hero: two flat fields, the headline cut by the seam ---------- */

.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: clip;
  background: var(--bg);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 50% 0 0;
  background: var(--accent);
}
.hero-bar {
  position: absolute;
  z-index: 3;
  inset: var(--m) var(--m) auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  font-size: var(--big);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.hero-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
h1 {
  color: var(--accent);
  font-size: var(--display);
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: -0.04em;
  text-align: center;
}
.lines .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.lines [data-line] {
  display: block;
}
/* The fields meet between the two lines: one word above water, one below. */
.lines .under {
  color: var(--on-accent);
}
.hero-say {
  position: absolute;
  z-index: 2;
  left: var(--m);
  right: var(--m);
  bottom: 40px;
  max-width: 34em;
  margin: 0 auto;
  text-align: center;
  font-size: var(--big);
  font-weight: 600;
  line-height: 1.3;
  color: var(--on-accent);
}

/* ---------- Board: the movements list, with one row you can use ---------- */

.board {
  padding: 12px 12px 0;
  background: var(--bg);
  overflow: clip;
}
.row {
  display: grid;
  grid-template-columns: 5fr 2fr 2fr 2fr auto;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  margin-bottom: 4px;
  padding: 0 20px;
  border-radius: 6px;
  background: var(--surface);
  font-size: var(--big);
}
.row-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-fact {
  color: var(--muted);
  font-size: var(--text);
}
.row-amount {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
}
.tag {
  display: inline-block;
  min-width: 92px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: var(--small);
  font-weight: 800;
  font-style: normal;
  text-align: center;
  color: var(--on-accent);
}
.tag-in {
  background: var(--accent);
}
.tag-out {
  background: var(--coral);
}
.tag-warn {
  background: var(--amber);
}
.row-open {
  grid-template-columns: 5fr 6fr auto;
  gap: 24px 32px;
  min-height: 216px;
  padding: 28px 20px;
  background: var(--accent);
  color: var(--on-accent);
}
.row-open h2 {
  font-size: var(--title);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}
.row-open-text p {
  margin-top: 12px;
  font-size: var(--text);
  font-weight: 600;
}
.row-open-fields {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.row-open label {
  flex: 1;
  min-width: 0;
  display: block;
  font-size: var(--small);
  font-weight: 700;
}
.row-open input,
.row-open select {
  display: block;
  width: 100%;
  height: 52px;
  margin-top: 6px;
  padding: 0 14px;
  border: 2px solid var(--on-accent);
  border-radius: 12px;
  background: var(--ink);
  color: var(--on-accent);
  font: inherit;
  font-size: var(--text);
  font-weight: 700;
}
.row-open-total {
  font-size: var(--text);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
.row-open-total strong {
  display: block;
  font-size: var(--title);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}
.row-new {
  animation: row-in 500ms var(--ease-out);
}
@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
}

/* ---------- Steps: four lines that walk across the page ---------- */

.steps {
  position: relative;
  z-index: 1;
  padding: var(--gap) var(--m) 0;
  background: var(--bg);
}
.step {
  margin-left: calc(var(--s) * 16.6%);
  margin-bottom: 56px;
}
.step h2,
.step h3 {
  font-size: var(--title);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.step p {
  max-width: 34ch;
  margin-top: 12px;
  color: var(--muted);
}
.step-last h3 {
  color: var(--accent);
}

/* ---------- Screens: pieces of the real app ---------- */

.screens {
  padding: calc(var(--gap) - 56px) var(--m) 0;
}
.screens > h2,
.price-head h2,
.faq > h2 {
  font-size: var(--title);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}
.screens-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  margin-top: 40px;
}
.shot {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 28px;
  border-radius: var(--r);
}
.shot figcaption {
  font-weight: 700;
}
.shot-a {
  grid-column: span 7;
  background: var(--field);
}
.shot-b {
  grid-column: span 5;
  background: var(--surface);
}
.shot-c {
  grid-column: span 5;
  background: var(--surface);
}
.shot-d {
  grid-column: span 7;
  background: var(--surface-2);
}
.ui-total span,
.ui-rent > span,
.ui-cats > span {
  display: block;
  color: var(--muted);
  font-weight: 600;
}
.ui-total > strong {
  display: block;
  font-size: var(--display);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.ui-total-month {
  display: flex;
  gap: 40px;
  margin-top: 28px;
}
.ui-total-month b {
  font-size: var(--big);
}
.ui-pockets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ui-pocket {
  padding: 18px;
  border-radius: 16px;
  background: var(--surface-2);
}
.ui-pocket:last-child {
  grid-column: span 2;
}
.ui-pocket span,
.ui-pocket small {
  display: block;
  color: var(--muted);
  font-size: var(--small);
  font-weight: 600;
}
.ui-pocket b {
  display: block;
  font-size: var(--big);
  white-space: nowrap;
}
.ui-bar {
  display: block;
  height: 8px;
  margin: 10px 0 8px;
  border-radius: 99px;
  background: rgb(255 255 255 / 0.12);
  overflow: hidden;
}
.ui-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
}
.ui-rent > strong {
  display: block;
  font-size: var(--title);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.ui-rent > strong small {
  font-size: var(--text);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}
.ui-rent li,
.ui-cats li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-weight: 600;
}
.ui-cats li {
  display: grid;
  grid-template-columns: 7em 1fr 6em;
  font-size: var(--big);
}
.ui-cats li b {
  text-align: right;
}
.ui-cats .ui-bar {
  height: 14px;
  margin: 0;
}

/* ---------- Price: two tiles, the bigger plan literally bigger ---------- */

.price {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 8px;
  padding: var(--gap) var(--m) 0;
}
.price-head {
  align-self: start;
}
.price-head p {
  max-width: 30ch;
  margin-top: 20px;
  color: var(--muted);
}
.tile {
  display: flex;
  flex-direction: column;
  border-radius: var(--r);
  overflow: hidden;
}
.tile h3 {
  padding: 28px 28px 0;
  font-size: var(--title);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}
.tile .tile-kind {
  margin: 0 0 14px;
  font-size: var(--big);
  font-weight: 800;
}
.tile ul {
  flex: 1;
  padding: 4px 28px 32px;
}
.tile li {
  margin-top: 8px;
  font-weight: 600;
}
.tile-btn {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 0 28px;
  font-size: var(--big);
  font-weight: 800;
  text-decoration: none;
  transition: background 140ms;
}
.tile-free {
  min-height: 420px;
  background: var(--surface-2);
}
.tile-free .tile-btn {
  background: var(--surface);
}
.tile-paid {
  min-height: 600px;
  background: var(--accent);
  color: var(--on-accent);
}
.tile-paid .tile-btn {
  background: var(--accent-dark);
}
@media (hover: hover) and (pointer: fine) {
  .tile-btn:hover {
    background: var(--ink);
    color: var(--on-accent);
  }
}

/* ---------- Poster list ---------- */

.poster {
  margin-top: var(--gap);
  padding: 80px var(--m);
  background: var(--field);
}
.poster h2,
.poster li span {
  display: block;
  font-size: var(--display);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.04em;
}
.poster h2 {
  color: var(--accent);
}
.poster li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  transition: color 140ms;
}
.poster li small {
  font-size: var(--big);
  font-weight: 600;
  text-align: right;
}
@media (hover: hover) and (pointer: fine) {
  .poster li:hover {
    color: var(--accent);
  }
}

/* ---------- Questions ---------- */

.faq {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: 32px;
  align-items: start;
  padding: var(--gap) var(--m) 0;
}
.faq > h2 {
  position: sticky;
  top: 96px;
}
details {
  margin-bottom: 8px;
  border-radius: var(--r);
  background: var(--surface);
  transition: background 200ms;
}
summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px 24px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}
/* The plus sign, drawn from two bars; one turns to make a minus. */
.plus {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
}
.plus::before,
.plus::after {
  content: '';
  position: absolute;
  left: 0;
  top: 6.5px;
  width: 16px;
  height: 3px;
  background: currentColor;
  transition: transform 200ms var(--ease-out);
}
.plus::after {
  transform: rotate(90deg);
}
details[open] {
  background: var(--accent);
  color: var(--on-accent);
}
details[open] .plus::after {
  transform: rotate(180deg);
}
details p {
  max-width: 52ch;
  padding: 0 24px 24px;
  font-weight: 600;
}

/* ---------- Footer: the name, built from blocks ---------- */

.foot {
  margin-top: var(--gap);
  padding: 0 var(--m) var(--m);
}
.mark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 34svh;
  min-height: 180px;
}
.mark span {
  flex: 1;
  height: var(--h);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 6px;
  background: var(--c);
  color: var(--k);
  font-size: clamp(40px, 8vw, 128px);
  font-weight: 900;
  line-height: 1;
  padding-bottom: 0.08em;
}
.mark .mark-gap {
  flex: 0.4;
  background: none;
}
.foot-cols {
  display: grid;
  grid-template-columns: 6fr 3fr 3fr;
  gap: 32px;
  margin-top: 56px;
}
.foot-about {
  max-width: 44ch;
}
.foot-cols li {
  margin-bottom: 8px;
  font-size: var(--small);
  font-weight: 600;
}
.foot-last {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 56px;
  font-size: var(--small);
  color: var(--muted);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .lines [data-line] {
    transform: translateY(105%);
    animation: line-up 900ms var(--ease-out) forwards;
    animation-delay: calc(var(--i) * 110ms + 150ms);
  }
  .js .hero-say,
  .js .hero-bar {
    opacity: 0;
    animation: fade-up 700ms var(--ease-out) 700ms forwards;
  }
  .js [data-r] {
    opacity: 0;
    transform: translateY(24px);
    transition:
      opacity 700ms var(--ease-out),
      transform 700ms var(--ease-out);
    transition-delay: calc(var(--d, 0) * 70ms);
  }
  .js [data-r].in {
    opacity: 1;
    transform: none;
  }
}
@keyframes line-up {
  to {
    transform: none;
  }
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Phone ---------- */

@media (max-width: 760px) {
  :root {
    --display: 15.5vw;
    --title: 8.4vw;
    --text: 16px;
  }
  .hero-say {
    bottom: 28px;
    text-align: left;
    font-size: 18px;
  }
  .btn {
    min-height: 48px;
    padding: 0 20px;
  }

  .board {
    padding: 8px 8px 0;
  }
  .row {
    grid-template-columns: 1fr auto;
    min-height: 64px;
    padding: 0 14px;
    font-size: 20px;
  }
  .row .row-fact,
  .row .tag {
    display: none;
  }
  .row-open {
    grid-template-columns: 1fr;
    padding: 24px 14px;
  }
  .row-open-fields {
    flex-wrap: wrap;
  }
  .row-open-fields .btn {
    width: 100%;
  }
  .row-open-total {
    text-align: left;
  }

  .step {
    margin-left: calc(var(--s) * 6vw);
    margin-bottom: 40px;
  }
  .step h2,
  .step h3 {
    white-space: normal;
  }

  .screens-grid {
    grid-template-columns: 1fr;
  }
  .shot {
    grid-column: auto;
    padding: 20px;
  }
  .ui-cats li {
    grid-template-columns: 6em 1fr 5em;
    font-size: var(--text);
  }

  .price {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .price-head {
    margin-bottom: 24px;
  }
  .tile-free,
  .tile-paid {
    min-height: 0;
  }

  .poster {
    padding: 56px var(--m);
  }
  .poster li {
    display: block;
  }
  .poster li small {
    display: block;
    margin: 6px 0 22px;
    font-size: 15px;
    text-align: left;
  }

  .faq {
    grid-template-columns: 1fr;
  }
  .faq > h2 {
    position: static;
  }
  summary {
    min-height: 64px;
    padding: 12px 20px;
    font-size: 18px;
  }
  details p {
    padding: 0 20px 20px;
  }

  .mark {
    height: 22svh;
    min-height: 140px;
  }
  .foot-cols {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
