/* ---------- Tokens ---------- */
:root {
  /* Palette: charcoal + safety orange. Change colors here and nowhere else
     (the only other copy is the theme-color meta tag in index.html). */
  --bg: #1E1F22;
  --bg-rgb: 30, 31, 34;            /* same as --bg, for rgba() overlays */
  --bg-tint: #232428;              /* alternate section background */
  --surface: #2A2B2F;              /* cards and elevated surfaces */
  --border: #3A3B40;               /* borders and dividers */
  --border-strong: #4A4B51;        /* hover borders, inactive dots */
  --text: #F2F2F0;
  --muted: #A1A1A6;                /* secondary text */
  --muted-on-photo: #C2C2C6;       /* secondary text over the hero photo */
  --accent: #FF6700;               /* safety orange */
  --accent-rgb: 255, 103, 0;       /* same as --accent, for rgba() glows */
  --accent-hover: #E55C00;
  --on-accent: #1E1F22;            /* text on orange */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='2.4 0 0 0 -0.7 2.4 0 0 0 -0.7 2.4 0 0 0 -0.7 0 0 0 0 0.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"); /* film grain tile; 'none' on phones */
  --dots: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1.5px); /* faint dot grid; 'none' on phones */
  --edge-highlight: rgba(255, 255, 255, 0.06);   /* 1px top edge on raised surfaces */
  --lift-shadow: 0 12px 32px -14px rgba(0, 0, 0, 0.55);
  --font-body: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Big Shoulders Display", Impact, "Arial Narrow", "sans-serif-condensed", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --error: #E5484D;                /* form error border */
  --error-text: #FF8A8E;           /* form error message */

  --radius: 16px;
  --radius-sm: 10px;
  --nav-h: 68px;
  --container: 1120px;
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--grain), var(--bg);
  background-blend-mode: overlay, normal;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.menu-open { overflow: hidden; }


img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 0.98;
  text-wrap: balance; /* avoids one-word last lines on phones */
}

h1 { font-size: clamp(2.9rem, 8vw, 6.05rem); line-height: 0.95; }
h2 { font-size: clamp(2.3rem, 5.2vw, 3.74rem); }
h3 { font-size: 1.44rem; line-height: 1; }

.muted { color: var(--muted); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--text);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  z-index: 200;
}
.skip-link:focus { top: 1rem; }

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

.label {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:active { transform: scale(0.98); }

.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }

.btn--ghost { border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--muted); }

.btn--block { width: 100%; padding-block: 1rem; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 120; /* above the full-screen menu (110) so the logo and close button stay visible and tappable */
  height: var(--nav-h);
  background: rgba(var(--bg-rgb), 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.is-scrolled { border-bottom-color: var(--border); }

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0;
}
.logo__mark {
  width: 22px;
  height: 22px;
  background: var(--text);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.nav__links {
  display: flex;
  gap: 2rem;
  margin-inline: auto;
}
.nav__links a {
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 0.2s;
}
.nav__links a:hover { color: var(--text); }

.nav__cta { padding: 0.65rem 1.1rem; font-size: 0.88rem; }

/* Menu toggle (mobile only) */
.menu-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  z-index: 1;
}
.menu-toggle span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.35s var(--ease), top 0.35s var(--ease);
}
.menu-toggle span:nth-child(1) { top: 17px; }
.menu-toggle span:nth-child(2) { top: 25px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

/* Full-screen mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: var(--grain), var(--bg);
  background-blend-mode: overlay, normal;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--nav-h) + 2rem) var(--gutter) 2rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-1rem);
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease), visibility 0s linear 0.4s;
}
.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.mobile-menu__nav { display: flex; flex-direction: column; }
.mobile-menu__nav a {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.mobile-menu__foot { display: grid; gap: 1.25rem; }
.mobile-menu__foot p { color: var(--muted); font-size: 0.9rem; text-align: center; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(5rem, 11vw, 9rem); }
.section--tint {
  background: var(--grain), var(--bg-tint);
  background-blend-mode: overlay, normal;
  border-block: 1px solid var(--border);
}
.section--dots {
  background: var(--grain), var(--dots) 0 0 / 24px 24px, var(--bg-tint);
  background-blend-mode: overlay, normal, normal;
}

.section__head { max-width: 720px; margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.section__head .label { margin-bottom: 1rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(4rem, 10vw, 8rem) clamp(4rem, 9vw, 7rem);
  background: var(--bg);
}
/* The photo is a real <img> (so it can be preloaded and prioritised); the overlays sit on top of it. */
.hero__img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 85%;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(var(--bg-rgb), 0) 65%, var(--bg) 100%),
    radial-gradient(ellipse 50% 55% at 32% 38%, rgba(var(--accent-rgb), 0.1), transparent 70%),
    var(--dots) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(var(--bg-rgb), 0.9) 0%, rgba(var(--bg-rgb), 0.76) 55%, rgba(var(--bg-rgb), 0.4) 100%);
}
.hero h1 .muted { color: var(--muted-on-photo); }

.hero__inner { display: flex; flex-direction: column; align-items: flex-start; }
.hero .label { margin-bottom: 1.5rem; }
.hero h1 { max-width: 18ch; } /* wider than the old 14ch: the condensed face is narrower per character */
.hero__lede {
  max-width: 52ch;
  margin-top: 1.75rem;
  color: var(--muted-on-photo);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.55;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.5rem; }


/* ---------- Grid + cards ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 0;
  box-shadow: inset 0 1px 0 var(--edge-highlight), var(--lift-shadow);
  transition: border-color 0.3s, transform 0.4s var(--ease);
}
.card:hover { border-color: var(--border-strong); }

.card__image {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.card__image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card h3 { margin-bottom: 0.6rem; }
.card p { color: var(--muted); font-size: 0.97rem; }

/* ---------- Before / after slider ---------- */
/* --pos (0-100) is the only thing JS changes. The after image is revealed with clip-path
   and the handle moves with transform (cqw = 1% of the stage width), so nothing reflows. */
.compare { max-width: 1100px; margin-inline: auto; }

.compare__stage {
  --pos: 50;
  position: relative;
  aspect-ratio: 16 / 9;
  container-type: inline-size;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--lift-shadow);
  cursor: ew-resize;
  touch-action: pan-y; /* vertical scroll still works; horizontal drags stay with the slider */
  -webkit-user-select: none;
  user-select: none;
}

.compare__stage::after { /* top-edge highlight, drawn above the photos */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 var(--edge-highlight);
  pointer-events: none;
}

.compare__pair { position: absolute; inset: 0; }
.compare__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}
.compare__img--after { clip-path: inset(0 0 0 calc(var(--pos) * 1%)); }

.compare__tag {
  position: absolute;
  top: 1rem;
  z-index: 4; /* above the handle (z-index 3) so the line never cuts through the text */
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(var(--bg-rgb), 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
}
.compare__tag--before { left: 1rem; }
.compare__tag--after { right: 1rem; }

.compare__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -20px;
  z-index: 3;
  width: 40px;
  transform: translateX(calc(var(--pos) * 1cqw));
  cursor: ew-resize;
  touch-action: pan-y;
}
.compare__handle:focus-visible { outline: none; }
.compare__handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 19px;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(var(--bg-rgb), 0.3);
}
.compare__grip {
  position: absolute;
  top: 50%;
  left: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s var(--ease), background 0.2s;
}
.compare__handle:hover .compare__grip,
.compare__stage.is-dragging .compare__grip { background: var(--accent-hover); transform: scale(1.08); }
.compare__handle:focus-visible .compare__grip { outline: 2px solid var(--text); outline-offset: 3px; }

.compare__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-top: 1.5rem;
}
.compare__title { margin-bottom: 0.35rem; }
.compare__result { max-width: 60ch; color: var(--muted); }

.compare__controls { display: flex; align-items: center; gap: 0.75rem; }
.compare__nav {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.compare__nav:hover { border-color: var(--muted); }
.compare__dots { display: flex; }
.compare__dot {
  width: 24px;
  height: 24px;
  padding: 8px;
  border: 0;
  border-radius: 50%;
  background: var(--border-strong);
  background-clip: content-box;
  cursor: pointer;
  transition: background 0.2s;
}
.compare__dot:hover { background-color: var(--muted); }
.compare__dot[aria-current="true"] { background-color: var(--accent); }

/* ---------- Stats ---------- */
.stat {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.stat__num {
  font-size: clamp(3.25rem, 7vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat__label { margin-top: 0.9rem; max-width: 26ch; color: var(--muted); }

/* ---------- Testimonials ---------- */
.quote { display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; }
.quote blockquote {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--text);
}
.quote figcaption {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}
.quote figcaption strong { color: var(--text); font-weight: 500; }
.avatar {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--border);
  color: var(--text);
  font-weight: 500;
}

/* ---------- Contact ---------- */
.contact {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: start;
}
.contact__copy .label { margin-bottom: 1rem; }
.contact__copy > p:not(.label) { margin-top: 1.25rem; color: var(--muted); max-width: 42ch; }

.contact__details { list-style: none; margin: 2.5rem 0 0; padding: 0; }
.contact__details li {
  display: flex;
  gap: 1.5rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--border);
  word-break: break-word;
}
.contact__details li:last-child { border-bottom: 1px solid var(--border); }
.contact__details span { flex: none; width: 4.5rem; color: var(--muted); }

.form { padding: clamp(1.25rem, 3vw, 2rem); display: grid; gap: 1.1rem; }
.field { display: grid; gap: 0.45rem; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }

.field label { font-size: 0.85rem; font-weight: 500; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 1rem; /* 16px avoids iOS zoom on focus */
  transition: border-color 0.2s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--border-strong); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238A8A93' stroke-width='1.5'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.field.has-error input,
.field.has-error textarea { border-color: var(--error); }
.field__error { min-height: 0; color: var(--error-text); font-size: 0.8rem; }

.form__status { min-height: 1.4em; font-size: 0.9rem; text-align: center; color: var(--muted); }
.form__status.is-success { color: var(--text); }
.form__status.is-error { color: var(--error-text); }

/* Netlify spam honeypot. display:none keeps phones from rendering (and autofilling) it; bots still see and fill it. */
.form__hp { display: none; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding-block: 3rem; }
.footer__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
}
.footer__tag { margin-top: 0.75rem; color: var(--muted); font-size: 0.9rem; }
.footer__links { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.footer__links a { color: var(--muted); font-size: 0.9rem; transition: color 0.2s; }
.footer__links a:hover { color: var(--text); }
.footer__legal {
  grid-column: 1 / -1;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}

/* ---------- Scroll fade-in ---------- */
/* Only hide elements when JS is running, so the page still works without it. */
.js .fade {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js .fade.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .fade { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid--3 { grid-template-columns: 1fr; }
  .stats { gap: 2rem; }
  .contact { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav__links, .nav__cta { display: none; }
  .menu-toggle { display: block; margin-right: -11px; }
  .hero h1 { max-width: none; }
}

@media (max-width: 767px) {
  :root { --grain: none; --dots: none; }
}

@media (max-width: 430px) {
  .label { font-size: 0.7rem; letter-spacing: 0.1em; } /* keeps the long hero label on one line */
}

@media (max-width: 380px) {
  .label { letter-spacing: 0.06em; }
}

@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; }
  .hero__actions .btn { flex: 1 1 100%; }
}
