/* Memfis — single stylesheet, no build step. Keep it that way until it hurts.
 *
 * Direction: dark, quiet, data-literate. One accent, used sparingly. The only
 * decorative gesture on a page is the violet→teal hairline under the hero;
 * everything else earns its place. Figures are tabular so prices and numbers
 * line up in a column. */

:root {
  --bg: #0b0d14;
  --bg-alt: #0e111a;
  --surface: #11141e;
  --surface-2: #161a26;
  --border: #1e2331;
  --border-strong: #2b3244;

  --text: #e7eaf2;
  --text-soft: #9aa2b8;
  --text-faint: #6b7488;

  --accent: #6b78f0;
  --accent-hover: #808bf5;
  --accent-quiet: #1a1e3a;
  --data: #43c9b0;

  --radius: 10px;
  --radius-lg: 14px;
  --max: 1080px;
  --narrow: 660px;

  color-scheme: dark light;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --bg-alt: #f7f8fb;
    --surface: #ffffff;
    --surface-2: #f4f6fa;
    --border: #e3e6ee;
    --border-strong: #cbd1de;

    --text: #12151d;
    --text-soft: #5b6376;
    --text-faint: #868d9e;

    --accent: #4551e0;
    --accent-hover: #3540c9;
    --accent-quiet: #eceefc;
    --data: #17917d;
  }
}

:root[data-theme="light"] {
  --bg: #ffffff; --bg-alt: #f7f8fb; --surface: #ffffff; --surface-2: #f4f6fa;
  --border: #e3e6ee; --border-strong: #cbd1de;
  --text: #12151d; --text-soft: #5b6376; --text-faint: #868d9e;
  --accent: #4551e0; --accent-hover: #3540c9; --accent-quiet: #eceefc; --data: #17917d;
}

:root[data-theme="dark"] {
  --bg: #0b0d14; --bg-alt: #0e111a; --surface: #11141e; --surface-2: #161a26;
  --border: #1e2331; --border-strong: #2b3244;
  --text: #e7eaf2; --text-soft: #9aa2b8; --text-faint: #6b7488;
  --accent: #6b78f0; --accent-hover: #808bf5; --accent-quiet: #1a1e3a; --data: #43c9b0;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.18; letter-spacing: -0.022em; font-weight: 500; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.container--narrow { max-width: var(--narrow); }
.center { text-align: center; }
.muted { color: var(--text-soft); }
.link { color: var(--accent); font-weight: 500; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header__inner { display: flex; align-items: center; gap: 28px; height: 62px; }
.header__brand { color: var(--text); font-weight: 600; font-size: 17px; letter-spacing: -0.03em; }
.header__brand:hover { color: var(--text); }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav__link { color: var(--text-soft); font-size: 14.5px; }
.nav__link:hover { color: var(--text); }
.nav__link.is-active { color: var(--text); }

/* Sections */
.main { min-height: 60vh; }
.section { padding: 76px 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section__title { font-size: 15px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 28px; font-weight: 500; }
.page__title { font-size: clamp(30px, 4.4vw, 42px); margin: 0 0 14px; }
.page__lead { color: var(--text-soft); font-size: 18px; max-width: 58ch; margin: 0 0 40px; }

/* Bento home page — the whole page is one grid.
 * auto-flow: dense lets small tiles slide into the hole an odd number of
 * products would otherwise leave, so the layout survives 1, 3 or 7 products. */
.bento-page { padding: 40px 0 0; }
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: 12px;
}
.tile {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px;
  color: inherit;
}
.tile--wide { grid-column: span 2; }
.tile--hero { grid-column: 1 / -1; padding: 46px 40px 40px; gap: 0; }
/* A full-width closing strip: label and text side by side rather than stacked,
   so a one-line tile does not pretend to be a card. */
.tile--strip { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 20px; padding: 18px 22px; }
.tile--strip .tile__label { flex: none; }

a.tile { text-decoration: none; }
a.tile:hover { border-color: var(--border-strong); color: inherit; }
a.tile:hover .tile__more { color: var(--accent-hover); }

/* The one decorative gesture on the site: a gradient rule above the headline */
.tile__rule {
  width: 76px; height: 2px; border-radius: 2px; margin-bottom: 26px;
  background: linear-gradient(90deg, var(--accent), var(--data));
}
.tile__headline { font-size: clamp(34px, 5vw, 52px); margin: 0 0 18px; max-width: 17ch; letter-spacing: -0.035em; }
.tile__lead { color: var(--text-soft); font-size: 18px; max-width: 56ch; margin: 0 0 30px; }
.tile__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.tile__label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.11em; color: var(--text-faint); font-weight: 500; }
.tile__head { display: flex; align-items: center; gap: 10px; }
.tile__name { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; color: var(--text); }
.tile__name--sm { font-size: 17px; line-height: 1.35; }
.tile__text { color: var(--text-soft); font-size: 14.5px; }
.tile__more { margin-top: auto; padding-top: 12px; font-size: 14px; font-weight: 500; color: var(--accent); }
.tile__chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 4px 0 0; }
.tile__chips li { font-size: 12.5px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); }

.tile--accent { background: var(--accent); border-color: var(--accent); }
.tile--accent .tile__name { color: #fff; }
.tile--accent .tile__text { color: #dfe2ff; }
.tile--accent .tile__more { color: #fff; }
a.tile--accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
a.tile--accent:hover .tile__more { color: #fff; }

/* Buttons */
.btn {
  display: inline-block; padding: 11px 20px; font-size: 14.5px; font-weight: 500;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  color: var(--text); background: var(--surface);
}
.btn:hover { color: var(--text); border-color: var(--text-faint); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; margin-bottom: 28px; }
.card, .feature, .tier {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.card { display: flex; flex-direction: column; }
.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card__title { font-size: 19px; margin: 0; }
.card__text { color: var(--text-soft); font-size: 14.5px; margin: 0 0 16px; }
.card__chains { color: var(--text-faint); font-size: 12.5px; margin: 0 0 18px; letter-spacing: 0.01em; }
.card__link { font-size: 14.5px; font-weight: 500; margin-top: auto; }
.feature__title { font-size: 17px; margin: 0 0 8px; }
.feature__text { color: var(--text-soft); font-size: 14.5px; margin: 0; }

.group { margin-bottom: 56px; }
.group:last-child { margin-bottom: 0; }
.group__title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); margin: 0 0 18px; font-weight: 500; padding-bottom: 10px; border-bottom: 1px solid var(--border); }

/* Status badges and chain chips */
.badge {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 500;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text-soft); white-space: nowrap;
}
.badge--beta { border-color: var(--data); color: var(--data); }
.badge--soon { border-color: var(--accent); color: var(--accent); }
.badge--sunset, .badge--retired { border-color: var(--border-strong); color: var(--text-faint); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; margin: 26px 0 0; }
.chip { font-size: 12.5px; padding: 4px 11px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); background: var(--surface); }

/* Product page */
.product__head { padding: 84px 0 56px; border-bottom: 1px solid var(--border); }
.product__category { color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.1em; font-size: 12.5px; margin: 0 0 14px; font-weight: 500; }
.product__title { font-size: clamp(34px, 5vw, 50px); margin: 0 0 14px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; letter-spacing: -0.035em; }
.product__tagline { color: var(--text-soft); font-size: 19px; max-width: 56ch; margin: 0 0 30px; }
.product__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Pricing */
.tier--highlight { border-color: var(--accent); }
.tier__name { font-size: 15px; margin: 0 0 10px; color: var(--text-soft); font-weight: 500; }
.tier__price { font-size: 34px; font-weight: 500; margin: 0 0 20px; letter-spacing: -0.03em; }
.tier__period { font-size: 14px; font-weight: 400; color: var(--text-faint); margin-left: 5px; letter-spacing: 0; }
.tier__list { list-style: none; padding: 0; margin: 0 0 22px; color: var(--text-soft); font-size: 14.5px; }
.tier__list li { padding: 9px 0; border-bottom: 1px solid var(--border); }
.tier__list li:last-child { border-bottom: 0; }

/* Prose (rendered Markdown) */
.prose { max-width: 68ch; font-size: 17px; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: 34px; margin: 0 0 18px; }
.prose h2 { font-size: 25px; margin: 48px 0 14px; }
.prose h3 { font-size: 19px; margin: 34px 0 10px; }
.prose p, .prose li { color: var(--text-soft); }
.prose strong { color: var(--text); font-weight: 500; }
.prose ol, .prose ul { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.86em;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--text);
}
.prose pre { background: var(--surface-2); border: 1px solid var(--border); padding: 18px; border-radius: var(--radius); overflow-x: auto; font-size: 14px; }
.prose pre code { border: 0; padding: 0; background: none; font-size: inherit; }
.prose blockquote { border-left: 2px solid var(--accent); margin: 26px 0; padding-left: 18px; color: var(--text-soft); }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.prose a:hover { text-decoration-color: currentColor; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { border-bottom: 1px solid var(--border); padding: 10px 12px 10px 0; text-align: left; }
.prose th { color: var(--text); font-weight: 500; }
.prose td { color: var(--text-soft); }

/* Blog */
.posts { list-style: none; padding: 0; margin: 0; }
.post { padding: 28px 0; border-bottom: 1px solid var(--border); }
.post:first-child { padding-top: 0; }
.post__date, .postlist__date { color: var(--text-faint); font-size: 13.5px; }
.post__title { font-size: 23px; margin: 8px 0 10px; }
.post__title a { color: var(--text); }
.post__title a:hover { color: var(--accent); }
.post__summary { color: var(--text-soft); margin: 0; }
.post__tags { color: var(--text-faint); font-size: 13px; margin: 12px 0 0; }
.post__meta { color: var(--text-faint); font-size: 14px; margin-bottom: 34px; }
.postlist { list-style: none; padding: 0; margin: 0; }
.postlist__item { display: flex; gap: 20px; align-items: baseline; padding: 15px 0; border-bottom: 1px solid var(--border); }
.postlist__item:last-child { border-bottom: 0; }
.postlist__date { flex: none; min-width: 92px; }
.postlist__link { color: var(--text); font-weight: 500; }
.postlist__link:hover { color: var(--accent); }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.tag { font-size: 13px; padding: 5px 13px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); }
.tag:hover { color: var(--text); border-color: var(--border-strong); }
.tag.is-active { border-color: var(--accent); color: var(--accent); }
.pager { display: flex; gap: 12px; margin-top: 40px; }
.breadcrumb { color: var(--text-faint); font-size: 14px; margin-bottom: 28px; }
.breadcrumb a { color: var(--text-faint); }
.breadcrumb a:hover { color: var(--text); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 13.5px; color: var(--text-soft); }
.field__input {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); padding: 12px 14px; font: inherit; font-size: 15px; width: 100%;
}
.field__input::placeholder { color: var(--text-faint); }
.field__input:hover { border-color: var(--border-strong); }
.field__input:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea.field__input { resize: vertical; min-height: 120px; }
.form__note { color: var(--text-faint); font-size: 13px; margin: 0; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 13px 17px; border-radius: var(--radius); border: 1px solid var(--border-strong); font-size: 15px; margin: 0 0 28px; }
.notice--ok { border-color: var(--data); color: var(--data); }
.notice--error { border-color: #e05563; color: #e05563; }

/* Error page */
.error__code { font-size: 15px; font-weight: 500; letter-spacing: 0.16em; color: var(--text-faint); margin: 0 0 18px; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 76px; }
.footer__inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.footer__copy { color: var(--text-faint); font-size: 13.5px; margin: 0; }
.footer__nav { display: flex; gap: 22px; font-size: 13.5px; }
.footer__nav a { color: var(--text-soft); }
.footer__nav a:hover { color: var(--text); }

@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile--wide { grid-column: span 2; }
}

@media (max-width: 720px) {
  .container { padding: 0 20px; }
  .bento-page { padding-top: 24px; }
  .bento { grid-template-columns: 1fr; }
  .tile--wide, .tile--hero { grid-column: 1 / -1; }
  .tile--hero { padding: 32px 24px 28px; }
  .section { padding: 56px 0; }
  .product__head { padding: 56px 0 40px; }
  .header__inner { height: auto; padding: 12px 0; flex-wrap: wrap; gap: 14px; }
  .nav { margin-left: 0; gap: 18px; }
  .postlist__item { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
