/* ==========================================================================
   Evidence Systems: holding page
   Every colour, font and radius lives in :root below, so the identity can be
   swapped in one place once the design partner work lands.
   ========================================================================== */

:root {
  /* Colour */
  --color-bg: #FFFFFF;
  --color-surface: #F5F5F7;
  --color-ink: #0A0A0A;
  --color-muted: #5E5E63;
  --color-line: #E4E4E7;

  --color-dark-bg: #0A0A0A;
  --color-dark-surface: #141416;
  --color-dark-ink: #FFFFFF;
  --color-dark-muted: #A1A1A6;
  --color-dark-line: #2A2A2E;

  --color-accent: #2F6BD0;        /* blue for text and fills on light (5.1:1 on white) */
  --color-accent-soft: #5B9CF5;   /* lighter blue for use on dark and in line art */
  --color-focus: #2F6BD0;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Shape and space */
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --wrap: 1200px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-y: clamp(4.5rem, 11vw, 9rem);
  --measure: 65ch;
}

/* Base ------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

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

.section-dark :focus-visible { outline-color: var(--color-accent-soft); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 1rem; top: -3rem;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--color-ink);
  color: var(--color-bg);
  border-radius: var(--radius-pill);
  text-decoration: none;
}
.skip:focus { top: 1rem; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Shared pieces ---------------------------------------------------------- */

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.eyebrow {
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--color-accent);
  margin-bottom: 1.25rem;
}
.section-dark .eyebrow { color: var(--color-accent-soft); }

.index {
  display: block;
  font-family: var(--font-mono);
  font-size: .8125rem;
  color: var(--color-accent);
  margin-bottom: 2.5rem;
}
.section-dark .index { color: var(--color-accent-soft); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .75rem 1.5rem;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
  overflow-wrap: anywhere;
}
.btn-primary { background: var(--color-ink); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent); }

.text-link {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
  text-underline-offset: 4px;
}
.text-link:hover { text-decoration: underline; }
.section-dark .text-link { color: var(--color-accent-soft); }

.section { padding-block: var(--section-y); }
.section-tint { background: var(--color-surface); }
.section-dark { background: var(--color-dark-bg); color: var(--color-dark-ink); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.header-link {
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  padding: .5rem 1rem;
  margin-right: -1rem;
  border-radius: var(--radius-pill);
  transition: color .2s ease;
}
.header-link:hover { color: var(--color-accent); }

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

.hero { padding-block: clamp(4rem, 12vw, 9.5rem) clamp(4rem, 10vw, 8rem); }

.hero-grid {
  display: grid;
  gap: clamp(3rem, 8vw, 5rem);
  align-items: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 9vw, 5.75rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 11ch;
  text-wrap: balance;
}

.lede {
  margin-top: 1.75rem;
  max-width: 34rem;
  font-size: clamp(1.125rem, 2.2vw, 1.3125rem);
  line-height: 1.5;
  color: var(--color-muted);
}

.hero .btn { margin-top: 2.25rem; }

/* Thread motif */
.thread { width: 100%; max-width: 520px; height: auto; justify-self: center; }
.thread .docs rect { fill: var(--color-bg); stroke: var(--color-line); stroke-width: 1.5; }
.thread .bars rect { fill: var(--color-line); }
.thread .marks rect { fill: var(--color-accent-soft); opacity: .35; }
.thread .lines path {
  fill: none;
  stroke: var(--color-accent-soft);
  stroke-width: 1.5;
  stroke-dasharray: 320;
  stroke-dashoffset: 0;
  animation: draw 1.6s cubic-bezier(.4, 0, .2, 1) .2s both;
}
.thread .lines path:nth-child(2) { animation-delay: .35s; }
.thread .lines path:nth-child(3) { animation-delay: .5s; }
.thread .dots circle { fill: var(--color-accent); }
.thread .claim { fill: var(--color-ink); }
.thread .claim-bars rect { fill: #3A3A3F; }
.thread .claim-mark { fill: var(--color-accent-soft); }

@keyframes draw { from { stroke-dashoffset: 320; } to { stroke-dashoffset: 0; } }

/* What we do ------------------------------------------------------------- */

.statement {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.4vw, 3rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
  max-width: 22ch;
  text-wrap: balance;
}

.grid-3 {
  display: grid;
  margin-top: clamp(3rem, 7vw, 5rem);
  border-top: 1px solid var(--color-line);
}
.cell {
  padding-block: 2rem 2.5rem;
  border-bottom: 1px solid var(--color-line);
}
.cell h3, .offer h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.cell p {
  margin-top: .75rem;
  max-width: 30ch;
  color: var(--color-muted);
}

/* How we help ------------------------------------------------------------ */

.offers {
  display: grid;
  gap: 1rem;
}
.offer {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 2.5rem);
}
.offer p {
  margin-top: 1rem;
  color: var(--color-muted);
  max-width: var(--measure);
}
.note {
  margin-top: 2rem;
  font-size: 1rem;
  color: var(--color-muted);
}

/* Selected work ---------------------------------------------------------- */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 2rem;
  margin-bottom: 1.25rem;
}
.section-head .eyebrow { margin-bottom: 0; }

.work {
  display: grid;
  gap: 1rem;
}
.work-card {
  background: var(--color-dark-surface);
  border: 1px solid var(--color-dark-line);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
}
.work-card h3 {
  font-family: var(--font-display);
  font-size: clamp(1.3125rem, 2.4vw, 1.625rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.work-card p {
  margin-top: 1rem;
  color: var(--color-dark-muted);
  max-width: 48ch;
}

/* Who we work with ------------------------------------------------------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .625rem;
}
.tags li {
  padding: .55rem 1rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  font-size: .9375rem;
}

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

.cta {
  padding-block: 0 var(--section-y);
}
.cta-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--section-y);
  border-top: 1px solid var(--color-line);
}
.cta h2 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 6.5vw, 4.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  max-width: 16ch;
  text-wrap: balance;
}
.cta p {
  margin-top: 1.25rem;
  font-size: clamp(1.125rem, 2.2vw, 1.3125rem);
  color: var(--color-muted);
}
.cta .btn { margin-top: 2.25rem; max-width: 100%; }

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

.site-footer {
  border-top: 1px solid var(--color-line);
  padding-block: 3rem;
  font-size: .9375rem;
  color: var(--color-muted);
}
.footer-grid {
  display: grid;
  gap: 2rem;
}
.footer-brand .wordmark { color: var(--color-ink); display: inline-block; margin-bottom: .75rem; }
.footer-brand a[href^="mailto"] { text-decoration: none; }
.footer-brand a[href^="mailto"]:hover { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }

.social { display: flex; gap: .25rem; margin-left: -.625rem; }
.social:not(:has(a:not([href="#"]))) { display: none; } /* all placeholders: hide the row */
.social a {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  transition: color .2s ease;
}
.social a:hover { color: var(--color-ink); }
.social svg { width: 20px; height: 20px; fill: currentColor; }
/* Hide any social link still pointing at a placeholder */
.social li:has(> a[href="#"]) { display: none; }
.social a[href="#"] { display: none; }

.legal { font-size: .8125rem; }

/* Breakpoints ------------------------------------------------------------ */

@media (min-width: 720px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .cell { padding-inline: 0 2rem; border-bottom: 0; }
  .cell + .cell { padding-left: 2rem; border-left: 1px solid var(--color-line); }

  .work { grid-template-columns: repeat(2, 1fr); }
  .work-card:first-child { grid-column: 1 / -1; }

  .footer-grid {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
  .social { margin: 0 -.625rem 0 0; }
  .legal { grid-column: 1 / -1; padding-top: 1.5rem; border-top: 1px solid var(--color-line); }
}

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.15fr 1fr; }
  .thread { justify-self: end; }

  .offers { grid-template-columns: repeat(3, 1fr); }

  .work { grid-template-columns: repeat(6, 1fr); }
  .work-card:nth-child(-n+2) { grid-column: span 3; }
  .work-card:nth-child(n+3) { grid-column: span 2; }
  .work-card:first-child { grid-column: span 3; }
  .work-card:nth-child(-n+2) { min-height: 20rem; }
  .work-card:nth-child(-n+2) h3 { font-size: 2rem; max-width: 20ch; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
  }
}
