/* =============================================================
   Baseline Partners — Design System
   Single source of truth: tokens.json
   Dark-first. 8pt grid. Inter only. No improvisation.
   ============================================================= */

:root {
  /* Color — primary */
  --c-navy:           #0B1E39;
  --c-cream:          #F5EDDC;
  --c-electric:       #2E6CFF;

  /* Color — secondary */
  --c-powder:         #C3D5E8;
  --c-charcoal:       #1F1F22;
  --c-white:          #FFFFFF;

  /* Color — derived (cream alphas only — no new colors introduced) */
  --c-cream-64:       rgba(245, 237, 220, 0.64);
  --c-cream-40:       rgba(245, 237, 220, 0.40);
  --c-cream-12:       rgba(245, 237, 220, 0.12);
  --c-cream-06:       rgba(245, 237, 220, 0.06);

  /* Spacing — 8pt scale */
  --s-1:  8px;
  --s-2:  16px;
  --s-3:  24px;
  --s-4:  32px;
  --s-6:  48px;
  --s-8:  64px;
  --s-12: 96px;
  --s-16: 128px;

  /* Layout */
  --max-w:        1320px;
  --gutter:       var(--s-3);
  --section-pad:  var(--s-12);

  /* Radius */
  --r-sm: 2px;
  --r-md: 4px;

  /* Motion */
  --t-fast: 120ms;
  --t-base: 150ms;
  --t-slow: 200ms;
  --ease:   cubic-bezier(0.2, 0, 0, 1);

  /* Type */
  --ff-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ff-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* =============================================================
   Reset & base
   ============================================================= */

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-navy);
  color: var(--c-cream);
  font-family: var(--ff-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

img, svg { display: block; max-width: 100%; }

::selection { background: var(--c-electric); color: var(--c-cream); }

/* Focus — WCAG visible, electric blue per spec */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--c-electric);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* =============================================================
   Layout primitives
   ============================================================= */

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  padding-top: var(--section-pad);
  padding-bottom: var(--section-pad);
  border-top: 1px solid var(--c-cream-06);
}
.section:first-of-type { border-top: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  row-gap: var(--s-6);
}

/* =============================================================
   Typography
   ============================================================= */

.t-display {
  font-weight: 500;
  font-size: clamp(48px, 7vw, 80px);
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin: 0;
}

.t-h1 {
  font-weight: 500;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.018em;
  margin: 0;
}

.t-h2 {
  font-weight: 500;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0;
}

.t-h3 {
  font-weight: 500;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
}

.t-body  { font-weight: 300; font-size: 16px; line-height: 1.6; }
.t-body-sm { font-weight: 300; font-size: 14px; line-height: 1.55; letter-spacing: 0.01em; }

.t-label {
  font-weight: 500;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-cream-64);
}

.t-meta {
  font-family: var(--ff-mono);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--c-cream-64);
}

.t-muted { color: var(--c-cream-64); }
.t-charcoal { color: var(--c-charcoal); }

/* =============================================================
   Logo / B-mark
   ============================================================= */

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3); /* 24px dot gap per brand book */
  color: var(--c-cream);
  text-decoration: none;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.logo__bmark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--c-cream);
  color: var(--c-navy);
  font-weight: 700; /* bold reserved for B-mark only */
  font-size: 16px;
  border-radius: var(--r-sm);
}

.logo__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-electric);
  display: inline-block;
}

/* =============================================================
   Navigation
   ============================================================= */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 30, 57, 0.78);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--c-cream-06);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.nav__menu {
  display: flex;
  gap: var(--s-4);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__link {
  color: var(--c-cream);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: color var(--t-base) var(--ease);
}
.nav__link:hover { color: var(--c-electric); }
.nav__cta { margin-left: var(--s-3); }

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--c-cream-12);
  color: var(--c-cream);
  padding: var(--s-1) var(--s-2);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* =============================================================
   Buttons
   ============================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 12px 20px;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity var(--t-base) var(--ease),
              background-color var(--t-base) var(--ease),
              color var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease);
}

.btn--primary {
  background: var(--c-cream);
  color: var(--c-navy);
}
.btn--primary:hover { opacity: 0.88; }

.btn--ghost {
  background: transparent;
  color: var(--c-cream);
  border-color: var(--c-cream-12);
}
.btn--ghost:hover { border-color: var(--c-cream); }

.btn__arrow {
  display: inline-block;
  transition: transform var(--t-base) var(--ease);
}
.btn:hover .btn__arrow { transform: translateX(4px); } /* under 8px cap */

/* =============================================================
   Hero
   ============================================================= */

.hero {
  padding-top: var(--s-16);
  padding-bottom: var(--s-12);
}
.hero__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  align-items: end;
}
.hero__copy { grid-column: 1 / span 7; }
.hero__card { grid-column: 9 / span 4; }

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  margin-bottom: var(--s-4);
}
.hero__eyebrow .logo__dot { width: 8px; height: 8px; }

.hero__headline {
  margin-bottom: var(--s-4);
}
.hero__headline em {
  font-style: normal;
  color: var(--c-cream-40);
}

.hero__lede {
  max-width: 52ch;
  color: var(--c-cream-64);
  margin: 0 0 var(--s-6);
}

.hero__actions {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* Powder card — callout surface only */
.card-powder {
  background: var(--c-powder);
  color: var(--c-charcoal);
  padding: var(--s-4);
  border-radius: var(--r-sm);
}
.card-powder__label {
  color: var(--c-charcoal);
  opacity: 0.7;
  margin-bottom: var(--s-3);
}
.card-powder__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
}
.card-powder__item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--s-2);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid rgba(31, 31, 34, 0.10);
}
.card-powder__item:last-child { border-bottom: 0; padding-bottom: 0; }
.card-powder__item-key { font-weight: 500; font-size: 14px; color: var(--c-charcoal); }
.card-powder__item-val { font-family: var(--ff-mono); font-size: 12px; color: var(--c-charcoal); opacity: 0.8; }

/* =============================================================
   Services
   ============================================================= */

.services__head {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  margin-bottom: var(--s-8);
}
.services__head h2 { grid-column: 1 / span 7; }
.services__head p  { grid-column: 9 / span 4; color: var(--c-cream-64); margin: 0; }

.services__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--c-cream-12);
}
.service {
  padding: var(--s-4) var(--s-3) var(--s-6);
  border-bottom: 1px solid var(--c-cream-12);
  border-right: 1px solid var(--c-cream-12);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  min-height: 280px;
}
.service:nth-child(4n) { border-right: 0; }
.service__index { color: var(--c-cream-40); }
.service__title { margin: 0; }
.service__body  { color: var(--c-cream-64); margin: 0; }
.service__tags  {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
}
.tag {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid var(--c-cream-12);
  border-radius: var(--r-sm);
  color: var(--c-cream-64);
}

/* =============================================================
   Approach (numbered system)
   ============================================================= */

.approach__head {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  margin-bottom: var(--s-8);
}
.approach__head h2 { grid-column: 1 / span 7; }
.approach__head p  { grid-column: 9 / span 4; color: var(--c-cream-64); margin: 0; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.step {
  display: grid;
  grid-template-columns: 96px 1fr 1fr;
  gap: var(--s-4);
  align-items: start;
  padding: var(--s-4) 0;
  border-top: 1px solid var(--c-cream-12);
  transition: background-color var(--t-base) var(--ease);
}
.step:last-child { border-bottom: 1px solid var(--c-cream-12); }
.step:hover { background-color: var(--c-cream-06); }
.step__num   { font-family: var(--ff-mono); font-size: 12px; color: var(--c-cream-40); padding-top: 6px; }
.step__title { margin: 0; }
.step__body  { color: var(--c-cream-64); margin: 0; }

/* =============================================================
   Casework
   ============================================================= */

.case-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  row-gap: var(--s-6);
}
.case {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  text-decoration: none;
  color: inherit;
}
.case__frame {
  background: var(--c-cream-06);
  border: 1px solid var(--c-cream-12);
  border-radius: var(--r-sm);
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-base) var(--ease);
}
.case:hover .case__frame { border-color: var(--c-cream-40); }
.case__frame::before,
.case__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--c-cream-06) 1px, transparent 1px),
    linear-gradient(90deg, var(--c-cream-06) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
  pointer-events: none;
}
.case__tag {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
}
.case__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: var(--s-2);
}
.case__title { margin: 0; }
.case__year  { color: var(--c-cream-40); }
.case__body  { color: var(--c-cream-64); margin: 0; }

/* =============================================================
   Contact / CTA
   ============================================================= */

.contact__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  align-items: start;
}
.contact__copy { grid-column: 1 / span 5; }
.contact__form { grid-column: 7 / span 6; }

.contact__copy h2 { margin-bottom: var(--s-3); }
.contact__copy p  { color: var(--c-cream-64); max-width: 42ch; margin: 0 0 var(--s-4); }

.contact__details {
  display: grid;
  gap: var(--s-2);
  padding-top: var(--s-4);
  border-top: 1px solid var(--c-cream-12);
}
.contact__details dt { color: var(--c-cream-40); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.contact__details dd { margin: 0 0 var(--s-2); }
.contact__details a  { color: var(--c-cream); text-decoration: none; transition: color var(--t-base) var(--ease); }
.contact__details a:hover { color: var(--c-electric); }

.form {
  display: grid;
  gap: var(--s-3);
}
.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
.field { display: grid; gap: var(--s-1); }
.field__label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-cream-64);
}
.field__input,
.field__textarea,
.field__select {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--c-cream-12);
  padding: 12px 0;
  color: var(--c-cream);
  font: inherit;
  font-weight: 300;
  font-size: 16px;
  border-radius: 0;
  transition: border-color var(--t-base) var(--ease);
}
.field__input::placeholder,
.field__textarea::placeholder { color: var(--c-cream-40); }
.field__input:focus,
.field__textarea:focus,
.field__select:focus {
  outline: none;
  border-bottom-color: var(--c-electric);
}
.field__textarea { resize: vertical; min-height: 96px; }
.field__select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%23F5EDDC' stroke-width='1.2' fill='none' stroke-linecap='square'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: var(--s-3);
}
.field__select option { background: var(--c-navy); color: var(--c-cream); }

.form__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-2);
}
.form__hint { color: var(--c-cream-40); margin: 0; }

/* =============================================================
   Footer
   ============================================================= */

.footer {
  padding-top: var(--s-8);
  padding-bottom: var(--s-6);
  border-top: 1px solid var(--c-cream-12);
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  align-items: start;
}
.footer__brand   { grid-column: 1 / span 4; }
.footer__brand p { color: var(--c-cream-64); margin: var(--s-3) 0 0; max-width: 30ch; }
.footer__col     { grid-column: span 2; }
.footer__col h4 {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-cream-40);
  margin: 0 0 var(--s-2);
  font-weight: 500;
}
.footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.footer__col a {
  color: var(--c-cream);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--t-base) var(--ease);
}
.footer__col a:hover { color: var(--c-electric); }

.footer__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--s-8);
  padding-top: var(--s-3);
  border-top: 1px solid var(--c-cream-06);
}

/* =============================================================
   Utilities
   ============================================================= */

.divider { height: 1px; background: var(--c-cream-12); border: 0; margin: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Subtle entry — under 200ms, max 8px */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(8px); }
  .reveal--in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--t-slow) var(--ease),
                transform var(--t-slow) var(--ease);
  }
}

/* =============================================================
   Responsive — 12 / 8 / 4 column collapses
   ============================================================= */

@media (max-width: 1199px) {
  :root { --section-pad: var(--s-8); }
  .hero { padding-top: var(--s-12); }
  .hero__copy { grid-column: 1 / span 8; }
  .hero__card { grid-column: 1 / span 8; margin-top: var(--s-4); }

  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .service:nth-child(4n)   { border-right: 1px solid var(--c-cream-12); }
  .service:nth-child(2n)   { border-right: 0; }

  .services__head h2 { grid-column: 1 / span 8; }
  .services__head p  { grid-column: 1 / span 8; }
  .approach__head h2 { grid-column: 1 / span 8; }
  .approach__head p  { grid-column: 1 / span 8; }

  .case { grid-column: span 6; }

  .contact__copy { grid-column: 1 / span 8; }
  .contact__form { grid-column: 1 / span 8; margin-top: var(--s-6); }

  .footer__brand { grid-column: 1 / span 8; }
  .footer__col   { grid-column: span 4; }
}

@media (max-width: 720px) {
  :root { --section-pad: var(--s-6); --gutter: 16px; }

  .nav__menu, .nav__cta { display: none; }
  .nav__toggle { display: inline-flex; }

  .hero { padding-top: var(--s-8); padding-bottom: var(--s-8); }
  .hero__copy, .hero__card { grid-column: 1 / span 4; }

  .step { grid-template-columns: 48px 1fr; }
  .step__body { grid-column: 2; }

  .services__grid { grid-template-columns: 1fr; }
  .service { border-right: 0 !important; min-height: 0; }
  .service:last-child { border-bottom: 0; }

  .case { grid-column: 1 / span 4; }

  .form__row { grid-template-columns: 1fr; }
  .form__actions { flex-direction: column; align-items: stretch; }
  .form__actions .btn { justify-content: center; }

  .footer__grid { grid-template-columns: repeat(4, 1fr); }
  .footer__brand { grid-column: 1 / span 4; }
  .footer__col   { grid-column: 1 / span 4; }
  .footer__bar { flex-direction: column; gap: var(--s-2); align-items: flex-start; }
}
