/* The Principle / Brand stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;1,400;1,500;1,600&display=swap');

:root {
  --black: #000000;
  --lime: #d3e805;
  --horizon: #013d1a;
  --sage: #cedcbf;
  --cream: #f7f3dc;
  --ink: #0b0b0b;
  --muted-dark: #6f6b58;
  --line-dark: rgba(247, 243, 220, 0.12);
  --line-light: rgba(0, 0, 0, 0.12);

  --container: 1240px;
  --gutter: clamp(24px, 4.5vw, 56px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
  font-size: 17px;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }

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

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

/* ======== TYPOGRAPHY ======== */

.serif { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.sans  { font-family: 'Outfit', sans-serif; }

.eyebrow {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  color: currentColor;
  opacity: 0.7;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.04; }

.h-display {
  font-size: clamp(44px, 6.4vw, 92px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.98;
}
.h-display .serif {
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
}

.h-section {
  font-size: clamp(34px, 4.6vw, 60px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
.h-section .serif { font-weight: 400; }

.h-card {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.18;
}

.lead {
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.5;
  color: rgba(0,0,0,0.65);
  max-width: 56ch;
  color: rgba(11,11,11,0.72);
}

.text-cream { color: var(--cream); }
.text-cream .lead,
.bg-black .lead,
.bg-horizon .lead { color: rgba(247, 243, 220, 0.74); }

.lime-dot {
  display: inline-block;
  width: 0.32em;
  height: 0.32em;
  background: var(--lime);
  border-radius: 999px;
  vertical-align: 0.06em;
  margin-left: 0.04em;
  transform: translateY(-0.05em);
}
/* Accessibility: brand lime fails contrast on cream/sage. Swap to horizon on light surfaces. */
.bg-cream .lime-dot,
.bg-sage  .lime-dot,
.page-intro .lime-dot,
body > .lime-dot { background: var(--horizon); }

/* ======== BUTTONS ======== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-lime { background: var(--lime); color: var(--black); }
.btn-lime:hover { background: #e2f33b; }

.btn-ghost-light {
  background: transparent;
  color: var(--cream);
  border-color: rgba(247, 243, 220, 0.25);
}
.btn-ghost-light:hover { border-color: var(--lime); color: var(--lime); }

.btn-ghost-dark {
  background: transparent;
  color: var(--black);
  border-color: rgba(0, 0, 0, 0.18);
}
.btn-ghost-dark:hover { border-color: var(--horizon); color: var(--horizon); }

.btn-solid-dark { background: var(--black); color: var(--cream); }
.btn-solid-dark:hover { background: var(--horizon); }

.btn .arrow { font-family: 'Outfit', sans-serif; font-weight: 400; transition: transform 0.18s ease; }
.btn:hover .arrow { transform: translateX(4px); }

/* ======== NAV ======== */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in oklab, var(--cream) 78%, transparent);
  border-bottom: 1px solid var(--line-light);
}
.nav.on-dark {
  background: #000;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: rgba(247, 243, 220, 0.08);
  color: var(--cream);
  box-shadow: 0 8px 24px -16px rgba(0,0,0,0.9);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.brand .b-the { font-family: 'Playfair Display', serif; font-style: italic; font-weight: 400; margin-right: 4px; }
.brand .b-principle { font-family: 'Outfit', sans-serif; font-weight: 700; }
.brand .b-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--lime);
  margin-left: 3px;
  transform: translateY(-1px);
}
/* Brand mark dot: switch to horizon on light surfaces for AA contrast */
.nav:not(.on-dark) .brand .b-dot,
.page-intro .brand .b-dot,
.bg-cream .brand .b-dot,
.bg-sage .brand .b-dot,
.lp > header .brand .b-dot { background: var(--horizon); }

.nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 14px;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  letter-spacing: -0.005em;
  opacity: 0.8;
  transition: opacity 0.18s ease, background 0.18s ease;
}
.nav-links a:hover { opacity: 1; background: rgba(0,0,0,0.04); }
.on-dark .nav-links a:hover { background: rgba(247, 243, 220, 0.06); }
/* CTAs in nav: don't let the generic hover rule wash them out */
.nav-links a.btn-solid-dark { background: var(--black); color: var(--cream); }
.nav-links a.btn-solid-dark:hover { background: var(--horizon); color: var(--cream); }
.nav-links a.btn-lime { background: var(--lime); color: var(--black); }
.nav-links a.btn-lime:hover { background: #e2f33b; color: var(--black); }
.nav-links a.active { opacity: 1; }
.nav-links a.active::after {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 999px;
  background: var(--horizon);
  margin-left: 8px;
  transform: translateY(-2px);
}
.nav.on-dark .nav-links a.active::after { background: var(--lime); }

.nav-cta { margin-left: 8px; }

/* ======== SECTION SHELLS ======== */

.section { padding: clamp(72px, 10vw, 140px) 0; }
.section-tight { padding: clamp(56px, 7vw, 96px) 0; }

.bg-cream { background: var(--cream); color: var(--ink); }
.bg-black { background: var(--black); color: var(--cream); }
.bg-horizon { background: var(--horizon); color: var(--cream); }
.bg-sage { background: var(--sage); color: var(--ink); }

.divider-thin { height: 1px; background: var(--line-light); }
.bg-black .divider-thin, .bg-horizon .divider-thin { background: var(--line-dark); }

/* ======== CARDS ======== */

/* Light card with left accent line */
.card-light {
  position: relative;
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--line-light);
  padding: 32px 28px 30px 32px;
  border-radius: 4px;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.card-light::before {
  content: "";
  position: absolute;
  left: 0; top: 24px; bottom: 24px;
  width: 2px;
  background: var(--horizon);
  transition: background 0.25s ease;
}
.card-light:hover { transform: translateY(-3px); border-color: rgba(0,0,0,0.22); }
.card-light:hover::before { background: var(--horizon); width: 3px; }

.card-light .num {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: rgba(0,0,0,0.45);
  margin-bottom: 22px;
}
.card-light h3 { margin-bottom: 12px; }
.card-light p {
  margin: 0;
  color: rgba(0,0,0,0.66);
  font-size: 15.5px;
  line-height: 1.55;
}

/* Dark card with lime tint border */
.card-dark {
  background: rgba(247, 243, 220, 0.025);
  border: 1px solid rgba(211, 232, 5, 0.18);
  padding: 32px 28px 30px;
  border-radius: 4px;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}
.card-dark:hover {
  border-color: rgba(211, 232, 5, 0.55);
  background: rgba(247, 243, 220, 0.04);
  transform: translateY(-3px);
}
.card-dark .num {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--lime);
  margin-bottom: 22px;
}
.card-dark h3 { color: var(--cream); margin-bottom: 12px; }
.card-dark p {
  margin: 0;
  color: rgba(247, 243, 220, 0.66);
  font-size: 15.5px;
  line-height: 1.55;
}

/* ======== GRID HELPERS ======== */

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 980px) {
  .grid-3, .grid-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-5 { grid-template-columns: 1fr; }
}

/* ======== FOOTER ======== */

.footer { background: var(--black); color: var(--cream); padding: 80px 0 36px; }
.footer .top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 56px;
  padding-bottom: 60px;
  border-bottom: 1px solid var(--line-dark);
}
@media (max-width: 880px) {
  .footer .top { grid-template-columns: 1fr 1fr; gap: 40px; }
}
.footer h4 {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  color: rgba(247, 243, 220, 0.55);
  margin-bottom: 18px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 15px; }
.footer ul a { opacity: 0.8; }
.footer ul a:hover { opacity: 1; color: var(--lime); }
.footer .credit-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 26px;
  font-size: 13px;
  color: rgba(247, 243, 220, 0.5);
}
.footer .credit-line .lime { color: var(--lime); }

/* ======== HERO ======== */

.hero {
  background: var(--black);
  color: var(--cream);
  padding: clamp(96px, 13vw, 176px) 0 clamp(96px, 13vw, 168px);
  position: relative;
  overflow: hidden;
}
.hero .grain {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1100px 360px at 82% 30%, rgba(211,232,5,0.045), transparent 60%),
    radial-gradient(900px 460px at -5% 115%, rgba(1,61,26,0.38), transparent 62%);
  pointer-events: none;
}
.hero-inner { position: relative; }
.hero .meta-line {
  display: flex;
  gap: 28px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(247, 243, 220, 0.55);
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.hero .meta-line span { display: inline-flex; align-items: center; gap: 8px; }
.hero .meta-line .pill { width: 6px; height: 6px; border-radius: 999px; background: var(--lime); }
.bg-cream .slash-list li::before, .bg-sage .slash-list li::before { color: var(--horizon); }
.bg-black .slash-list li::before, .bg-horizon .slash-list li::before { color: var(--lime); }

.hero h1 {
  max-width: 17ch;
  margin-bottom: 28px;
}
.hero .lead-dark {
  font-size: clamp(17px, 1.35vw, 19px);
  color: rgba(247, 243, 220, 0.74);
  max-width: 64ch;
  line-height: 1.55;
  margin-bottom: 40px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.work-graphic {
  aspect-ratio: 16/10;
  border: none;
  border-bottom: 1px solid var(--line-light);
  border-radius: 0;
  width: 100%;
  overflow: hidden;
  background: var(--cream);
}
.work-graphic svg { display: block; width: 100%; height: 100%; }

/* Text-only client engagement card (homepage + our-work) */
.case-card {
  background: #fff;
  border: 1px solid var(--line-light);
  padding: 40px 40px 36px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.case-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 3px; height: 64px;
  background: var(--lime);
}
.case-card__kicker {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(0,0,0,0.5);
  text-transform: uppercase;
  margin-bottom: 24px;
}
.case-card__title {
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
  color: var(--ink);
  max-width: 22ch;
}
.case-card__body {
  color: rgba(0,0,0,0.68);
  font-size: 16px;
  line-height: 1.55;
  margin: 0 0 28px;
  flex: 1;
}
.case-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 22px 0;
  border-top: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
  margin-bottom: 24px;
}
.case-card__metric-num {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 6px;
}
.case-card__metric-label {
  font-size: 12px;
  color: rgba(0,0,0,0.5);
  letter-spacing: 0.04em;
}
.case-card__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Hero carousel */
.hero-carousel {
  position: relative;
  margin-bottom: 28px;
  min-height: 1.04em;
}
.hero-slide {
  max-width: 17ch;
  margin: 0;
  position: absolute;
  top: 0; left: 0;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  pointer-events: none;
}
.hero-slide.is-active {
  position: relative;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.hero-lead { margin-bottom: 40px; }
.hero-dots {
  display: flex;
  gap: 10px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid rgba(247, 243, 220, 0.1);
}
.hero-dot {
  width: 28px;
  height: 3px;
  border-radius: 2px;
  border: none;
  background: rgba(247, 243, 220, 0.18);
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease, width 0.3s ease;
}
.hero-dot:hover { background: rgba(247, 243, 220, 0.4); }
.hero-dot.is-active { background: var(--lime); width: 44px; }

/* ======== UTILITY ======== */

.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: end;
  margin-bottom: 56px;
}
.section-head .right { padding-top: 8px; }
@media (max-width: 820px) {
  .section-head { grid-template-columns: 1fr; gap: 16px; }
}

.kicker-row {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-light);
  margin-bottom: 22px;
  font-size: 13px;
  color: rgba(0,0,0,0.55);
}
.bg-black .kicker-row, .bg-horizon .kicker-row { border-bottom-color: var(--line-dark); color: rgba(247,243,220,0.55); }

/* Ghost placeholder image */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      rgba(0,0,0,0.04) 0 1px,
      transparent 1px 9px),
    rgba(0,0,0,0.03);
  border: 1px solid var(--line-light);
  border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
}
.bg-black .ph, .bg-horizon .ph {
  background:
    repeating-linear-gradient(135deg,
      rgba(247, 243, 220, 0.05) 0 1px,
      transparent 1px 9px),
    rgba(247, 243, 220, 0.02);
  border-color: var(--line-dark);
  color: rgba(247, 243, 220, 0.45);
}

/* page-intro: slim header used on inner pages */
.page-intro {
  background: var(--cream);
  padding: clamp(80px, 11vw, 140px) 0 clamp(48px, 6vw, 80px);
  border-bottom: 1px solid var(--line-light);
}
.page-intro h1 { max-width: 18ch; }
.page-intro .lead { margin-top: 22px; }

/* tag */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-light);
  font-size: 12px;
  letter-spacing: 0.04em;
  background: rgba(255,255,255,0.4);
}
.bg-black .tag, .bg-horizon .tag {
  border-color: rgba(211, 232, 5, 0.4);
  background: transparent;
  color: var(--lime);
}

/* List with leading slash */
.slash-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.slash-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  font-size: 16px;
  line-height: 1.5;
}
.slash-list li::before {
  content: "/";
  color: var(--horizon);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
}

/* Available pill */
.avail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--horizon);
  font-weight: 500;
}
.avail::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--horizon);
  box-shadow: 0 0 0 3px rgba(1,61,26,0.15);
}
.bg-black .avail, .bg-horizon .avail { color: var(--lime); }
.bg-black .avail::before, .bg-horizon .avail::before {
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(211,232,5,0.18);
}

/* ============================================================
   RESPONSIVE — TABLET (≤960px) AND MOBILE (≤640px)
   ============================================================ */

/* Mobile nav toggle (CSS-only burger) */
.nav-toggle { display: none; }
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  cursor: pointer;
  margin-left: auto;
  align-items: center;
  border-radius: 999px;
  transition: background 0.18s ease;
}
.nav-burger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.2s ease;
  border-radius: 2px;
}
.nav.on-dark .nav-burger span,
.nav.on-dark + * .nav-burger span,
.nav.on-dark .nav-burger span { background: var(--cream); }
.nav-burger:hover { background: rgba(0,0,0,0.05); }
.nav.on-dark .nav-burger:hover { background: rgba(247,243,220,0.06); }

/* ---------- TABLET (≤960px) ---------- */
@media (max-width: 960px) {
  :root { --container: 100%; }

  /* Global overflow guard */
  html, body { overflow-x: hidden; }

  /* Cards spanning multiple cols collapse on small grids */
  [style*="grid-column: span 2"],
  [style*="grid-column:span 2"] { grid-column: auto !important; }

  /* Type scale dial-down */
  .h-display { font-size: clamp(40px, 7.4vw, 64px); }
  .h-section { font-size: clamp(30px, 5.6vw, 44px); }
  .h-card    { font-size: 22px; }

  /* Hero spacing */
  .hero { padding: clamp(72px, 12vw, 120px) 0 clamp(64px, 11vw, 110px); }

  /* Nav: switch to burger */
  .nav-burger { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 var(--gutter);
    background: inherit;
    border-bottom: 1px solid transparent;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, border-color 0.3s ease;
    background: color-mix(in oklab, var(--cream) 96%, transparent);
  }
  .nav.on-dark .nav-links { background: #000; }
  .nav-toggle:checked ~ .nav-links {
    max-height: 480px;
    padding: 8px var(--gutter) 24px;
    border-bottom-color: var(--line-light);
  }
  .nav.on-dark .nav-toggle:checked ~ .nav-links { border-bottom-color: rgba(247,243,220,0.08); }
  .nav-links a {
    padding: 14px 4px;
    font-size: 17px;
    border-radius: 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    width: 100%;
  }
  .nav.on-dark .nav-links a { border-bottom-color: rgba(247,243,220,0.06); }
  .nav-links a.btn-lime,
  .nav-links a.btn-solid-dark {
    margin-top: 12px;
    border-radius: 999px;
    border-bottom: none;
    text-align: center;
    align-self: stretch;
    padding: 14px 18px !important;
  }
  .nav-links a.active::after { display: none; }
  /* Burger to X */
  .nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav { position: relative; }

  /* Section spacing */
  .section { padding: clamp(64px, 10vw, 96px) 0; }
  .section-head { margin-bottom: 36px; }

  /* Two-column inline grids → stack on tablet (CTA strips, intros) */
  [style*="grid-template-columns:1.4fr 1fr"],
  [style*="grid-template-columns: 1.4fr 1fr"],
  [style*="grid-template-columns:1.2fr 1fr"],
  [style*="grid-template-columns: 1.2fr 1fr"],
  [style*="grid-template-columns:1fr 1.2fr"],
  [style*="grid-template-columns: 1fr 1.2fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    align-items: start !important;
  }

  /* 4-col timeline on how-we-work → 2 cols */
  [style*="grid-template-columns: repeat(4, 1fr)"],
  [style*="grid-template-columns:repeat(4, 1fr)"],
  [style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* 5-col table-style index rows in our-work → tighter columns, hide eyebrow tag */
  [style*="grid-template-columns: 90px 1fr 1.4fr 180px 32px"] {
    grid-template-columns: 60px 1fr 24px !important;
    gap: 12px 16px !important;
    padding: 22px 0 !important;
  }
  [style*="grid-template-columns: 90px 1fr 1.4fr 180px 32px"] > :nth-child(3),
  [style*="grid-template-columns: 90px 1fr 1.4fr 180px 32px"] > :nth-child(4) {
    grid-column: 1 / -1;
    padding-left: 76px;
    margin-top: 4px;
    font-size: 14px !important;
  }

  /* Case-card padding tightens */
  .case-card { padding: 32px 28px 28px; }
  .case-card__title { font-size: 26px; }

  /* Footer credit line wraps */
  .footer .credit-line {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
}

/* ---------- MOBILE (≤640px) ---------- */
@media (max-width: 640px) {
  /* Type scale further down */
  .h-display { font-size: clamp(36px, 9.5vw, 48px); line-height: 1.02; }
  .h-section { font-size: clamp(28px, 7.5vw, 38px); }
  .h-card    { font-size: 20px; }

  /* Hero further compresses */
  .hero { padding: 64px 0 56px; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .hero .meta-line { font-size: 11px; gap: 16px; }

  /* All two-column inline grids stack at mobile too */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* 4-col timeline → 1 col on phone */
  [style*="grid-template-columns: repeat(4, 1fr)"],
  [style*="grid-template-columns:repeat(4, 1fr)"],
  [style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Case-card metrics → 3 stays but tighter; below 380, single row scrolls or 1col */
  .case-card { padding: 28px 22px 24px; }
  .case-card::before { width: 2px; height: 48px; }
  .case-card__title { font-size: 22px; }
  .case-card__body { font-size: 15px; }
  .case-card__metric-num { font-size: 26px; }
  .case-card__kicker {
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
  }

  /* Section-head right column tighter */
  .section-head .right { padding-top: 0; }

  /* Section spacing */
  .section { padding: 56px 0; }
  .section-head { margin-bottom: 28px; }

  /* Page-intro pads less */
  .page-intro { padding: 56px 0 36px; }

  /* Footer: stack columns */
  .footer { padding: 56px 0 28px; }
  .footer .top { grid-template-columns: 1fr !important; gap: 32px; padding-bottom: 36px; }

  /* Buttons full-width-ish in CTAs */
  .bg-horizon .btn,
  .bg-black .btn { width: 100%; justify-content: center; }

  /* Tags don't wrap mid-word */
  .tag { font-size: 11px; }

  /* Nav burger fits brand on small phones */
  .brand { font-size: 20px; }

  /* Grid utilities (already partially handled at 620px in earlier rule) */
  .grid-2, .grid-3, .grid-5 { grid-template-columns: 1fr !important; }

  /* Form: single column */
  #contact-form > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }
}

/* Small-tablet refinement: keep 5-col grid splitting earlier */
@media (max-width: 820px) {
  .grid-5 { grid-template-columns: repeat(2, 1fr) !important; }
}
