:root {
  --ink: #1b2734;
  --ink-75: rgba(27, 39, 52, 0.75);
  --ink-50: rgba(27, 39, 52, 0.5);
  --ink-2: rgba(27, 39, 52, 0.62);
  --ink-3: rgba(27, 39, 52, 0.12);
  --page: #f8f9f9;
  --tile: #ffffff;
  --frame: #1b2734;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eceff3;
    --ink-75: rgba(236, 239, 243, 0.75);
    --ink-50: rgba(236, 239, 243, 0.5);
    --ink-2: rgba(236, 239, 243, 0.6);
    --ink-3: rgba(236, 239, 243, 0.14);
    --page: #111113;
    --tile: #1c1c1e;
    --frame: #2c2c2e;
  }
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  background: var(--page);
  color: var(--ink);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

a { color: inherit; }

/* The logo — the app's icon and its name — at the top of every page. */
.brand { display: flex; align-items: center; }
.brand .logo { display: block; height: 32px; width: auto; }

/* ——— Landing ——— */

.hero {
  flex: 1;
  display: grid;
  /* The picture 600px, the words up to 500px in what it leaves. */
  grid-template-columns: minmax(0, 500px) 600px;
  justify-content: space-between;
  /* One fixed height for both columns. */
  grid-template-rows: 600px;
  align-content: center;
  gap: 120px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 0;
}
/* Narrower than the section: off the window's edges, and half each, as a
   600px picture would leave the words too little room. The picture still
   no wider than 600px. */
@media (max-width: 1199.98px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* The section's height: the words and buttons at its top, the three points
   at its foot, whatever room is left between them. */
.copy {
  display: flex;
  flex-direction: column;
}

/* STIX Two Text, a serif (SIL Open Font License, from Google Fonts), the
   system's own while it loads. */
/* The logo over the heading. */
.copy .brand { margin-bottom: 24px; }
.copy .brand .logo { height: 40px; }

.copy h1 {
  font-family: "STIX Two Text", Georgia, serif;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.015em;
  font-weight: 500;
}

.copy .lede {
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink-75);
  margin-top: 32px;
  text-wrap: pretty;
}

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 32px; }

.store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--page);
  font-weight: 500;
  font-size: 16px;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.store:hover { opacity: 0.85; }
/* Until Mesa is out: the same button, saying so, with nowhere to go — a
   click lets stars go up from it instead. */
.store.soon {
  position: relative;
  z-index: 11;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
/* Solid under the pointer too: faded, it let the stars behind it show through. */
.store.soon:hover { opacity: 1; }
.store.soon:active { transform: scale(0.97); }
.spark {
  position: fixed;
  z-index: 10;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  font-size: 18px;
  line-height: 20px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
}
.store svg {
  width: 20px;
  height: 20px;
  margin-top: -3px;
  fill: currentColor;
}
.store.outline {
  background: none;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

/* Three things it does, quietly, under the buttons. */
.points {
  list-style: none;
  padding: 0;
  margin-top: auto;
  padding-top: 48px;
  display: grid;
  gap: 14px;
  font-size: 16px;
  color: var(--ink-2);
}
.points li { display: flex; align-items: center; gap: 12px; }

/* Reicon icons, in the colour of their text. */
.ic {
  width: 20px;
  height: 20px;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
  mask: var(--i) center / contain no-repeat;
}

/* A slice's mark — Guglielmo's artwork, stacked as the app stacks it: the
   tile and what is in its window in the text's colour, the window white,
   and in Today's, today's date (set by demo.js), semibold at 14 of the 32
   on a line at 23. */
.mark {
  position: relative;
  display: grid;
  flex: none;
  width: 20px;
  height: 20px;
  container-type: size;
}
.mark .ly {
  grid-area: 1 / 1;
  background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
  mask: var(--i) center / contain no-repeat;
}
.mark .ly.win { background: #fff; }
.mark .day {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% * 9 / 32);
  text-align: center;
  font: 600 calc(100cqw * 14 / 32) / 1 -apple-system, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: calc(100cqw * -0.6 / 32);
  text-box: trim-both cap alphabetic;
}

/* The phone on a picture, as a Mac's desktop has one. */
.stage {
  position: relative;
  width: 100%;
  max-width: 600px;
  justify-self: end;
  display: grid;
  place-items: center;
  border-radius: 40px;
  overflow: hidden;
  /* A cane chair and a wooden stool in a warm clay room: Ela De Pure, on
     Unsplash (free under the Unsplash License). */
  background: #a47c62 url(room.jpg) center / cover no-repeat;
  /* So the demo can size itself by the picture's width. */
  container-type: inline-size;
}

/* ——— The demo: Mesa drawn in the app's own numbers (its phone sizes) ——— */

.demo {
  --app-ink: #1b2734;
  --app-yellow: #ffcc00;
  --app-cyan: #00c0e8;
  --app-green: #4bca6b;
  /* Liquid Glass, as the web can draw it: a clear white over the photo,
     blurred and brightened through, with a lit edge. */
  --glass: rgba(255, 255, 255, 0.9);
  --glass-blur: blur(4px) saturate(1.8);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  /* One shadow for the card, the bar and Add To-Do: close and defined, then
     wide and soft. */
  --glass-shadow: 0 2px 6px rgba(27, 39, 52, 0.1), 0 16px 40px rgba(27, 39, 52, 0.22);
  /* The app's spring, Spec.motion's bounce of 0.35, a little slower here:
     it overshoots by about 7% and settles in 0.25s, the time every change here takes. The cards' alone; what
     is in them moves smoothly, without give. */
  --spring: linear(0, 0.026, 0.092, 0.185, 0.293, 0.407, 0.519, 0.625, 0.721, 0.805, 0.876, 0.934, 0.98, 1.014, 1.039, 1.055, 1.064, 1.068, 1.067, 1.063, 1.057, 1.05, 1.043, 1.035, 1.028, 1.021, 1.015, 1.01, 1.006, 1.002, 1, 0.998, 0.997, 0.996, 0.995, 0.995, 0.996, 0.996, 0.996, 0.997, 1);
  --spring-time: 0.25s;
  --smooth: cubic-bezier(0.32, 0.72, 0, 1);
  position: relative;
  width: 340px;
  /* Drawn at the app's numbers and shrunk whole, to four fifths of the
     picture, once it is narrower than 425px — a phone, or the two columns
     under 1200px — rather than squeezed, its words cut off and its card
     clipped. tan(atan2()) divides one length by another, which calc()
     cannot. demo.js allows for the zoom. */
  zoom: min(1, tan(atan2(100cqw, 425px)));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--app-ink);
  font-size: 16px;
  -webkit-user-select: none;
  user-select: none;
}

/* The card: glass, as tall as whichever view is showing. */
.demo .card {
  position: relative;
  width: 100%;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: 28px;
  box-shadow: var(--glass-edge), var(--glass-shadow);
  overflow: hidden;
  transition: height var(--spring-time) var(--spring);
}
.demo .view {
  position: absolute;
  inset: 0 0 auto 0;
  padding: 24px;
  transition: opacity 0.25s ease;
}
.demo .view.hidden { opacity: 0; pointer-events: none; }
/* Today and Upcoming: more room above the title and under the last to-do. */
.demo .view.list, .demo .view.upcoming { padding-top: 32px; padding-bottom: 56px; }

.demo .title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 600;
}
.demo .title .mark { width: 24px; height: 24px; color: var(--app-yellow); }
.demo .upcoming .title .mark { color: var(--app-cyan); }

/* Upcoming's parts, a day each, under its name in semibold — the app's
   section heading, lined up with the boxes. */
.demo .part { padding-left: 8px; margin-bottom: 4px; font-weight: 600; }
.demo .part.later { margin-top: 16px; }
.demo .upcoming .events { margin-top: 4px; margin-bottom: 4px; }
/* A birthday: the 🎂 before its title, as the app marks it. */
.demo .occ { margin-right: 6px; }

/* Today's events over its to-dos, as the app draws them on the phone: one
   13.5 line each, the start then the name in black 50, on a black 3 wash
   rounded 12 and 16 in. */
.demo .events {
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(27, 39, 52, 0.03);
  color: rgba(27, 39, 52, 0.5);
  font-size: 13.5px;
}
.demo .event { display: flex; align-items: center; gap: 8px; height: 19px; white-space: nowrap; }
.demo .event span { width: 36px; flex: none; }

/* A row: the box and the title, 32 high. */
.demo .row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 32px;
  padding-left: 8px;
  overflow: hidden;
  transition: opacity 0.25s ease, height 0.25s var(--smooth);
}
.demo .row.gone { opacity: 0; height: 0; }
.demo .row.new { opacity: 0; }
.demo .text { transition: color 0.25s ease; white-space: nowrap; }

.demo .box {
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  display: grid;
  place-items: center;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.demo .box .tick { width: 14px; height: 14px; color: #fff; transform: scale(0); transition: transform 0.25s var(--smooth); }
.demo .row.ticked .box { background: var(--app-green); box-shadow: none; }
.demo .row.ticked .tick { transform: scale(1); }
.demo .row.ticked .text { color: rgba(27, 39, 52, 0.25); }

/* A birthday's balloons, let go from its box by demo.js. */
.demo .balloon {
  position: absolute;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  font-size: 18px;
  line-height: 20px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
}

/* Confetti: thrown from the box by demo.js. */
.demo .piece {
  position: absolute;
  width: 3px;
  height: 5px;
  border-radius: 1px;
  pointer-events: none;
}

/* The open card: the title being typed, Notes, and its chips. */
.demo .field { position: relative; display: flex; align-items: center; }
.demo .placeholder { color: rgba(27, 39, 52, 0.25); }
.demo .field.typing .placeholder { display: none; }
.demo .caret {
  width: 2px;
  height: 19px;
  margin-right: 1px;
  background: var(--app-ink);
  animation: demo-blink 1s steps(1) infinite;
}
@keyframes demo-blink { 50% { opacity: 0; } }
.demo .notes { padding-left: 40px; margin-top: 2px; color: rgba(27, 39, 52, 0.25); }
.demo .chips {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  color: rgba(27, 39, 52, 0.25);
}
.demo .chips .ic, .demo .chips .mark { width: 22px; height: 22px; }
.demo .chip.on { display: flex; align-items: center; gap: 4px; color: var(--app-ink); font-weight: 500; }
.demo .chip.on .mark { color: var(--app-yellow); }

/* The bar: the three slices in a capsule, Today's on its pill, and the +,
   together as wide as the card. */
.demo .bar { display: flex; align-items: center; gap: 12px; width: 100%; }
.demo .slices,
.demo .plus {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge), var(--glass-shadow);
}
.demo .slices { flex: 1; display: flex; padding: 4px; height: 60px; border-radius: 30px; }
.demo .slice { position: relative; flex: 1; display: grid; place-items: center; border-radius: 26px; }
.demo .slice.today.on { color: var(--app-yellow); }
.demo .slice.upcoming.on { color: var(--app-cyan); }
/* The faint pill under the slice on screen, sliding to the next on the
   card's spring as the app's does. */
.demo .pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  border-radius: 26px;
  background: rgba(27, 39, 52, 0.05);
  transform: translateX(calc(var(--at, 0) * 100%));
  transition: transform var(--spring-time) var(--spring), opacity 0.25s ease;
}
.demo .slice .mark, .demo .plus .ic { width: 24px; height: 24px; }
.demo .plus {
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: transform 0.25s ease;
}
.demo .plus.pressed { transform: scale(0.9); }

/* While a to-do is being written, the bar becomes one wide glass button
   that adds it: the + folds into the capsule as it grows to the full width,
   on the card's spring, and the slices give way to its words. */
.demo .slices { position: relative; transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease; }
/* As Add To-Do: solid ink, its words white, without the glass's lit edge. */
.demo .bar.adding .slices { background: var(--app-ink); box-shadow: var(--glass-shadow); }
.demo .slices.pressed { transform: scale(0.97); }
.demo .slice { transition: opacity 0.25s ease, color 0.25s ease; }
.demo .bar.adding .slice, .demo .bar.adding .pill { opacity: 0; }
.demo .plus { overflow: hidden; transition: width var(--spring-time) var(--spring), margin var(--spring-time) var(--spring), opacity 0.25s ease, transform 0.25s ease; }
.demo .bar.adding .plus { width: 0; margin-left: -12px; opacity: 0; }
.demo .add {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.demo .bar.adding .add { opacity: 1; }

/* Where a finger would land. */
.demo .tap {
  position: absolute;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(27, 39, 52, 0.16);
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
}
.demo .tap.on { animation: demo-tap 0.5s ease-out; }
@keyframes demo-tap {
  0% { opacity: 0; transform: scale(0.6); }
  30% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.15); }
}

footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 24px 32px 32px;
  font-size: 14px;
  color: var(--ink-50);
}
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }

/* Stacked before the phone, which keeps its size, leaves the words too
   narrow a column: below 900px it would squeeze the heading to a word a line. */
/* One column: the words, then the phone on its picture. Below 900px two
   columns would squeeze the heading to a word a line. */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; grid-template-rows: auto; gap: 48px; padding-top: 32px; padding-bottom: 40px; }
  .copy h1 { font-size: 44px; }
  .points { padding-top: 40px; }
  .stage { aspect-ratio: 1 / 1.05; border-radius: 32px; justify-self: center; }
}

/* ——— Privacy and support ——— */

.page {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 24px 32px;
}
.page header { margin-bottom: 40px; }
.page h1 { font-size: 36px; letter-spacing: -0.02em; line-height: 1.15; }
.page .updated { color: var(--ink-2); font-size: 15px; margin-top: 8px; }
.page h2 { font-size: 18px; margin-top: 32px; }
.page p { margin-top: 10px; }
.page > a { text-decoration: none; }
