/* Constraction — shared styles */
:root {
  --bg: #f4f0e8;
  --bg-2: #ebe6db;
  --bg-3: #1c1b18;
  --fg: #1c1b18;
  --fg-muted: #5b574e;
  --fg-soft: #8a8579;
  --line: #d8d2c3;
  --line-strong: #b8b1a0;
  --accent: #2f4a3a;
  --accent-2: #c66a3b;
  --on-dark: #f4f0e8;
  --on-dark-muted: #a8a497;

  --display: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --body: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;

  --maxw: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -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; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Type ---------- */
.display, h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.02;
  margin: 0;
}
h1 { font-size: clamp(54px, 8.4vw, 132px); }
h2 { font-size: clamp(40px, 5.4vw, 76px); }
h3 { font-size: clamp(28px, 3vw, 44px); }
.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--fg-muted);
}
.lead {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.5;
  max-width: 60ch;
  color: var(--fg-muted);
}
p { margin: 0 0 1em; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; }

/* ---------- Top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 10px;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 4px;
  background: var(--accent);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 5px 5px auto auto;
  width: 8px; height: 8px; background: var(--bg);
  border-radius: 1px;
}
.nav {
  display: flex; gap: 6px; align-items: center;
  font-size: 14px;
}
.nav a {
  padding: 8px 12px; border-radius: 999px;
  color: var(--fg-muted);
  transition: color .2s, background .2s;
}
.nav a:hover { color: var(--fg); background: var(--bg-2); }
.nav a.active { color: var(--fg); background: var(--bg-2); }
.nav .has-sub { position: relative; }
.nav .submenu {
  position: absolute; top: 100%; left: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  min-width: 220px;
  opacity: 0; pointer-events: none;
  transform: translateY(6px);
  transition: opacity .18s, transform .18s;
  box-shadow: 0 18px 40px -20px rgba(28,27,24,.25);
  display: flex; flex-direction: column;
  margin-top: 4px;
}
.nav .has-sub:hover .submenu,
.nav .has-sub:focus-within .submenu {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.nav .submenu a { padding: 10px 12px; border-radius: 8px; }
.top-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  background: var(--fg); color: var(--on-dark);
  font-size: 13px; font-weight: 500;
  transition: opacity .2s;
}
.top-cta:hover { opacity: 0.9; }
.menu-toggle {
  display: none;
  background: none; border: 1px solid var(--line);
  width: 40px; height: 40px; border-radius: 8px;
  color: var(--fg);
}

@media (max-width: 900px) {
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg); flex-direction: column; align-items: stretch;
    padding: 12px var(--gutter); border-bottom: 1px solid var(--line); gap: 2px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .nav .submenu { position: static; opacity: 1; pointer-events: auto;
    transform: none; box-shadow: none; border: none; padding: 0 0 0 16px;
    margin: 0; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .top-cta .cta-label-long { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px; font-weight: 500;
  transition: transform .2s, background .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--fg); color: var(--on-dark); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-outline { border-color: var(--line-strong); color: var(--fg); }
.btn-outline:hover { background: var(--bg-2); }
.btn-ghost { color: var(--fg); }
.btn-ghost:hover { background: var(--bg-2); }
.btn .arr { display: inline-block; transition: transform .25s; }
.btn:hover .arr { transform: translateX(4px); }

/* ---------- Placeholder imagery ---------- */
.ph {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(135deg,
      #d8d2c3 0 1px, transparent 1px 14px),
    linear-gradient(180deg, #e8e2d2, #d4cdb9);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--fg-muted);
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ph > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph.dark {
  background:
    repeating-linear-gradient(135deg,
      #2a2925 0 1px, transparent 1px 14px),
    linear-gradient(180deg, #232220, #1a1916);
  color: var(--on-dark-muted);
  border-color: #2a2925;
}
.ph-label {
  background: rgba(244,240,232,.7);
  backdrop-filter: blur(4px);
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line);
}
.ph.dark .ph-label {
  background: rgba(28,27,24,.5);
  border-color: #2a2925;
  color: var(--on-dark-muted);
}

/* ---------- Sections ---------- */
section { padding: clamp(64px, 9vw, 140px) 0; }
.section-head {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  align-items: end;
  margin-bottom: clamp(36px, 5vw, 64px);
}
.section-head .lead { justify-self: start; max-width: 46ch; }
@media (max-width: 760px) { .section-head { grid-template-columns: 1fr; } }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Grid utilities ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 40px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 2vw, 28px); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
footer { background: var(--bg-3); color: var(--on-dark); padding: 96px 0 32px; }
footer .top-row {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px;
  padding-bottom: 56px; border-bottom: 1px solid #2a2925;
}
@media (max-width: 800px) { footer .top-row { grid-template-columns: 1fr 1fr; } }
footer h4 { font-family: var(--body); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--on-dark-muted); margin: 0 0 16px; font-weight: 500; }
footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
footer ul a { color: var(--on-dark); opacity: 0.85; font-size: 14px; }
footer ul a:hover { opacity: 1; }
footer .big { font-family: var(--display); font-size: clamp(40px, 5vw, 64px); line-height: 1; margin-bottom: 20px; }
footer .bottom-row {
  display: flex; justify-content: space-between; padding-top: 24px;
  font-size: 12px; color: var(--on-dark-muted);
}
footer .brand-mark { background: var(--accent); }
footer .brand-mark::after { background: var(--bg-3); }

/* ---------- Form ---------- */
.field {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--fg-muted);
}
.field label { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; }
.field input, .field textarea, .field select {
  font: inherit;
  background: transparent;
  border: 0; border-bottom: 1px solid var(--line-strong);
  padding: 10px 0; color: var(--fg);
  outline: none;
  transition: border-color .2s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--fg); }
.field textarea { resize: vertical; min-height: 110px; }

/* ---------- Pill list ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 12px; color: var(--fg-muted);
  background: transparent;
  transition: background .2s, color .2s, border-color .2s;
}
.pill.active, .pill:hover { background: var(--fg); color: var(--on-dark); border-color: var(--fg); }

/* ---------- Cards ---------- */
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
}
.card.cream { background: var(--bg-2); }

/* ---------- Tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--bg-2); color: var(--fg-muted);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------- Hero util ---------- */
.page-hero { padding: clamp(48px, 7vw, 96px) 0 clamp(40px, 5vw, 72px); }
.page-hero .crumb { color: var(--fg-muted); font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 20px; }
.page-hero h1 { font-size: clamp(48px, 7vw, 110px); margin-bottom: 28px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* =================== MOBILE REFINEMENTS =================== */
@media (max-width: 720px) {
  :root { --gutter: 18px; }

  /* Top bar — tighter, smaller phone CTA */
  .top-inner { height: 60px; }
  .brand { font-size: 22px; }
  .top-cta {
    padding: 8px 14px; font-size: 12px;
  }
  .top-cta span:first-child { display: none; }
  .top-cta .cta-label-long { font-size: 0; }
  .top-cta .cta-label-long::before { content: "Book a call"; font-size: 12px; }

  /* Section padding */
  section { padding: 56px 0; }
  .page-hero { padding: 32px 0 24px; }
  .page-hero h1 { font-size: clamp(44px, 12vw, 64px); margin-bottom: 18px; }
  .section-head { gap: 14px; margin-bottom: 28px; }
  .lead { font-size: 16px; }

  /* Type scale */
  h1 { font-size: clamp(48px, 13vw, 72px); }
  h2 { font-size: clamp(36px, 10vw, 54px); }
  h3 { font-size: clamp(24px, 6.5vw, 32px); }

  /* Buttons full-width feel */
  .btn { padding: 12px 18px; font-size: 13px; }

  /* Footer */
  footer { padding: 56px 0 24px; }
  footer .top-row { padding-bottom: 36px; gap: 28px; }
  footer .big { font-size: 40px; margin-bottom: 16px; }
  footer .bottom-row { flex-direction: column; gap: 10px; padding-top: 18px; text-align: left; }
  footer ul a { font-size: 14px; }

  /* Cards */
  .card { padding: 20px; border-radius: 14px; }

  /* Placeholder radius / aspect */
  .ph { border-radius: 14px; }
}

@media (max-width: 720px) {
  /* Sticky calculators shouldn't stick on phones */
  .estimate, .roi-card { position: static !important; }

  /* Hero ribbon (home) — grid into two columns */
  .hero-ribbon {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px !important;
    padding: 18px !important;
  }
  .hero-ribbon .vsep { display: none; }
  .hero-ribbon .num { font-size: 26px !important; }

  /* Home meta strip */
  .hero-meta > div { padding: 14px 0; }

  /* Hero image: don't go ultra-wide on phones */
  .hero-img { aspect-ratio: 4/3 !important; margin-top: 24px !important; }

  /* Trust row wraps and tightens */
  .trust-row { gap: 12px !important; padding-top: 32px !important; font-size: 10px !important; }

  /* Why list */
  .why-row { padding: 18px 0 !important; gap: 16px !important; }

  /* Form rows */
  .form .row { gap: 18px !important; }

  /* Contact info cards */
  .info-card { padding: 22px; }

  /* Calculator forms */
  .calc-form, .roi-form { padding: 22px !important; gap: 18px !important; }
  .opt-grid { grid-template-columns: 1fr !important; }

  /* Footer big text */
  footer .big { font-size: 36px !important; line-height: 1.05; }
}

@media (max-width: 480px) {
  .hero-ribbon { grid-template-columns: 1fr !important; }
  .hero-ribbon .num { font-size: 28px !important; }
}
