/* CTR Ltd — design tokens & global styles. See .stitch/DESIGN.md */

:root {
  --ink: #0B1626;
  --ink-raised: #13233C;
  --ink-border: #243248;
  --teal: #5DCAA5;
  --teal-deep: #0F6E56;
  --paper: #FAF7F2;
  --white: #FFFFFF;
  --border-warm: #E5E3DC;
  --text-strong: #1A2433;
  --text-body: #3D4654;
  --text-muted: #6B7280;
  --on-navy-body: #9BA6B5;
  --on-navy-muted: #7E8A9B;
  --brick: #993C1D;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-serif: "Fraunces", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --max-w: 1140px;
  --radius: 8px;
  --radius-lg: 12px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-body);
  background: var(--white);
}

body.editorial { background: var(--paper); }

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

h1, h2, h3, h4 { color: var(--text-strong); line-height: 1.15; margin: 0 0 1rem; font-weight: 600; }
h1 { font-size: clamp(2.1rem, 4.5vw, 2.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.25rem; max-width: 68ch; }

a { color: var(--teal-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--teal-deep);
  outline-offset: 2px;
  border-radius: 2px;
}
.hero :focus-visible, .navy :focus-visible, .site-footer :focus-visible { outline-color: var(--teal); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 12px 20px; z-index: 100;
}
.skip-link:focus { left: 0; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin: 0 0 1rem;
}
.hero .eyebrow, .navy .eyebrow { color: var(--teal); }
.editorial-block .eyebrow, body.editorial .eyebrow { color: var(--brick); }

/* ---------- Navbar ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-warm);
}
body.editorial .site-nav { background: rgba(250, 247, 242, 0.96); }
.site-nav .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 68px;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand-mark { font-weight: 600; font-size: 1.2rem; color: var(--ink); letter-spacing: 0.02em; }
.brand-sub { font-size: 0.8rem; color: var(--text-muted); }
.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none; color: var(--text-body); font-size: 0.9375rem;
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--teal-deep); font-weight: 500; }
/* Qualified with `.nav-links a` so it outranks the `.nav-links a` base rule
   (0-1-1) — otherwise its `padding: 4px 0` wins and the button renders cramped.
   Higher specificity also lets us drop the `!important` band-aids. */
.nav-links a.nav-cta {
  background: var(--ink); color: #fff; padding: 14px 32px;
  border-radius: var(--radius); font-weight: 500; border-bottom: none;
}
.nav-links a.nav-cta:hover { background: var(--ink-raised); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--border-warm);
  border-radius: var(--radius); padding: 8px 10px; cursor: pointer; color: var(--ink);
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--white); border-bottom: 1px solid var(--border-warm);
    flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 24px 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 12px 0; width: 100%; }
  .nav-links a.nav-cta { display: inline-block; margin-top: 8px; text-align: center; padding: 14px 32px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 14px 26px; border-radius: var(--radius);
  font-weight: 500; font-size: 1rem; text-decoration: none; border: 1px solid transparent;
  cursor: pointer; font-family: inherit;
}
.btn-teal { background: var(--teal); color: #04342C; }
.btn-teal:hover { background: #74D6B4; }
.btn-navy { background: var(--ink); color: #fff; }
.btn-navy:hover { background: var(--ink-raised); }
.btn-ghost-light { border-color: var(--ink-border); color: #fff; }
.btn-ghost-light:hover { border-color: var(--on-navy-body); }
.btn-ghost-dark { border-color: var(--text-strong); color: var(--text-strong); }
.btn-ghost-dark:hover { background: var(--text-strong); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
.section-paper { background: var(--paper); }
.section-white { background: var(--white); }
.navy { background: var(--ink); }
.navy h1, .navy h2, .navy h3 { color: #fff; }
.navy p { color: var(--on-navy-body); }
@media (max-width: 640px) { .section { padding: 64px 0; } }

/* ---------- Hero ---------- */
.hero { background: var(--ink); padding: 110px 0 72px; }
.hero h1 {
  color: #fff; font-size: clamp(2.4rem, 5.5vw, 3.4rem);
  max-width: 17ch; margin-bottom: 1.25rem;
}
.hero .lede { color: var(--on-navy-body); font-size: 1.125rem; max-width: 52ch; margin-bottom: 2rem; }
.proof-bar {
  margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--ink-border);
}
.proof-bar p {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em;
  color: var(--on-navy-muted); margin: 0 0 12px; text-transform: uppercase;
}
.proof-bar ul {
  display: flex; flex-wrap: wrap; gap: 10px 32px; list-style: none; margin: 0; padding: 0;
}
.proof-bar li {
  font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--on-navy-body); font-weight: 500;
}

/* ---------- Cards ---------- */
.card-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--white); border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg); padding: 28px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
a.card { text-decoration: none; color: inherit; display: block; }
.card:hover { transform: translateY(-3px); border-color: #C9C4B6; }
.card .icon { font-size: 26px; color: var(--teal-deep); margin-bottom: 14px; display: inline-block; }
.card h3 { margin-bottom: 8px; font-size: 1.125rem; }
.card p { font-size: 0.9375rem; margin: 0; color: var(--text-muted); }
.card .card-link { display: inline-block; margin-top: 14px; font-size: 0.9rem; font-weight: 500; }

/* ---------- Stats ---------- */
.stat-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat-num { font-size: clamp(2.4rem, 5vw, 3.2rem); font-weight: 600; color: var(--teal); line-height: 1; }
.section-white .stat-num, .section-paper .stat-num { color: var(--ink); }
.stat-cap {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--on-navy-body); margin-top: 10px; line-height: 1.6;
}
.section-white .stat-cap, .section-paper .stat-cap { color: var(--text-muted); }

/* ---------- Case studies ---------- */
.case-card { display: flex; flex-direction: column; }
.case-metric { font-size: 2rem; font-weight: 600; color: var(--teal-deep); line-height: 1.1; }
.case-org {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); margin: 6px 0 12px;
}
.case-detail h2 { margin-top: 0; }
.case-section-label {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--teal-deep); margin: 2rem 0 0.5rem;
}
.todo {
  background: #FAEEDA; color: #633806; border-radius: 6px;
  padding: 2px 8px; font-size: 0.8125rem; font-family: var(--font-mono);
}

/* ---------- Editorial ---------- */
.serif, .editorial-headline { font-family: var(--font-serif); font-weight: 500; }
.editorial-headline { font-size: clamp(2rem, 4.5vw, 2.9rem); letter-spacing: 0; }
.pull-quote {
  font-family: var(--font-serif); font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  line-height: 1.5; color: var(--text-strong); max-width: 46ch; margin: 0 0 1rem;
}
.quote-attr { font-size: 0.9375rem; color: var(--brick); font-weight: 500; }
.two-col { display: grid; gap: 56px; grid-template-columns: 1.4fr 1fr; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.portrait-placeholder {
  background: #E2DDD2; border-radius: var(--radius-lg); min-height: 380px;
  display: flex; align-items: center; justify-content: center;
  color: #A39C8C; font-family: var(--font-mono); font-size: 0.8rem;
}

.numbered-list { list-style: none; margin: 0; padding: 0; }
.numbered-list > li {
  display: grid; grid-template-columns: 48px 1fr; gap: 16px;
  padding: 24px 0; border-bottom: 1px solid var(--border-warm); align-items: baseline;
}
.numbered-list .num { font-family: var(--font-mono); font-size: 0.875rem; color: var(--brick); }
.numbered-list h3 { font-family: var(--font-serif); font-weight: 500; margin-bottom: 6px; }
.numbered-list p { margin: 0; font-size: 0.9375rem; color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); padding: 64px 0 32px; }
.footer-grid { display: grid; gap: 40px; grid-template-columns: 2fr 1fr 1fr 1fr; margin-bottom: 48px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 {
  color: #fff; font-size: 0.8125rem; font-family: var(--font-mono);
  letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; margin-bottom: 16px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: var(--on-navy-body); text-decoration: none; font-size: 0.9375rem; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-brand p { color: var(--on-navy-body); font-size: 0.9375rem; max-width: 36ch; }
.footer-legal {
  border-top: 1px solid var(--ink-border); padding-top: 24px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  color: var(--on-navy-muted); font-size: 0.8125rem;
}
.footer-legal a { color: var(--on-navy-muted); font-size: 0.8125rem; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--ink); padding: 72px 0; }
.cta-band h2 { color: #fff; max-width: 22ch; }
.cta-band p { color: var(--on-navy-body); }

/* ---------- Calendly placeholder ---------- */
.calendly-box {
  border: 1px dashed #C9C4B6; border-radius: var(--radius-lg);
  padding: 48px 32px; text-align: center; background: var(--white); color: var(--text-muted);
}

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- Utility ---------- */
.center { text-align: center; }
.center p { margin-left: auto; margin-right: auto; }
.mt-0 { margin-top: 0; }
.mb-lg { margin-bottom: 3rem; }
.section-head { max-width: 60ch; margin-bottom: 3rem; }
.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
.dl-list { list-style: none; margin: 0; padding: 0; }
.dl-list li { margin-bottom: 12px; }
.dl-list a { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }

/* ---------- Portfolio additions ---------- */
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.5rem; }
.filter-pills a, .pill {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  font-size: 0.875rem; font-weight: 500; text-decoration: none;
  border: 1px solid var(--ink); color: var(--ink);
  transition: background 0.15s, color 0.15s;
}
.filter-pills a:hover { background: var(--ink); color: #fff; }
.filter-pills a.active { background: var(--teal-deep); color: #fff; border-color: var(--teal-deep); }
.filter-pills--inline { list-style: none; padding: 0; margin-top: 0.75rem; }
.filter-pills--inline .pill { border-color: rgba(255,255,255,.35); color: rgba(255,255,255,.8); }
.logo-lockup { display: flex; align-items: center; gap: 12px; margin-bottom: 0.75rem; }
.logo-lockup img { max-height: 48px; width: auto; }
.logo-lockup-name { font-size: 0.9375rem; font-weight: 600; opacity: 0.75; }
.engagement-badge { font-size: 0.9375rem; font-style: italic; color: var(--teal); margin-top: 0.25rem; }
.case-card-logo { max-height: 40px; width: auto; margin-bottom: 10px; display: block; }
.approach-steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.approach-steps > li { position: relative; padding-left: 2.5rem; margin-bottom: 1.25rem; counter-increment: step; }
.approach-steps > li .case-section-label::before {
  content: counter(step) ". ";
  font-variant-numeric: tabular-nums;
  color: var(--teal-deep);
}

/* Hero background image (Charlie's delivered heroes) — navy overlay keeps
   white headline text WCAG AA on the quiet left third of the composition. */
.hero.has-image {
  background-image: linear-gradient(
      90deg,
      rgba(15, 51, 80, 0.94) 0%,
      rgba(15, 51, 80, 0.78) 45%,
      rgba(15, 51, 80, 0.55) 100%
    ),
    var(--hero-image);
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
}

/* Case-study card cover image (laverydigital.com/projects style). */
.case-card-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}
