/* Top page only. Colors follow tailwind.css: the tab screens' canvas gradient
   (canvas-top → mid → bottom), white cards, orange only for "now". */
:root {
  --canvas-top: #f3ead9;
  --canvas-mid: #f7f3ec;
  --canvas-bottom: #f6f5f1;
  --line: #e5e2db;
  --emoji-bg: #f4f1ea;
  --disc: #fdfcf9;
  --dot: #1e293b;
  --frame: #0f172a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas-top: #1a1814;
    --canvas-mid: #121212;
    --canvas-bottom: #141414;
    --surface: #26292f;
    --line: #33373e;
    --emoji-bg: #33373e;
    --disc: #3d4a5c;
    --dot: #e2e8f0;
    --frame: #000000;
  }
}

body.home {
  background:
    linear-gradient(var(--canvas-top), var(--canvas-mid) 560px, var(--canvas-bottom)) no-repeat,
    var(--canvas-bottom);
}

.home .site-header {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--canvas-top) 85%, transparent);
}

.home .wrap {
  max-width: 1040px;
}

.home h2,
.home h3,
.home h4 {
  margin: 0;
  text-wrap: balance;
}

.home p {
  margin: 0;
}

/* Intro */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: center;
  padding: 56px 0 24px;
}

.intro h1 {
  font-size: clamp(2.125rem, 5.4vw, 3.5rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.intro .lead {
  max-width: 30em;
  margin-top: 20px;
}

.intro .phone {
  width: 300px;
}

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

.get-note {
  color: var(--foreground-muted);
  font-size: 14px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 14px;
  border-radius: 8px;
  background: var(--foreground);
  color: var(--canvas-mid);
  font-size: 15px;
  line-height: 1.2;
}

.store-badge svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.store-badge small {
  display: block;
  font-size: 11px;
  opacity: 0.7;
}

/* Features */

.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  padding-top: 56px;
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
  padding: 32px 28px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.feature-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--foreground-muted);
  font-size: 14px;
}

.feature-label b {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot);
}

.feature-label b.is-now {
  background: var(--accent);
}

.feature h2 {
  margin-top: 8px;
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  line-height: 1.3;
}

.feature p:not(.feature-label) {
  margin-top: 10px;
  color: var(--foreground-secondary);
  font-size: 15px;
}

/* The phone is cut at the bottom of the card. */
.feature .phone {
  align-self: center;
  width: 264px;
  height: 400px;
  aspect-ratio: auto;
  padding-bottom: 0;
  border-radius: 46px 46px 0 0;
}

.feature .m-screen {
  border-radius: 38px 38px 0 0;
}

.feature .m-tabbar {
  display: none;
}

/* Uses */

.uses {
  padding-top: 96px;
}

.uses > h2 {
  font-size: clamp(1.625rem, 3.6vw, 2.25rem);
  line-height: 1.3;
}

.uses-lead {
  max-width: 34em;
  margin-top: 16px;
  color: var(--foreground-secondary);
}

.use-group {
  margin-top: 40px;
}

.use-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.use-group-head h3 {
  color: var(--foreground-muted);
  font-size: 15px;
  font-weight: 600;
}

.use-group-head p {
  font-size: 20px;
  font-weight: 700;
}

.use-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.use {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 20px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.use h4 {
  font-size: 18px;
  line-height: 1.4;
}

.use p {
  margin-top: 6px;
  color: var(--foreground-secondary);
  font-size: 14.5px;
}

/* A rally tile: one dot per stamp, the newest in orange. */
.use-rally {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  background: var(--canvas-mid);
  font-size: 12px;
  line-height: 1.4;
}

.use-rally .m-emoji {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface);
  font-size: 18px;
}

.use-rally b {
  margin-top: 4px;
  font-size: 13px;
}

.use-rally > span:not(.m-emoji) {
  color: var(--foreground-muted);
  font-size: 11.5px;
}

.use-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}

.use-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot);
}

.use-dots i:last-child {
  background: var(--accent);
}

/* Closing */

.closing {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 96px;
  padding-top: 72px;
  border-top: 1px solid var(--line);
}

.closing h2 {
  font-size: clamp(1.625rem, 3.6vw, 2.25rem);
  line-height: 1.3;
}

.closing p {
  margin-top: 12px;
  color: var(--foreground-muted);
  font-size: 14px;
}

.closing .get {
  margin-top: 0;
}

.home .site-footer {
  margin-top: 72px;
  border-top-color: var(--line);
}

/* ---------- Phone mockups (drawn, not screenshots) ---------- */

.phone {
  flex: none;
  width: 272px;
  max-width: 100%;
  aspect-ratio: 272 / 572;
  padding: 9px;
  border-radius: 46px;
  background: var(--frame);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06);
}

.m-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  padding: 10px 14px 0;
  border-radius: 38px;
  background: linear-gradient(var(--canvas-top), var(--canvas-mid) 45%, var(--canvas-bottom));
  color: var(--foreground);
  font-size: 11px;
  line-height: 1.35;
}

.m-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 22px;
  padding: 2px 8px 0;
  font-size: 11px;
  font-weight: 600;
}

.m-island {
  width: 78px;
  height: 22px;
  border-radius: 999px;
  background: #000000;
}

.m-battery {
  width: 18px;
  height: 8px;
  border-radius: 2px;
  background: var(--foreground);
}

.m-appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.m-menu {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
}

.m-menu::after {
  content: "";
  position: absolute;
  inset: 10px 8px;
  border-block: 1.5px solid var(--foreground);
  background: linear-gradient(var(--foreground), var(--foreground)) center / 100% 1.5px no-repeat;
}

.m-title {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.m-sub {
  color: var(--foreground-muted);
}

.m-card {
  padding: 11px 12px;
  border-radius: 16px;
  background: var(--surface);
}

.m-head {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--foreground-muted);
  font-size: 9.5px;
}

.m-head b {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.m-head > span:last-child {
  margin-left: auto;
}

.m-today {
  display: flex;
  gap: 8px;
  height: 104px;
  margin-top: 12px;
}

.m-today-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.m-num {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 700;
}

.m-row {
  color: var(--foreground-secondary);
  font-size: 10px;
}

.m-disc {
  display: grid;
  place-items: center;
  align-self: center;
  width: 72px;
  height: 72px;
  padding-right: 8px;
  border-radius: 50%;
  background: var(--disc);
  box-shadow: inset 0 0 0 1.5px var(--accent);
  font-size: 22px;
  letter-spacing: -8px;
}

.m-pager {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 8px 0 10px;
}

.m-pager i {
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background: var(--foreground-muted);
  opacity: 0.4;
}

.m-pager i:first-child {
  width: 14px;
  background: var(--foreground);
  opacity: 1;
}

.m-section {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 700;
}

.m-section > span {
  color: var(--foreground-muted);
  font-size: 10px;
  font-weight: 500;
}

.m-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.m-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px;
  border-radius: 16px;
  background: var(--surface);
}

.m-tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.m-emoji {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--emoji-bg);
  font-size: 16px;
}

.m-press {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.m-press.is-on {
  background: var(--accent);
}

.m-press.is-on::before {
  content: "";
  width: 8px;
  height: 4px;
  border-bottom: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.m-name {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
}

.m-count {
  color: var(--foreground-muted);
  font-size: 9.5px;
}

.m-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 2px;
  color: var(--foreground-muted);
  font-size: 7px;
  text-align: center;
}

.m-week i {
  justify-self: center;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--foreground-muted);
  opacity: 0.35;
}

.m-week i.on,
.m-week i.now {
  width: 5px;
  height: 5px;
  background: var(--dot);
  opacity: 1;
}

.m-week i.now {
  background: var(--accent);
}

.m-tabbar {
  position: absolute;
  bottom: 14px;
  left: 50%;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 0 0 1px var(--line);
  transform: translateX(-50%);
}

.m-tabbar > span {
  padding: 6px 16px;
  border-radius: 999px;
  color: var(--foreground-secondary);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.m-tabbar > span.is-on {
  background: var(--canvas-top);
  color: var(--accent);
}

.m-toast {
  position: absolute;
  top: 40px;
  right: 10px;
  left: 10px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 14px;
  background: var(--foreground);
  color: var(--canvas-mid);
  font-size: 10px;
}

.m-toast b {
  margin-left: auto;
  color: #fdba74;
}

.m-cal {
  margin-top: 12px;
}

.m-cal-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
}

.m-cal-top span {
  color: var(--foreground-muted);
  font-weight: 500;
}

.m-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 3px;
  font-size: 9px;
  text-align: center;
}

.m-wd {
  color: var(--foreground-muted);
  font-size: 8px;
}

.m-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 23px;
}

.m-day b {
  font-weight: 400;
}

.m-day.is-today b {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--foreground);
  color: var(--canvas-mid);
  font-weight: 600;
}

.m-day em {
  padding-right: 4px;
  font-size: 10px;
  font-style: normal;
  line-height: 1.1;
  letter-spacing: -4px;
}

.m-daycard {
  margin-top: 8px;
}

.m-line {
  position: relative;
  height: 26px;
  margin: 8px 0 4px;
}

.m-line::before {
  content: "";
  position: absolute;
  top: 10px;
  right: 0;
  left: 0;
  border-top: 1.5px solid var(--line);
}

.m-line i {
  position: absolute;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.m-line u {
  position: absolute;
  top: 3px;
  height: 16px;
  border-left: 1.5px solid var(--accent);
  opacity: 0.6;
}

.m-ticks {
  position: absolute;
  top: 15px;
  right: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  color: var(--foreground-muted);
  font-size: 7px;
}

.m-post {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.m-post .m-emoji {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 13px;
}

.m-post b {
  font-size: 10.5px;
}

.m-post time {
  margin-left: 4px;
  color: var(--foreground-muted);
  font-size: 9.5px;
}

.m-post p {
  color: var(--foreground-secondary);
  font-size: 10px;
}

@media (max-width: 760px) {
  .intro,
  .features,
  .use-grid,
  .use {
    grid-template-columns: minmax(0, 1fr);
  }

  .intro {
    gap: 32px;
    padding-top: 40px;
  }

  .intro .phone {
    justify-self: center;
  }
}
