/* merle.io — one stylesheet for all pages. Tokens first, then base, then components. */

:root {
  --canvas: #fbfbfa;
  --surface: #f3f3f1;
  --hairline: #e2e3e0;
  --ink: #1a1c1e;
  --ink-2: #5b6066;
  --merle: #3e5c8f;
  --merle-2: #2f4a78;
  --radius: 2px;
  --gutter: 24px;
  --container: 1120px;
  --measure: 64ch;
  --fs-0: 13px;
  --fs-1: 15px;
  --fs-2: 17px;
  --fs-3: 21px;
  --fs-4: 27px;
  --fs-5: 34px;
  --fs-6: 44px;
  --fs-7: 56px;
}

@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin.woff2?v=3f1960e") format("woff2");
  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: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin-ext.woff2?v=3f1960e") format("woff2");
  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;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/schibsted-grotesk-italic-latin.woff2?v=3f1960e") format("woff2");
  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: "Schibsted Grotesk";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/schibsted-grotesk-italic-latin-ext.woff2?v=3f1960e") format("woff2");
  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;
}

/* Base */

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

html {
  font-size: var(--fs-2);
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: var(--fs-2);
  line-height: 1.55;
  font-feature-settings: "kern" 1;
  text-rendering: optimizeLegibility;
}

::selection { background: #d4dcea; color: var(--ink); }

h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: var(--fs-7); line-height: 1.05; }
h2 { font-size: var(--fs-5); line-height: 1.15; }
h3 { font-size: var(--fs-3); line-height: 1.3; letter-spacing: -0.005em; }
p { margin: 0 0 1em; max-width: var(--measure); }
p, li, figcaption, .roster__desc { overflow-wrap: anywhere; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; max-width: var(--measure); }
li { margin-bottom: 0.35em; }
strong { font-weight: 700; }
small, .small { font-size: var(--fs-1); color: var(--ink-2); }
img, video { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--hairline); margin: 0; }

a {
  color: var(--merle);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--merle) 45%, transparent);
}
a:hover { color: var(--merle-2); text-decoration-color: currentColor; }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.skip {
  position: absolute; left: var(--gutter); top: -100px;
  background: var(--ink); color: var(--canvas); padding: 8px 12px; border-radius: var(--radius);
  z-index: 3; text-decoration: none;
}
.skip:focus { top: 12px; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--merle);
  outline-offset: 3px;
  border-radius: var(--radius);
}

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

/* Header */

.site-header {
  border-bottom: 1px solid var(--hairline);
  background: var(--canvas);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 24px;
}
.wordmark {
  font-weight: 700;
  font-size: var(--fs-3);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover { color: var(--ink); text-decoration: none; }
.site-nav ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; max-width: none; }
.site-nav li { margin: 0; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: var(--fs-1); }
.site-nav a:hover { text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--ink-2); }
.nav-toggle {
  display: none;
  appearance: none;
  background: none;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-1);
  padding: 6px 12px;
  cursor: pointer;
}

@media (max-width: 719px) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--canvas); border-bottom: 1px solid var(--hairline); z-index: 2; }
  .site-nav[data-open="true"] { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px; }
  .site-nav a { display: block; padding: 10px 0; font-size: var(--fs-2); }
  .site-header { position: relative; }
}

/* Sections */

main > section, .section { padding: 72px 0; border-bottom: 1px solid var(--hairline); }
main > section:last-child { border-bottom: 0; }
.section-title { margin-bottom: 32px; }

.hero { padding: 80px 0 64px; }
.hero h1 { max-width: 20ch; margin-bottom: 20px; }
.hero .deck { font-size: var(--fs-3); line-height: 1.45; color: var(--ink-2); max-width: 46ch; margin-bottom: 48px; }

/* Ledger: the operations table in the hero */

.ledger {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--hairline);
}
.ledger caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ledger th, .ledger td {
  text-align: left;
  vertical-align: top;
  padding: 14px 24px 14px 0;
  border-bottom: 1px solid var(--hairline);
}
.ledger th { font-weight: 500; font-size: var(--fs-1); color: var(--ink-2); padding-top: 12px; padding-bottom: 10px; }
.ledger th:last-child, .ledger td:last-child { padding-right: 0; }
.ledger td { font-size: var(--fs-2); }
.ledger .ledger__name a { font-weight: 500; }
.ledger .ledger__for { color: var(--ink-2); }
.ledger .ledger__since { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ledger .ledger__status { white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 8px; }
.status::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--merle);
  flex: none;
}
.status--off::before { background: transparent; border: 1px solid var(--ink-2); box-sizing: border-box; }

@media (max-width: 639px) {
  .ledger thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ledger tr { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
  .ledger td { display: block; border: 0; padding: 0; }
  .ledger .ledger__for, .ledger .ledger__since { font-size: var(--fs-1); color: var(--ink-2); }
  .ledger .ledger__status { grid-column: 2; grid-row: 1 / span 3; align-self: start; font-size: var(--fs-1); }
  .ledger .ledger__since::before { content: "Since "; }
}

/* Product rows */

.product { padding: 56px 0; border-bottom: 1px solid var(--hairline); }
.product:last-child { border-bottom: 0; }
.product .container {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 48px;
  align-items: start;
}
.product h3 { font-size: var(--fs-4); margin-bottom: 12px; }
.product p { margin-bottom: 0.75em; }
.product .product__link { display: inline-block; margin-top: 8px; }
.frame {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.frame img { width: 100%; height: auto; }
.frame figcaption { font-size: var(--fs-1); color: var(--ink-2); padding: 10px 14px; border-top: 1px solid var(--hairline); }
.frame--text {
  display: flex; align-items: center; gap: 16px;
  padding: 24px; aspect-ratio: 16 / 10;
}
.frame--text img { width: 48px; height: 48px; border-radius: var(--radius); }
.frame--text p { color: var(--ink-2); font-size: var(--fs-1); }

@media (max-width: 899px) {
  .product .container { grid-template-columns: 1fr; gap: 24px; }
  .product .frame { order: -1; }
}

/* Two-column prose with a side heading */

.split .container { display: grid; grid-template-columns: 4fr 8fr; gap: 48px; align-items: start; }
.split h2 { font-size: var(--fs-4); }
.prose-cols { columns: 2; column-gap: 40px; }
.prose-cols p { break-inside: avoid; max-width: none; margin-bottom: 1.25em; }
.prose-cols p:last-child { margin-bottom: 0; }
.prose-cols strong { font-weight: 500; }

@media (max-width: 899px) {
  .split .container { grid-template-columns: 1fr; gap: 20px; }
  .prose-cols { columns: 1; }
}

/* Lists on Labs: name | description | status */

.roster { list-style: none; margin: 0; padding: 0; max-width: none; border-top: 1px solid var(--hairline); }
.roster li {
  display: grid;
  grid-template-columns: 180px 1fr 190px;
  gap: 24px;
  padding: 14px 0;
  margin: 0;
  border-bottom: 1px solid var(--hairline);
}
.roster .roster__name { font-weight: 500; }
.roster .roster__desc { color: var(--ink); }
.roster .roster__desc p { max-width: none; }
.roster .roster__status { color: var(--ink-2); font-size: var(--fs-1); text-align: right; }
.roster .roster__status .status { gap: 7px; }
.roster .roster__status .status::before { width: 7px; height: 7px; }

@media (max-width: 719px) {
  .roster li { grid-template-columns: 1fr; gap: 4px; }
  .roster .roster__status { text-align: left; }
}

/* Long-form page (privacy) */

.page { padding: 64px 0; }
.page h1 { font-size: var(--fs-6); margin-bottom: 8px; }
.page .meta { color: var(--ink-2); font-size: var(--fs-1); margin-bottom: 40px; }
.page h2 { font-size: var(--fs-4); margin: 40px 0 12px; }
.page h3 { font-size: var(--fs-3); margin: 24px 0 8px; }
.page .lede { font-size: var(--fs-3); color: var(--ink-2); line-height: 1.45; margin-bottom: 40px; max-width: 46ch; }

/* Contact */

.contact p { font-size: var(--fs-3); line-height: 1.45; max-width: 46ch; }
.contact .addresses { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px 40px; }
.contact .addresses li { margin: 0; }
.contact .addresses small { display: block; }

/* Footer */

.site-footer { border-top: 1px solid var(--hairline); padding: 28px 0 40px; font-size: var(--fs-1); color: var(--ink-2); }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--ink); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; max-width: none; }
.site-footer li { margin: 0; }

/* Breakpoints for display type */

@media (max-width: 899px) {
  h1 { font-size: var(--fs-6); }
  h2 { font-size: var(--fs-4); }
  main > section, .section { padding: 56px 0; }
  .hero { padding: 56px 0 48px; }
}
@media (max-width: 599px) {
  h1 { font-size: var(--fs-5); }
  .hero .deck { font-size: var(--fs-2); }
  .product h3 { font-size: var(--fs-3); }
}

/* Print */

@media print {
  .site-header, .nav-toggle, .site-footer ul { display: none; }
  a { color: var(--ink); }
  .frame { break-inside: avoid; }
}
