/* =========================================================================
   Drizzlejar: design system
   A design and technology studio. Dark, monochrome, typographic.

   House rules (binding):
     · no gradients, anywhere (the hero scrim is a flat rgba)
     · no uppercase: never set text-transform
     · headlines are Figtree Medium (500), never heavier
     · buttons are 4px radius, no arrow icons
     · mobile-first, 375px → 1440px+

   The palette is monochrome by decision: the old #005FF5 blue is retired.
   Text-over-video legibility on the hero is carried by a flat dark scrim plus a
   soft text-shadow, verified numerically against the real bg.mp4 frame (99% of
   the text region ≥18:1, worst pixel 6.1:1). If a brighter clip is ever swapped
   in, re-measure and raise --scrim.
   ========================================================================= */

:root {
  /* Surfaces */
  --bg: #06070A;          /* page base: the splash near-black */
  --surface: #0E1015;     /* raised panels, cards */
  --surface-2: #15181F;   /* hover / nested */

  /* Ink */
  --paper: #FFFFFF;       /* headlines, primary text */
  --paper-soft: #D4D4D8;  /* body copy */
  --muted: #9AA1AC;       /* secondary / meta */
  --ink: #0B0B0C;         /* text on light buttons */

  /* Lines.
     --border is the ONLY grey allowed on an interactive boundary (ghost button,
     input, pagination link): it is the shallowest neutral clearing WCAG 1.4.11's
     3:1 against all three surfaces: 3.45 on --bg, 3.26 on --surface, 3.04 on
     --surface-2. --hair is decorative (section rules, card edges, header/footer
     lines) and is exempt at 1.3–1.5:1. Never promote --hair to a control border. */
  --border: #61656E;      /* interactive boundaries: verified 3:1 */
  --hair: #1B1F26;        /* decorative rules only: never a control border */

  --scrim: rgba(6, 7, 10, 0.55);

  /* Type */
  --font-sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.92rem);
  --step-0:  clamp(1.00rem, 0.96rem + 0.20vw, 1.13rem);
  --step-1:  clamp(1.20rem, 1.12rem + 0.40vw, 1.45rem);
  --step-2:  clamp(1.45rem, 1.30rem + 0.75vw, 2.00rem);
  --step-3:  clamp(1.80rem, 1.50rem + 1.50vw, 2.75rem);
  --step-4:  clamp(2.20rem, 1.65rem + 2.75vw, 4.00rem);

  /* Space */
  --gap: clamp(1rem, 0.8rem + 1vw, 1.5rem);
  --section-y: clamp(4rem, 3rem + 6vw, 8rem);
  --wrap: 1200px;
  --wrap-narrow: 760px;

  --radius: 4px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --header-h: 72px;
}

/* ---------- Reset ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  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;
  background: var(--bg);
  color: var(--paper-soft);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  color: var(--paper);
  font-weight: 500;          /* Figtree Medium: never heavier */
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--paper);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.2s var(--ease);
}

a:hover { color: var(--paper-soft); }

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

.lede {
  font-size: var(--step-1);
  color: var(--paper-soft);
  max-width: 62ch;
}

.eyebrow {
  display: block;
  font-size: var(--step--1);
  color: var(--muted);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

/* ---------- Layout ---------- */

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.wrap--narrow { max-width: var(--wrap-narrow); }

.section { padding-block: var(--section-y); }

.section__head {
  max-width: 62ch;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem);
}

.grid {
  display: grid;
  gap: var(--gap);
}

@media (min-width: 700px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.rule {
  border: 0;
  border-top: 1px solid var(--hair);
  margin: 0;
}

/* ---------- Accessibility helpers ---------- */

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 0.75rem 1rem;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);   /* 4px */
  font-size: var(--step-0);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn--primary {
  background: var(--paper);
  color: var(--ink);
}

.btn--primary:hover {
  background: var(--paper-soft);
  color: var(--ink);
}

.btn--ghost {
  background: transparent;
  color: var(--paper);
  border-color: var(--border);
}

.btn--ghost:hover {
  background: var(--surface-2);
  color: var(--paper);
  border-color: var(--paper-soft);
}

.btn--sm {
  padding: 0.6rem 1.05rem;
  font-size: var(--step--1);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--paper);
  flex-shrink: 0;
}

.brand__logo { height: 22px; width: auto; }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Nav: shared */

.nav__list,
.nav__submenu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  display: block;
  padding: 0.5rem 0;
  color: var(--paper-soft);
  font-size: var(--step--1);
  text-decoration: none;
}

.nav__link:hover,
.nav__item.is-current > .nav__link { color: var(--paper); }

/* Nav: desktop */

@media (min-width: 981px) {
  .nav__list {
    display: flex;
    align-items: center;
    gap: 1.75rem;
  }

  .nav__item { position: relative; }

  .nav__item--parent > .nav__link { padding-right: 0.9rem; }

  .nav__toggle {
    position: absolute;
    right: 0;
    top: 50%;
    width: 0.42rem;
    height: 0.42rem;
    transform: translateY(-70%) rotate(45deg);
    background: none;
    border: 0 solid var(--muted);
    border-right-width: 1px;
    border-bottom-width: 1px;
    padding: 0;
    cursor: pointer;
    pointer-events: none;   /* hover / focus-within opens the submenu here */
  }

  .nav__submenu {
    position: absolute;
    top: 100%;
    left: -1rem;
    min-width: 260px;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--hair);
    border-radius: var(--radius);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
  }

  .nav__item--parent:hover > .nav__submenu,
  .nav__item--parent:focus-within > .nav__submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav__submenu .nav__link {
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius);
  }

  .nav__submenu .nav__link:hover { background: var(--surface-2); }

  .nav-burger { display: none; }
}

/* Nav: mobile drawer */

@media (max-width: 980px) {
  /* The drawer is positioned ABSOLUTE against .site-header, not fixed against
     the viewport, and this is deliberate: .site-header sets backdrop-filter,
     which makes it a containing block for fixed-position descendants. A
     position:fixed drawer therefore resolves its insets against the 72px-tall
     header and collapses to a 72px sliver with every item below the first one
     clipped out of view. Anchoring to the header with top:100% and an explicit
     viewport-height sidesteps that entirely. */
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    padding: 1.5rem 1.25rem 3rem;
    background: var(--bg);
    overflow-y: auto;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.28s var(--ease), visibility 0.28s;
  }

  .nav.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  .nav__item { border-bottom: 1px solid var(--hair); }

  .nav__item--parent {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .nav__link {
    padding: 0.9rem 0;
    font-size: var(--step-1);
  }

  .nav__toggle {
    width: 44px;
    height: 44px;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    position: relative;
  }

  .nav__toggle::before,
  .nav__toggle::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 11px;
    height: 1px;
    background: var(--muted);
    transform: translate(-50%, -50%);
  }

  .nav__toggle::after {
    transform: translate(-50%, -50%) rotate(90deg);
    transition: opacity 0.2s var(--ease);
  }

  .nav__toggle[aria-expanded="true"]::after { opacity: 0; }

  .nav__submenu {
    grid-column: 1 / -1;
    display: none;
    padding: 0 0 0.5rem 0.9rem;
  }

  .nav__item--parent.is-open > .nav__submenu { display: block; }

  .nav__submenu .nav__item { border-bottom: 0; }
  .nav__submenu .nav__link { font-size: var(--step-0); padding: 0.6rem 0; }

  .nav-burger {
    width: 44px;
    height: 44px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
  }

  .nav-burger__bar {
    width: 20px;
    height: 1px;
    background: var(--paper);
    transition: transform 0.24s var(--ease), opacity 0.24s var(--ease);
  }

  .nav-burger[aria-expanded="true"] .nav-burger__bar:first-child {
    transform: translateY(3px) rotate(45deg);
  }

  .nav-burger[aria-expanded="true"] .nav-burger__bar:last-child {
    transform: translateY(-3px) rotate(-45deg);
  }

  body.nav-open { overflow: hidden; }
}

@media (max-width: 560px) {
  .site-header__actions .btn { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: min(78vh, 760px);
  padding-block: var(--section-y);
  overflow: hidden;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);   /* flat rgba, never a gradient */
  z-index: 1;
}

.hero__inner {
  position: relative;
  z-index: 2;
}

.hero__title {
  max-width: 18ch;
  text-shadow: 0 1px 24px rgba(6, 7, 10, 0.5);
}

.hero__lede {
  max-width: 54ch;
  color: var(--paper-soft);
  text-shadow: 0 1px 18px rgba(6, 7, 10, 0.5);
}

/* Interior pages: same shape, no video. */
.hero--plain {
  min-height: 0;
  padding-block: clamp(3rem, 2rem + 5vw, 6rem);
  border-bottom: 1px solid var(--hair);
}

/* ---------- Closing CTA ---------- */

.cta { padding-block: 0 var(--section-y); }

.cta__inner {
  max-width: 62ch;
  padding-top: var(--section-y);
}

/* ---------- Cards ---------- */

.card {
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.card:hover {
  border-color: var(--border);
  background: var(--surface-2);
}

.card__title {
  font-size: var(--step-1);
  margin-bottom: 0.4em;
}

.card__title a { text-decoration: none; }

.card__text {
  color: var(--paper-soft);
  font-size: var(--step-0);
}

.card__meta {
  margin-top: auto;
  padding-top: 1rem;
  color: var(--muted);
  font-size: var(--step--1);
}

.card__media {
  margin: calc(-1 * clamp(1.25rem, 1rem + 1vw, 1.75rem));
  margin-bottom: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Numbered process steps */

.step__num {
  display: block;
  font-size: var(--step--1);
  color: var(--muted);
  margin-bottom: 0.75rem;
}

/* ---------- Case study ---------- */

.case-hero { margin-top: var(--gap); }

.case-hero__img {
  width: 100%;
  border-radius: var(--radius);
}

.factsheet {
  display: grid;
  gap: var(--gap);
  margin: 0 0 clamp(2rem, 1.5rem + 2vw, 3.5rem);
  padding-bottom: clamp(2rem, 1.5rem + 2vw, 3rem);
  border-bottom: 1px solid var(--hair);
}

@media (min-width: 700px) {
  .factsheet { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.factsheet dt {
  color: var(--muted);
  font-size: var(--step--1);
  margin-bottom: 0.3rem;
}

.factsheet dd {
  margin: 0;
  color: var(--paper);
  font-size: var(--step-1);
}

/* ---------- Article / prose ---------- */

.prose { max-width: 68ch; }

.prose > * + * { margin-top: 1.15em; }

.prose h2 { font-size: var(--step-2); margin-top: 1.8em; }
.prose h3 { font-size: var(--step-1); margin-top: 1.5em; }

.prose ul,
.prose ol { padding-left: 1.25rem; }

.prose li + li { margin-top: 0.4em; }

.prose img { border-radius: var(--radius); }

.prose blockquote {
  margin: 1.5em 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--border);
  color: var(--paper);
}

.prose code {
  background: var(--surface-2);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

.entry__meta {
  color: var(--muted);
  font-size: var(--step--1);
  margin-bottom: 1.5rem;
}

/* ---------- Pagination ---------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 3rem;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.6rem;
  border: 1px solid var(--border);   /* interactive control: not --hair */
  border-radius: var(--radius);
  color: var(--paper-soft);
  text-decoration: none;
}

.pagination .page-numbers:hover { border-color: var(--paper-soft); color: var(--paper); }

.pagination .page-numbers.current {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

/* ---------- Forms ---------- */

.field { margin-bottom: 1.1rem; }

.field__label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: var(--step--1);
  color: var(--paper-soft);
}

.field__input,
.field__textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--paper);
  font-family: inherit;
  font-size: var(--step-0);
}

.field__input:focus,
.field__textarea:focus {
  outline: 2px solid var(--paper);
  outline-offset: 1px;
  border-color: var(--paper);
}

.field__textarea { min-height: 150px; resize: vertical; }

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

/* Contact page: form beside the direct-contact details. */
.contact {
  display: grid;
  gap: clamp(2rem, 1.5rem + 3vw, 4rem);
}

@media (min-width: 900px) {
  .contact { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}

.contact__note { margin-top: 2rem; }

/* Honeypot: off-screen, never focusable (tabindex="-1" in markup). */
.field--hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.form { max-width: 44rem; }

.form__note {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  color: var(--paper);
}

.form__note--error { border-color: #8C3A3A; }

/* ---------- Footer ---------- */

.site-footer {
  padding-block: clamp(3rem, 2.5rem + 3vw, 5rem) 2rem;
  border-top: 1px solid var(--hair);
}

.site-footer__grid {
  display: grid;
  gap: clamp(2rem, 1.5rem + 2vw, 3rem);
}

@media (min-width: 700px) {
  .site-footer__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .site-footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

.site-footer__logo {
  height: 22px;
  width: auto;
  color: var(--paper);
  margin-bottom: 1rem;
}

.site-footer__blurb {
  color: var(--muted);
  font-size: var(--step--1);
  max-width: 42ch;
}

.site-footer__heading {
  font-size: var(--step--1);
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 0.9rem;
}

.site-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.site-footer__list a {
  color: var(--paper-soft);
  font-size: var(--step--1);
  text-decoration: none;
}

.site-footer__list a:hover { color: var(--paper); }

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--hair);
  color: var(--muted);
  font-size: var(--step--1);
}

.site-footer__legal p { margin: 0; }

.site-footer__legal a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer__legal a:hover { color: var(--paper); }
