/* Layout: white page, sticky top bar, one centered column (max 1080px) with wide screenshot rows. */
:root {
  --bg: #ffffff;
  --fg: #16181d;
  --muted: #5b616e;
  --line: #e6e8ec;
  --soft: #f0f1f3;
  --bit-on: #e00000;
  --bit-off: #515151;
  --frame: #888888;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --max: 1080px;
  --bar-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--bar-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--bit-on); outline-offset: 3px; border-radius: 4px; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Sticky menu bar */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.bar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 9;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar .wrap { display: flex; align-items: center; gap: 24px; height: var(--bar-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; white-space: nowrap; }
.brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 0 1px var(--line); }
.brand span { font-size: 1rem; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.97rem;
}
.nav a:hover { color: var(--fg); background: var(--soft); }
.nav a[aria-current="page"] { color: var(--fg); background: var(--soft); }
@media (max-width: 560px) {
  .brand span { display: none; }
  .bar .wrap { gap: 8px; }
  .nav a { padding: 8px 10px; }
}

main { display: block; }
section { padding-block: 72px; }
section + section { border-top: 1px solid var(--line); }
.lede { color: var(--muted); font-size: 1.15rem; max-width: 58ch; }
.eyebrow { font: 500 0.78rem/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* Play button */
.play {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--fg); color: #fff; text-decoration: none;
  padding: 10px 20px 10px 16px; border-radius: 10px;
  line-height: 1.15;
}
.play:hover { background: #000; }
.play.apk { background: var(--bg); color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--fg); }
.play.apk:hover { background: var(--soft); }
.apk-note { max-width: 70ch; }
.apk-note code { font-family: var(--font-mono); font-size: 0.8rem; word-break: break-all; }
.play svg { width: 26px; height: 26px; flex: none; }
.play small { display: block; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
.play b { font-size: 1.15rem; font-weight: 600; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.cta-note { color: var(--muted); font-size: 0.92rem; }

/* Hero */
.hero { padding-block: 56px 64px; }
.hero .wrap { display: grid; gap: 40px; }
.hero-text { display: grid; gap: 20px; max-width: 640px; }

/* Live clock in phone frame */
.clock-wrap { display: grid; gap: 14px; }
.clock {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 2513 / 1187;
  width: 100%;
  max-width: 100%;
  background: url("../img/clock-frame.webp") center / 100% 100% no-repeat;
}
.cell {
  position: absolute;
  width: 8.595%;
  height: 18.28%;
  border: 0.2cqw solid #000;
  border-radius: 1.7cqw;
  background: var(--bit-off);
  display: grid; place-items: center;
  font: 600 3.6cqw/1 var(--font-mono);
  color: transparent;
  transition: background-color 0.18s ease;
}
.cell.on { background: var(--bit-on); }
.clock.labels .cell.on { color: #fff; }
.clock.labels .cell:not(.on) { color: rgba(255, 255, 255, 0.28); }
@media (prefers-reduced-motion: reduce) { .cell { transition: none; } }

.clock-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.toggle button {
  font: 500 0.88rem/1 var(--font-body); color: var(--muted);
  background: none; border: 0; padding: 8px 12px; border-radius: 6px; cursor: pointer;
}
.toggle button[aria-pressed="true"] { background: var(--fg); color: #fff; }
.readout { font: 500 0.95rem/1.4 var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.readout b { color: var(--fg); font-weight: 600; }

/* How to read */
.howto { display: grid; gap: 28px; }
.howto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.howto-grid div { display: grid; gap: 6px; }
.howto-grid p { color: var(--muted); }
.weights { font-family: var(--font-mono); color: var(--fg); }

/* Highlights on home */
.highlights { display: grid; gap: 36px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
.card { display: grid; gap: 14px; align-content: start; }
.card p { color: var(--muted); }
.shot {
  border-radius: 22px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--soft);
}
.cards .shot { max-width: 300px; }
@media (max-width: 560px) { .cards .shot { max-width: 240px; } }
.more { font-weight: 500; }

/* Features page: one feature per row, sides alternate, every other row on a rounded gray panel */
.features { display: grid; gap: 24px; }
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 260px);
  gap: 48px;
  align-items: center;
  padding: 40px 48px;
  border-radius: 32px;
}
.feature:nth-child(even) { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); }
.feature:nth-child(even) .feature-text { order: 2; }
.feature.tinted { background: var(--soft); }
.feature-text { display: grid; gap: 12px; max-width: 52ch; }
.feature-text p { color: var(--muted); font-size: 1.05rem; }
.feature:nth-child(odd) .feature-text { justify-self: end; }
.feature-shot .shot { border-radius: 22px; }
.feature.wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.feature.wide:nth-child(even) { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.feature.wide .shot { border: 0; background: none; border-radius: 0; }

/* Two screenshots that crossfade back and forth */
.swap { display: grid; }
.swap > * { grid-area: 1 / 1; }
.swap > :nth-child(2) { animation: swap-fade 8s ease-in-out infinite; }
@keyframes swap-fade {
  0%, 40% { opacity: 0; }
  50%, 90% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .swap > :nth-child(2) { animation: none; opacity: 0; } }

/* Closing tablet section */
.tablet .wrap { display: grid; gap: 32px; justify-items: center; text-align: center; }
.tablet-shot { width: 100%; max-width: 900px; }
.tablet-text { display: grid; gap: 16px; justify-items: center; max-width: 62ch; }
.tablet-text h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.tablet-text p { color: var(--muted); font-size: 1.1rem; }
@media (max-width: 760px) {
  .feature, .feature:nth-child(even) { grid-template-columns: 1fr; gap: 24px; padding: 28px 20px; }
  .feature:nth-child(even) .feature-text { order: 0; }
  .feature:nth-child(odd) .feature-text { justify-self: start; }
  .feature-shot { max-width: 240px; }
  .feature.wide, .feature.wide:nth-child(even) { grid-template-columns: 1fr; }
  .feature.wide .feature-shot { max-width: 100%; }
}

/* Gallery strip */
.strip { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; }
.strip figure { margin: 0; flex: 0 0 200px; scroll-snap-align: start; display: grid; gap: 8px; }
.strip figcaption { font-size: 0.88rem; color: var(--muted); }

/* Download page */
.download-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; }
.download-head img { width: 120px; height: 120px; border-radius: 26px; box-shadow: 0 0 0 1px var(--line); }
@media (max-width: 560px) { .download-head { grid-template-columns: 1fr; } }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 0; }
.facts div { border-top: 1px solid var(--line); padding-top: 12px; }
.facts dt { font-size: 0.85rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.changelog { display: grid; gap: 28px; }
.release { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 20px; }
.release h3 { font: 600 1rem/1.5 var(--font-mono); }
.release ul { margin: 0; padding-left: 1.1em; color: var(--muted); display: grid; gap: 4px; }
.release p { font-weight: 600; }
@media (max-width: 560px) { .release { grid-template-columns: 1fr; gap: 6px; } }

/* Prose pages (privacy, support) */
.prose { max-width: 68ch; display: grid; gap: 18px; }
.prose h2 { font-size: 1.3rem; margin-top: 18px; }
.prose p, .prose li { color: #343843; }
.prose ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.prose .updated { color: var(--muted); font-size: 0.92rem; }
.faq { display: grid; gap: 12px; }
.faq details { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin-top: 10px; color: #343843; }
.email { font-family: var(--font-mono); font-weight: 500; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-block: 32px 40px; font-size: 0.92rem; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-left: auto; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--fg); text-decoration: underline; }
