/* CoHabby shared design system — r1
   Loaded AFTER each page's inline <style> so these rules win ties.
   Scope: tokens, nav, footer, buttons, cards, section rhythm, utilities.
   Base element selectors are kept minimal so legacy inline page styles
   keep working; everything else is class-scoped. */

:root {
  /* Brand (Direction A — Warm Anchor, founder-final) */
  --coral: #FF6B4A;
  --coral-deep: #E85A3A;
  --amber: #FFB347;
  --aqua: #4ECDC4;
  --teal: #00A699;
  --teal-deep: #00867C;
  --gradient-hero: linear-gradient(135deg, #FF6B4A 0%, #FFB347 35%, #4ECDC4 65%, #00A699 100%);

  /* Warm neutrals */
  --ink: #201714;
  --ink-soft: #4A3F39;
  --muted: #6E625C;
  --faint: #A6988F;
  --dusk: #221712;
  --paper: #FFF9F8;
  --white: #FFFFFF;
  --border: #F0E4DF;
  --border-strong: #E3D2CA;

  /* Legacy aliases (used by pre-redesign inline styles) */
  --primary: #FF6B4A;
  --primary-dark: #E85A3A;
  --secondary: #00A699;
  --text-primary: #201714;
  --text-secondary: #6E625C;
  --bg-cream: #FFF9F8;
  --bg-white: #FFFFFF;
  --bg-subtle: #FAF4F1;

  /* Type */
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: clamp(2.6rem, 6.5vw, 4.9rem);
  --h2: clamp(1.9rem, 3.6vw, 2.8rem);
  --h3: 1.3rem;
  --body: 1.0625rem;

  /* Rhythm */
  --space-section: clamp(72px, 10vw, 128px);
  --space-gutter: 24px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-card: 0 2px 8px rgba(32, 23, 20, 0.05), 0 12px 32px rgba(32, 23, 20, 0.07);
  --shadow-lift: 0 4px 12px rgba(32, 23, 20, 0.08), 0 20px 48px rgba(32, 23, 20, 0.12);
}

body { font-family: var(--font); }

/* ---------- Utilities ---------- */
.s-container { max-width: 1180px; margin: 0 auto; padding: 0 var(--space-gutter); }
.s-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin-bottom: 14px;
}
.s-h2 {
  font-size: var(--h2);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--ink);
  margin: 0 0 14px;
}
.s-lede {
  font-size: var(--body);
  line-height: 1.65;
  color: var(--muted);
  max-width: 560px;
  margin: 0;
}
.s-section { padding: var(--space-section) var(--space-gutter); }
.s-grad-text {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Scroll reveal (pairs with IntersectionObserver adding .visible).
   Hidden state only applies when JS marked <html class="js">, so content
   is never lost if scripts fail. */
.js .animate-on-scroll { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .animate-on-scroll.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll { opacity: 1; transform: none; transition: none; }
  .s-btn, .s-card { transition: none !important; }
}

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Buttons ---------- */
.s-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  padding: 16px 30px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.s-btn svg { width: 19px; height: 19px; flex: none; }
.s-btn--primary {
  color: #fff;
  background: linear-gradient(120deg, var(--coral) 0%, var(--coral-deep) 100%);
  box-shadow: 0 6px 20px rgba(255, 107, 74, 0.35);
}
.s-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(255, 107, 74, 0.45); }
.s-btn--ghost {
  color: var(--ink);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--border-strong);
}
.s-btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.s-btn--light { color: var(--ink); background: #fff; box-shadow: 0 6px 20px rgba(32, 23, 20, 0.18); }
.s-btn--light:hover { transform: translateY(-2px); }

/* ---------- Cards ---------- */
.s-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.s-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: var(--border-strong); }
.s-card h3 { font-size: var(--h3); font-weight: 650; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 8px; }
.s-card p { font-size: 0.95rem; line-height: 1.6; color: var(--muted); margin: 0; }

/* ---------- Nav ---------- */
nav.s-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 249, 248, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(240, 228, 223, 0.7);
}
.s-nav .nav-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--space-gutter);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.s-nav .nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.s-nav .nav-logo img { border-radius: 9px; }
.s-nav .nav-logo .logo-co { color: var(--coral); }
.s-nav .nav-logo .logo-habby { color: var(--teal-deep); }
.s-nav .nav-links { display: flex; align-items: center; gap: 26px; }
.s-nav .nav-links > a {
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.15s ease;
}
.s-nav .nav-links > a:hover { color: var(--coral-deep); }
.s-nav .nav-cta {
  color: #fff !important;
  font-weight: 600 !important;
  background: linear-gradient(120deg, var(--coral), var(--coral-deep));
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(255, 107, 74, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.s-nav .nav-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255, 107, 74, 0.4); }
@media (max-width: 860px) {
  .s-nav .nav-links > a:not(.nav-cta) { display: none; }
}

/* ---------- Footer ---------- */
footer.s-footer {
  background: var(--dusk);
  color: #CBBBB2;
  padding: 72px var(--space-gutter) 36px;
  font-size: 0.9rem;
}
.s-footer .footer-container { max-width: 1180px; margin: 0 auto; }
.s-footer .footer-top {
  display: grid;
  grid-template-columns: 1.4fr repeat(5, 1fr);
  gap: 36px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(203, 187, 178, 0.16);
}
@media (max-width: 1024px) { .s-footer .footer-top { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .s-footer .footer-top { grid-template-columns: repeat(2, 1fr); } }
.s-footer .footer-brand { grid-column: span 1; }
@media (max-width: 1024px) { .s-footer .footer-brand { grid-column: 1 / -1; } }
.s-footer .footer-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: #fff; margin-bottom: 12px; }
.s-footer .footer-logo img { border-radius: 9px; }
.s-footer .footer-tagline { color: #A6988F; line-height: 1.6; max-width: 240px; }
.s-footer .footer-column h4 {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 14px;
}
.s-footer .footer-column ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.s-footer .footer-column a { color: #CBBBB2; text-decoration: none; transition: color 0.15s ease; }
.s-footer .footer-column a:hover { color: #fff; }
.s-footer .footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
}
.s-footer .footer-intelligence { font-size: 0.78rem; color: #8A7A70; margin: 0; flex-basis: 100%; }
.s-footer .footer-intelligence a { color: #A6988F; }
.s-footer .footer-copyright { color: #8A7A70; margin: 0; }
.s-footer .footer-legal { display: flex; gap: 18px; }
.s-footer .footer-legal a { color: #8A7A70; text-decoration: none; }
.s-footer .footer-legal a:hover { color: #fff; }

/* ---------- Store buttons (App Store / Google Play) ---------- */
.s-store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.s-store:hover { transform: translateY(-1px); opacity: 0.92; }
.s-store svg { width: 22px; height: 22px; }
.s-store .store-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.s-store .store-kicker { font-size: 0.62rem; font-weight: 400; opacity: 0.8; }
.s-store .store-name { font-size: 0.95rem; font-weight: 600; }
.s-store--light { background: #fff; color: var(--ink); }
