/* ============ Tokens ============ */
:root {
  --bg: #0f0d0a;
  --bg-alt: #17130e;
  --surface-dark: #211b12;
  --paper: #f7f2e9;
  --paper-alt: #efe7d8;
  --text: #f6f1e7;
  --text-dark: #1b1710;
  --muted: #a89a83;
  --muted-dark: #6e6553;
  --accent: #ff5a3a;
  --accent-hover: #e6451f;
  --accent-on-light: #c23716; /* AA-safe darker accent for text on paper/white (raw --accent is 2.78:1 on paper, fails AA) */
  --border: rgba(246, 241, 231, 0.12);
  --border-dark: rgba(27, 23, 16, 0.12);

  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-body: "Manrope", ui-sans-serif, system-ui, sans-serif;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4rem;
  --space-8: 6rem;
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; }
p { margin: 0; }
button { font-family: inherit; }

.wrap {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.section-dark { background: var(--bg); color: var(--text); }
.section-dark-alt { background: var(--bg-alt); color: var(--text); }
.section-light { background: var(--paper); color: var(--text-dark); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

h1 { font-size: clamp(2.75rem, 6vw, 4.75rem); font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.375rem; font-weight: 600; }
.lede { font-size: clamp(1.0625rem, 1.5vw, 1.25rem); max-width: 62ch; }
.section-dark .lede, .section-dark-alt .lede { color: var(--muted); }
.section-light .lede { color: var(--muted-dark); }
.section-light .eyebrow, .section-light .eyebrow::before { color: var(--accent-on-light); }
.section-light .eyebrow::before { background: var(--accent-on-light); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  min-height: 44px;
  min-width: 44px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #170b06; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn-ghost-dark { border-color: var(--border); color: var(--text); }
.btn-ghost-dark:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost-light { border-color: var(--border-dark); color: var(--text-dark); }
.btn-ghost-light:hover { border-color: var(--accent-on-light); color: var(--accent-on-light); }
.btn-ghost-dark:focus-visible, .btn-ghost-light:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
a:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ============ Nav ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 13, 10, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; padding-block: var(--space-3); }
.nav-mark { font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; text-decoration: none; color: var(--text); }
.nav-mark span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: var(--space-5); list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 0.9375rem; font-weight: 500; transition: color 0.15s ease; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: none; }
@media (min-width: 768px) { .nav-cta { display: inline-flex; } }
.nav-links-collapse { display: none; }
@media (min-width: 768px) { .nav-links-collapse { display: flex; } }

/* ============ Hero ============ */
.hero {
  padding-block: var(--space-8) var(--space-8);
  position: relative;
  overflow: hidden;
  min-height: 88vh;
  display: flex;
  align-items: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 46vw;
  height: 46vw;
  max-width: 620px;
  max-height: 620px;
  background: radial-gradient(circle, rgba(255, 90, 58, 0.16), transparent 70%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: end;
  position: relative;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.3fr 0.7fr; }
}
.hero-copy { display: flex; flex-direction: column; gap: var(--space-4); }
.hero-copy h1 { max-width: 14ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
}
.hero-stats dt { font-family: var(--font-display); font-size: 2rem; color: var(--accent); }
.hero-stats dd { margin: 0; font-size: 0.875rem; color: var(--muted); }

/* ============ Services ============ */
.services { padding-block: var(--space-8); }
.section-head { max-width: 42rem; margin-bottom: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }
.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 800px) {
  .service-grid { grid-template-columns: 1.15fr 0.85fr; }
}
.service-card {
  background: #fff;
  border: 1px solid var(--border-dark);
  border-radius: 20px;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.service-card .num { font-family: var(--font-display); color: var(--accent-on-light); font-size: 1rem; }
.service-card p { color: var(--muted-dark); }
.service-card ul { margin: 0; padding-left: 1.1rem; color: var(--muted-dark); display: flex; flex-direction: column; gap: 0.35rem; }

/* ============ Case study ============ */
.case-study { padding-block: var(--space-8); }
.case-head { max-width: 44rem; margin-bottom: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }
.case-fact {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  width: fit-content;
}

.browser-frame {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-dark);
}
.browser-chrome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface-dark);
  border-bottom: 1px solid var(--border);
}
.browser-chrome .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.browser-chrome .url {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  background: rgba(246, 241, 231, 0.06);
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
}

/* Before/after slider */
.compare {
  position: relative;
  aspect-ratio: 1600 / 825;
  user-select: none;
  touch-action: pan-y;
}
.compare + .browser-frame { margin-top: var(--space-4); }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Base img (no class) = the "after" shot, always fully visible underneath.
   .compare-top = the "before" shot, clipped away from the right as the handle moves right
   so the visible before-region always matches the handle's left-side position. */
.compare .compare-top {
  clip-path: inset(0 var(--reveal, 50%) 0 0);
}
.compare-tag {
  position: absolute;
  top: 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 13, 10, 0.7);
  color: var(--text);
  backdrop-filter: blur(4px);
}
.compare-tag.before-tag { left: 1rem; }
.compare-tag.after-tag { right: 1rem; }
.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 0;
  transform: translateX(-50%);
  cursor: ew-resize;
}
.compare-handle::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 2px;
  background: var(--text);
  transform: translateX(-50%);
}
.compare-handle-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #170b06;
  font-size: 1rem;
  box-shadow: 0 6px 20px rgba(255, 90, 58, 0.35);
}
.compare-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
}

.case-proof {
  margin-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-alt);
}
.case-proof-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #170b06;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  flex-shrink: 0;
}
.case-proof strong { display: block; font-size: 0.9375rem; }
.case-proof span { color: var(--muted); font-size: 0.875rem; }

/* ============ About ============ */
.about { padding-block: var(--space-8); }
.about-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
@media (min-width: 860px) { .about-grid { grid-template-columns: 1fr 1fr; align-items: center; } }
.about-list { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.about-list li { display: flex; gap: 0.75rem; align-items: baseline; color: var(--muted-dark); }
.about-list li::before { content: "→"; color: var(--accent); font-weight: 700; flex-shrink: 0; }

/* ============ Contact ============ */
.contact { padding-block: var(--space-8); }
.contact-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: var(--space-4); }
.field label { font-size: 0.875rem; color: var(--muted); font-weight: 600; }
.field input, .field textarea {
  background: var(--surface-dark);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  min-height: 44px;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 90, 58, 0.2);
}
.form-note { font-size: 0.8125rem; color: var(--muted); margin-top: var(--space-2); }
.contact-direct { margin-top: var(--space-4); }
.link-accent { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.link-accent:hover { color: var(--accent-hover); }

/* ============ Footer ============ */
.footer { padding-block: var(--space-6); border-top: 1px solid var(--border); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); align-items: center; }
.footer small { color: var(--muted); font-size: 0.8125rem; }
.footer a { color: var(--muted); text-decoration: none; font-size: 0.8125rem; }
.footer a:hover { color: var(--accent); }

/* ============ Reveal-on-scroll ============ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > * { transition-delay: calc(var(--i, 0) * 80ms); }
