/* =========================================================================
   Dereva — one-page site
   Plain CSS, no build step. Edit tokens below; everything cascades.
   ========================================================================= */

:root {
  /* Brand palette (locked) */
  --color-signal-red: #D5352B;   /* accent only — never a large fill */
  --color-near-black: #0E0E0E;   /* primary dark background */
  --color-white: #FFFFFF;
  --color-text-secondary: #5F5E5A;
  --color-border: #D3D1C7;

  /* Derived, kept minimal: a warm off-white for subtle fills/hover */
  --color-surface: #F6F5F1;

  /* On-dark neutrals */
  --on-dark-primary: rgba(255, 255, 255, 0.92);
  --on-dark-secondary: rgba(255, 255, 255, 0.60);
  --on-dark-hairline: rgba(255, 255, 255, 0.12);

  /* Type */
  --font-headline: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-accent: 'Bodoni Moda', Georgia, 'Times New Roman', serif;

  /* Rhythm */
  --container-max: 68rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --section-pad: clamp(4rem, 11vw, 8.5rem);
  --header-h: 64px;
}

/* ----------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-near-black);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--color-signal-red);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--color-white);
  color: var(--color-near-black);
  font-weight: 500;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

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

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  /* At the very top it matches the hero — no seam, no blur. */
  background: var(--color-near-black);
  border-bottom: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.site-header.is-scrolled {
  background: rgba(14, 14, 14, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom-color: var(--on-dark-hairline);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
}
.wordmark { display: inline-flex; align-items: center; flex: none; }
.wordmark__img { width: auto; height: 30px; }

/* text wordmark — fallback when a PNG is missing (see script.js) */
.wordmark-text {
  font-family: var(--font-headline);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--color-white);
  display: inline-block;
}
.wordmark-text__dot { color: var(--color-signal-red); }

/* nav */
.site-nav { display: flex; align-items: center; }
.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
}
.nav-menu a {
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--on-dark-secondary);
  transition: color 0.15s ease;
}
.nav-menu a:hover { color: var(--on-dark-primary); }
.nav-menu__cta a { color: var(--color-white); }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nav-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: var(--color-white);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }

/* ---------------------------------------------------------------- button */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  padding: 0.95rem 1.5rem;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: transform 0.12s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn--primary {
  background: var(--color-signal-red);
  color: var(--color-white);
}
.btn--primary:hover { background: #b92c23; transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0); }
.btn--sm { padding: 0.6rem 1rem; font-size: 0.9375rem; }
.btn--lg { padding: 1.1rem 2rem; font-size: 1.0625rem; }

/* ghost — secondary CTA on light backgrounds */
.btn--ghost {
  background: transparent;
  border-color: var(--color-near-black);
  color: var(--color-near-black);
}
.btn--ghost:hover { background: var(--color-near-black); color: var(--color-white); transform: translateY(-1px); }

/* --------------------------------------------------------------- section */
.section { padding-block: var(--section-pad); }
.section > .container > * + * { margin-top: 1.5rem; }

.section--dark {
  background: var(--color-near-black);
  color: var(--on-dark-primary);
}
.section--light {
  background: var(--color-white);
  color: var(--color-near-black);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

/* section eyebrow — Bodoni 800 all-caps, cinematic emphasis */
.eyebrow {
  font-family: var(--font-accent);
  font-weight: 800;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}
.section--dark .eyebrow { color: var(--on-dark-secondary); }

/* accent word — signal red, same font as its context, no italics.
   red on near-black clears AA only at large sizes, which is where this is used. */
.accent-word { color: var(--color-signal-red); white-space: nowrap; }

/* --------------------------------------------------------------- hero */
.hero { padding-top: clamp(4.5rem, 12vw, 9rem); text-align: center; }
.hero__headline {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(2.05rem, 5.4vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: min(30ch, 100%);
  margin-inline: auto;
}
.hero__line { display: block; text-wrap: balance; }
.hero__subhead {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  line-height: 1.55;
  color: var(--on-dark-secondary);
  max-width: 52ch;
  margin-inline: auto;
}
.hero__cta { margin-top: 2.25rem; }

/* --------------------------------------------------------------- logo reel */
.logos {
  background: var(--color-surface);
  border-block: 1px solid var(--color-border);
  padding-block: clamp(2.75rem, 6vw, 4.5rem);
  overflow: hidden;
}
.logos .container { max-width: 76rem; }
.logos__label {
  text-align: center;
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}
.logos__reel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(1.75rem, 3.4vw, 2.8rem) clamp(1.75rem, 3.4vw, 2.8rem);
  --logo-h: clamp(20px, 2.5vw, 28px);
}
.logos__item { display: inline-flex; }
.logos__item img {
  height: calc(var(--logo-h) * var(--s, 1));
  width: auto;
  max-width: 160px;
  object-fit: contain;
  opacity: 0.72;
}
/* assemble-on-scroll: items are hidden only once JS arms the section, then
   fade + rise + un-blur in a staggered wave when it scrolls into view (once). */
.logos.js-reveal .logos__item {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
  transition:
    opacity 0.85s ease,
    transform 0.85s cubic-bezier(0.16, 0.8, 0.3, 1),
    filter 0.85s ease;
  transition-delay: calc(var(--i, 0) * 90ms);
  will-change: opacity, transform, filter;
}
.logos.js-reveal.is-revealed .logos__item {
  opacity: 1;
  transform: none;
  filter: none;
}
@media (prefers-reduced-motion: reduce) {
  .logos.js-reveal .logos__item {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
    transition-delay: 0s;
  }
}

/* --------------------------------------------------------------- manifesto */
.manifesto {
  max-width: min(44rem, 100%);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(1.1rem, 2.3vw, 1.45rem);
  line-height: 1.5;
}
.manifesto li + li { margin-top: clamp(1.1rem, 2.6vw, 1.65rem); }

/* --------------------------------------------------------------- proof */
.stat-grid {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  grid-template-columns: 1fr;
}
@media (min-width: 40rem) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat {
  padding-top: 1.5rem;
  border-top: 1px solid var(--on-dark-hairline);
}
.stat__number {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--color-signal-red);
}
.stat__label {
  margin-top: 0.75rem;
  font-size: 0.975rem;
  line-height: 1.55;
  color: var(--on-dark-secondary);
  max-width: 34ch;
}

/* case studies — anonymized, one metric per line */
.proof .proof__sublabel { margin-top: clamp(3rem, 7vw, 4.5rem); }
.proof .case-grid {
  display: grid;
  gap: clamp(1.25rem, 3vw, 1.75rem);
  grid-template-columns: 1fr;
}
@media (min-width: 44rem) {
  .proof .case-grid { grid-template-columns: repeat(2, 1fr); }
}
.case {
  border: 1px solid var(--on-dark-hairline);
  border-radius: 8px;
  padding: clamp(1.25rem, 3vw, 1.75rem);
}
.case__label {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  color: var(--on-dark-secondary);
}
.case__metrics {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.case__metrics li {
  font-size: 1rem;
  line-height: 1.4;
  color: var(--on-dark-primary);
  padding-left: 1rem;
  position: relative;
}
.case__metrics li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-signal-red);
}

/* --------------------------------------------------------------- method */
.method__person {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.method__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--color-border);
}
.method__name {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.2;
}
.method__role {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}
/* five stages */
.stages {
  list-style: none;
  padding: 0;
  max-width: min(46rem, 100%);
}
.stage {
  padding-top: clamp(1.25rem, 3vw, 1.75rem);
  margin-top: clamp(1.25rem, 3vw, 1.75rem);
  border-top: 1px solid var(--color-border);
}
.stage:first-child { margin-top: 0.5rem; }
.stage__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
}
.stage__name {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  letter-spacing: -0.01em;
}
.stage__when {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-signal-red);
}
.stage__body {
  margin-top: 0.6rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  max-width: 54ch;
}

/* --------------------------------------------------------------- affect */
.affect__body {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  line-height: 1.55;
  color: var(--on-dark-primary);
  max-width: 48ch;
}
.affect__body strong { font-weight: 500; color: var(--color-white); }
.inline-link {
  color: var(--color-signal-red);
  text-underline-offset: 3px;
}
.inline-link:hover { text-decoration-thickness: 2px; }

/* --------------------------------------------------------------- pricing */
.price-grid {
  display: grid;
  gap: clamp(1.25rem, 3vw, 1.75rem);
  grid-template-columns: 1fr;
}
@media (min-width: 58rem) {
  .price-grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
}
.price-card {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: clamp(1.5rem, 3.5vw, 2rem);
}
.price-card__name {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.price-card__price {
  margin-top: 0.35rem;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.5vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--color-signal-red);
}
.price-card__price--text {
  font-size: 1.1rem;
  white-space: nowrap;
}
.price-card__unit {
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-text-secondary);
}
.price-card__body {
  margin-top: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
}
.price-card__who {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
}
.price-card .btn {
  margin-top: 1.5rem;
  align-self: flex-start;
}
@media (min-width: 58rem) {
  /* equal-height cards → pin CTAs to the bottom edge */
  .price-card .btn { margin-top: auto; }
  .price-card__who { margin-bottom: 1.5rem; }
}

/* --------------------------------------------------------------- contact */
.contact { text-align: center; }
.contact__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}
.contact__wordmark { width: auto; height: 36px; }
.contact__line {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.6vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: min(26ch, 100%);
}

/* --------------------------------------------------------------- footer */
.site-footer {
  background: var(--color-near-black);
  color: var(--on-dark-secondary);
  padding-block: 2.5rem;
  border-top: 1px solid var(--on-dark-hairline);
}
.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-footer__wordmark { width: auto; height: 16px; opacity: 0.9; }
.site-footer__meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.875rem;
}
.site-footer__social {
  display: inline-flex;
  color: var(--on-dark-secondary);
  transition: color 0.15s ease;
}
.site-footer__social:hover { color: var(--color-white); }

/* --------------------------------------------------------- mobile nav */
@media (max-width: 44rem) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--color-near-black);
    border-bottom: 1px solid var(--on-dark-hairline);
    padding: 0.5rem var(--gutter) 1.25rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }
  .nav-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-menu li { padding: 0.5rem 0; }
  .nav-menu li + li { border-top: 1px solid var(--on-dark-hairline); }
  .nav-menu a { display: block; font-size: 1rem; }
  .nav-menu__cta { padding-top: 1rem; }
  .nav-menu__cta a { text-align: center; }
  .site-header__inner { position: relative; }
}

/* ------------------------------------------------------------- print */
@media print {
  .site-header, .nav-toggle, .site-footer__social { display: none; }
  .section--dark { background: #fff; color: #000; }
}
