/* Merian design system, shared by every merianlabs.com site.
   Direction from rua de cima: calm and precise, restrained neutrals, one accent,
   hierarchy from type and hairlines rather than cards and shadows.
   A site only sets its accent: <body data-brand="blue|plum|ember">. */

/* Instrument Sans, SIL Open Font License 1.1. */
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400 600;
  src: url('/fonts/instrument-sans-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400 600;
  src: url('/fonts/instrument-sans-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

/* Tokens */
:root {
  color-scheme: light dark;

  --font-sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --bg: light-dark(#ffffff, #161718);
  --surface: light-dark(#ffffff, #1d1e20);
  --surface-muted: light-dark(#f0f1f3, #26272a);
  --ink: light-dark(#18191b, #f0f1f2);
  --ink-2: light-dark(#5b5d62, #a6a8ad);
  --ink-3: light-dark(#8a8d93, #878a8f);
  --line: light-dark(#e4e5e8, #2c2d30);
  --line-strong: light-dark(#d0d2d6, #3b3d41);
  --ring: light-dark(rgb(24 25 27 / 9%), rgb(255 255 255 / 10%));
  --ok: light-dark(#2a6247, #7fbf9b);
  --warn: light-dark(#7e5510, #d9ae63);
  --alert: light-dark(#8f3524, #e08b76);

  /* Default accent: rua de cima's blue. */
  --brand: light-dark(#0f5a7a, #5fa8c7);
  --brand-ink: light-dark(#0a445e, #a9d4e6);
  --brand-wash: light-dark(#eaf1f5, #17303b);
  --brand-contrast: light-dark(#ffffff, #0d1b22);

  --shade-soft: light-dark(rgb(24 25 27 / 5%), rgb(0 0 0 / 40%));
  --shade-cast: light-dark(rgb(24 25 27 / 24%), rgb(0 0 0 / 70%));
  --shadow-raised: 0 0 0 1px var(--ring), 0 1px 2px var(--shade-soft), 0 6px 16px -10px var(--shade-cast);

  --radius: 0.5rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.75rem;

  --page: 1200px;
  --measure: 65ch;
  --gutter: 1.25rem;
  --chapter-gap: 7rem;
  --ease: cubic-bezier(0.2, 0.6, 0.25, 1);
}

/* Accents. Each lightens in dark to hold contrast at the same hue. */
[data-brand='blue'] {
  --brand: light-dark(#1d4f9c, #7fa6e8);
  --brand-ink: light-dark(#163d79, #b9cdf2);
  --brand-wash: light-dark(#ecf1fa, #172238);
  --brand-contrast: light-dark(#ffffff, #0e1729);
}
[data-brand='plum'] {
  --brand: light-dark(#7a2e4f, #d98aac);
  --brand-ink: light-dark(#5e223c, #edc0d3);
  --brand-wash: light-dark(#f7edf1, #331b26);
  --brand-contrast: light-dark(#ffffff, #23101a);
}
[data-brand='ember'] {
  --brand: light-dark(#a8420e, #ee9a66);
  --brand-ink: light-dark(#83330a, #f6c4a3);
  --brand-wash: light-dark(#fbefe7, #36210f);
  --brand-contrast: light-dark(#ffffff, #261406);
}

[data-brand='pine'] {
  --brand: light-dark(#1f6b4a, #74c9a0);
  --brand-ink: light-dark(#175239, #b5e4cc);
  --brand-wash: light-dark(#eaf5ef, #14291f);
  --brand-contrast: light-dark(#ffffff, #0b1a13);
}

[data-surface='inverse'] { color-scheme: dark; }

@media (min-width: 60rem) {
  :root { --gutter: 2rem; --chapter-gap: 10.5rem; }
}

/* Type scale: tracking tightens as size grows. */
.t-hero { font-size: clamp(2.625rem, 5vw, 3.75rem); line-height: 1; letter-spacing: -0.05em; font-weight: 480; }
.t-display { font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.04; letter-spacing: -0.04em; font-weight: 480; }
.t-title { font-size: clamp(1.75rem, 3.4vw, 2.25rem); line-height: 1.1; letter-spacing: -0.035em; font-weight: 480; }
.t-figure { font-size: 1.625rem; line-height: 1.2; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.t-lead { font-size: 1.125rem; line-height: 1.4; letter-spacing: -0.01em; }
.t-body { font-size: 1rem; line-height: 1.5; letter-spacing: -0.01em; }
.t-detail { font-size: 0.875rem; line-height: 1.4; }
.t-note { font-size: 0.75rem; line-height: 1.4; }
.ink-2 { color: var(--ink-2); }
.ink-3 { color: var(--ink-3); }
.medium { font-weight: 480; }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
a { color: var(--brand); text-underline-offset: 0.2em; }
a:hover { color: var(--brand-ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

.page { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: var(--measure); }

/* Bar */
.bar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.bar .page { display: flex; align-items: center; justify-content: space-between; height: 3.5rem; }
.wordmark { color: var(--ink); text-decoration: none; font-weight: 480; letter-spacing: -0.02em; }
.wordmark span { color: var(--brand); }
.wordmark:hover { color: var(--ink); }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 2.75rem; padding: 0 1.125rem;
  border-radius: var(--radius); border: 1px solid transparent;
  background: var(--brand); color: var(--brand-contrast);
  font: inherit; font-weight: 480; text-decoration: none; cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.button:hover { background: var(--brand-ink); color: var(--brand-contrast); }
.button.quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.button.quiet:hover { background: var(--surface-muted); color: var(--ink); }
.button.small { height: 2.25rem; padding: 0 0.875rem; font-size: 0.875rem; }
.button.wide { width: 100%; }

/* Hero: text beside the product at work. */
.hero { display: grid; gap: 3rem; padding: 4rem 0 0; align-items: center; }
.hero-text { display: grid; gap: 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; }
@media (min-width: 60rem) {
  .hero { grid-template-columns: 1fr 1.05fr; gap: 4rem; padding-top: 6rem; }
}

/* The stage holds an example of the product. */
.stage { background: var(--surface-muted); border-radius: var(--radius-2xl); padding: clamp(1.25rem, 3vw, 2.5rem); }
.sheet { background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-raised); overflow: hidden; }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.sheet-row { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; align-items: center; padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--line); }
.sheet-row:last-child { border-bottom: 0; }
.sheet-foot { padding: 0.75rem 1.25rem; background: var(--surface-muted); }
.badge {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.125rem 0.5rem; border-radius: 999px;
  font-size: 0.75rem; line-height: 1.4; white-space: nowrap;
  background: var(--surface-muted); color: var(--ink-2);
}
.badge.brand { background: var(--brand-wash); color: var(--brand-ink); }
.badge.ok { background: color-mix(in oklab, var(--ok) 12%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in oklab, var(--warn) 12%, transparent); color: var(--warn); }
.badge.alert { background: color-mix(in oklab, var(--alert) 12%, transparent); color: var(--alert); }
.example-label { margin-top: 0.75rem; text-align: center; }

/* Chapters: eyebrow, heading, line. */
.chapter { padding-top: var(--chapter-gap); }
.chapter-head { display: grid; gap: 1rem; margin-bottom: 3rem; }
.eyebrow { font-size: 0.875rem; font-weight: 480; color: var(--brand); }
@media (min-width: 60rem) {
  .chapter-head.split { grid-template-columns: 1fr 1fr; gap: 4rem; align-items: end; }
}

/* Columns separated by a hairline on top, never boxed. */
.columns { display: grid; gap: 2rem; }
.columns > * { border-top: 1px solid var(--line); padding-top: 1.25rem; display: grid; gap: 0.5rem; align-content: start; }
@media (min-width: 44rem) { .columns { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60rem) { .columns.three { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }

/* Numbered list of pains or steps. */
.numbered { list-style: none; padding: 0; counter-reset: item; display: grid; }
.numbered li { counter-increment: item; display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem; padding: 1.25rem 0; border-top: 1px solid var(--line); }
.numbered li:last-child { border-bottom: 1px solid var(--line); }
.numbered li::before { content: counter(item, decimal-leading-zero); color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 0.875rem; padding-top: 0.2rem; }

/* Pricing */
.plans { display: grid; gap: 1rem; }
@media (min-width: 44rem) { .plans { grid-template-columns: repeat(2, 1fr); } }
.plan { display: grid; gap: 1.25rem; align-content: start; padding: 1.75rem; border-radius: var(--radius-xl); box-shadow: var(--shadow-raised); background: var(--surface); }
.plan[data-featured] { box-shadow: 0 0 0 2px var(--brand), 0 6px 16px -10px var(--shade-cast); }
.plan-price { display: flex; align-items: baseline; gap: 0.375rem; }
.plan-price .t-display { font-variant-numeric: tabular-nums; }
.plan ul { list-style: none; padding: 0; display: grid; gap: 0.5rem; color: var(--ink-2); }
.plan li { display: grid; grid-template-columns: 1.25rem 1fr; }
.plan li::before { content: '—'; color: var(--ink-3); }

/* Form */
.form-panel { display: grid; gap: 2rem; }
@media (min-width: 60rem) { .form-panel { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.form { display: grid; gap: 1.125rem; }
.field { display: grid; gap: 0.375rem; }
.field label { font-size: 0.875rem; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 2.75rem; padding: 0.625rem 0.75rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit;
}
.field textarea { min-height: 5.5rem; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.honeypot { position: absolute; left: -9999px; }
.notice { display: none; padding: 1rem 1.125rem; border-radius: var(--radius); background: var(--brand-wash); color: var(--brand-ink); }
.notice.alert { background: color-mix(in oklab, var(--alert) 10%, var(--bg)); color: var(--alert); }

/* Questions */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem 0; cursor: pointer; list-style: none; font-weight: 480; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--ink-3); transition: transform 150ms var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 1.25rem; color: var(--ink-2); max-width: var(--measure); }

/* Footer: a dark band in both themes, with the wordmark clipped at its foot. */
.footer { margin-top: var(--chapter-gap); background: var(--bg); color: var(--ink-2); overflow: hidden; border-top: 1px solid var(--line); }
.footer .page { display: grid; gap: 1.5rem; padding-top: 3rem; }
.footer a { color: var(--ink); }
.footer-mark { font-size: clamp(4rem, 15vw, 12rem); line-height: 0.8; letter-spacing: -0.06em; font-weight: 480; color: var(--surface-muted); margin-bottom: -0.12em; white-space: nowrap; }

/* A vertical run of text blocks. */
.stack { display: grid; gap: 1rem; align-content: start; }
.chapter-head > div { display: grid; gap: 0.75rem; align-content: start; }
