/* Keepwatch landing page. Colours: tools/shell/tokens.css, header and footer:
   tools/shell/shell.css. The build links both before this file. */

:root {
  --radius: 16px;
  --radius-sm: 14px;
  --max: 1100px;
  --pad: 20px;
  --hpad: var(--pad);
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* Same content width with and without a scrollbar. */
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Footer stays at the bottom on short pages. */
body > main { flex: 1 0 auto; width: 100%; }

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; text-wrap: balance; }
p { text-wrap: pretty; }

a { color: var(--gold-light); text-decoration: none; }
a:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--on-gold);
  border-radius: 10px;
  font-weight: 600;
  z-index: 10;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* Header, footer and search: tools/shell/shell.css, linked before this file. */

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Store badges ---------- */

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  position: relative;
  display: block;
  height: 48px;
  border-radius: 9px;
}
.badge:hover { opacity: 0.85; }
.badge img { position: relative; height: 48px; width: auto; }

/* Fallback shown until the official badge files are added */
.badge-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 14px;
  background: #000;
  border: 1px solid #a6a6a6;
  border-radius: 9px;
  color: #fff;
  line-height: 1.1;
}
.badge-fallback small { font-size: 10px; }
.badge-fallback span { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }

.badge-appstore { width: 144px; }     /* 120 x 40 official ratio */
.badge-googleplay { width: 162px; }   /* 135 x 40 official ratio */

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

.phone {
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  padding: 7px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 34px;
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.55);
}

.screen {
  position: relative;
  aspect-ratio: 9 / 19.5;
  overflow: hidden;
  border-radius: 27px;
  background: var(--surface);
}

.screen::before {
  content: "Screenshot";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.screen img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 36px 0 48px;
  overflow: hidden;
}

.hero .wrap {
  position: relative;
  display: grid;
  gap: 36px;
}

.hero-media { position: relative; }

/* Faint warm light behind the phone */
.hero-media::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 420px;
  height: 420px;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(243, 164, 24, 0.08), transparent);
  pointer-events: none;
}
.hero-media .phone { position: relative; }

.hero h1 {
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 700;
  max-width: 14ch;
}

.hero .lede {
  margin-top: 14px;
  max-width: 38ch;
  color: var(--muted);
  font-size: 17px;
}

.hero .badges { margin-top: 24px; }

.hero .phone { max-width: 240px; }

/* ---------- Features ---------- */

.features {
  border-top: 1px solid var(--border);
}

.feature {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

.feature .wrap {
  display: grid;
  gap: 28px;
  align-items: center;
}

.icon-tile {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--raised);
  color: var(--gold-text);
}
.icon-tile svg { width: 20px; height: 20px; }

.feature h2 {
  font-size: clamp(1.4rem, 4.5vw, 1.75rem);
  font-weight: 700;
}

.feature p {
  margin-top: 8px;
  max-width: 42ch;
  color: var(--muted);
}

.feature-text {
  display: grid;
  gap: 32px;
}

.phones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
  max-width: 420px;
  margin: 0 auto;
}
.phones .phone { max-width: none; }

/* ---------- Free strip ---------- */

.free {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.free .wrap {
  display: grid;
  gap: 12px;
}

.free h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.free-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.free-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.free-list svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--gold);
}

/* ---------- Final CTA ---------- */

.cta {
  padding: 48px 0 56px;
}

.cta .wrap {
  display: grid;
  gap: 20px;
}

.cta h2 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
}

.cta p {
  margin-top: 4px;
  color: var(--muted);
}

/* ---------- Scroll fade-in (only when JS is on) ---------- */

.js .reveal {
  opacity: 0;
  transition: opacity 0.6s ease-out;
}
.js .reveal.is-visible { opacity: 1; }

/* ---------- Larger screens ---------- */

@media (min-width: 600px) {
  :root { --pad: 32px; }

  .free .wrap {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 32px;
  }
  .free-list {
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    gap: 8px 28px;
  }
}

@media (min-width: 860px) {
  .hero { padding: 48px 0 56px; }

  .hero .wrap {
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: center;
    gap: 48px;
  }

  .hero .phone { max-width: 260px; }

  .feature { padding: 44px 0; }

  .feature .wrap {
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 56px;
  }

  .feature-flip .wrap { grid-template-columns: 420px minmax(0, 1fr); }
  .feature-text { gap: 40px; }
  .feature-flip .feature-text { order: 2; }
  .feature-flip .feature-media { order: 1; }

  .cta .wrap {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .js .reveal { opacity: 1; }
}

/* ---------- Header button, hero facts ---------- */

.get { height: 40px; padding: 0 14px; border-radius: 10px; background: var(--gold); color: var(--on-gold); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; white-space: nowrap; }
.get:hover { background: var(--gold-hover); color: var(--on-gold); text-decoration: none; }
.facts { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.facts li::before { content: ""; display: inline-block; width: 11px; height: 6px; margin: 0 8px 3px 1px; border: solid #3fcf8e; border-width: 0 0 2px 2px; transform: rotate(-45deg); }

/* ---------- Game data block (filled by tools/build_data_pages.py) ---------- */

.gamedata { background: var(--surface); border-top: 1px solid var(--border); padding: 48px 0 56px; }
.gamedata .eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.gamedata h2 { margin: 6px 0 20px; font-size: clamp(1.4rem, 4vw, 1.9rem); font-weight: 700; letter-spacing: -.01em; }
.gamedata h3 { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.gamedata a { color: var(--text); }
.gamedata a:hover { text-decoration: none; }
.thstrip { position: relative; display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 14px; scrollbar-width: thin; }
.thstrip a { flex: 0 0 auto; width: 62px; padding: 7px 4px 6px; border-radius: 12px; background: var(--raised); border: 1px solid var(--border); text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.thstrip a img { width: 44px; height: 44px; object-fit: contain; margin: 0 auto 2px; }
.thstrip a:hover { border-color: var(--muted); }
.thstrip a.me { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); color: var(--text); }
.dgrid { display: grid; gap: 16px; }
.areas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.areas a { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 14px; background: var(--raised); border: 1px solid var(--border); min-width: 0; }
.areas a:hover { border-color: var(--muted); }
.areas img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 auto; }
.areas span { min-width: 0; }
.areas b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.areas small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; }
.hn { display: contents; }
.hn[hidden] { display: none !important; }
.hheroes > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hheroes a { padding: 9px 6px 8px; border-radius: 14px; background: var(--raised); border: 1px solid var(--border); text-align: center; min-width: 0; }
.hheroes a:hover { border-color: var(--muted); }
.hheroes img { width: 48px; height: 48px; object-fit: contain; margin: 0 auto 4px; }
.hheroes b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hheroes em { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--gold-text); }
.hheroes small { font-size: 11.5px; color: var(--dim); }
.hheroes a.off img { opacity: .45; filter: grayscale(.6); }
.hnew { padding: 16px; border-radius: 16px; background: var(--raised); border: 1px solid var(--border); display: grid; gap: 10px; align-content: start; }
.hnew h3 { margin: 0; }
.hnew > a:not(.more) { display: flex; align-items: center; gap: 10px; }
.hnew > a img { width: 38px; height: 38px; object-fit: contain; flex: 0 0 auto; }
.hnew b { display: block; font-size: 14.5px; }
.hnew small { display: block; font-size: 12.5px; color: var(--muted); }
.hnew p { margin: 0; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.hnew p:empty { display: none; }
.hnew .more { color: var(--gold-text); font-weight: 600; font-size: 14px; }
.hnew .more:hover { color: var(--gold-light); }
@media (min-width: 700px) {
  .areas { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hheroes > div { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .thstrip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; overflow: visible; padding: 2px 0 0; }
  .thstrip a { width: auto; padding: 6px 2px 5px; }
  .thstrip a img { width: 40px; height: 40px; }
}
@media (min-width: 900px) {
  .dgrid { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
  .areas { grid-column: 1; grid-row: 1; }
  .hheroes { grid-column: 1; grid-row: 2; }
  .hnew { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---------- Home: tracker hero (browser + phone) ---------- */

.eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hero-kw h1 { max-width: 15ch; margin-top: 10px; }
.hero-kw .lede { max-width: 44ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700; font-size: 16px; white-space: nowrap; }
.btn:hover { color: var(--text); text-decoration: none; border-color: var(--muted); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold-hover); border-color: var(--gold-hover); color: var(--on-gold); }
.hero-demo { margin-top: 14px; font-size: 14px; color: var(--muted); }
.hero-demo a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.hero-demo a:hover { color: var(--gold-text); }
.hero-kw .facts { margin-top: 20px; }

.hero-stage { position: relative; padding: 0 0 26px 34px; max-width: 620px; width: 100%; margin: 0 auto; }
.hero-stage::before { content: ""; position: absolute; inset: 10% 5% 0 20%; background: radial-gradient(closest-side, rgba(243, 164, 24, .09), transparent); pointer-events: none; }
.browser { position: relative; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-deep); overflow: hidden; box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .6); }
.browser-bar { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; background: var(--raised); border-bottom: 1px solid var(--border); }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--chip); }
.browser-bar span { margin-left: 12px; padding: 1px 10px; border-radius: 6px; background: var(--bg); color: var(--muted); font-size: 11px; }
.browser img { width: 100%; }
.hero-stage .phone { position: absolute; left: 0; bottom: 0; width: 30%; max-width: 180px; padding: 5px; border-radius: 26px; }
.hero-stage .screen { border-radius: 21px; }

/* ---------- Home: feature tiles ---------- */

.does { padding: 48px 0 56px; border-top: 1px solid var(--border); }
.does h2 { margin: 6px 0 22px; font-size: clamp(1.4rem, 4vw, 1.9rem); font-weight: 700; letter-spacing: -.01em; }
.tiles { display: grid; gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.tile h3 { font-size: 17px; font-weight: 700; }
.tile p { margin-top: -4px; color: var(--muted); font-size: 14.5px; }
.tile-vis { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; min-height: 0; padding-top: 6px; }
.tile-vis:has(> .phone-crop) { justify-content: flex-end; margin-bottom: -18px; }
.t-boost .tile-vis { justify-content: flex-end; }
.where { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tile .where { margin-top: -2px; }
.where li { padding: 1px 9px; border-radius: 99px; background: var(--chip); font-size: 12px; font-weight: 600; }
.where li.no { background: none; border: 1px dashed var(--border); color: var(--dim); font-weight: 500; text-decoration: line-through; text-decoration-color: var(--dim); }

/* a window onto part of a screenshot */
.crop { position: relative; overflow: hidden; background: var(--bg-deep); }
.crop img { width: 100%; }
.phone-crop { width: min(78%, 250px); height: 220px; margin-bottom: -6px; border: 5px solid var(--raised); border-radius: 22px; box-shadow: 0 10px 28px -14px rgba(0, 0, 0, .6); }
.phone-crop img { margin-top: -10%; }
.t-time .phone-crop img { margin-top: -2%; }
.web-crop { width: 100%; border-radius: 10px; border: 1px solid var(--border); }

.boosts { display: flex; flex-wrap: wrap; gap: 6px; align-self: stretch; margin: 0; padding: 0; list-style: none; }
.boosts li { padding: 3px 10px; border-radius: 99px; border: 1px solid var(--border); background: var(--raised); font-size: 12.5px; font-weight: 600; }
.boosts b { color: var(--new); }
.timers { display: grid; gap: 8px; align-self: stretch; }
.timer { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--raised); min-width: 0; }
.timer img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.timer small { display: block; font-size: 12px; color: var(--muted); }
.timer b { font-size: 18px; font-variant-numeric: tabular-nums; margin-right: 8px; white-space: nowrap; }
.timer s { font-size: 13px; color: var(--dim); white-space: nowrap; }

.widget { width: 100%; max-width: 320px; padding: 12px 14px; border-radius: 22px; background: var(--raised); border: 1px solid var(--border); box-shadow: 0 12px 30px -16px rgba(0, 0, 0, .6); }
.widget-h { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 11.5px; color: var(--muted); }
.widget-h b { color: var(--text); }
.widget-r { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 6px 0; border-top: 1px solid var(--border); }
.widget-r img { width: 28px; height: 28px; object-fit: contain; }
.widget-r b { display: block; font-size: 12.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget-r i { display: block; height: 4px; margin-top: 4px; border-radius: 3px; background: linear-gradient(90deg, var(--blue) var(--p), var(--chip) var(--p)); }
.widget-r.lab i { background: linear-gradient(90deg, #2dd4bf var(--p), var(--chip) var(--p)); }
.widget-r em { font-style: normal; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

.sync { position: relative; display: flex; align-items: flex-end; width: 100%; padding-right: 8%; }
.sync .web-crop { width: 82%; height: 140px; }
.sync .phone-crop { width: 28%; height: 150px; margin: 0 0 -26px -18%; border-width: 4px; border-radius: 18px; }
.sync .phone-crop img { margin-top: -4%; }
.synced { position: absolute; top: 8px; right: 0; padding: 2px 10px; border-radius: 99px; background: var(--new-bg); color: var(--new); font-size: 12px; font-weight: 600; }
.synced::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 0; border-radius: 50%; background: currentColor; }

/* phones: the tiles become a row to swipe through */
@media (max-width: 599px) {
  .tiles { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad) 8px; scroll-padding: 0 var(--pad); scrollbar-width: none; }
  .tiles::-webkit-scrollbar { display: none; }
  .tiles:focus-visible { outline-offset: -2px; }
  .tile { flex: 0 0 84%; scroll-snap-align: start; }
  .phone-crop { height: 200px; }
  .t-boost .timer + .timer { display: none; }
}
@media (min-width: 600px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; }
  .t-left, .t-boost, .t-sync { grid-column: span 2; }
  .tile { min-height: 360px; }
}
@media (min-width: 860px) {
  .hero-kw .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; }
  .hero-stage { max-width: none; }
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
  .tile, .t-sync { grid-column: span 2; }
  .t-left, .t-boost { grid-column: span 4; }
  .t-boost .timers { grid-template-columns: 1fr 1fr; }
}
