/* ============================================================
   Landscapey — base.css
   Loaded on every page. Variables, reset, typography, utilities.
   ============================================================ */

:root {
  /* ── Typography ─────────────────────────────────── */
  --font-display: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Geist Mono', 'SF Mono', 'JetBrains Mono', Menlo, monospace;

  /* ── Color ──────────────────────────────────────── */
  --ink:           #1c1f1a;
  --ink-soft:      #3a3d36;
  --paper:         #f7f4ec;
  --paper-deep:    #eee8d8;
  --cream:         #ede5d1;
  --moss:          #3f5235;
  --moss-deep:     #2c3a25;
  --sage:          #94a585;
  --sage-soft:     #c0c9b5;
  --clay:          #c8aa84;
  --terracotta:    #b85c3a;
  --mist:          #8a8e84;
  --line:          rgba(28, 31, 26, 0.08);
  --line-strong:   rgba(28, 31, 26, 0.16);

  /* ── Layout ─────────────────────────────────────── */
  --max:           1280px;
  --gutter:        clamp(20px, 4vw, 56px);
  --radius:        14px;
  --radius-lg:     22px;
  --radius-xl:     32px;

  /* ── Motion ─────────────────────────────────────── */
  --ease:          cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft:     cubic-bezier(0.65, 0, 0.35, 1);
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }
::selection { background: var(--moss); color: var(--paper); }

/* ── Container ─────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── Buttons ───────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  text-decoration: none;
  transition: transform 0.4s var(--ease), background-color 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.4s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--moss-deep);
  color: var(--paper);
  box-shadow: 0 10px 22px -10px rgba(44, 58, 37, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.btn-primary:hover {
  background: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 16px 32px -10px rgba(28, 31, 26, 0.5);
}
.btn-primary .btn-arrow { transition: transform 0.4s var(--ease); }
.btn-primary:hover .btn-arrow { transform: translateX(3px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  padding: 14px 18px;
}
.btn-ghost:hover { color: var(--moss); }
.btn-ghost::after {
  content: "";
  display: inline-block;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 0.4s var(--ease);
  margin-left: 8px;
  align-self: center;
}
.btn-ghost:hover::after { width: 16px; }

.btn-pill {
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
}
.btn-pill:hover { background: var(--moss-deep); transform: translateY(-1px); }

.btn-light {
  background: var(--paper);
  color: var(--moss-deep);
}
.btn-light:hover { background: var(--cream); transform: translateY(-1px); }

/* ── Eyebrow / micro-labels ───────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--moss);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--moss);
}

/* ── Section heading typography ───────────────── */
.section-heading {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.5vw, 76px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 18px 0 0;
}
.section-heading em { font-style: italic; color: var(--moss); }
.section-lede {
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 580px;
  margin: 22px 0 0;
}

/* ── Reveal-on-scroll utility ─────────────────── */
/* FAIL-SAFE TO VISIBLE: .reveal content is shown by default and only hidden
   once JS confirms it can run (html.js, set by an inline script in header.php).
   If any script errors — or JS is off — the content still renders, so a single
   JS bug can never silently blank a whole page again (plan 2bc641: a syntax
   error in pricing.js had left the entire pricing page invisible). */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Staggered entrance delays. Apply alongside .reveal — e.g. <div class="reveal r-d08"> */
.r-d04 { transition-delay: 40ms; }
.r-d08 { transition-delay: 80ms; }
.r-d12 { transition-delay: 120ms; }
.r-d14 { transition-delay: 140ms; }
.r-d16 { transition-delay: 160ms; }
.r-d18 { transition-delay: 180ms; }
.r-d20 { transition-delay: 200ms; }
.r-d24 { transition-delay: 240ms; }
.r-d28 { transition-delay: 280ms; }
.r-d32 { transition-delay: 320ms; }
.r-d40 { transition-delay: 400ms; }

/* ── Before/after comparison slider ───────────── */
/* Shared component. Used by the landing hero, the /generate reveal step, and
   the /design page. Each page supplies its own card wrapper sizing
   (.hero-art / .gen-reveal-card / .design-ba-card); the mechanics below
   (absolute-stacked images, clip-path reveal, draggable handle) live here so
   every page gets the identical, working slider. Driven by --pos (set in JS). */
.ba-card {
  position: relative;
  z-index: 1;
  width: 100%; height: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--cream);
  box-shadow:
    0 40px 80px -30px rgba(28, 31, 26, 0.32),
    0 16px 32px -16px rgba(28, 31, 26, 0.18),
    inset 0 0 0 1px rgba(28, 31, 26, 0.06);
}

.ba-slider {
  --pos: 50%;
  position: relative;
  width: 100%; height: 100%;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.ba-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.ba-after-wrap {
  position: absolute; inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
  will-change: clip-path;
}

/* Fallback gradients so the page looks intentional before real images exist */
.ba-img.placeholder-before {
  background:
    linear-gradient(180deg, rgba(150, 145, 130, 0.25), rgba(120, 115, 100, 0.55)),
    linear-gradient(135deg, #b8b3a3, #8a8473);
}
.ba-img.placeholder-after {
  background:
    radial-gradient(800px 400px at 70% 30%, rgba(255, 230, 180, 0.4), transparent 60%),
    linear-gradient(135deg, #6b8159 0%, #8aa178 50%, #c8aa84 100%);
}

.ba-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--pos);
  width: 2px;
  background: var(--paper);
  transform: translateX(-50%);
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.ba-handle::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px;
  background: var(--paper);
  border-radius: 50%;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(28, 31, 26, 0.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232c3a25' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6 4 12l4 6M16 6l4 6-4 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px 22px;
}

.ba-tag {
  position: absolute;
  bottom: 18px;
  background: rgba(28, 31, 26, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--paper);
  padding: 7px 14px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}
.ba-tag.is-before { left: 18px; }
.ba-tag.is-after  { right: 18px; }

/* ── Accessibility ────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  border: 0; overflow: hidden;
  clip: rect(0 0 0 0);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
