/* ============================================================
   Glance Works — one number, on your homescreen.
   The hero widget is a 1:1 replica of the Flow Now iOS widget:
   colors sampled from the app, geometry measured off the
   screenshots (176.7pt square card), so every interior size is a
   percentage of the card width via container units (cqw).
   No webfonts — the product is native iOS, so the type is too.
   ============================================================ */

:root {
  color-scheme: light dark;

  --bg:       #E7EDE6;
  --bg-2:     #EEF2EC;
  --ink:      #152420;
  --stone:    #5C6A61;
  --hairline: #D3DCD1;

  --moss:     #2C9F4B;   /* the app's sparkline green */
  --mint:     #6FC191;
  --amber:    #C47B18;   /* a falling river */

  --snow:     #6E8BA0;
  --tide:     #2F7A63;
  --aurora:   #5566A0;

  /* --- widget internals, sampled from the app --- */
  --card:      #FDFDFB;
  --card-ink:  #152420;
  --card-sub:  #808985;
  --card-cfs:  #858F8B;
  --card-spark:#2C9F4B;
  --card-trend:#C47B18;
  --card-topo: #EBEEEB;
  --card-line: #EEF1EE;

  --wrap: 660px;
  --sys: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
         "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #0D1712;
    --bg-2:     #10201A;
    --ink:      #E6EEE7;
    --stone:    #8A988E;
    --hairline: #1E2C25;

    --moss:     #57C185;
    --mint:     #8FD3A8;
    --amber:    #D8A64E;

    --snow:     #8CA4B8;
    --tide:     #4FA184;
    --aurora:   #7C8ECB;

    --card:      #2C3A36;
    --card-ink:  #EEF5EF;
    --card-sub:  #909B95;
    --card-cfs:  #848F8A;
    --card-spark:#8ED5A3;
    --card-trend:#E5B96F;
    --card-topo: #36433F;
    --card-line: #35423E;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sys);
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(680px 460px at 50% -6%, color-mix(in srgb, var(--moss) 10%, transparent), transparent 70%),
    radial-gradient(560px 420px at 100% 8%, color-mix(in srgb, var(--mint) 8%, transparent), transparent 72%);
  background-attachment: fixed;
}

a { color: var(--moss); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--moss); outline-offset: 3px; border-radius: 5px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }

/* ---------- Topbar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding-block: 22px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--ink);
  font-weight: 700; font-size: 1.04rem; letter-spacing: -0.02em; }
.wordmark:hover { text-decoration: none; }
.wordmark b { color: var(--stone); font-weight: 700; }
.wordmark__mark { width: 22px; height: 22px; color: var(--mint); }

.appstore { display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--bg); border-radius: 11px; padding: 7px 13px 7px 11px; line-height: 1; }
.appstore:hover { text-decoration: none; opacity: 0.9; }
.appstore__logo { width: 20px; height: 20px; fill: currentColor; flex: none; }
.appstore__text { display: flex; flex-direction: column; gap: 2px; }
.appstore__text small { font-size: 9px; letter-spacing: 0.02em; opacity: 0.85; }
.appstore__text strong { font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap; color: currentColor; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(32px, 6vw, 64px) 20px;
  display: flex; flex-direction: column; align-items: center; text-align: center; }
.topo-bg { position: absolute; top: clamp(-40px, -2vw, 0px); left: 50%; transform: translateX(-50%);
  width: min(780px, 152vw); height: min(780px, 152vw); color: var(--card-topo);
  opacity: 0.5; z-index: 0; pointer-events: none; }

.app-title {
  z-index: 1;
  font-size: clamp(1.5rem, 4.4vw, 1.9rem);
  font-weight: 700; letter-spacing: -0.028em;
  margin-bottom: clamp(16px, 2.4vw, 22px);
}

/* ---------- The Flow Now widget (exact replica) ----------
   Card: 176.7pt square. Every interior value below is the measured
   percentage of card width, expressed in cqw.                       */
.widget {
  container-type: inline-size;
  position: relative;
  z-index: 1;
  /* floor stays under 82vw at a 320px viewport (262px) so the card never
     overflows the 272px content box on the narrowest supported screen */
  width: clamp(240px, 82vw, 372px);
  aspect-ratio: 1 / 1;
  background: var(--card);
  /* % (not cqw): container units on the container itself resolve
     against an ancestor/viewport, not this element. Square card, so
     12.4% of the side == the app's ~22pt radius. */
  border-radius: 12.4%;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 1px 2px rgba(16,26,20,0.05), 0 34px 60px -30px rgba(13,30,20,0.45);
}
@media (prefers-color-scheme: dark) { .widget { border: 1px solid rgba(255,255,255,0.05); } }

.w-topo { position: absolute; inset: 0; width: 100%; height: 100%;
  color: var(--card-topo); pointer-events: none; }

.w-inner {
  position: relative; height: 100%;
  padding: 8.9cqw;
  display: flex; flex-direction: column; justify-content: space-between;
}

.w-name { font-size: 7.07cqw; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25;
  color: var(--card-ink); }
.w-loc  { font-size: 5.43cqw; font-weight: 400; line-height: 1.3; color: var(--card-sub); margin-top: 0.5cqw; }

.w-read { display: flex; align-items: baseline; gap: 2.2cqw; }
.w-num {
  font-size: 21.7cqw; font-weight: 800; line-height: 1; letter-spacing: -0.022em;
  color: var(--card-ink);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
}
.w-cfs { font-size: 4.45cqw; font-weight: 600; letter-spacing: 0.02em; color: var(--card-cfs); }

.w-foot { display: flex; flex-direction: column; }
.w-spark { width: 100%; height: auto; overflow: visible; margin-bottom: 3.4cqw; }
.w-spark__line {
  fill: none; stroke: var(--card-spark); stroke-width: 1.33;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: draw 0.9s ease 0.45s forwards;
}
.w-spark__dot { fill: var(--card-spark); opacity: 0; animation: dot 0.3s ease 1.25s forwards; }

.w-trend  { font-size: 5.8cqw; font-weight: 600; line-height: 1.2; color: var(--card-trend);
  font-variant-numeric: tabular-nums; }
.w-height { font-size: 5.4cqw; font-weight: 400; line-height: 1.2; color: var(--card-sub);
  margin-top: 1.4cqw; font-variant-numeric: tabular-nums; }

.thesis { max-width: 30rem; margin-top: 30px; color: var(--stone); font-size: 1.06rem; z-index: 1; }

/* ---------- Promise ---------- */
.promise { padding-block: clamp(38px, 7vw, 64px); }
.promise p { font-size: 1.2rem; line-height: 1.6; letter-spacing: -0.006em; }
.promise p + p { margin-top: 1.1rem; }
/* scoped to the paragraph: an unscoped `.promise strong` also hit the
   <strong>App Store</strong> inside the badge, painting it ink-on-ink.
   No nowrap — this phrase is long enough to overflow a narrow screen. */
.promise p strong { color: var(--ink); font-weight: 600; }
.appstore--cta { margin-top: 28px; z-index: 1; }

/* ---------- More apps ---------- */
.more { padding-block: clamp(34px, 6vw, 56px); border-top: 1px solid var(--hairline);
  margin-top: clamp(30px, 5vw, 52px); }
.more p { color: var(--stone); font-size: 1.06rem; }

/* ---------- Prose (privacy policy) ---------- */
.prose { padding-block: clamp(28px, 5vw, 48px) clamp(36px, 6vw, 60px); }
.prose h1 { font-size: clamp(1.7rem, 5vw, 2.1rem); font-weight: 700; letter-spacing: -0.028em; }
.prose__meta { color: var(--stone); font-size: 0.95rem; margin-top: 6px; }
.prose__meta strong { color: var(--ink); font-weight: 600; }
.prose__lede { font-size: 1.14rem; margin-top: 26px; }
.prose h2 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em;
  margin-top: 36px; margin-bottom: 8px; }
.prose p { color: var(--stone); }
.prose__lede, .prose h1 { color: var(--ink); }
.prose p strong, .prose li strong { color: var(--ink); font-weight: 600; }
.prose ul { margin: 10px 0 0; padding-left: 1.15rem; }
.prose li { color: var(--stone); margin-bottom: 8px; }
.prose li::marker { color: var(--mint); }
.prose p + p { margin-top: 12px; }

/* ---------- Footer ---------- */
.footer { padding-block: 32px 48px; border-top: 1px solid var(--hairline); }
.footer nav { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--stone); }
.footer a { color: var(--stone); }
.footer a:hover { color: var(--ink); }
.footer__sep { color: var(--hairline); }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes dot  { to { opacity: 1; } }

.rise { opacity: 0; animation: rise 0.72s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; animation-delay: var(--delay, 0ms); }

@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; animation: none; transform: none; }
  .w-spark__line { stroke-dashoffset: 0; animation: none; }
  .w-spark__dot { opacity: 1; animation: none; }
  * { scroll-behavior: auto !important; }
}
