/* Improve Dashboard: marketing site.
   Colour and type tokens mirror the app (style.css) so the site and the app feel like one place. */

:root {
  color-scheme: light;
  --bg: #f7f4ed;
  --surface: #fffcf7;
  --pale: #e5e7d7;
  --pale-line: #d9dcc8;
  --pale-ink: #353c28;
  --ink: #352e28;
  --muted: #655f56;
  --line: #e5e0d6;
  --olive: #68734d;
  --olive-dark: #505b38;
  --on-olive: #fffdf5;
  --focus: #505b38;
  --sq-empty: #eae9dd;
  --sq-partial: #a6af87;
  --sq-missed: #d2b69f;
  --chip-work-bg: #e9ddd1;
  --chip-work-ink: #6c4f3e;
  --chip-off-bg: #e5e7d7;
  --chip-off-ink: #475135;
  --chip-vac-bg: #dde8e7;
  --chip-vac-ink: #435f5e;
  --panel: #505b38;
  --panel-ink: #f6f3e8;
  --panel-muted: #d3dabf;
  --panel-line: #6c7852;
  --shadow: 0 1px 2px #352e2808, 0 22px 50px -22px #352e2826;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
  --gutter: clamp(20px, 5vw, 40px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #20231f;
  --surface: #2b3029;
  --pale: #3b4532;
  --pale-line: #5c694e;
  --pale-ink: #f0eee6;
  --ink: #f0eee6;
  --muted: #b8baae;
  --line: #474d41;
  --olive: #a8bb88;
  --olive-dark: #c2d3a6;
  --on-olive: #20271b;
  --focus: #c2d3a6;
  --sq-empty: #43483b;
  --sq-partial: #7d9162;
  --sq-missed: #aa7d65;
  --chip-work-bg: #4a3d34;
  --chip-work-ink: #ecd3bf;
  --chip-off-bg: #3b4532;
  --chip-off-ink: #d4e0bd;
  --chip-vac-bg: #33494a;
  --chip-vac-ink: #c4e0e0;
  --panel: #323c2c;
  --panel-ink: #f0eee6;
  --panel-muted: #c8cbb9;
  --panel-line: #4f5c43;
  --shadow: 0 1px 2px #00000020, 0 22px 50px -22px #00000070;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --bg: #20231f;
    --surface: #2b3029;
    --pale: #3b4532;
    --pale-line: #5c694e;
    --pale-ink: #f0eee6;
    --ink: #f0eee6;
    --muted: #b8baae;
    --line: #474d41;
    --olive: #a8bb88;
    --olive-dark: #c2d3a6;
    --on-olive: #20271b;
    --focus: #c2d3a6;
    --sq-empty: #43483b;
    --sq-partial: #7d9162;
    --sq-missed: #aa7d65;
    --chip-work-bg: #4a3d34;
    --chip-work-ink: #ecd3bf;
    --chip-off-bg: #3b4532;
    --chip-off-ink: #d4e0bd;
    --chip-vac-bg: #33494a;
    --chip-vac-ink: #c4e0e0;
    --panel: #323c2c;
    --panel-ink: #f0eee6;
    --panel-muted: #c8cbb9;
    --panel-line: #4f5c43;
    --shadow: 0 1px 2px #00000020, 0 22px 50px -22px #00000070;
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--pale); color: var(--ink); }

.wrap { width: min(100% - 2 * var(--gutter), 1120px); margin-inline: auto; }
.icon { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: 16px; top: -64px; z-index: 50; padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--bg); text-decoration: none; transition: top 0.2s; }
.skip:focus { top: 12px; }

/* Type */
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 500; }
h1 { font-size: clamp(3rem, 1.5rem + 6.4vw, 5.75rem); line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance; }
h2 { font-size: clamp(2rem, 1.3rem + 2.9vw, 3.3rem); line-height: 1.08; letter-spacing: -0.025em; text-wrap: balance; }
h3 { font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.01em; }
.lead { font-size: clamp(1.125rem, 1.02rem + 0.5vw, 1.3125rem); line-height: 1.6; color: var(--muted); max-width: 46ch; text-wrap: pretty; }
.prose p { max-width: 54ch; color: var(--muted); text-wrap: pretty; }
.prose p + p { margin-top: 16px; }
.prose h2 + p { margin-top: 24px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: 14px;
  font-size: 1rem; font-weight: 700; line-height: 1; text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn-primary { background: var(--olive); color: var(--on-olive); }
.btn-primary:hover { background: var(--olive-dark); }
.btn-quiet { background: var(--surface); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--olive); }
.btn-small { min-height: 42px; padding: 0 18px; font-size: 0.9375rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, background-color 0.25s;
}
@supports (background: color-mix(in srgb, red, blue)) {
  .site-header { background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
}
.site-header.scrolled { border-bottom-color: var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font: 500 1.25rem/1 var(--serif); letter-spacing: -0.01em; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav-link { padding: 10px 14px; border-radius: 10px; text-decoration: none; font-size: 0.9375rem; color: var(--muted); transition: color 0.2s; }
.nav-link:hover { color: var(--ink); }
.nav .btn-quiet { margin-left: 8px; }
.nav .btn + .btn { margin-left: 4px; }

/* Sections */
.section { padding-block: clamp(72px, 11vw, 136px); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(40px, 7vw, 104px); align-items: center; }
.split.flip > .visual { order: -1; }

/* Hero */
.hero { padding-block: clamp(24px, 3.4vw, 48px) clamp(72px, 10vw, 128px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: clamp(40px, 6vw, 88px); align-items: center; }
.hero .lead { margin-top: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-note { margin-top: 20px; font-size: 0.9375rem; color: var(--muted); }
.hero-note a { color: var(--olive-dark); }

/* App preview pieces (HTML replicas of the real screens, with sample data) */
.app-stack { width: 100%; max-width: 460px; margin-inline: auto; display: grid; gap: 16px; }
.app-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-inline: 4px; }
.app-title { font: 500 2.5rem/1 var(--serif); letter-spacing: -0.035em; }
.app-date { margin-top: 10px; color: var(--muted); font-size: 0.9375rem; line-height: 1.4; }
.pill { display: inline-block; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 0.8125rem; line-height: 1.2; white-space: nowrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 20px 22px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { display: flex; align-items: center; gap: 10px; font: 700 1rem/1.3 var(--sans); }
.card-title .icon { color: var(--olive-dark); }
.card-count { font-size: 0.9375rem; color: var(--muted); }
.progress { height: 6px; margin: 16px 0 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: var(--p, 25%); border-radius: inherit; background: var(--olive); transition: width 0.5s var(--ease); }
.habits li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.habits li:first-child { border-top: 0; }
.habit-name { display: block; font: 500 1.1875rem/1.25 var(--serif); letter-spacing: -0.005em; }
.habit-when { display: block; margin-top: 3px; font-size: 0.875rem; color: var(--muted); line-height: 1.3; }
.tick {
  width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center;
  border: 1.5px solid var(--muted); border-radius: 50%; color: transparent;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.tick .icon { width: 20px; height: 20px; stroke-width: 2; }
.tick:hover { border-color: var(--olive); }
.tick:active { transform: scale(0.92); }
.tick[aria-pressed="true"] { background: var(--olive); border-color: var(--olive); color: var(--on-olive); }
.today-note { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.9375rem; color: var(--muted); }
.try-hint { padding-inline: 4px; font-size: 0.875rem; color: var(--muted); }

.funds { background: var(--pale); border: 1px solid var(--pale-line); border-radius: 22px; padding: 22px 24px; color: var(--pale-ink); }
.funds-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.9375rem; }
.funds-top .icon { color: var(--olive-dark); }
.amount { display: block; font: 500 clamp(2.5rem, 2rem + 2vw, 3.25rem)/1 var(--serif); letter-spacing: -0.035em; margin: 10px 0 8px; }
.funds small { font-size: 0.9375rem; opacity: 0.85; }
.funds-metrics { display: grid; grid-template-columns: 1fr 1fr; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--pale-line); font-size: 0.875rem; }
.funds-metrics > div + div { padding-left: 20px; border-left: 1px solid var(--pale-line); }
.funds-metrics strong { display: block; margin-top: 4px; font-size: 1.3125rem; font-weight: 700; }
.funds-set { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--pale-line); font-size: 0.875rem; line-height: 1.5; }
.funds-set span { flex: 1; }
.funds-set strong { font: 500 1.375rem/1 var(--serif); }
.net-row { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 6px; color: var(--muted); }
.net-row strong { font-size: 1.1875rem; color: var(--ink); }
.coming-label { margin: 8px 6px -4px; font-size: 0.9375rem; font-weight: 700; }
.coming { border: 1px dashed var(--line); border-radius: 20px; overflow: hidden; background: var(--surface); }
.coming li { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-top: 1px solid var(--line); }
.coming li:first-child { border-top: 0; }
.coming-icon { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--sq-empty); }
.coming-icon .icon { width: 20px; height: 20px; }
.coming-icon.in { background: var(--pale); color: var(--olive-dark); }
.coming-text { flex: 1; min-width: 0; }
.coming-text b { display: block; font-size: 0.9375rem; font-weight: 700; }
.coming-text small { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--muted); }
.coming-amount { font-size: 0.9375rem; font-weight: 700; color: var(--muted); }
.coming-amount.plus { color: var(--olive-dark); }

/* Consistency grid */
.consistency { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: clamp(20px, 3vw, 28px); }
.consistency h3 { font-size: 1.5rem; }
.consistency > p { margin-top: 6px; font-size: 0.9375rem; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; margin-top: 22px; }
.sq { aspect-ratio: 1; border-radius: 3px; background: var(--sq-empty); min-width: 0; }
.sq.d { background: var(--olive); }
.sq.p { background: var(--sq-partial); }
.sq.m { background: var(--sq-missed); }
.sq.t { background: transparent; border: 1.5px solid var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 20px; font-size: 0.8125rem; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend .sq { width: 12px; flex-shrink: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.chip { padding: 8px 14px; border-radius: 999px; font-size: 0.875rem; line-height: 1.2; }
.chip.work { background: var(--chip-work-bg); color: var(--chip-work-ink); }
.chip.off { background: var(--chip-off-bg); color: var(--chip-off-ink); }
.chip.vac { background: var(--chip-vac-bg); color: var(--chip-vac-ink); }

/* Lists with the grid square as bullet */
.chips + p { margin-top: 28px; }
.marks { margin-top: 28px; display: grid; gap: 12px; max-width: 54ch; }
.marks li { position: relative; padding-left: 26px; }
.marks li::before { content: ""; position: absolute; left: 0; top: 0.58em; width: 10px; height: 10px; border-radius: 3px; background: var(--olive); }

/* Details */
.details-head { max-width: 40rem; }
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(32px, 6vw, 88px); margin-top: clamp(36px, 5vw, 64px); }
.detail { padding: 26px 0 30px; border-top: 1px solid var(--line); }
.detail p { margin-top: 8px; max-width: 44ch; color: var(--muted); text-wrap: pretty; }

/* Privacy panel */
.panel { background: var(--panel); color: var(--panel-ink); }
.panel .split { align-items: start; }
.panel h2 + p { margin-top: 24px; max-width: 40ch; color: var(--panel-muted); }
.facts li { padding: 22px 0; border-top: 1px solid var(--panel-line); font: 500 1.375rem/1.3 var(--serif); letter-spacing: -0.01em; }
.facts li:last-child { border-bottom: 1px solid var(--panel-line); }
.panel-links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 28px; font-size: 0.9375rem; }
.panel-links a { color: var(--panel-ink); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.panel :focus-visible { outline-color: var(--panel-ink); }

/* Steps and closing call to action */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 5vw, 64px); margin-top: clamp(36px, 5vw, 60px); }
.step-num { display: block; font: 500 3.5rem/1 var(--serif); letter-spacing: -0.04em; color: var(--olive); }
.step h3 { margin-top: 14px; }
.step p { margin-top: 8px; color: var(--muted); max-width: 32ch; text-wrap: pretty; }
.closing { margin-top: clamp(48px, 7vw, 88px); padding-top: clamp(32px, 5vw, 48px); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.closing p { font: 500 clamp(1.5rem, 1.2rem + 1.2vw, 2rem)/1.2 var(--serif); letter-spacing: -0.02em; max-width: 22ch; }
.closing .hero-actions { margin-top: 0; }

/* Footer */
.footer { padding-block: 44px 56px; border-top: 1px solid var(--line); font-size: 0.9375rem; color: var(--muted); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px 48px; }
.footer .brand { color: var(--ink); font-size: 1.125rem; }
.footer .brand img { width: 32px; height: 32px; border-radius: 9px; }
.footer-tag { margin-top: 12px; max-width: 28ch; }
.footer-links { display: grid; gap: 4px; }
.footer-links a { display: inline-block; padding: 4px 0; text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.theme { display: none; }
.js .theme { display: block; }
.theme-label { display: block; margin-bottom: 8px; font-size: 0.875rem; }
.segmented { display: inline-flex; padding: 4px; gap: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.segmented button { min-height: 38px; padding: 0 14px; border-radius: 10px; font-size: 0.875rem; color: var(--muted); transition: background-color 0.2s, color 0.2s; }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--pale); color: var(--pale-ink); font-weight: 700; }
.legal { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 0.8125rem; }

/* 404 */
.notfound { min-height: 70vh; display: grid; align-content: center; padding-block: 64px; }
.notfound h1 { font-size: clamp(2.75rem, 1.5rem + 5vw, 4.5rem); }
.notfound p { margin-top: 20px; max-width: 40ch; color: var(--muted); }
.notfound .hero-actions { margin-top: 32px; }

/* Scroll reveal. Only active when JS is running, so the page is complete without it. */
.js [data-reveal] {
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js [data-reveal].in { opacity: 1; transform: none; }
.js .grid .sq { opacity: 0; transform: scale(0.55); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); transition-delay: calc(var(--n, 0) * 9ms + 250ms); }
.js .consistency.in .sq { opacity: 1; transform: none; }

@media (max-width: 880px) {
  .hero-grid, .split { grid-template-columns: minmax(0, 1fr); }
  .split.flip > .visual { order: 1; }
  .app-stack { max-width: 520px; margin-inline: 0; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .details { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .nav-link { display: none; }
}
@media (max-width: 480px) {
  .bar { min-height: 64px; }
  .brand span { display: none; }
  .hero-actions .btn { flex: 1 1 auto; }
  .card { padding: 18px; }
  .funds { padding: 20px; }
  .funds-metrics > div + div { padding-left: 14px; }
  .grid { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js [data-reveal], .js .grid .sq { opacity: 1; transform: none; }
}
