/* ===========================================================
   BackUPlan LLC — Design Tokens & Shared Styles
   ========================================================= */

:root {
  /* Palette — warm neutral with single emerald accent */
  --bg: #F6F5F0;
  --bg-2: #FFFFFF;
  --bg-3: #EFEDE5;
  --ink: #0D0F0C;
  --ink-2: #1B1E1A;
  --muted: #6B6F66;
  --muted-2: #9A9D94;
  --line: #E4E2D8;
  --line-2: #D8D5C8;
  /* Brand blue from BackUPlan logo */
  --accent: oklch(40% 0.14 256);
  --accent-2: oklch(46% 0.14 256);
  --accent-soft: oklch(94% 0.035 256);
  --accent-ink: oklch(32% 0.12 256);
  --warn: oklch(70% 0.13 60);

  /* Type */
  --font-sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Spacing scale */
  --space-pad: clamp(20px, 4vw, 48px);
  --shell: 1280px;
  --shell-narrow: 1080px;

  /* Density */
  --density: 1;
  --section-pad: calc(112px * var(--density));

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Shadows */
  --shadow-1: 0 1px 0 rgba(13,15,12,0.04), 0 1px 2px rgba(13,15,12,0.04);
  --shadow-2: 0 1px 0 rgba(13,15,12,0.04), 0 12px 32px -16px rgba(13,15,12,0.16);
  --shadow-3: 0 1px 0 rgba(13,15,12,0.04), 0 32px 80px -32px rgba(13,15,12,0.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }

::selection { background: var(--accent); color: white; }

/* -----------------------------
   Shell / layout
   ----------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-inline: var(--space-pad);
}
.shell.narrow { max-width: var(--shell-narrow); }
.section { padding-block: var(--section-pad); position: relative; }
.section.cream { background: var(--bg); }
.section.white { background: var(--bg-2); }
.section.ink { background: var(--ink); color: #E9E9E5; }
.section.ink .eyebrow { color: var(--muted-2); }
.section.ink .lead { color: rgba(233,233,229,0.78); }
.section.tight { padding-block: calc(72px * var(--density)); }

/* -----------------------------
   Typography
   ----------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--accent);
  display: inline-block;
}
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.022em; margin: 0; text-wrap: balance; }
h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 500;
}
h2 {
  font-size: clamp(30px, 4.4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.026em;
}
h3 { font-size: clamp(20px, 2.2vw, 24px); line-height: 1.2; }
h4 { font-size: 17px; line-height: 1.3; }
p { margin: 0; color: var(--ink-2); }
.lead {
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.55;
  color: var(--muted);
  max-width: 60ch;
  text-wrap: pretty;
}
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--muted);
}

/* -----------------------------
   Top Nav
   ----------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.nav.scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 500; letter-spacing: -0.02em; font-size: 16px;
}
.brand-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  position: relative;
}
.brand-mark img {
  width: 100%; height: 100%;
  object-fit: contain;
}
.brand-name { font-weight: 600; letter-spacing: -0.018em; }
.brand-name b { font-weight: 700; }
.brand-name span { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 2px; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-size: 14px;
  color: var(--ink-2);
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-links a:hover { background: rgba(13,15,12,0.05); }
.nav-links a.active { color: var(--accent-ink); }

.nav-cta { display: flex; align-items: center; gap: 8px; }
.nav-burger {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.nav-burger svg { margin: auto; }

/* -----------------------------
   Buttons
   ----------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: transform 0.15s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--ink);
  color: white;
}
.btn-primary:hover { background: #000; box-shadow: 0 8px 24px -8px rgba(13,15,12,0.4); }
.btn-primary .arrow { transition: transform 0.18s ease; }
.btn-primary:hover .arrow { transform: translateX(2px); }

.btn-secondary {
  background: var(--bg-2);
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--line-2); }

.btn-ghost {
  background: transparent; color: var(--ink-2);
  padding: 10px 14px;
}
.btn-ghost:hover { color: var(--ink); }

.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover { background: var(--accent-2); }

.btn .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }
.btn-primary .dot { background: var(--accent); }

/* Link with arrow */
.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 2px;
  transition: gap 0.18s ease, border-color 0.18s ease;
}
.link-arrow:hover { gap: 10px; border-color: var(--ink); }

/* -----------------------------
   Section header pattern
   ----------------------------- */
.sec-head { display: grid; gap: 16px; margin-bottom: 56px; max-width: 760px; }
.sec-head.center { text-align: center; margin-inline: auto; justify-items: center; }
.sec-head .row { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.sec-head h2 { max-width: 18ch; }
.sec-head.center h2 { text-align: center; }
.sec-head p { color: var(--muted); }

/* -----------------------------
   Cards
   ----------------------------- */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.card.hover-lift:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  box-shadow: var(--shadow-2);
}

/* -----------------------------
   Footer
   ----------------------------- */
.footer {
  background: var(--ink);
  color: rgba(233,233,229,0.7);
  padding-block: 80px 32px;
  font-size: 14px;
}
.footer a { color: rgba(233,233,229,0.7); transition: color 0.15s ease; }
.footer a:hover { color: white; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
.footer h5 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(233,233,229,0.5);
  font-family: var(--font-mono);
  font-weight: 400;
  margin: 0 0 16px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer .brand-mark { background: white; border-radius: 8px; padding: 4px; }
.footer .brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.footer .brand-name { color: white; }
.footer-desc {
  color: rgba(233,233,229,0.6);
  margin: 16px 0 24px;
  max-width: 36ch;
  line-height: 1.6;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(233,233,229,0.5);
}
.footer-social { display: flex; gap: 12px; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  display: grid; place-items: center;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.footer-social a:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.04); }

@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-burger { display: grid; place-items: center; }
}

/* -----------------------------
   Mobile menu (drawer)
   ----------------------------- */
.mobile-menu {
  display: none;
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg);
  padding: 24px;
  flex-direction: column;
}
.mobile-menu.open { display: flex; }
.mobile-menu .row-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 32px;
}
.mobile-menu nav { display: grid; gap: 4px; }
.mobile-menu nav a {
  font-size: 24px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.mobile-menu .actions { margin-top: 24px; display: grid; gap: 12px; }

/* -----------------------------
   Reveal animation
   ----------------------------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* -----------------------------
   Tweaks panel
   ----------------------------- */
.tweaks-toggle {
  position: fixed; bottom: 20px; right: 20px; z-index: 70;
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--ink); color: white;
  display: grid; place-items: center;
  box-shadow: var(--shadow-2);
  transition: transform 0.15s ease;
}
.tweaks-toggle:hover { transform: scale(1.05); }
.tweaks-panel {
  position: fixed; bottom: 76px; right: 20px; z-index: 70;
  width: 280px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-3);
  display: none;
}
.tweaks-panel.open { display: block; }
.tweaks-panel h6 {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
}
.tweaks-row { margin-bottom: 14px; }
.tweaks-row:last-child { margin-bottom: 0; }
.tweaks-row label {
  font-size: 12px; color: var(--ink-2);
  display: block; margin-bottom: 6px;
  font-family: var(--font-mono);
}
.swatches { display: flex; gap: 8px; }
.swatch {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.swatch.active { border-color: var(--ink); }
.swatch:hover { transform: scale(1.08); }
.toggle-group {
  display: flex; gap: 4px;
  background: var(--bg-3);
  border-radius: 10px;
  padding: 3px;
}
.toggle-group button {
  flex: 1;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.toggle-group button.active {
  background: var(--bg-2);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}
