/* ============================================================
   CalMonitor — Design System
   Fresh-green / friendly-rounded consumer aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,500&family=Outfit:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ---- Design tokens ------------------------------------------------ */
:root {
  /* Brand — fresh green */
  --brand-50:  #ecfdf3;
  --brand-100: #d3f8e0;
  --brand-200: #a7eec4;
  --brand-300: #6fdda0;
  --brand-400: #38c878;
  --brand-500: #14ad5f;   /* primary */
  --brand-600: #0c8e4c;
  --brand-700: #0c6f3e;
  --brand-800: #0e5733;
  --brand-900: #0c422a;

  /* Warm secondary accent — appetizing amber */
  --warm-300: #ffd59e;
  --warm-400: #ffb863;
  --warm-500: #f59331;

  /* Ink + neutrals (very subtly green-warm) */
  --ink:      #0f221a;
  --ink-soft: #34463d;
  --muted:    #6b7d73;
  --line:     #e3ece6;
  --line-soft:#eef4f0;

  /* Surfaces */
  --bg:       #f4faf6;
  --bg-2:     #eaf5ee;
  --surface:  #ffffff;
  --surface-2:#f7fbf8;

  /* Effects */
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius:    20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(15,34,26,.06), 0 1px 3px rgba(15,34,26,.04);
  --shadow:    0 6px 20px -6px rgba(15,34,26,.12), 0 2px 6px rgba(15,34,26,.05);
  --shadow-lg: 0 24px 60px -16px rgba(12,66,42,.22), 0 8px 24px -12px rgba(15,34,26,.12);
  --shadow-brand: 0 16px 40px -12px rgba(20,173,95,.45);

  --font: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'Space Mono', ui-monospace, monospace;

  --container: 1200px;
  --gutter: clamp(20px, 5vw, 48px);
}

/* ---- Reset -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 3px solid var(--brand-400); outline-offset: 2px; border-radius: 6px; }

/* ---- Typography --------------------------------------------------- */
h1, h2, h3, h4 { line-height: 1.08; letter-spacing: -0.02em; font-weight: 800; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); letter-spacing: -0.015em; }
p  { text-wrap: pretty; }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand-600);
  display: inline-flex;
  align-items: center;
  gap: .55em;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-500);
  box-shadow: 0 0 0 4px var(--brand-100);
}
.lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--ink-soft); line-height: 1.55; }
.text-grad {
  background: linear-gradient(105deg, var(--brand-600), var(--brand-400) 60%, var(--warm-500));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---- Layout ------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container-wide { max-width: 1340px; }
.container-narrow { max-width: 820px; }
section { padding-block: clamp(64px, 9vw, 120px); }
.section-tight { padding-block: clamp(48px, 6vw, 80px); }
.stack-sm > * + * { margin-top: .75rem; }
.stack > * + * { margin-top: 1.25rem; }
.center { text-align: center; }
.section-head { max-width: 680px; }
.section-head.center { margin-inline: auto; }
.section-head .eyebrow { margin-bottom: 18px; }
.section-head p { margin-top: 16px; }

/* ---- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font-weight: 700; font-size: 1rem;
  padding: 14px 26px; border-radius: var(--radius-pill);
  transition: transform .18s ease, box-shadow .25s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--brand-500); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-600); transform: translateY(-2px); }
.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.btn-ghost:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand-200); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { transform: translateY(-2px); background: #16352a; }
.btn-lg { padding: 17px 34px; font-size: 1.06rem; }
.btn-block { width: 100%; }

/* ---- Cards -------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .3s ease, border-color .25s ease;
}
.card-hover:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--brand-200); }
.pill {
  display: inline-flex; align-items: center; gap: .5em;
  padding: 7px 14px; border-radius: var(--radius-pill);
  background: var(--brand-50); color: var(--brand-700);
  font-size: .82rem; font-weight: 700;
  border: 1px solid var(--brand-100);
}
.pill-warm { background: #fff5e9; color: #a85a12; border-color: #ffe2bf; }

.icon-badge {
  width: 54px; height: 54px; border-radius: 16px;
  display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-600);
  border: 1px solid var(--brand-100);
}
.icon-badge svg { width: 26px; height: 26px; }

/* ---- Grids -------------------------------------------------------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---- Header / Nav ------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: saturate(1.4) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 74px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.22rem; letter-spacing: -0.02em; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(150deg, var(--brand-400), var(--brand-600));
  display: grid; place-items: center; color: #fff;
  box-shadow: var(--shadow-brand);
}
.brand .mark svg { width: 20px; height: 20px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 9px 14px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: .95rem; color: var(--ink-soft);
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.nav-links a:hover { background: var(--bg-2); color: var(--ink); }
.nav-links a.active { color: var(--brand-700); background: var(--brand-50); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; align-items: center; justify-content: center; }
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 1024px) {
  .nav-links, .nav-cta a.btn-ghost { display: none; }
  .nav-toggle { display: inline-flex; }
  .mobile-menu { display: block; }
}
.mobile-menu {
  display: none; position: fixed; inset: 0; z-index: 80;
  background: var(--bg); padding: 24px;
  transform: translateX(100%); transition: transform .32s cubic-bezier(.4,0,.1,1);
}
.mobile-menu.open { transform: none; }
.mobile-menu .mm-head { display: flex; justify-content: space-between; align-items: center; height: 50px; }
.mobile-menu nav { margin-top: 28px; display: flex; flex-direction: column; gap: 6px; }
.mobile-menu nav a { font-size: 1.5rem; font-weight: 700; padding: 14px 8px; border-bottom: 1px solid var(--line-soft); }
.mobile-menu .mm-cta { margin-top: 28px; display: grid; gap: 12px; }

/* ---- Footer ------------------------------------------------------- */
.site-footer { background: var(--ink); color: #cdd9d1; padding-block: 72px 36px; margin-top: 40px; }
.site-footer a { color: #cdd9d1; transition: color .2s; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 40px; }
.footer-grid h4 { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: #7e9387; font-family: var(--mono); font-weight: 700; margin-bottom: 16px; }
.footer-grid ul { display: grid; gap: 10px; }
.footer-grid .brand { color: #fff; }
.footer-grid .brand .mark { box-shadow: none; }
.footer-blurb { color: #93a89b; margin-top: 16px; max-width: 32ch; font-size: .95rem; }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: #7e9387; font-size: .85rem; }
.footer-bottom .badge-row { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-bottom .badge-row span { padding: 5px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-pill); }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-grid .footer-about { grid-column: 1 / -1; }
}

/* ---- Reveal animation -------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---- Decorative -------------------------------------------------- */
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; z-index: 0; pointer-events: none; }
.grain-bg { background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 22px 22px; }

/* ---- Breadcrumb -------------------------------------------------- */
.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: .85rem; color: var(--muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--brand-600); }
.breadcrumb .sep { opacity: .5; }

/* ---- Page hero (interior pages) ---------------------------------- */
.page-hero { padding-block: clamp(48px, 7vw, 96px) clamp(32px, 5vw, 56px); position: relative; overflow: hidden; }
.page-hero .container { position: relative; z-index: 1; }

/* ---- Utility ----------------------------------------------------- */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; } .mt-6 { margin-top: 48px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; } .wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.maxw-prose { max-width: 68ch; }

@media (max-width: 880px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .btn { padding: 13px 22px; }
}

/* ============================================================
   VISUAL DIRECTIONS ("Looks") — set on <html data-look>
   ============================================================ */
:root[data-look="citrus"] {
  --brand-50:#f8fce9; --brand-100:#eef7c8; --brand-200:#dcec95; --brand-300:#c3dd5c;
  --brand-400:#a6c932; --brand-500:#86ad17; --brand-600:#688711; --brand-700:#516810;
  --brand-800:#42530f; --brand-900:#36430d;
  --warm-300:#ffd59e; --warm-400:#ff9d4d; --warm-500:#f5731f;
  --ink:#1c2410; --ink-soft:#414a31; --muted:#79836a;
  --line:#e9eccf; --line-soft:#f2f4e2;
  --bg:#fbfcf3; --bg-2:#f4f6e4; --surface:#ffffff; --surface-2:#fafbf1;
  --shadow-brand:0 16px 40px -12px rgba(134,173,23,.45);
}
:root[data-look="tide"] {
  --brand-50:#e9fbf7; --brand-100:#c7f5ec; --brand-200:#92ebda; --brand-300:#53d8c1;
  --brand-400:#1fc1a6; --brand-500:#0aa28b; --brand-600:#08816f; --brand-700:#0a6459;
  --brand-800:#0c504a; --brand-900:#0a3f3a;
  --warm-300:#bfe3f0; --warm-400:#5bc0e0; --warm-500:#2f9bc0;
  --ink:#0e211f; --ink-soft:#314744; --muted:#6a807c;
  --line:#dcefea; --line-soft:#ecf8f4;
  --bg:#f0faf8; --bg-2:#e2f4f0; --surface:#ffffff; --surface-2:#f4fbf9;
  --shadow-brand:0 16px 40px -12px rgba(10,162,139,.45);
}

/* Type variants — set on <html data-type> */
:root[data-type="geometric"] { --font:'Outfit', ui-sans-serif, system-ui, sans-serif; }
:root[data-type="grotesk"]   { --font:'Space Grotesk', ui-sans-serif, system-ui, sans-serif; }

/* Corner softness — set on <html data-corners="sharp"> */
:root[data-corners="sharp"] {
  --radius-xs:5px; --radius-sm:7px; --radius:10px; --radius-lg:14px; --radius-xl:18px;
}

/* ============================================================
   TWEAKS PANEL (vanilla, host-protocol wired)
   ============================================================ */
.cm-tweaks {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  width: 296px; max-width: calc(100vw - 32px);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg);
  font-family: var(--font);
  transform: translateY(16px) scale(.98); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.cm-tweaks.open { transform: none; opacity: 1; pointer-events: auto; }
.cm-tweaks .tk-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.cm-tweaks .tk-head b { font-size: .95rem; font-weight: 800; letter-spacing: -.01em; }
.cm-tweaks .tk-head .tk-x { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); }
.cm-tweaks .tk-head .tk-x:hover { background: var(--bg-2); color: var(--ink); }
.cm-tweaks .tk-body { padding: 16px 18px 20px; display: grid; gap: 18px; }
.cm-tweaks .tk-sec > span { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.cm-tweaks .tk-looks { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 10px; }
.cm-tweaks .tk-look { border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 6px; cursor: pointer; display: grid; gap: 7px; justify-items: center; transition: border-color .15s, background .15s; }
.cm-tweaks .tk-look:hover { background: var(--surface-2); }
.cm-tweaks .tk-look.on { border-color: var(--brand-500); background: var(--brand-50); }
.cm-tweaks .tk-look .dots { display: flex; gap: 3px; }
.cm-tweaks .tk-look .dots i { width: 12px; height: 12px; border-radius: 50%; }
.cm-tweaks .tk-look small { font-size: .72rem; font-weight: 700; color: var(--ink-soft); }
.cm-tweaks .tk-seg { display: flex; background: var(--bg-2); border-radius: 11px; padding: 4px; margin-top: 10px; gap: 4px; }
.cm-tweaks .tk-seg button { flex: 1; padding: 8px 4px; border-radius: 8px; font-size: .8rem; font-weight: 700; color: var(--muted); transition: all .15s; }
.cm-tweaks .tk-seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.cm-tweaks .tk-reset { width: 100%; padding: 10px; border-radius: 11px; border: 1px solid var(--line); font-weight: 700; font-size: .85rem; color: var(--ink-soft); }
.cm-tweaks .tk-reset:hover { background: var(--bg-2); }
@media (prefers-reduced-motion: reduce){ .cm-tweaks{ transition: opacity .15s ease; transform: none; } }
