/* Dayweave website. Values come from the app's theme (src/theme/colors.ts), which follows the
   Tracker App Design System with Tim's Oct 12 change: a neutral off-white page, black text and gray
   secondary text, with the sage kept for actions and links. Dark mode follows the visitor's device. */

@font-face { font-family: Figtree; src: url(assets/fonts/Figtree_400Regular.ttf) format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Figtree; src: url(assets/fonts/Figtree_400Regular_Italic.ttf) format('truetype'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: Figtree; src: url(assets/fonts/Figtree_500Medium.ttf) format('truetype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: Figtree; src: url(assets/fonts/Figtree_600SemiBold.ttf) format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: Figtree; src: url(assets/fonts/Figtree_700Bold.ttf) format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #F6F6F4;
  --surface: #FFFFFF;
  --surface-muted: #F0F0EE;
  --line: #E2E2DE;
  --divider: #ECECE9;
  --chevron: #8A8D8A;
  --ink: #1A1A1A;
  --muted: #5C5F5D;
  --accent: #2F5D4E;
  --accent-hover: #264C40;
  --on-accent: #FFFFFF;
  --accent-soft: #E3EDE4;
  --accent-softer: #F1F6F2;
  --focus: #3D6F5F;
  --bad: #9A4A2A; /* a "worse" pattern: cat-symptoms, information, not an error */
  --cat-meals: #8A5A12;
  --cat-mood: #3F5A8C;
  --cat-symptoms: #9A4A2A;
  --cat-digestive: #8A4560;
  --cat-sleep: #2A6B78;
  --cat-meds: #6B4A86;
  --cat-movement: #2E6B57;
  --cat-habits: #5E6B24;
  --shadow-card: 0 1px 2px rgba(26, 26, 26, 0.06), 0 8px 24px rgba(26, 26, 26, 0.08);

  --radius-md: 12px;
  --radius-lg: 20px;
  --gutter: 16px;
  --max: 1080px;
  --max-text: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121212;
    --surface: #1E1F1E;
    --surface-muted: #2A2B2A;
    --line: #2F302F;
    --divider: #282928;
    --chevron: #7E817F;
    --ink: #ECECEA;
    --muted: #A8ABA9;
    --accent: #A9C8A4;
    --accent-hover: #BFD8BA;
    --on-accent: #14261F;
    --accent-soft: #22352E;
    --accent-softer: #1A2621;
    --focus: #A9C8A4;
    --bad: #EDAA8A;
    --cat-meals: #E8C27A;
    --cat-mood: #A9BDE6;
    --cat-symptoms: #EDAA8A;
    --cat-digestive: #E6A9C0;
    --cat-sleep: #8FCFDB;
    --cat-meds: #CDB3E3;
    --cat-movement: #8FD1B5;
    --cat-habits: #C9D38A;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

@media (min-width: 640px) {
  :root { --gutter: 32px; }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Figtree, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

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

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

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 10;
  padding: 10px 14px; border-radius: var(--radius-md);
  background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 8px; color: var(--on-accent); }

/* Icons from the app (src/components/Icon.tsx): 24 × 24 line icons with round caps. */
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; min-height: 44px; }
.brand:hover { color: var(--ink); }
.brand .mark { width: 34px; height: 30px; }
.brand .tile { width: 32px; height: 32px; }
.brand .tile, .hero-mark .tile { display: none; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--radius-md);
  color: var(--muted); font-weight: 600; font-size: 15px; text-decoration: none;
}
.site-nav a:hover { color: var(--ink); background: var(--surface-muted); }
.site-nav a[aria-current="page"] { color: var(--ink); }

/* On a dark page the design system uses the app tile, so the mark keeps its sage ground. */
@media (prefers-color-scheme: dark) {
  .brand .mark, .hero-mark .mark { display: none; }
  .brand .tile, .hero-mark .tile { display: block; }
}

/* Type */
h1, h2, h3 { margin: 0; color: var(--ink); }
.display { font-size: 40px; line-height: 44px; font-weight: 700; letter-spacing: -0.02em; }
.title { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.01em; }
.heading { font-size: 20px; line-height: 26px; font-weight: 600; }
.lead { font-size: 18px; line-height: 27px; color: var(--ink); margin: 0; }
.muted { color: var(--muted); }
.overline { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.02em; color: var(--muted); }
.overline .icon { width: 13px; height: 13px; stroke-width: 2.4; }

@media (min-width: 900px) {
  .display { font-size: 52px; line-height: 56px; }
  .title { font-size: 32px; line-height: 38px; }
}

/* Home: hero */
.hero { padding: 48px 0 56px; }
.hero .wrap { display: grid; gap: 40px; align-items: center; }
.hero-text { display: grid; gap: 18px; align-content: start; }
.hero-mark .mark { width: 58px; height: 52px; }
.hero-mark .tile { width: 60px; height: 60px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 6px; }
.availability { margin: 0; font-size: 15px; color: var(--muted); }
.hero-visual { display: grid; }
/* The insight the example sentence leads to, tucked under the example card. */
.insight--float { box-shadow: var(--shadow-card); margin: -14px 0 0 24px; position: relative; max-width: 330px; justify-self: end; }
@media (min-width: 900px) {
  .hero { padding: 80px 0 88px; }
  .hero .wrap { grid-template-columns: 1.1fr 1fr; gap: 64px; }
  .insight--float { margin: -18px -16px 0 48px; }
}

.benefit-tile { width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.benefit-tile .icon { width: 17px; height: 17px; }

/* The "You say / It logs" card from the app's welcome screen. */
.example {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  margin: 0; padding: 18px 20px 20px; display: grid; gap: 10px; box-shadow: var(--shadow-card);
}
.example .bubble {
  justify-self: start; margin: 0; padding: 12px 16px; background: var(--surface-muted);
  border-radius: 20px 20px 4px 18px; font-style: italic; font-size: 17px; line-height: 24px;
}
.example .arrow { display: flex; align-items: center; gap: 8px; color: var(--chevron); padding: 2px 0; }
.example .arrow::before, .example .arrow::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.example .arrow .icon { width: 16px; height: 16px; }
.example .logs { color: var(--accent); }
.example .logs .icon { stroke-width: 2.8; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px 0 11px;
  border-radius: 17px; background: var(--accent-soft); font-size: 15px; font-weight: 600;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dot); }
.chip--meals { --dot: var(--cat-meals); }
.chip--mood { --dot: var(--cat-mood); }
.chip--symptoms { --dot: var(--cat-symptoms); }
.chip--digestive { --dot: var(--cat-digestive); }
.chip--sleep { --dot: var(--cat-sleep); }
.chip--meds { --dot: var(--cat-meds); }
.chip--movement { --dot: var(--cat-movement); }
.chip--habits { --dot: var(--cat-habits); }
.chips--lg { gap: 8px; }
.chips--lg .chip { height: 40px; padding: 0 16px 0 14px; border-radius: 20px; font-size: 16px; background: var(--surface); border: 1px solid var(--line); }
.chips--lg .chip .dot { width: 8px; height: 8px; }

/* Home: sections */
.section { padding: 56px 0; border-top: 1px solid var(--line); }
.section--tight { padding: 40px 0; }
.section-head { display: grid; gap: 10px; margin-bottom: 28px; max-width: var(--max-text); }
.section-head p { margin: 0; }
@media (min-width: 900px) {
  .section { padding: 88px 0; }
  .section--tight { padding: 56px 0; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.feature-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.feature-icon .icon { width: 21px; height: 21px; }

.why .section-head { margin-bottom: 24px; }
.tracks { display: grid; gap: 12px; }

/* Logging takes seconds: three numbered steps, then the smaller points. */
.steps { list-style: none; margin: 0 0 40px; padding: 0; display: grid; gap: 16px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.step { display: grid; gap: 8px; align-content: start; padding: 24px; }
.step p { margin: 0; color: var(--muted); }
.step-num {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; margin-bottom: 4px;
}

.extras { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
@media (min-width: 640px) { .extras { grid-template-columns: repeat(2, 1fr); gap: 24px 32px; } }
@media (min-width: 960px) { .extras { grid-template-columns: repeat(4, 1fr); } .extras--three { grid-template-columns: repeat(3, 1fr); } }
.extras li { display: flex; gap: 12px; align-items: flex-start; }
.extras h3 { font-size: 16px; line-height: 22px; font-weight: 600; margin: 4px 0 2px; }
.extras p { margin: 0; font-size: 15px; line-height: 22px; color: var(--muted); }

/* Insight cards, drawn like Discover's (src/features/discover/Insights.tsx). */
.insights { list-style: none; margin: 0 0 40px; padding: 0; display: grid; gap: 12px; }
@media (min-width: 640px) { .insights { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 1000px) { .insights { grid-template-columns: repeat(4, 1fr); } }
.insight {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px;
}
.insight-kind { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; font-weight: 700; color: var(--muted); }
.insight-kind .dot { width: 8px; height: 8px; border-radius: 50%; }
.dot--bad { background: var(--bad); }
.dot--good { background: var(--accent); }
.insight-text { margin: 0; font-size: 16px; line-height: 22px; font-weight: 600; flex: 1; }
.insight-basis { margin: 0; font-size: 13px; line-height: 18px; color: var(--muted); }
.insight-link { font-size: 13px; line-height: 18px; font-weight: 700; color: var(--accent); }

/* Ask about your history: words on one side, a short example thread on the other. */
.chat { display: grid; gap: 20px; margin-top: 40px; padding: 24px; }
@media (min-width: 860px) { .chat { grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; padding: 32px; } }
.chat-text { display: grid; gap: 8px; }
.chat-text p { margin: 0; color: var(--muted); }
.chat-thread { display: grid; gap: 10px; }
.msg { margin: 0; padding: 12px 16px; max-width: 88%; font-size: 15px; line-height: 22px; border-radius: var(--radius-lg); }
.msg--you { justify-self: end; background: var(--accent-soft); border-bottom-right-radius: 6px; }
.msg--app { justify-self: start; background: var(--surface-muted); border-bottom-left-radius: 6px; }

.fine { margin: 24px 0 0; font-size: 14px; line-height: 20px; color: var(--muted); max-width: var(--max-text); }

.yours { display: flex; gap: 16px; align-items: flex-start; padding: 24px; }
.yours > div { display: grid; gap: 6px; }
.yours p { margin: 0; color: var(--muted); }

.closing { padding: 56px 0 72px; border-top: 1px solid var(--line); text-align: center; }
.closing .wrap { display: grid; justify-items: center; gap: 12px; }
@media (min-width: 900px) { .closing { padding: 88px 0 104px; } }

/* Buttons (design system): 44px or taller, radius 12, sentence case. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: var(--radius-md); font: inherit; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
}
.btn--primary { background: var(--accent); color: var(--on-accent); border: 0; }
.btn--primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn--secondary { background: var(--accent-soft); color: var(--ink); border: 0; }
.btn--secondary:hover { color: var(--ink); background: var(--accent-soft); filter: brightness(0.97); }

/* Text pages (Support, Delete your account, legal) */
.page { padding: 40px 0 72px; }
.page .wrap { max-width: calc(var(--max-text) + 2 * var(--gutter)); }
.page-head { display: grid; gap: 10px; margin-bottom: 28px; }
.page-head p { margin: 0; }
.prose { font-size: 16px; line-height: 25px; }
.prose h2 { font-size: 20px; line-height: 26px; font-weight: 600; margin: 36px 0 10px; scroll-margin-top: 16px; }
.prose h3 { font-size: 17px; line-height: 24px; font-weight: 600; margin: 22px 0 8px; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin: 0 0 8px; }
.prose li::marker { color: var(--muted); }
.prose .path { font-weight: 600; white-space: nowrap; }
@media (max-width: 399px) { .prose .path { white-space: normal; } }
.prose > :first-child { margin-top: 0; }

.notice {
  display: flex; gap: 12px; align-items: flex-start; margin: 0 0 24px; padding: 14px 16px;
  background: var(--surface-muted); border-radius: var(--radius-md); font-size: 14px; line-height: 20px; color: var(--ink);
}
.notice .icon { margin-top: 1px; color: var(--muted); }
.notice p { margin: 0; }

.toc { margin: 0 0 32px; padding: 16px 20px; }
.toc h2 { margin: 0 0 8px; font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 6px 0; font-size: 15px; line-height: 20px; text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.steps-card { margin: 0 0 16px; }
.steps-card h2 { margin-top: 0; }
.steps-card ol { margin-bottom: 0; }

/* Help: the topic list on the index, and pieces used inside the how-to pages. */
.topics { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 12px; }
@media (min-width: 640px) { .topics { grid-template-columns: repeat(2, 1fr); } }
.topic { display: flex; align-items: center; gap: 14px; height: 100%; padding: 16px 16px 16px 18px; color: var(--ink); text-decoration: none; }
.topic:hover { color: var(--ink); border-color: var(--chevron); }
.topic > .icon { color: var(--chevron); margin-left: auto; }
.topic-text { display: grid; gap: 2px; min-width: 0; }
.topic-title { font-weight: 600; font-size: 17px; line-height: 23px; }
.topic-summary { font-size: 14px; line-height: 20px; color: var(--muted); }

.crumb { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.crumb a { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; text-decoration: none; }
.crumb .icon { width: 18px; height: 18px; }

/* An example of what to say, like the speech bubble on the home page. */
.prose .say {
  display: block; width: fit-content; max-width: 100%; margin: 0 0 12px; padding: 10px 14px; background: var(--surface-muted);
  border-radius: 18px 18px 4px 16px; font-style: italic;
}
.prose > .card { margin: 0 0 16px; }
.prose .card > :last-child { margin-bottom: 0; }
.prose li > ul { margin: 6px 0 0; }
.prose .notice { margin: 16px 0; }
.prose .notice p { margin: 0; }
.prose dl { margin: 0 0 14px; }
.prose dt { font-weight: 600; margin-top: 12px; }
.prose dd { margin: 2px 0 0; color: var(--ink); }
.prose .insight { margin: 8px 0 16px; max-width: 380px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 40px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.pager-link { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); text-decoration: none; min-height: 44px; }
.pager-link:hover { border-color: var(--chevron); }
.pager-link--next { text-align: right; }
.pager-label { font-size: 13px; line-height: 18px; color: var(--muted); }
.pager-title { font-weight: 600; color: var(--accent); }
.pager-all { margin: 16px 0 0; font-size: 15px; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: 14px; line-height: 20px; color: var(--muted); }
.site-footer .wrap { display: grid; gap: 16px; }
/* Every link has the same padding, and the list pulls left by that much, so wrapped rows line up too. */
.footer-links { list-style: none; margin: 0 0 0 -8px; padding: 0; display: flex; flex-wrap: wrap; gap: 0 4px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--muted); font-weight: 500; }
.footer-links a:hover { color: var(--ink); }
.site-footer p { margin: 0; max-width: var(--max-text); }
