/* Offset: the site in the app's own design language.
   Colours from native/ios/Offset (PageInk, AccentColor, LaunchBackground, AppIcon.icon).
   Titles and numbers in Geologica, as the app sets them; body text in the system face. */

@font-face {
  font-family: "Geologica";
  src: url("fonts/Geologica-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #f4f1ea;
  --card: #fbf8f2;
  --raised: #fbf8f2;
  --ink: #17211d;
  --ink-2: #4a544e;
  --ink-3: #5e6862;
  --accent: #1f6b57;
  --accent-ink: #ffffff;
  --mint: #9ee0c3;
  --wash-top: #e9f2ed;
  --wash-bottom: #d6e8de;
  --tint: rgba(31, 107, 87, 0.10);
  --band: rgba(31, 107, 87, 0.12);
  --segment: rgba(23, 33, 29, 0.07);
  --hair: rgba(23, 33, 29, 0.10);
  --grid: rgba(23, 33, 29, 0.18);
  --glass: rgba(251, 248, 242, 0.74);
  --glass-edge: rgba(255, 255, 255, 0.6);
  --shadow: 0 12px 30px rgba(23, 33, 29, 0.08);
  --deep: #123b31;
  --display: "Geologica", -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0f1412;
    --card: #1f2925;
    --raised: rgba(255, 255, 255, 0.18);
    --ink: #eceae4;
    --ink-2: #bac3bd;
    --ink-3: #9ca8a2;
    --accent: #9ee0c3;
    --accent-ink: #0b1512;
    --wash-top: #123b31;
    --wash-bottom: #0b1512;
    --tint: rgba(158, 224, 195, 0.14);
    --band: rgba(158, 224, 195, 0.16);
    --segment: rgba(255, 255, 255, 0.08);
    --hair: rgba(255, 255, 255, 0.10);
    --grid: rgba(255, 255, 255, 0.28);
    --glass: rgba(31, 41, 37, 0.70);
    --glass-edge: rgba(255, 255, 255, 0.10);
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    --deep: #0b1512;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 17px/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 10px; }

.wrap { width: min(70rem, 100% - 32px); margin-inline: auto; }

/* Top bar: the wordmark, as the app's first site drew it */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 20px 0; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 24px/1 var(--display); letter-spacing: -0.8px; color: var(--ink); text-decoration: none; }
.wordmark img { width: 34px; height: 34px; border-radius: 22.5%; }
.wordmark .off { font-weight: 300; }
.wordmark .set { font-weight: 650; color: var(--accent); }
.links { display: flex; gap: 18px; font-size: 15px; }
.links a { color: var(--ink-3); text-decoration: none; }
.links a:hover { color: var(--ink); }

/* Segmented control for the subpages (the app's segment and raised tokens) */
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--segment); }
.segmented a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-3); text-decoration: none; }
.segmented a:hover { color: var(--ink); }
.segmented a[aria-current="page"] { background: var(--raised); color: var(--ink); box-shadow: 0 1px 3px rgba(23, 33, 29, 0.12); }

/* Small capitals, as every section in the app names itself */
.label { margin: 0 0 12px; font: 700 13px/1.2 var(--text); letter-spacing: 0.8px; text-transform: uppercase; color: var(--accent); }

/* Today: the allowance is the hero */
.panel {
  display: grid; gap: clamp(28px, 5vw, 56px); align-items: center;
  padding: clamp(28px, 5vw, 64px);
  border-radius: 40px;
  background: linear-gradient(180deg, var(--wash-top), var(--wash-bottom));
}
@media (min-width: 880px) { .panel { grid-template-columns: 1.05fr 1fr; } }

h1 { margin: 0 0 18px; font: 500 clamp(40px, 6.4vw, 68px)/1.04 var(--display); letter-spacing: -0.04em; text-wrap: balance; }
.lede { margin: 0 0 28px; max-width: 32rem; font-size: clamp(19px, 2.2vw, 22px); line-height: 1.42; color: var(--ink-2); }
.soon { display: inline-flex; align-items: center; min-height: 46px; margin: 0; padding: 0 22px; border-radius: 999px; background: var(--ink); color: var(--ground); font-weight: 600; font-size: 16px; }
.fine { margin: 14px 0 0; font-size: 14px; color: var(--ink-3); }

.allowance {
  margin: 0; padding: 26px 26px 18px;
  border-radius: 32px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--glass-edge);
}
.dateline { margin: 0; font-size: 15px; font-weight: 500; color: var(--ink-3); }
.number { margin: 4px 0 0; font: 600 clamp(88px, 13vw, 132px)/0.95 var(--display); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.unit { margin: 8px 0 14px; color: var(--ink-3); }
.verdict { margin: 0 0 16px; font-size: 19px; line-height: 1.35; }
.dayline { display: block; width: 100%; height: auto; overflow: visible; }
.dayline .area { fill: var(--band); }
.dayline .line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.dayline .ahead { fill: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-dasharray: 1 5; stroke-linecap: round; }
.dayline .zero { stroke: var(--grid); stroke-width: 1; stroke-dasharray: 2 4; }
.dayline .now { fill: var(--card); stroke: var(--ink); stroke-width: 3; }
.dayline .halo { fill: var(--mint); opacity: 0.45; }
.dayline text { font: 600 10px var(--text); fill: var(--ink-3); }
.dayline .walk { fill: var(--accent); }
.allowance figcaption { margin-top: 12px; font-size: 13px; color: var(--ink-3); }

/* The rest of the day: one rail, one stop per moment */
.day { padding-top: clamp(56px, 9vw, 104px); }
.moment { position: relative; display: grid; gap: 32px; align-items: center; padding: 0 0 clamp(56px, 9vw, 104px) 40px; }
.moment::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 0; width: 3px; border-radius: 2px; background: var(--band); }
.moment::after { content: ""; position: absolute; left: 0; top: 0; width: 17px; height: 17px; border-radius: 50%; background: var(--ground); border: 4px solid var(--accent); }
@media (min-width: 880px) { .moment { grid-template-columns: 1.1fr 1fr; padding-left: 64px; } }
.moment h2 { margin: 0 0 14px; font: 500 clamp(30px, 4.2vw, 44px)/1.08 var(--display); letter-spacing: -0.03em; text-wrap: balance; }
.moment p { margin: 0 0 14px; max-width: 34rem; color: var(--ink-2); }
.note { font-size: 14px; color: var(--ink-3) !important; }
.shot { justify-self: center; width: min(300px, 76vw); border-radius: 40px; box-shadow: var(--shadow), 0 0 0 1px var(--hair); }

.ledger { justify-self: stretch; max-width: 30rem; margin: 0; padding: 6px 22px; list-style: none; border-radius: 24px; background: var(--card); box-shadow: var(--shadow); }
.ledger li { display: flex; gap: 14px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--hair); }
.ledger li:last-child { border-bottom: 0; font-weight: 700; }
.ledger .op { flex: none; width: 1ch; font: 600 20px/1 var(--display); color: var(--accent); text-align: center; }

.ways { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; padding: 0; list-style: none; }
.ways li { padding: 9px 16px; border-radius: 999px; background: var(--tint); color: var(--ink); font-weight: 600; font-size: 15px; }

/* Closing: the icon's own deep green */
.closing { margin: 0 0 32px; padding: clamp(32px, 6vw, 72px); border-radius: 40px; background: var(--deep); color: #f4f1ea; }
.closing .label { color: #9ee0c3; }
.closing h2 { margin: 0 0 16px; font: 500 clamp(30px, 4.2vw, 44px)/1.08 var(--display); letter-spacing: -0.03em; }
.closing p { margin: 0 0 14px; max-width: 38rem; color: rgba(244, 241, 234, 0.8); }
.closing a { color: #9ee0c3; }

/* Floating tab bar: Today, Log, Progress, as in the app */
.tabbar { position: fixed; z-index: 20; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; }
.tabs, .help {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--glass-edge);
}
.tabs { display: flex; padding: 5px; border-radius: 999px; }
.tabs a { display: flex; align-items: center; justify-content: center; min-width: 84px; min-height: 44px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.tabs a[aria-current="true"] { background: var(--tint); color: var(--accent); }
.help { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; color: var(--ink); font: 600 21px/1 var(--display); text-decoration: none; }
@media (max-width: 380px) { .tabs a { min-width: 0; padding: 0 12px; } }

/* Footer */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 28px 0 48px; border-top: 1px solid var(--hair); font-size: 14px; color: var(--ink-3); }
.foot p { margin: 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot a { color: var(--ink-3); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.landing .foot { padding-bottom: 120px; }

/* Subpages: privacy, support, terms */
.prose { max-width: 42rem; margin: 0 auto; padding: clamp(24px, 5vw, 56px) 0 72px; }
.prose h1 { margin: 0 0 12px; font-size: clamp(36px, 6vw, 52px); letter-spacing: -0.035em; }
.prose .intro { margin: 0 0 8px; font-size: 19px; color: var(--ink-2); }
.prose .updated { margin: 0 0 36px; font-size: 14px; color: var(--ink-3); }
.prose h2 { margin: 44px 0 10px; font: 500 24px/1.25 var(--display); letter-spacing: -0.02em; }
.prose h3 { margin: 24px 0 6px; font-size: 17px; font-weight: 600; }
.prose p, .prose li { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul { padding-left: 22px; }
.prose li { margin: 6px 0; }
.callout { margin: 0 0 8px; padding: 22px 24px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow); }
.callout p { margin: 0; color: var(--ink); }
.callout ul { margin: 12px 0 0; }
.button { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.faq details { margin: 10px 0; padding: 0 20px; border-radius: 20px; background: var(--card); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 12px 0; cursor: pointer; list-style: none; font-weight: 600; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font: 400 22px/1 var(--display); color: var(--accent); }
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { border-bottom: 1px solid var(--hair); }
.faq details p { margin: 12px 0 16px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
