/* Sage website: shared base. The palette matches the legal pages served by
   api.sage.contact (privacy, terms, docs) so the site reads as one thing. */

:root {
  --paper: #efeee6;
  --card: #fbfaf6;
  --ink: #1f211c;
  --gray: #676a5f;
  --olive: #5c6b1e;
  --tint: #e4e7d4;
  --rule: #d6d6ca;
  --link: #4f5d19;
  --primary: #262624;
  --on-primary: #ffffff;
  --lime: #c7d64f;
  --lime-light: #e3edb4;
  --on-accent: #1c1c1a;
  --glow: rgba(92, 107, 30, 0.18);
  --shadow: 0 34px 70px -34px rgba(31, 33, 28, 0.42);
  --shadow-soft: 0 18px 40px -26px rgba(31, 33, 28, 0.35);
  /* The app's own surfaces, for the phone and the cards that imitate it. */
  --app-top: #efeee6;
  --app-cream: #f8f7f1;
  --app-surface: #fdfcf7;
  --app-ink: #1c1c1a;
  --app-body: #383634;
  --app-gray: #6e6b63;
  --app-iconbg: #ece9e2;
  --app-olive: #667014;
  --app-hair: rgba(0, 0, 0, 0.09);
  --frame: #15150f;
  --frame-edge: #3b3b33;
  --noise-blend: multiply;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #181913;
    --card: #20221b;
    --ink: #ecebe2;
    --gray: #a3a699;
    --olive: #b8c563;
    --tint: #2a2d1f;
    --rule: #34372c;
    --link: #c2ce74;
    --primary: #edebe0;
    --on-primary: #1c1c1a;
    --glow: rgba(184, 197, 99, 0.13);
    --shadow: 0 34px 70px -30px rgba(0, 0, 0, 0.75);
    --shadow-soft: 0 18px 40px -24px rgba(0, 0, 0, 0.6);
    --app-top: #1b1b18;
    --app-cream: #22221f;
    --app-surface: #30302c;
    --app-ink: #f2f0e7;
    --app-body: #d4d1c7;
    --app-gray: #aba99e;
    --app-iconbg: #41413c;
    --app-olive: #a3b347;
    --app-hair: rgba(255, 255, 255, 0.12);
    --frame: #0c0c0a;
    --frame-edge: #4a4a42;
    --noise-blend: screen;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #181913;
  --card: #20221b;
  --ink: #ecebe2;
  --gray: #a3a699;
  --olive: #b8c563;
  --tint: #2a2d1f;
  --rule: #34372c;
  --link: #c2ce74;
  --primary: #edebe0;
  --on-primary: #1c1c1a;
  --glow: rgba(184, 197, 99, 0.13);
  --shadow: 0 34px 70px -30px rgba(0, 0, 0, 0.75);
  --shadow-soft: 0 18px 40px -24px rgba(0, 0, 0, 0.6);
  --app-top: #1b1b18;
  --app-cream: #22221f;
  --app-surface: #30302c;
  --app-ink: #f2f0e7;
  --app-body: #d4d1c7;
  --app-gray: #aba99e;
  --app-iconbg: #41413c;
  --app-olive: #a3b347;
  --app-hair: rgba(255, 255, 255, 0.12);
  --frame: #0c0c0a;
  --frame-edge: #4a4a42;
  --noise-blend: screen;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Nothing may widen the page sideways. `clip` on both html and body, not
   `hidden` on body alone: iPhone Safari ignores body overflow, and `hidden`
   would turn body into a scroller and break the sticky header. */
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
/* A faint grain over the paper, so the flat color has some tooth. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.045;
  mix-blend-mode: var(--noise-blend);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
body > * { position: relative; z-index: 1; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 3px;
  border-radius: 4px;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; margin: 0; }
p { margin: 0 0 16px; }

.skip {
  position: absolute; left: 16px; top: -60px;
  background: var(--primary); color: var(--on-primary);
  padding: 10px 14px; border-radius: 10px; z-index: 50;
}
.skip:focus { top: 16px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Header: stays at the top of the window while the page scrolls. */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.top.scrolled { border-bottom-color: var(--rule); }
.top-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; padding-bottom: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 14px;
  color: var(--ink); text-decoration: none;
  font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 36px; letter-spacing: -0.015em;
}
.brand img { width: 52px; height: 52px; }
/* The header mark is the logo twice: the soil, which never moves, and the plant above the soil
   line, which grows up out of it on the first open. The soil line sits 70% down the image. */
.brand .mark { position: relative; width: 52px; height: 52px; flex: 0 0 auto; display: block; }
.brand .mark img { position: absolute; inset: 0; width: 100%; height: 100%; }
.brand .mark .soil { clip-path: inset(70% 0 0 0); }
.brand .mark .plant { clip-path: inset(0 0 29.5% 0); transform-origin: 50% 70%; }
html.sprout .brand .mark .plant { animation: sprout 3200ms cubic-bezier(.25, 1.18, .4, 1) 400ms both; }
@keyframes sprout { from { transform: scale(0.12, 0.03); } to { transform: none; } }
.top nav { display: flex; align-items: center; gap: 22px; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15.5px; }
.top nav a:not(.button):hover { color: var(--link); }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--primary); color: var(--on-primary) !important;
  border: 0; border-radius: 999px;
  padding: 15px 28px; min-height: 52px;
  font: inherit; font-weight: 600; font-size: 16px; line-height: 1;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  box-shadow: 0 8px 20px -14px rgba(0, 0, 0, 0.5);
}
.button:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -14px rgba(0, 0, 0, 0.55); }
.button:active { transform: translateY(0); }
.button.small { padding: 11px 20px; min-height: 40px; font-size: 15px; white-space: nowrap; }
.button.secondary {
  background: transparent; color: var(--ink) !important;
  border: 1px solid var(--rule); box-shadow: none;
}
.button.secondary:hover { border-color: var(--gray); }

.label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--olive); margin: 0 0 14px;
}
.muted { color: var(--gray); }

/* Cards that imitate the app */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 24px;
  padding: 28px 30px;
  box-shadow: var(--shadow-soft);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--app-surface); border: 1px solid var(--app-hair);
  color: var(--app-ink); font-size: 14.5px; font-weight: 500; line-height: 1.2;
}
.chip svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Closing + footer */
.closing {
  text-align: center;
  padding: 120px 0 104px;
  border-top: 1px solid var(--rule);
}
.closing h2 {
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  line-height: 1.02;
  font-variation-settings: "opsz" 144;
  margin: 0 auto 12px;
  max-width: 14ch;
}
.closing h2 { margin-bottom: 34px; }

/* footer.wrap, not footer: the .wrap class sets its own padding and would win otherwise. */
footer.wrap {
  padding: 0 24px 112px;
  color: var(--gray); font-size: 15px;
}
footer .brand { font-size: 28px; gap: 12px; }
footer .brand img { width: 40px; height: 40px; }
footer .foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 32px 48px; }
footer .cols { display: flex; flex-wrap: wrap; gap: 24px 72px; }
footer .cols h4 { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gray); }
footer .cols a { display: block; color: var(--ink); text-decoration: none; margin: 0 0 9px; }
footer .cols a:hover { color: var(--link); }
footer .copy { margin-top: 40px; font-size: 14px; }

@media (max-width: 720px) {
  body { font-size: 16.5px; }
  .top-inner { padding-top: 12px; padding-bottom: 12px; }
  .top nav { gap: 16px; }
  .brand { font-size: 29px; gap: 11px; }
  .brand img, .brand .mark { width: 42px; height: 42px; }
  footer .brand { font-size: 24px; }
  footer .brand img { width: 34px; height: 34px; }
  .closing { padding: 88px 0 72px; }
  .card { padding: 22px 22px; border-radius: 20px; }
  footer.wrap { padding-bottom: 80px; }
  footer .foot { flex-direction: column; gap: 28px; }
  footer .cols { gap: 24px 48px; }
}
@media (max-width: 380px) {
  .top nav { gap: 12px; }
  .brand { font-size: 25px; gap: 9px; }
  .brand img, .brand .mark { width: 36px; height: 36px; }
  .button.small { padding: 9px 14px; min-height: 36px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .button:hover { transition: none; transform: none; }
}
