/* Keepling shared stylesheet
   Used by index.html, privacy.html, and support.html.
   Self-contained: system fonts only, no external resources, no JS.
   Warm storybook palette (Honey Amber + Sage on parchment / Cocoa Night).
   Light and dark themes via prefers-color-scheme. */

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light dark;

  /* Warm parchment surface ladder (no cold gray; every neutral tinted warm) */
  --bg: #fbf5ec;          /* page */
  --surface: #f1e7d7;     /* header, footer, trays, callouts */
  --border: #d8c9b0;

  /* Ink (never pure black) */
  --heading: #2a2118;
  --text: #3d342a;
  --text-muted: #6e5d49;

  /* Honey Amber roles */
  --accent: #a85f16;        /* decorative fills only: brand mark, feature dots */
  --link: #8e4f11;          /* AA text links on every light surface */
  --link-hover: #553208;    /* AA+ hover */
  --accent-soft: #fcefd6;   /* gentle honey tint for the privacy callout */
  --sage: #5e7a5a;           /* sage green: decorative SVG fills only */
  --focus: #8e4f11;

  /* Primary button (filled honey, light label) */
  --btn-bg: #8e4f11;
  --btn-bg-hover: #6e4a18;
  --btn-text: #fcefd6;

  --maxw: 720px;
  --radius: 16px;
  --pill: 999px;
  --space: 1.25rem;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Cocoa Night surface ladder */
    --bg: #171310;          /* intentional one-step below cocoa-night (#1f1a15) so surfaces lift above page */
    --surface: #1f1a15;
    --border: #463e34;

    /* Warm text (never pure white) */
    --heading: #f4ece0;
    --text: #efe5d6;
    --text-muted: #c2b49f;

    /* Lighter honey for AA on dark */
    --accent: #f0b968;
    --link: #f0b968;
    --link-hover: #fbdfb0;
    --accent-soft: #272019;
    --sage: #88b07e;           /* lighter sage for dark surfaces */
    --focus: #f0b968;

    /* Primary button inverts on dark: bright honey fill, dark label */
    --btn-bg: #f0b968;
    --btn-bg-hover: #fbdfb0;
    --btn-text: #2e1b05;
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

:target {
  scroll-margin-top: 1rem;
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space);
}

main {
  padding: 1.75rem 0 3rem;
}

section {
  margin: 2.5rem 0;
}

/* ---------- Type scale (>= 1.25 step ratio, weight-driven hierarchy) ---------- */
h1,
h2,
h3 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(2.15rem, 4vw + 1rem, 2.95rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.7rem, 2vw + 0.9rem, 1.95rem);
  margin-top: 0;
}

h3 {
  font-size: 1.35rem;
}

p {
  margin: 0 0 1.1em;
}

p:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
}

/* ---------- Links ---------- */
a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 0.08em;
  overflow-wrap: anywhere;
}

a:hover {
  color: var(--link-hover);
}

/* ---------- Visible focus states ---------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Skip link (hidden until focused) ---------- */
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.6rem 1.1rem;
  clip: auto;
  overflow: visible;
  z-index: 1000;
  background-color: var(--surface);
  color: var(--link);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  text-decoration: none;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background-color: var(--surface);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--heading);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--link-hover);
}

.brand-mark {
  width: 1.35rem;
  height: 1.35rem;
  flex: none;
  display: block;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 1rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.4rem;
  color: var(--text-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.site-nav a[aria-current="page"] {
  color: var(--link);
  font-weight: 700;
}

/* ---------- Hero (landing) ---------- */
.hero {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin: 2.75rem 0 2rem;
}

.hero-text {
  flex: 1 1 auto;
  min-width: 0;
}

.hero-illustration {
  flex: 0 0 auto;
  padding-top: 0.25rem;
}

.garden-motif {
  width: 7rem;
  height: auto;
}

.hero h1 {
  margin-bottom: 0.35em;
}

/* ---------- Feature list (landing) ---------- */
.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.features li {
  position: relative;
  padding-left: 1.9rem;
}

.features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background-color: var(--accent);
}

/* ---------- Action button row (landing) ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border-radius: var(--pill);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--btn-bg);
  color: var(--btn-text);
  border-color: var(--btn-bg);
}

.btn-primary:hover {
  background-color: var(--btn-bg-hover);
  border-color: var(--btn-bg-hover);
  color: var(--btn-text);
}

.btn-secondary {
  background-color: transparent;
  color: var(--link);
  border-color: var(--link);
}

.btn-secondary:hover {
  background-color: var(--accent-soft);
  color: var(--link-hover);
  border-color: var(--link-hover);
}

/* ---------- Trust callout (landing) ---------- */
.trust {
  background-color: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  font-size: 1.05rem;
}

.trust strong {
  color: var(--link);
}

/* ---------- Status badge (landing) ---------- */
.badge {
  display: inline-block;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  padding: 0.4rem 0.95rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ---------- Prose pages (privacy, support) ---------- */
.prose {
  overflow-wrap: anywhere;
  max-width: 40rem;   /* ~68ch at body size; keeps hero wrap at 720px */
}

.prose > :first-child {
  margin-top: 0;
}

.prose h3 {
  margin-top: 1.6rem;
}

.prose ul {
  margin: 0 0 1.1em;
  padding-left: 1.3rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose li:last-child {
  margin-bottom: 0;
}

/* Definition-style metadata block (privacy) */
.meta-list {
  margin: 0 0 1.75rem;
  padding: 1.1rem 1.4rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.meta-list > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.75rem;
  padding: 0.4rem 0;
}

.meta-list > div + div {
  border-top: 1px solid var(--border);
}

.meta-list dt {
  flex: 0 0 9rem;
  font-weight: 700;
  color: var(--heading);
}

.meta-list dd {
  flex: 1 1 12rem;
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Subtle tray callout (privacy legal notice, support contact line) */
.callout {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
}

.callout > :first-child {
  margin-top: 0;
}

.callout > :last-child {
  margin-bottom: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.site-footer .wrap {
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
}

.site-footer p {
  margin: 0 0 0.4em;
}

.site-footer nav {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.4rem;
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--link-hover);
}

.site-footer a[aria-current="page"] {
  color: var(--link);
  font-weight: 700;
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 480px) {
  body {
    font-size: 1rem;
  }
  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero {
    flex-direction: column;
    gap: 1.25rem;
  }
  .hero-illustration {
    order: -1;
    padding-top: 0;
  }
  .garden-motif {
    width: 5rem;
  }
  .meta-list dt {
    flex-basis: 100%;
  }
}
