/* Darwin Labs shared stylesheet (all pages) */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Warm paper ramp */
  --bg: #FBF6EC;
  --card: #FFFDF8;
  --raised: #F3ECDD;
  --line: rgba(46, 36, 25, 0.10);

  /* Three text roles */
  --ink: #2E2419;
  --text-2: #5E554A;
  --muted: #6D6656;
  --on-ink: #FBF6EC;

  /* One accent: --accent for fills and lines, --accent-text where it carries text */
  --accent: #2E9E92;
  --accent-text: #1F6E66;

  --serif: "Newsreader", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --card: #1C1A18;
    --raised: #262421;
    --line: rgba(239, 233, 222, 0.10);
    --ink: #EFE9DE;
    --text-2: #AAA398;
    --muted: #8A847A;
    --on-ink: #161513;
    --accent-text: #5FC4B8;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

.wrap.narrow { max-width: 720px; }

a { color: var(--accent-text); }

a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  background: var(--ink);
  color: var(--on-ink);
  padding: 8px 16px;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { top: 16px; }

/* Text */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
}

h1 {
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}

h2 {
  font-size: 28px;
  line-height: 1.2;
  margin: 48px 0 12px;
}

h3 {
  font-size: 22px;
  line-height: 1.2;
  margin: 0 0 4px;
}

p, li {
  font-size: 15px;
  color: var(--text-2);
}

/* Small meta line above headlines. Also styles the privacy page's .badge */
.meta,
.badge {
  display: block;
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
  margin: 0 0 16px;
}

p.tagline,
.lede {
  font-size: 18px;
  line-height: 28px;
  color: var(--text-2);
  max-width: 36rem;
  margin: 0 0 32px;
}

.prose { max-width: 40rem; }

/* Navigation */

nav.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  margin-bottom: 32px;
  font-size: 14px;
}

nav.top a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  transition: color 150ms var(--ease);
}

nav.top a:hover { color: var(--accent-text); }

nav.top .nav-links { display: flex; gap: 24px; }
nav.top .nav-links a { font-weight: 400; color: var(--text-2); }
nav.top .nav-links a:hover { color: var(--accent-text); }

/* Buttons */

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 20px;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), transform 150ms var(--ease);
}

.btn:hover { background: var(--accent-text); }
.btn:active { transform: scale(0.98); }

.link-quiet {
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 150ms var(--ease), border-color 150ms var(--ease);
}

.link-quiet:hover {
  color: var(--accent-text);
  border-color: var(--accent);
}

/* Hero: text on the left, phones rising from the bottom edge on the right */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: end;
  padding-top: 48px;
  border-bottom: 1px solid var(--line);
  animation: rise 400ms var(--ease) both;
}

.hero-text { padding-bottom: 96px; }

.hero-home h1 { font-size: clamp(36px, 4.6vw, 52px); }

.hero-phones {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  height: 480px;
  overflow: hidden;
}

.hero-phones figure { margin: 0; width: min(240px, 44%); }
.hero-phones figure:first-child { margin-top: 64px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

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

.shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Sections */

.section { padding-top: 96px; }
.section h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

/* Steps: a thin line runs through the numbered nodes, the fork in the road */

.how-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
  margin-top: 48px;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps li {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 16px;
  padding-bottom: 40px;
}

.steps li:last-child { padding-bottom: 0; }

.steps li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 40px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--bg);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.steps h3 { margin-top: 2px; }
.steps p { margin: 0; }

.how-shots {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.how-shots figure { margin: 0; flex: 1 1 0; min-width: 0; }

.how-shots figcaption {
  margin-top: 12px;
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
}

/* Privacy statement */

.statement {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 48px;
}

.statement h2 { margin: 0; }
.statement p { margin: 0; font-size: 16px; line-height: 28px; }

/* Pull line */

.pull {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 28ch;
  text-wrap: balance;
  margin: 0;
}

/* Cards (pricing, privacy page) */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}

.card p { margin: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.card .price {
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
  margin: 0 0 12px;
}

/* Closing call to action and the fork divider */

.cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.fork {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.cta .meta { margin: 0; }

/* Root page feature card */

.feature {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 32px 0;
  margin-bottom: -1px;
  border-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.feature .meta { margin-bottom: 8px; }
.feature h2 { font-size: 28px; margin: 0 0 8px; }
.feature p { margin: 0 0 24px; }

.feature .actions { margin-bottom: 32px; }

.feature .shot-wrap {
  width: min(240px, 60%);
  margin: 0 auto;
  height: 240px;
  overflow: hidden;
}

/* Research index and case studies */

.work-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.work-card {
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  transition: border-color 150ms var(--ease);
}

.work-card:hover { border-color: var(--accent); }
.work-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.work-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--raised);
}

.work-card .body { padding: 24px; }
.work-card h2 { font-size: 28px; margin: 0 0 8px; }
.work-card p { margin: 0 0 12px; }
.work-card .meta { margin: 0; }

.case-head { max-width: 760px; padding-top: 48px; }

.logo-tile {
  display: inline-flex;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 24px;
  background: #161513;
  border-radius: 12px;
}

.logo-tile img { display: block; height: 48px; width: auto; }

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 32px;
  margin: 40px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  max-width: 760px;
}

.facts dt { font-size: 13px; line-height: 20px; color: var(--muted); }
.facts dd { margin: 0; font-size: 15px; color: var(--ink); }

.case-fig { margin: 48px 0 0; }

.case-fig img,
.case-fig video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--raised);
}

.case-fig.narrow { max-width: 560px; }

.case-fig figcaption,
.shots figcaption {
  margin-top: 12px;
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
}

.shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 32px 0 0;
}

.shots figure { margin: 0; }
.shots img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--raised);
}

.parts {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  gap: 24px;
}

.parts li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 16px;
  max-width: 40rem;
}

.parts h3 { margin: 2px 0 4px; }
.parts p { margin: 0; }

.points {
  margin: 24px 0 0;
  padding-left: 20px;
  max-width: 40rem;
}

.points li { margin-bottom: 12px; }
.points li:last-child { margin-bottom: 0; }

.callout {
  max-width: 40rem;
  margin-top: 32px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.callout h3 { font-size: 20px; margin: 0 0 8px; }
.callout p { margin: 0 0 12px; }
.callout p:last-child { margin-bottom: 0; }

/* Evaluation bars: one accent for the item that matters, the rest neutral */

.bars {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  max-width: 40rem;
}

.bars li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.bars .label { grid-column: 1 / -1; font-size: 14px; line-height: 20px; color: var(--text-2); }

.bars .track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: var(--raised);
}

.bars .fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--muted);
}

.bars li.low .fill { background: var(--accent); }

.bars .track::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -4px;
  bottom: -4px;
  width: 1px;
  background: var(--line);
}

.bars .value {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.scale-note { margin: 12px 0 0; font-size: 13px; line-height: 20px; color: var(--muted); max-width: 40rem; }

/* Architecture flow */

.flow {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.flow li {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}

.flow li:not(:last-child)::after {
  content: "\2192";
  position: absolute;
  right: -24px;
  top: 24px;
  width: 16px;
  text-align: center;
  color: var(--muted);
}

.flow h3 { font-size: 20px; margin: 0 0 8px; }
.flow p { margin: 0; font-size: 14px; line-height: 22px; }

.next-link {
  display: inline-block;
  margin-top: 64px;
  font-size: 15px;
  font-weight: 500;
}

/* Footer */

footer {
  margin-top: 96px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

footer p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

footer a { color: var(--muted); transition: color 150ms var(--ease); }
footer a:hover { color: var(--accent-text); }

/* Privacy page */

.wrap.narrow h1 { font-size: clamp(32px, 5vw, 44px); }
.wrap.narrow h2 { margin-top: 48px; }
.wrap.narrow footer { margin-top: 64px; }

/* Mobile-only download bar */

.sticky-cta { display: none; }

/* Small screens */

@media (max-width: 860px) {
  .wrap { padding: 16px 20px 64px; }

  .hero,
  .how-grid,
  .statement {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .hero { padding-top: 32px; }
  .hero-text { padding-bottom: 0; }
  .hero-phones { height: 400px; }
  .hero-phones figure:first-child { margin-top: 48px; }

  .section { padding-top: 64px; }
  .statement { padding: 32px 24px; }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  footer { margin-top: 64px; }

  .work-list,
  .facts,
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow { gap: 24px; }
  .flow li:not(:last-child)::after {
    content: "\2193";
    right: auto;
    left: 24px;
    top: auto;
    bottom: -24px;
  }
  .shots {
    display: flex;
    gap: 12px;
    margin-inline: -20px;
    padding-inline: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 20px;
  }
  .shots figure { flex: 0 0 78%; scroll-snap-align: start; }
  .case-head { padding-top: 32px; }

  nav.top .nav-links { gap: 16px; }

  .hero .actions { flex-direction: column; align-items: stretch; gap: 12px; }
  .hero .actions .btn { justify-content: center; text-align: center; }
  .hero .actions .link-quiet { text-align: center; padding: 8px 0; }

  .sticky-cta {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 10;
    display: block;
    min-height: 48px;
    padding: 14px 20px;
    border-radius: 12px;
    background: var(--ink);
    color: var(--on-ink);
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 16px rgb(0 0 0 / 0.18);
  }
  body:has(.sticky-cta) .wrap { padding-bottom: 112px; }
}
