/*
 * Cohort Brief public site.
 *
 * The tokens are the application's (apps/web/app/globals.css, ADR 0012):
 * warm white / near-black / graphite / stone with the muted accent family,
 * Source Serif 4 for headings and Geist for text. Keep the two files in
 * step when the application's palette changes.
 */

:root {
  color-scheme: light dark;

  --background: oklch(0.977 0.005 90);
  --foreground: oklch(0.24 0.006 78);
  --card: oklch(0.99 0.003 90);
  --card-foreground: oklch(0.24 0.006 78);
  --primary: oklch(0.512 0.118 39);
  --primary-foreground: oklch(0.977 0.005 90);
  --secondary: oklch(0.945 0.006 88);
  --secondary-foreground: oklch(0.3 0.008 60);
  --muted: oklch(0.945 0.006 88);
  --muted-foreground: oklch(0.5 0.012 75);
  --accent: oklch(0.94 0.01 75);
  --accent-foreground: oklch(0.3 0.008 60);
  --border: oklch(0.9 0.007 85);
  --ring: oklch(0.512 0.118 39 / 55%);
  --chart-1: oklch(0.512 0.118 39);
  --chart-2: oklch(0.397 0.056 245);
  --chart-3: oklch(0.405 0.047 157);
  --chart-4: oklch(0.615 0.111 79);
  --chart-5: oklch(0.444 0.06 306);
  --sidebar: oklch(0.962 0.006 88);
  --radius: 0.625rem;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia,
    "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --measure: 68rem;
  --shadow: 0 1px 2px oklch(0.24 0.006 78 / 6%), 0 12px 32px -16px oklch(0.24 0.006 78 / 18%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: oklch(0.19 0.005 70);
    --foreground: oklch(0.95 0.005 85);
    --card: oklch(0.235 0.006 70);
    --card-foreground: oklch(0.95 0.005 85);
    --primary: oklch(0.68 0.115 40);
    --primary-foreground: oklch(0.17 0.005 70);
    --secondary: oklch(0.29 0.007 70);
    --secondary-foreground: oklch(0.95 0.005 85);
    --muted: oklch(0.29 0.007 70);
    --muted-foreground: oklch(0.72 0.01 80);
    --accent: oklch(0.3 0.009 65);
    --accent-foreground: oklch(0.95 0.005 85);
    --border: oklch(0.95 0.01 85 / 12%);
    --ring: oklch(0.68 0.115 40 / 55%);
    --chart-1: oklch(0.68 0.115 40);
    --chart-2: oklch(0.62 0.08 245);
    --chart-3: oklch(0.63 0.075 157);
    --chart-4: oklch(0.75 0.11 82);
    --chart-5: oklch(0.66 0.08 306);
    --sidebar: oklch(0.215 0.006 70);
    --shadow: 0 1px 2px oklch(0 0 0 / 30%), 0 12px 32px -16px oklch(0 0 0 / 60%);
  }
}

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

*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: var(--border);
}

html {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-size: 1rem;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in oklch, currentColor 40%, transparent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: calc(var(--radius) * 0.6);
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.eyebrow::before {
  content: "";
  width: 1.25rem;
  height: 1px;
  background: currentColor;
}

.lede {
  font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.25rem);
  color: var(--muted-foreground);
  max-width: 44rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.pill .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 20%, transparent);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.6rem 1.15rem;
  border-radius: calc(var(--radius) * 0.8);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    transform 120ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.button-primary:hover {
  background: color-mix(in oklch, var(--primary) 90%, var(--foreground));
}

.button-secondary {
  background: var(--card);
  color: var(--foreground);
  border-color: var(--border);
}

.button-secondary:hover {
  background: var(--accent);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in oklch, var(--background) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark svg {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--primary);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9375rem;
}

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

.site-nav a:hover {
  color: var(--foreground);
}

.site-nav .button {
  min-height: 2.25rem;
  padding: 0.35rem 0.9rem;
  color: var(--foreground);
}

@media (max-width: 720px) {
  .site-nav .nav-link {
    display: none;
  }
}

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

.hero {
  position: relative;
  padding-block: clamp(3.5rem, 6vw, 6.5rem) clamp(3rem, 5vw, 5rem);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 70%;
  background:
    radial-gradient(60% 55% at 78% 30%, color-mix(in oklch, var(--chart-4) 18%, transparent), transparent 70%),
    radial-gradient(45% 50% at 15% 10%, color-mix(in oklch, var(--chart-2) 12%, transparent), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero .container {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 960px) {
  .hero .container {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 4rem;
  }
}

.hero-copy {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
}

.hero h1 {
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);
  font-weight: 500;
  line-height: 1.05;
}

.hero h1 em {
  font-style: italic;
  color: var(--primary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-note {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* ---- Artifact illustration ------------------------------------------- */

.artifact-figure {
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.artifact {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.4);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 2vw, 1.75rem);
  display: grid;
  gap: 1rem;
}

.artifact-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.artifact-meta .tag {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-weight: 500;
}

.artifact-meta .tag.stage {
  background: color-mix(in oklch, var(--chart-3) 14%, var(--card));
  color: var(--chart-3);
}

.artifact-title {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem);
  line-height: 1.25;
  font-weight: 500;
}

.artifact-section {
  display: grid;
  gap: 0.25rem;
}

.artifact-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.artifact-section p {
  font-size: 0.9375rem;
}

.artifact-sources {
  display: grid;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 0.8125rem;
}

.artifact-sources li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  color: var(--muted-foreground);
}

.artifact-sources li::before {
  content: "";
  flex: none;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--chart-2);
  transform: translateY(-0.1em);
}

.artifact-sources .read {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 0 0.35rem;
  border-radius: 4px;
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.artifact-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.artifact-figure figcaption {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  text-align: center;
}

/* ---- Sections --------------------------------------------------------- */

.section {
  padding-block: clamp(3rem, 6vw, 5.5rem);
  border-top: 1px solid var(--border);
}

.section-heading {
  display: grid;
  gap: 1rem;
  max-width: 44rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-alt {
  background: var(--sidebar);
}

.grid-3 {
  display: grid;
  gap: 1.25rem;
}

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

.grid-2 {
  display: grid;
  gap: 1.25rem;
}

/* A second grid placed under another block in the same section. */
.grid-2-follow {
  margin-top: 1.25rem;
}

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

.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.4);
  padding: 1.5rem;
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.card h3 {
  font-size: 1.2rem;
}

.card p {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
}

.card-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: calc(var(--radius) * 0.8);
  background: color-mix(in oklch, var(--primary) 12%, var(--card));
  color: var(--primary);
}

.card-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ---- How it works ----------------------------------------------------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--border);
}

.step:first-child {
  border-top: 0;
  padding-top: 0;
}

.step-number {
  counter-increment: step;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--primary);
  line-height: 1;
  padding-top: 0.15rem;
}

.step-number::before {
  content: counter(step, decimal-leading-zero);
}

.step-body {
  display: grid;
  gap: 0.35rem;
}

.step-body h3 {
  font-size: 1.15rem;
}

.step-body h3 span {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-left: 0.5rem;
}

.step-body p {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
}

.how-layout {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 960px) {
  .how-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 4rem;
    align-items: start;
  }
}

.rules {
  position: sticky;
  top: 5.5rem;
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: calc(var(--radius) * 1.4);
  background: var(--foreground);
  color: var(--background);
}

.rules h3 {
  color: inherit;
  font-size: 1.35rem;
}

.rules ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.rules li {
  display: grid;
  gap: 0.15rem;
  padding-left: 1.25rem;
  position: relative;
  font-size: 0.9375rem;
}

.rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--chart-4);
}

.rules li strong {
  font-weight: 600;
}

.rules li span {
  opacity: 0.78;
}

/* ---- Evidence ladder -------------------------------------------------- */

.ladder {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.rung {
  display: grid;
  gap: 0.4rem;
  padding: 0.85rem 0.9rem;
  border-radius: calc(var(--radius) * 0.8);
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
}

.rung b {
  font-weight: 600;
  font-size: 0.875rem;
}

.rung::before {
  content: "";
  height: 3px;
  border-radius: 2px;
  background: var(--rung-color, var(--chart-1));
}

.rung:nth-child(1) {
  --rung-color: var(--chart-4);
}
.rung:nth-child(2) {
  --rung-color: var(--chart-2);
}
.rung:nth-child(3) {
  --rung-color: var(--chart-3);
}
.rung:nth-child(4) {
  --rung-color: var(--chart-1);
}

@media (max-width: 640px) {
  .ladder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---- Surfaces --------------------------------------------------------- */

.surfaces {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .surfaces {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .surfaces {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.surface {
  display: grid;
  gap: 0.5rem;
  padding: 1.25rem;
  border-radius: calc(var(--radius) * 1.4);
  background: var(--card);
  border: 1px solid var(--border);
}

.surface-name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.8125rem;
}

.surface-name svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--primary);
}

.surface h3 {
  font-size: 1.15rem;
}

.surface p {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
}

/* ---- Sectors ---------------------------------------------------------- */

.sectors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sectors li {
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 0.9375rem;
}

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

.closing .container {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
  padding: clamp(2rem, 4vw, 3.5rem);
  border-radius: calc(var(--radius) * 1.8);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.closing h2 {
  max-width: 30ch;
}

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

.site-footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer nav {
  display: flex;
  gap: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .button {
    transition: none;
  }
}
