/* ============================================================
   Orken — website styles
   Design tokens mirror the app's "Sprout" system
   (core.html and Orken/DesignSystem/HabitColors.swift).

   Landing page is built from full-bleed alternating bands:
   deep forest <-> light. No nav bar, no cards, no borders —
   one idea and one visual per band.
   ============================================================ */

:root {
  /* Sprout tokens */
  --forest: #0E3B2E;
  --emerald: #1E7A4F;
  --leaf: #2EA46B;
  --mint: #BFEBD0;
  --mist: #E8F4EC;
  --lime: #C8F259;
  --ink: #0B1F17;
  --muted: #6E8A7C;
  --sep: #E3ECE6;
  --danger: #E5484D;
  --gold: #F5A524;

  /* Band surfaces. --deep keeps the brand colour in both themes;
     only the light band flips. */
  --deep: #0E3B2E;
  --on-deep: #FFFFFF;
  --on-deep-dim: rgba(255, 255, 255, .68);
  --light: #F2F6F3;
  --on-light: #0B1F17;
  --on-light-dim: #5C7A6B;
  --surface: #FFFFFF;

  --r-card: 18px;
  --r-control: 14px;
  --maxw: 1080px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
}

:root[data-theme="dark"] {
  --light: #08150F;
  --on-light: #F5F8F6;
  --on-light-dim: #94B0A2;
  --surface: #132A20;
  --mist: #162E24;
  --sep: #20382D;
  --ink: #F5F8F6;
  --muted: #94B0A2;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --light: #08150F;
    --on-light: #F5F8F6;
    --on-light-dim: #94B0A2;
    --surface: #132A20;
    --mist: #162E24;
    --sep: #20382D;
    --ink: #F5F8F6;
    --muted: #94B0A2;
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

body {
  position: relative;
  font-family: var(--font);
  background: var(--light);
  color: var(--on-light);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 200;
  background: var(--forest); color: #fff; padding: 10px 16px; border-radius: 10px;
}
.skip-link:focus { left: 16px; }

/* ============================================================
   Scroll reveals — fade and rise as a section enters the viewport.

   The hidden state is scoped to .js, which head.js sets in <head> before
   the body paints; without JS nothing is ever hidden, so the page degrades
   to plain static content. head.js also drops .js again after a timeout if
   site.js never initialises, so a failed script can't leave a blank page.

   prefers-reduced-motion must restore opacity explicitly here: the global
   reduced-motion rule only collapses durations, which would leave these
   elements stuck at opacity 0 waiting for an observer that never fires.
   ============================================================ */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition:
    opacity .85s cubic-bezier(.16, 1, .3, 1),
    transform .85s cubic-bezier(.16, 1, .3, 1);
  transition-delay: var(--rd, 0ms);
}

/* Device mockups travel a little further and settle from slightly small. */
.js [data-reveal="phone"] {
  transform: translate3d(0, 46px, 0) scale(.965);
  transition-duration: 1.05s;
}

.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal],
  .js [data-reveal="phone"] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   Bands — the whole landing page is a stack of these
   ============================================================ */

.band {
  padding-block: clamp(76px, 11vw, 132px);
  padding-inline: 24px;
  text-align: center;
  position: relative;
}
.band > * { margin-inline: auto; }

.band-deep  { background: var(--deep);  color: var(--on-deep); }
.band-light { background: var(--light); color: var(--on-light); }

/* The hero band carries the wordmark and runs tighter at the top. */
.band-hero { padding-top: clamp(52px, 7vw, 84px); padding-bottom: 0; overflow: hidden; }

/* One large statement per band. Short on purpose. */
.statement {
  font-size: clamp(27px, 4.4vw, 46px);
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -.03em;
  max-width: 17ch;
  text-wrap: balance;
}
.band-light .statement { color: var(--on-light); }
.band-deep  .statement { color: var(--on-deep); }

/* Supporting line under a statement. */
.support-text {
  margin-top: 22px;
  font-size: clamp(16.5px, 1.9vw, 19px);
  line-height: 1.62;
  max-width: 46ch;
}
.band-light .support-text { color: var(--on-light-dim); }
.band-deep  .support-text { color: var(--on-deep-dim); }

.kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.band-deep  .kicker { color: var(--lime); }
.band-light .kicker { color: var(--leaf); }

/* ---------- Wordmark ---------- */
.wordmark {
  font-size: clamp(52px, 12vw, 124px);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: .9;
  text-transform: uppercase;
  color: var(--on-deep);
}

.tagline {
  margin-top: 20px;
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 500;
  color: var(--on-deep-dim);
  max-width: 32ch;
  margin-inline: auto;
  text-wrap: balance;
}

/* Small status pill under the wordmark */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 26px;
  padding: 9px 18px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .16);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--on-deep);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--lime); flex-shrink: 0;
}

/* ---------- App Store button ---------- */
.appstore {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-height: 60px;
  padding: 0 26px 0 22px;
  border-radius: var(--r-control);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.appstore svg { width: 27px; height: 27px; flex-shrink: 0; fill: currentColor; }
.appstore .as-txt { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.appstore .as-txt small { font-size: 11px; font-weight: 500; opacity: .82; letter-spacing: .2px; }
.appstore .as-txt strong { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.appstore:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, .22); }
.appstore[aria-disabled="true"] { cursor: default; }
.appstore[aria-disabled="true"]:hover { transform: none; box-shadow: none; }

/* On a deep band the button is light; on a light band it is black. */
.band-deep  .appstore { background: #FFFFFF; color: #0B1F17; }
.band-light .appstore { background: #000000; color: #FFFFFF; }
:root[data-theme="dark"] .band-light .appstore { background: #F5F8F6; color: #0B1F17; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .band-light .appstore { background: #F5F8F6; color: #0B1F17; }
}

.cta { margin-top: 40px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.cta-note { font-size: 13.5px; font-weight: 500; }
.band-deep  .cta-note { color: var(--on-deep-dim); }
.band-light .cta-note { color: var(--on-light-dim); }

/* ---------- Example habit list (band 2) ---------- */
.examples {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 680px;
}
.examples li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: 99px;
  background: var(--mist);
  color: var(--emerald);
  font-size: 15px;
  font-weight: 600;
}
:root[data-theme="dark"] .examples li { color: var(--mint); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .examples li { color: var(--mint); }
}

/* ---------- Metric list (Apple Health band) ---------- */
.metrics {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 20px;
  max-width: 620px;
}
@media (max-width: 620px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.metrics li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15.5px;
  font-weight: 500;
  text-align: left;
}
.metrics svg {
  width: 17px; height: 17px; flex-shrink: 0;
  stroke: var(--leaf); stroke-width: 2.6; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
.band-deep .metrics svg { stroke: var(--lime); }

/* ---------- Languages line ---------- */
.langs {
  margin-top: 26px;
  font-size: 14.5px;
  max-width: 44ch;
}
.band-light .langs { color: var(--on-light-dim); }
.band-deep  .langs { color: var(--on-deep-dim); }

/* ---------- Floating language toggle ---------- */
/* Sits at the top of the page and scrolls away with it. It used to be
   position:fixed, which meant the pill hovered over every band and covered
   the right-hand end of centred headings on narrow screens. The footer
   carries a second copy so language stays reachable from the bottom too.
   Styled neutrally: a translucent white pill reads over both band colours. */
.lang-switch {
  position: absolute;
  top: 18px; right: 18px;
  z-index: 90;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 2px 14px rgba(8, 26, 18, .18);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
}
.lang-switch button {
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .4px;
  border-radius: 99px;
  color: #4A6B5B;
  transition: background .15s ease, color .15s ease;
}
.lang-switch button[aria-pressed="true"] { background: var(--forest); color: #fff; }

:root[data-theme="dark"] .lang-switch { background: rgba(19, 42, 32, .86); }
:root[data-theme="dark"] .lang-switch button { color: var(--mint); }
:root[data-theme="dark"] .lang-switch button[aria-pressed="true"] { background: var(--leaf); color: #0B1F17; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lang-switch { background: rgba(19, 42, 32, .86); }
  :root:not([data-theme="light"]) .lang-switch button { color: var(--mint); }
  :root:not([data-theme="light"]) .lang-switch button[aria-pressed="true"] { background: var(--leaf); color: #0B1F17; }
}

/* Second copy in the footer — in flow, centred. */
/* Block-level so it takes its own line. As inline-flex it sat on the same
   centred line as the .foot-mark wordmark, which is also inline-flex. */
.site-footer .lang-switch {
  position: static;
  display: flex;
  width: fit-content;
  margin: 0 auto 26px;
}

/* ============================================================
   iPhone mockup — a faithful rebuild of the app's Today screen
   ============================================================ */
.hero-phone {
  margin-top: clamp(44px, 6vw, 68px);
  display: flex;
  justify-content: center;
}

.phone {
  width: 330px;
  height: 610px;
  border-radius: 48px;
  background: #F2F6F3;
  color: #0B1F17;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 10px #081A12, 0 0 0 11px #2A3D34, 0 -10px 60px rgba(0, 0, 0, .28);
}
.phone .notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 98px; height: 26px; background: #081A12; border-radius: 24px; z-index: 20;
}
.phone .statusbar {
  height: 46px;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 26px 6px 30px;
  font-size: 13px; font-weight: 600;
  position: relative; z-index: 10;
}
.phone .statusbar .icons { display: flex; gap: 5px; align-items: center; }
.phone .statusbar .icons svg { width: 15px; height: 15px; fill: #0B1F17; }

.screen {
  height: calc(100% - 46px);
  overflow: hidden;
  /* Clears the Dynamic Island: without it the nav title sits ~9px under the
     island and the mockup's header reads as cut into the cutout. */
  padding: 8px 14px 0;
  display: flex; flex-direction: column; gap: 11px;
  text-align: left;
}

.scr-title { display: flex; justify-content: space-between; align-items: flex-end; padding-top: 2px; }
.scr-title .eyebrow { font-size: 11px; font-weight: 600; color: #6E8A7C; }
.scr-title h2 { font-size: 28px; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; }
.scr-title .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #0E3B2E; color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}

.week { display: flex; justify-content: space-between; gap: 4px; }
.week .day {
  flex: 1; text-align: center; font-size: 10px; font-weight: 600;
  color: #6E8A7C; padding: 6px 0 5px; border-radius: 10px;
}
.week .day .n { font-size: 13px; font-weight: 700; color: #0B1F17; margin-top: 2px; }
.week .day.done { background: #E8F4EC; }
.week .day.done .n { color: #1E7A4F; }
.week .day.today { background: #0E3B2E; }
.week .day.today, .week .day.today .n { color: #fff; }

.scr-hero {
  background: linear-gradient(135deg, #1E7A4F, #0E3B2E);
  border-radius: 22px; padding: 16px;
  color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.scr-hero h3 { font-size: 16px; font-weight: 700; line-height: 1.25; letter-spacing: -.2px; }
.scr-hero p { font-size: 11.5px; opacity: .82; margin-top: 3px; }
.scr-hero .streak-pill {
  display: inline-block; margin-top: 9px;
  background: rgba(255, 255, 255, .16);
  padding: 4px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
}
.ring {
  width: 74px; height: 74px; border-radius: 50%;
  background: conic-gradient(#C8F259 0 var(--p, 57%), rgba(255, 255, 255, .16) var(--p, 57%) 100%);
  display: grid; place-items: center; position: relative; flex-shrink: 0;
}
.ring::before { content: ""; position: absolute; inset: 8px; background: #1E7A4F; border-radius: 50%; }
.ring span { position: relative; font-weight: 700; font-size: 16px; text-align: center; }
.ring small { display: block; font-size: 9px; opacity: .72; font-weight: 500; }

.scr-sec {
  font-size: 11px; font-weight: 700; color: #6E8A7C;
  text-transform: uppercase; letter-spacing: .5px;
  padding-inline: 3px; margin-bottom: -4px;
  display: flex; justify-content: space-between; align-items: center;
}
.scr-sec .n { text-transform: none; letter-spacing: 0; font-weight: 500; }

.habit {
  background: #fff; border-radius: 18px; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 1px 2px rgba(14, 59, 46, .05);
}
.habit .icon {
  width: 38px; height: 38px; border-radius: 11px; background: #E8F4EC;
  display: grid; place-items: center; font-size: 17px; position: relative; flex-shrink: 0;
}
.habit .icon .hdot {
  position: absolute; right: -3px; bottom: -3px;
  width: 15px; height: 15px; border-radius: 50%; background: #fff;
  display: grid; place-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  font-size: 8px; color: #FF2D55;
}
.habit .info { flex: 1; min-width: 0; }
.habit .info b {
  display: block; font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.habit .info span {
  display: block; font-size: 10.5px; color: #6E8A7C; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.habit .streak { font-size: 11px; font-weight: 700; color: #1E7A4F; flex-shrink: 0; }
.habit .check { width: 25px; height: 25px; border-radius: 50%; border: 2px solid #CDDBD2; flex-shrink: 0; }
.habit.done .check {
  border-color: #2EA46B; background: #2EA46B;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 15px; background-position: center; background-repeat: no-repeat;
}
.habit .check.auto {
  border: none; background: #E8F4EC;
  display: grid; place-items: center;
  font-size: 9.5px; font-weight: 800; color: #1E7A4F;
}
.habit .track { margin-top: 5px; height: 4px; border-radius: 99px; background: #E3ECE6; overflow: hidden; }
.habit .track i { display: block; height: 100%; border-radius: 99px; background: #2EA46B; }

@media (max-width: 400px) { .phone { width: 296px; height: 560px; } }

/* ============================================================
   Screenshot showcase — rows of phones, one screen per feature.
   Desktop: centred row. Mobile: horizontal scroll-snap so a band
   never becomes a column of full-height phones.
   ============================================================ */
.phones {
  margin-top: clamp(40px, 5vw, 60px);
  display: flex;
  gap: 26px;
  justify-content: center;
  align-items: flex-start;
}
.phones .phone { width: 300px; height: 572px; border-radius: 44px; }
.phones .phone .screen { height: calc(100% - 46px); }

@media (max-width: 860px) {
  .phones {
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-inline: max(24px, calc((100vw - 300px) / 2));
    margin-inline: -24px;
    gap: 20px;
  }
  .phones::-webkit-scrollbar { display: none; }
  .phones > * { scroll-snap-align: center; }
}

/* Caption under each phone */
.shot { display: flex; flex-direction: column; align-items: center; gap: 16px; flex-shrink: 0; }
.shot figcaption {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .2px;
}
.band-deep  .shot figcaption { color: var(--on-deep-dim); }
.band-light .shot figcaption { color: var(--on-light-dim); }

/* ---------- Shared in-screen chrome ---------- */
.scr-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 2px;
}
.scr-nav h2 { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.scr-nav .ic {
  width: 30px; height: 30px; border-radius: 50%;
  background: #E6EEE9; color: #0E3B2E;
  display: grid; place-items: center; font-size: 16px; font-weight: 600;
}
.scr-nav .ic.dark { background: #0E3B2E; color: #fff; }

.seg {
  display: flex; background: #E4EBE6; border-radius: 10px; padding: 2px; flex-shrink: 0;
}
.seg div {
  flex: 1; text-align: center; padding: 6px;
  font-size: 12px; font-weight: 600; border-radius: 8px; color: #4A6B5B;
}
.seg div.on { background: #fff; color: #0B1F17; box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }

/* ---------- Challenge card ---------- */
.ch { background: #fff; border-radius: 20px; overflow: hidden; flex-shrink: 0; }
.ch .cover {
  height: 88px; padding: 13px;
  display: flex; flex-direction: column; justify-content: space-between;
  color: #fff; position: relative; overflow: hidden;
}
.ch .cover::after {
  content: ""; position: absolute; right: -30px; top: -40px;
  width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, .12);
}
.ch .cover.g1 { background: linear-gradient(135deg, #1E7A4F, #0E3B2E); }
.ch .cover.g2 { background: linear-gradient(135deg, #2EA46B, #1E7A4F); }
.ch .cover b { font-size: 16px; font-weight: 700; position: relative; z-index: 1; }
.ch .cover .em { font-size: 28px; position: absolute; right: 14px; bottom: 8px; }
.ch .cover .tags { display: flex; gap: 6px; }
.tag {
  font-size: 9px; font-weight: 800; letter-spacing: .6px;
  padding: 3px 7px; border-radius: 6px;
  background: rgba(255, 255, 255, .22); color: #fff;
}
.tag.live { background: #C8F259; color: #0E3B2E; }

.ch .body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 9px; }
.ch .gl {
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 600; color: #4A6B5B; margin-bottom: 5px;
}
.track.thick { height: 7px; border-radius: 99px; background: #E3ECE6; overflow: hidden; }
.track.thick i { display: block; height: 100%; border-radius: 99px; background: #2EA46B; }
.ch .meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: #6E8A7C; font-weight: 500;
}
.ch .meta .l { display: flex; align-items: center; gap: 7px; }

.stack { display: flex; }
.stack .av { margin-left: -7px; border: 2px solid #fff; }
.stack .av:first-child { margin-left: 0; }
.av {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 9px; color: #fff; flex-shrink: 0;
}
.av.a2 { background: #5B9BD5; }
.av.a3 { background: #F5A524; }
.av.a4 { background: #A78BFA; }
.av.a5 { background: #E5484D; }
.av.more { background: #CDDBD2; color: #0E3B2E; }

/* ---------- Leaderboard rows ---------- */
.lb { background: #fff; border-radius: 18px; padding: 6px 13px; }
.lb .row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid #E3ECE6;
}
.lb .row:first-child { border-top: none; }
.lb .row .rk { width: 16px; font-size: 12px; font-weight: 700; color: #6E8A7C; }
.lb .row .nm { flex: 1; font-size: 13px; font-weight: 500; }
.lb .row .pc { font-size: 13px; font-weight: 700; color: #1E7A4F; }
.lb .row.me { background: #E8F4EC; margin-inline: -13px; padding-inline: 13px; border-radius: 10px; border-top-color: transparent; }

/* ---------- Calendar ---------- */
.cal-card { background: #fff; border-radius: 18px; padding: 13px; }
.cal-card h5 {
  font-size: 14px; font-weight: 700; margin-bottom: 11px;
  display: flex; justify-content: space-between; align-items: center;
}
.cal-card h5 span { color: #6E8A7C; font-weight: 500; font-size: 11.5px; }
.cal-head {
  display: grid; grid-template-columns: repeat(7, 1fr);
  font-size: 10.5px; font-weight: 600; color: #6E8A7C;
  text-align: center; margin-bottom: 5px;
}
.cal { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; }
.cal div {
  height: 36px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  font-size: 13px; font-weight: 500; border-radius: 10px;
}
.cal div.mute { color: #B7C4BC; }
.cal div.sel { background: #0E3B2E; color: #fff; }
.cal .d { display: flex; gap: 2px; }
.cal .d i { width: 4px; height: 4px; border-radius: 50%; background: #2EA46B; }
.cal .d i.o { background: #F5A524; }
.cal div.sel .d i { background: #C8F259; }

/* ---------- Level & XP (gamification) ---------- */
.lvl-hero {
  background: linear-gradient(150deg, #1E7A4F, #0E3B2E);
  border-radius: 22px; padding: 20px 16px; color: #fff; text-align: center;
}
.lvl-hero .tier { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.lvl-hero .sub { font-size: 11.5px; opacity: .78; margin-top: 4px; }
.lvl-hero .bar {
  margin-top: 14px; height: 8px; border-radius: 99px;
  background: rgba(255, 255, 255, .18); overflow: hidden;
}
.lvl-hero .bar i { display: block; height: 100%; border-radius: 99px; background: #C8F259; }
.lvl-hero .xp { margin-top: 8px; font-size: 11px; font-weight: 600; color: #C8F259; }

.stages { background: #fff; border-radius: 18px; padding: 4px 13px; }
.stages .st {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px solid #E3ECE6;
}
.stages .st:first-child { border-top: none; }
.stages .st .nm { flex: 1; font-size: 13px; font-weight: 600; }
.stages .st .tagx {
  font-size: 8.5px; font-weight: 800; letter-spacing: .5px;
  padding: 3px 7px; border-radius: 6px; background: #E8F4EC; color: #1E7A4F;
}
.stages .st.dim .nm { color: #B7C4BC; font-weight: 500; }

.xp-rule {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 14px; padding: 10px 13px;
}
.xp-rule .ico {
  width: 30px; height: 30px; border-radius: 9px; background: #E8F4EC;
  display: grid; place-items: center; font-size: 14px; flex-shrink: 0;
}
.xp-rule .t { flex: 1; font-size: 12.5px; font-weight: 600; }
.xp-rule .v { font-size: 12px; font-weight: 800; color: #1E7A4F; }

/* ---------- Apple Health rows ---------- */
.hlist { background: #fff; border-radius: 18px; padding: 2px 13px; }
.hlist .hr {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-top: 1px solid #E3ECE6;
}
.hlist .hr:first-child { border-top: none; }
.hlist .hr .ico {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; font-size: 13px;
  background: #FFE8ED; flex-shrink: 0;
}
.hlist .hr .nm { flex: 1; font-size: 13px; font-weight: 500; }
.hlist .hr .vl { font-size: 13px; font-weight: 700; color: #0B1F17; }
.toggle {
  width: 38px; height: 23px; border-radius: 99px; background: #2EA46B;
  position: relative; flex-shrink: 0;
}
.toggle::after {
  content: ""; position: absolute; right: 2px; top: 2px;
  width: 19px; height: 19px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: #081A12;
  color: rgba(255, 255, 255, .62);
  padding: 60px 24px 48px;
  text-align: center;
  font-size: 14px;
}
.foot-mark {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px; color: #fff;
  letter-spacing: -.02em; text-decoration: none;
  margin-bottom: 26px;
}
.foot-mark .m {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(160deg, #35C27E, #1E7A4F);
  display: grid; place-items: center;
}
.foot-mark .m svg { width: 17px; height: 17px; stroke: #fff; stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.foot-links {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 12px 30px; margin-bottom: 30px;
}
.foot-links a {
  color: rgba(255, 255, 255, .8);
  text-decoration: none; font-size: 15px; font-weight: 500;
  transition: color .15s ease;
}
.foot-links a:hover { color: #C8F259; }

.foot-fine { font-size: 12.5px; line-height: 1.7; color: rgba(255, 255, 255, .42); max-width: 62ch; margin-inline: auto; }
.foot-fine a { color: rgba(255, 255, 255, .62); }

/* ============================================================
   Legal / support pages
   ============================================================ */
.doc-header {
  padding: 22px 24px;
  background: var(--light);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--sep);
}
.doc-header .brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 19px; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none;
}
.doc-header .brand .m {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(160deg, #35C27E, #1E7A4F);
  display: grid; place-items: center;
}
.doc-header .brand .m svg { width: 17px; height: 17px; stroke: #fff; stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.doc-hero { padding: 56px 24px 30px; text-align: center; }
.doc-hero h1 { font-size: clamp(30px, 5vw, 42px); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; }
.doc-hero .updated { font-size: 14px; color: var(--muted); margin-top: 14px; }
.doc-hero .lede { font-size: 17px; color: var(--muted); margin: 14px auto 0; max-width: 52ch; line-height: 1.6; }
.doc-hero .back { font-size: 14px; color: var(--muted); text-decoration: none; }
.doc-hero .back:hover { color: var(--leaf); }

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

.doc { max-width: 720px; margin-inline: auto; padding: 34px 24px 60px; }
.doc h2 { font-size: 22px; font-weight: 700; margin: 40px 0 14px; letter-spacing: -.02em; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { font-size: 17px; font-weight: 700; margin: 26px 0 10px; }
.doc p { margin-bottom: 14px; font-size: 16px; line-height: 1.72; }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 2px; }
.doc li { position: relative; padding-left: 22px; margin-bottom: 9px; font-size: 16px; line-height: 1.68; }
.doc ul li::before {
  content: ""; position: absolute; left: 4px; top: 11px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--leaf);
}
.doc ol { counter-reset: li; }
.doc ol li { counter-increment: li; }
.doc ol li::before {
  content: counter(li) "."; position: absolute; left: 0; top: 0;
  color: var(--emerald); font-weight: 700; font-size: 14px;
}
.doc strong { font-weight: 650; }
.doc a { color: var(--emerald); text-decoration: underline; text-underline-offset: 3px; }

.doc .callout {
  background: var(--mist);
  border-left: 3px solid var(--leaf);
  border-radius: var(--r-control);
  padding: 18px 20px; margin: 24px 0;
}
.doc .callout p { margin-bottom: 0; font-size: 15.5px; }
.doc .callout p + p { margin-top: 10px; }

.doc .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.doc table { width: 100%; border-collapse: collapse; margin: 20px 0 26px; font-size: 14.5px; }
.doc th, .doc td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--sep); vertical-align: top; }
.doc th {
  font-weight: 700; background: var(--mist); font-size: 12.5px;
  text-transform: uppercase; letter-spacing: .5px; color: var(--emerald);
}
.doc tbody tr:last-child td { border-bottom: none; }

.toc {
  background: var(--surface);
  border: 1px solid var(--sep);
  border-radius: var(--r-card);
  padding: 22px 24px; margin-bottom: 40px;
}
.toc h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 14px; }
.toc ol { columns: 2; column-gap: 28px; margin: 0; }
@media (max-width: 620px) { .toc ol { columns: 1; } }
.toc li { padding-left: 0; margin-bottom: 8px; font-size: 14px; break-inside: avoid; }
.toc li::before { content: none; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--emerald); text-decoration: underline; }

/* Support page cards */
.support-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 48px; }
@media (max-width: 860px) { .support-grid { grid-template-columns: 1fr; } }
.support-card {
  background: var(--surface);
  border: 1px solid var(--sep);
  border-radius: var(--r-card);
  padding: 26px 24px;
  display: flex; flex-direction: column;
}
.support-card .fi {
  width: 44px; height: 44px; border-radius: 12px; background: var(--mist);
  display: grid; place-items: center; margin-bottom: 16px;
}
.support-card .fi svg { width: 22px; height: 22px; stroke: var(--emerald); stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.support-card h3 { margin-bottom: 8px; font-size: 17px; font-weight: 700; }
.support-card p { font-size: 14.5px; color: var(--muted); margin-bottom: 18px; flex: 1; line-height: 1.58; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border-radius: var(--r-control);
  background: var(--forest); color: #fff;
  font-size: 15.5px; font-weight: 600; text-decoration: none;
  transition: transform .18s ease;
  width: 100%;
}
.btn:hover { transform: translateY(-2px); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--sep); }
:root[data-theme="dark"] .btn { background: var(--leaf); color: #0B1F17; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn { background: var(--leaf); color: #0B1F17; }
}

.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--sep);
  border-radius: var(--r-card);
  overflow: hidden;
}
.faq summary {
  padding: 18px 20px; font-size: 15.5px; font-weight: 600;
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 9px; height: 9px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s ease; flex-shrink: 0; margin-right: 4px;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq .faq-body { padding: 0 20px 18px; font-size: 15px; color: var(--muted); line-height: 1.65; }
.faq .faq-body p + p { margin-top: 10px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-row .btn { width: auto; }

/* ---------- Language block visibility ---------- */
[data-lang-block] { display: none; }
[data-lang-block].active { display: block; }
.no-js [data-lang-block="en"] { display: block; }
