/* ============================================================
   PrettyMD — shared theme
   Single source of truth for: design tokens (colours, fonts,
   radii, easing), base reset, the sticky nav, reusable buttons,
   the site footer, and the scroll-motion system.
   Linked by every page. Edit here once → it changes everywhere.
   ============================================================ */

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

:root {
  --bg: #111110;
  --bg-subtle: #1A1918;
  --ink-on-dark: #E8E4DF;
  --ink-on-dark-muted: #8A8580;
  --border-strong-dark: rgba(232, 228, 223, 0.12);

  --card: #FEFCF7;
  --ink: #1C1B19;
  --ink-muted: #6E6A63;
  --ink-faint: #A8A39C;
  --card-border: rgba(28, 27, 25, 0.08);
  --win-btn: #EBE5D8;
  --win-btn-hover: #E3DCCB;

  --accent: #34B892;
  --cta: #1D9E75;
  --mint: #4ECBA5;
  --yellow: #E7B23C;

  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  --font-sign: 'Caveat', cursive;
  --sys: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease-fast: cubic-bezier(0.22, 0.68, 0, 1);
  --ease-smooth: cubic-bezier(0.16, 0.6, 0.2, 1);
  --radius-btn: 8px;
  --radius-lg: 24px;
  --radius-md: 14px;
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.25);
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; scroll-padding-top: 84px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink-on-dark);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

body::after {
  content: ''; position: fixed; inset: 24px; filter: url(#grain);
  opacity: 0.035; pointer-events: none; z-index: 9999; mix-blend-mode: screen;
}

.ambient { position: fixed; pointer-events: none; z-index: 1; }
.ambient-1 { width: 600px; height: 600px; top: -15%; right: -5%; background: radial-gradient(circle, rgba(52,184,146,0.06) 0%, transparent 70%); animation: drift1 18s ease-in-out infinite; }
.ambient-2 { width: 500px; height: 500px; bottom: -10%; left: -8%; background: radial-gradient(circle, rgba(52,184,146,0.05) 0%, transparent 70%); animation: drift2 22s ease-in-out infinite; }
@keyframes drift1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-30px,20px); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(20px,-25px); } }

/* Component wrappers are layout-transparent so the markup inside
   behaves exactly as if it were written directly in the page. */
site-header, site-footer { display: contents; }

/* ── Sticky nav ── */
nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 65px; flex-shrink: 0;
  background: #111110; border-bottom: 1px solid rgba(232, 228, 223, 0.08);
  transition: box-shadow 320ms var(--ease-fast), border-color 320ms var(--ease-fast);
}
nav.scrolled { border-bottom-color: rgba(232, 228, 223, 0.13); box-shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.65); }
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { height: 56px; width: auto; display: block; }
.nav-links { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 38px; }
.nav-link { font-family: var(--font-body); font-size: 16px; font-weight: 500; color: var(--ink-on-dark-muted); text-decoration: none; letter-spacing: -0.01em; transition: color 200ms var(--ease-fast); }
.nav-link:hover { color: var(--ink-on-dark); }
.nav-cta { font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--ink); background: var(--card); border: none; padding: 9px 20px; border-radius: var(--radius-btn); cursor: pointer; transition: transform 180ms var(--ease-fast), background 180ms var(--ease-fast); letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.nav-cta:hover { background: #ffffff; transform: translateY(-1px); }
.nav-cta:active { transform: translateY(0) scale(0.97); }
.nav-cta svg { width: auto; fill: currentColor; }
.nav-cta .ic-apple { height: 14px; margin-top: -1px; }
.nav-cta .ic-win { height: 12px; }

/* Nav responsive — lives here (not in any page's local <style>) so every page's
   shared <site-header> collapses identically: hide the centre links before they
   can collide with the CTA, then tighten the bar on phones. */
@media (max-width: 720px) { .nav-links { display: none; } }
@media (max-width: 640px) {
  nav { padding: 0 16px; height: 54px; }
  .logo img { height: 42px; }
}

/* ── Reusable "Start free trial" CTA (nav, footer, founder note) ── */
.btn-free { font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--ink); background: var(--card); border: none; padding: 9px 18px; border-radius: var(--radius-btn); cursor: pointer; transition: transform 180ms var(--ease-fast), background 180ms var(--ease-fast); letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; white-space: nowrap; }
.btn-free:hover { background: #ffffff; transform: translateY(-1px); }
.btn-free:active { transform: translateY(0) scale(0.97); }
.btn-free .arrow-wrap { position: relative; width: 15px; height: 15px; overflow: hidden; flex-shrink: 0; }
.btn-free .arrow-wrap svg { position: absolute; top: 0; left: 0; width: 15px; height: 15px; transition: transform 480ms var(--ease-smooth); }
.btn-free .arrow-wrap .a2 { transform: translateX(-160%); }
.btn-free:hover .arrow-wrap .a1 { transform: translateX(160%); }
.btn-free:hover .arrow-wrap .a2 { transform: translateX(0); }
.btn-free.solid { background: var(--ink); color: #fff; }
.btn-free.solid:hover { background: #2E2A25; }

/* ── Footer (giant wordmark + emerald sheen) ── */
.site-footer { position: relative; z-index: 5; overflow: hidden; margin-top: 48px; }
.footer-main { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: 72px 40px 220px; }
.footer-top { display: flex; justify-content: space-between; gap: 56px; flex-wrap: wrap; }
.footer-brand { max-width: 380px; }
.footer-logo { height: 92px; width: auto; display: block; margin-left: -4px; }
.footer-statement { margin-top: 12px; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 2.3vw, 1.9rem); line-height: 1.14; letter-spacing: -0.02em; color: var(--ink-on-dark); max-width: 18ch; }
.footer-dl { margin-top: 26px; display: inline-flex; gap: 10px; flex-wrap: wrap; }
.ft-btn { font-family: var(--font-body); font-size: 14px; font-weight: 600; border: none; border-radius: var(--radius-btn); cursor: pointer; padding: 11px 18px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; letter-spacing: -0.01em; transition: transform 180ms var(--ease-fast), background 180ms var(--ease-fast); }
.ft-btn.primary { background: var(--card); color: var(--ink); }
.ft-btn.primary:hover { background: #fff; transform: translateY(-1px); }
.ft-btn.ghost { background: transparent; color: var(--ink-on-dark); border: 1px solid var(--border-strong-dark); }
.ft-btn.ghost:hover { background: rgba(232,228,223,0.05); transform: translateY(-1px); }
.ft-btn:active { transform: translateY(0) scale(0.97); }
.ft-btn .ic-apple { height: 16px; width: 14px; margin-top: -2px; }
.ft-btn .ic-win { height: 14px; width: 14px; }
.footer-links { display: flex; gap: 44px; flex-wrap: wrap; }
.footer-links > div { flex: 0 0 150px; }
.footer-links h5 { font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-on-dark-muted); margin-bottom: 13px; }
.footer-links a { display: block; font-family: var(--font-body); font-size: 14px; color: var(--ink-on-dark); text-decoration: none; margin-bottom: 8px; letter-spacing: -0.01em; transition: color 160ms var(--ease-fast); }
.footer-links a:last-child { margin-bottom: 0; }
.footer-links a:hover { color: var(--accent); }
.footer-base { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--border-strong-dark); display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-family: var(--font-body); font-size: 13px; color: var(--ink-on-dark-muted); }
.footer-base a { color: var(--ink-on-dark-muted); text-decoration: none; }
.footer-base a:hover { color: var(--ink-on-dark); }
.footer-word { position: absolute; left: 0; right: 0; bottom: -0.16em; text-align: center; font-family: var(--font-display); font-weight: 400; font-size: clamp(7rem, 25vw, 20rem); line-height: 0.8; letter-spacing: -0.02em; white-space: nowrap; pointer-events: none; user-select: none; z-index: 1;
  color: transparent; background: linear-gradient(100deg, rgba(232,228,223,0.15) 38%, rgba(78,203,165,0.45) 50%, rgba(232,228,223,0.15) 62%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; animation: footSheen 7s linear infinite; }
@keyframes footSheen { to { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) { .footer-word { animation: none; } }

/* The footer is the last thing on the page, so it lands in the scroll-reveal
   observer's bottom blind spot — the giant wordmark never intersects, so it
   never fades in (and a fast scroll can miss the whole footer). It's a footer,
   not a hero: don't gate it behind the reveal at all — always show it. */
html.js .site-footer .reveal { opacity: 1; transform: none; }

@media (max-width: 720px) {
  .footer-main { padding: 56px 24px 130px; }
  .footer-top { gap: 36px; }
  .footer-base { flex-direction: column; gap: 10px; }
  .footer-word { font-size: 25vw; bottom: 0.45em; }   /* desktop bleeds -0.16em; on a small phone word that hides it under the fold, so lift it into view */
}

/* ════════════════════════════════════════════════════════════
   Motion: scroll reveals + page cross-fade
   All gated behind html.js so no-JS / failed-JS shows everything.
   Only transform + opacity animate (GPU-composited, no jank).
   ════════════════════════════════════════════════════════════ */

html.js body { opacity: 0; }
html.js body.ready { opacity: 1; transition: opacity 0.45s var(--ease-smooth); }
html.js body.leaving { opacity: 0; transition: opacity 0.2s ease-in; }

html.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition-property: opacity, transform;
  transition-duration: 0.7s;
  transition-timing-function: var(--ease-smooth);
}
html.js .reveal.in { opacity: 1; transform: none; }
html.js .reveal.rd1 { transition-delay: 0.09s; }
html.js .reveal.rd2 { transition-delay: 0.18s; }
html.js .reveal.rd3 { transition-delay: 0.27s; }

html.js .reveal-group > * {
  opacity: 0;
  transform: translateY(20px);
  transition-property: opacity, transform;
  transition-duration: 0.62s;
  transition-timing-function: var(--ease-smooth);
}
html.js .reveal-group.in > * { opacity: 1; transform: none; }
html.js .reveal-group.in > *:nth-child(1) { transition-delay: 0.02s; }
html.js .reveal-group.in > *:nth-child(2) { transition-delay: 0.09s; }
html.js .reveal-group.in > *:nth-child(3) { transition-delay: 0.16s; }
html.js .reveal-group.in > *:nth-child(4) { transition-delay: 0.23s; }
html.js .reveal-group.in > *:nth-child(5) { transition-delay: 0.30s; }
html.js .reveal-group.in > *:nth-child(6) { transition-delay: 0.37s; }
html.js .reveal-group.in > *:nth-child(7) { transition-delay: 0.44s; }
html.js .reveal-group.in > *:nth-child(8) { transition-delay: 0.50s; }
html.js .reveal-group.in > *:nth-child(n+9) { transition-delay: 0.55s; }

html.js .feature.reveal { transform: translateY(30px); transition-duration: 0.8s; }

html.js .footer-word.reveal {
  transform: translateY(46px);
  transition-duration: 0.8s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
html.js .feature.reveal.in,
html.js .footer-word.reveal.in { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.js body, html.js body.ready, html.js body.leaving { opacity: 1 !important; }
  html.js .reveal,
  html.js .reveal-group > *,
  html.js .footer-word.reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
