/* InboxSauce website. Built to site/DESIGN.md: one accent, warm greys, IBM Plex, an 8 px radius, the spacing scale
   below and nothing off it. Light and dark are each designed. */

@font-face { font-family: "Plex Sans"; src: url("/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("/assets/fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("/assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("/assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  color-scheme: light dark;

  --bg: #FAF9F7;
  --surface: #FFFFFF;
  --sunken: #F2EFEA;
  --border: #E3DED6;
  --text: #1C1A17;
  --muted: #5C564E;
  --faint: #716A61;
  --accent: #B93A1C;
  --accent-hover: #9E2F15;
  --on-accent: #FFFFFF;
  --brass: #A68443;
  --selection: rgb(185 58 28 / 0.16);

  --code-bg: #1C1A17;
  --code-border: #1C1A17;
  --code-bar: #26231F;
  --code-text: #EDE9E2;
  --code-muted: #9C958A;
  --code-string: #FFB59E;
  --code-key: #E8D3A9;
  --code-accent: #FF8A65;

  --sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --t-hero: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
  --t-1: 2.25rem;
  --t-2: 1.5rem;
  --t-3: 1.125rem;
  --t-body: 1.0625rem;
  --t-small: 0.9375rem;
  --t-micro: 0.8125rem;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  --r: 8px;
  --measure: 66ch;
  --gutter: var(--s-4);
  --section: var(--s-8);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141311;
    --surface: #1C1A18;
    --sunken: #100F0E;
    --border: #302C27;
    --text: #EDE9E2;
    --muted: #A69F94;
    --faint: #8C857A;
    --accent: #FF8A65;
    --accent-hover: #FFA285;
    --on-accent: #1C1A17;
    --brass: #D2B06A;
    --selection: rgb(255 138 101 / 0.24);

    --code-bg: #0E0D0C;
    --code-border: #302C27;
    --code-bar: #171614;
  }
}

@media (min-width: 48rem) {
  :root { --gutter: var(--s-6); --section: var(--s-9); }
}

/* Base */

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.6;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--selection); color: var(--text); }

h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: var(--t-1); line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: var(--t-2); line-height: 1.25; letter-spacing: -0.01em; }
h3 { font-size: var(--t-3); line-height: 1.4; }
p { margin: 0; text-wrap: pretty; }

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

code, pre, kbd { font-family: var(--mono); }
:not(pre) > code {
  font-size: 0.875em;
  background: var(--sunken);
  border-radius: 4px;
  padding: 2px 6px;
  overflow-wrap: anywhere;
}

img, svg { display: block; max-width: 100%; }

.container { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 10;
  background: var(--surface);
  color: var(--text);
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.skip-link:focus { top: var(--s-4); }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header */

.site-header { border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand__mark { width: 28px; height: 28px; color: var(--accent); flex: none; }
.brand__name { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1; }

.site-nav ul { display: flex; align-items: center; gap: var(--s-5); margin: 0; padding: 0; list-style: none; }
.site-nav a:not(.button) { color: var(--muted); text-decoration: none; font-size: var(--t-small); font-weight: 500; }
.site-nav a:not(.button):hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav .nav-contact { display: none; }
@media (min-width: 30rem) { .site-nav .nav-contact { display: list-item; } }
/* Narrow phones (320 to 374 px): the header fits without scrolling sideways. */
@media (max-width: 23.4375rem) {
  .site-header .container { gap: var(--s-3); }
  .site-nav ul { gap: var(--s-3); }
  .site-nav .button--small { padding: 0 var(--s-2); }
  .brand { gap: 8px; }
  .brand__mark { width: 24px; height: 24px; }
  .brand__name { font-size: 1rem; }
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 var(--s-4);
  border: 1px solid transparent;
  border-radius: var(--r);
  font: 500 var(--t-small) / 1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.button--primary { background: var(--accent); color: var(--on-accent); }
.button--primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.button--secondary { background: transparent; color: var(--text); border-color: var(--border); }
.button--secondary:hover { border-color: var(--muted); color: var(--text); }
.button--small { height: 34px; padding: 0 var(--s-3); }

.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* Sections */

.section { padding-block: var(--section); border-top: 1px solid var(--border); }
.section:first-child { border-top: 0; }
.section__head { max-width: var(--measure); margin-bottom: var(--s-6); }
.section__head p { margin-top: var(--s-3); color: var(--muted); }

.label {
  display: block;
  margin-bottom: var(--s-3);
  font: 500 var(--t-micro) / 1.5 var(--mono);
  letter-spacing: 0.02em;
  color: var(--faint);
}

.lede { font-size: 1.1875rem; line-height: 1.55; color: var(--muted); max-width: 40ch; }

/* Home: hero */

.hero { padding-block: var(--s-8) var(--section); }
.hero__grid { display: grid; gap: var(--s-7); align-items: start; }
.hero__title { font-size: var(--t-hero); line-height: 1.08; letter-spacing: -0.025em; max-width: 14ch; }
.hero__copy .lede { margin-top: var(--s-5); }
.hero__copy .actions { margin-top: var(--s-6); }
.hero__note { margin-top: var(--s-5); font-size: var(--t-small); color: var(--faint); }
.hero__code { display: grid; gap: var(--s-4); min-width: 0; }

@media (min-width: 60rem) {
  .hero { padding-top: var(--s-9); }
  .hero__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-6); }
  .hero__copy { grid-column: 1 / span 5; padding-top: var(--s-2); }
  .hero__code { grid-column: 6 / span 7; }
}

/* Code blocks: dark in both schemes */

.code {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--r);
  color: var(--code-text);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.04);
  min-width: 0;
}
.code__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: 40px;
  padding: 0 var(--s-2) 0 var(--s-4);
  background: var(--code-bar);
  border-bottom: 1px solid rgb(255 255 255 / 0.06);
}
.code__label { font: 500 var(--t-micro) / 1 var(--mono); letter-spacing: 0.02em; color: var(--code-muted); }
.code__label b { font-weight: 500; color: var(--code-accent); }
.code pre {
  margin: 0;
  padding: var(--s-4);
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.65;
  tab-size: 2;
}
@media (min-width: 48rem) { .code pre { padding: var(--s-4) var(--s-5); font-size: 0.875rem; } }
.code pre:focus-visible { outline-offset: -2px; }
.copy {
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 6px;
  background: transparent;
  color: var(--code-muted);
  font: 500 var(--t-micro) / 1 var(--mono);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}
.copy:hover { color: var(--code-text); border-color: rgb(255 255 255 / 0.28); }
.copy:focus-visible { outline-color: var(--code-accent); }

.t-m { color: var(--code-accent); }
.t-s { color: var(--code-string); }
.t-k { color: var(--code-key); }
.t-c { color: var(--code-muted); }

/* Home: what you get (a spec list, not cards) */

.spec { display: grid; margin: 0; }
.spec__item { padding-block: var(--s-5); border-top: 1px solid var(--border); }
.spec__item:last-child { border-bottom: 1px solid var(--border); }
.spec dt { font-weight: 600; }
.spec dd { margin: var(--s-2) 0 0; color: var(--muted); max-width: 52ch; }
.spec dd code { color: var(--text); }
.spec__tech { display: block; margin-top: var(--s-3); font: 500 var(--t-micro) / 1.5 var(--mono); color: var(--faint); }

@media (min-width: 48rem) {
  .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-7); }
  .spec__item:nth-last-child(2) { border-bottom: 1px solid var(--border); }
}

.split { display: grid; gap: var(--s-6); }
@media (min-width: 60rem) {
  .split { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-6); }
  .split__head { grid-column: 1 / span 4; }
  .split__body { grid-column: 5 / span 8; }
  .split__head .section__head { margin-bottom: 0; }
}

/* Home: how it works */

.steps { display: grid; gap: var(--s-6); margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; max-width: var(--measure); }
.steps li::before {
  content: "0" counter(step);
  display: block;
  margin-bottom: var(--s-3);
  font: 500 var(--t-micro) / 1.5 var(--mono);
  color: var(--accent);
}
.steps h3 { margin-bottom: var(--s-2); }
.steps p { color: var(--muted); }
@media (min-width: 60rem) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); }
}

.event-list { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-4) 0 0; padding: 0; list-style: none; }
.event-list li::before { content: none; }

/* Home: scope and call to action */

.scope p { max-width: 58ch; color: var(--muted); }
.scope .split__body { padding-top: var(--s-1); }
.scope p + p { margin-top: var(--s-4); }
.scope strong { color: var(--text); font-weight: 600; }

.cta { display: grid; gap: var(--s-5); }
.cta p { max-width: var(--measure); color: var(--muted); }
@media (min-width: 60rem) {
  .cta { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: var(--s-6); }
  .cta__text { grid-column: 1 / span 7; }
  .cta .actions { grid-column: 9 / span 4; justify-content: flex-end; }
}
.cta h2 { margin-bottom: var(--s-3); }

/* Page heads (pricing, legal, contact) */

.page-head { padding-block: var(--s-8) var(--s-7); }
.page-head h1 { max-width: 20ch; }
.page-head .lede { margin-top: var(--s-4); max-width: var(--measure); }
.page-head .updated { margin-top: var(--s-4); font-size: var(--t-small); color: var(--faint); }

/* Pricing */

.pricing-top { padding-bottom: var(--section); }

.plans { display: grid; gap: var(--s-4); margin: 0; padding: 0; list-style: none; }
@media (min-width: 48rem) { .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plan {
  display: flex;
  flex-direction: column;
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.plan h2 { font-size: var(--t-3); line-height: 1.4; letter-spacing: 0; }
.plan__price { display: flex; align-items: baseline; gap: var(--s-2); margin-top: var(--s-4); }
.plan__amount { font-size: 2.5rem; line-height: 1; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan__per { color: var(--muted); font-size: var(--t-small); }
.plan__emails { margin-top: var(--s-3); font: 500 var(--t-small) / 1.5 var(--mono); }
.plan__daily { margin-top: var(--s-1); font: 400 var(--t-micro) / 1.5 var(--mono); color: var(--muted); }
.plan__for { margin-top: var(--s-2); color: var(--muted); font-size: var(--t-small); }
.plan .button { margin-top: var(--s-5); align-self: flex-start; }

.includes { display: grid; gap: var(--s-2) var(--s-6); margin: 0; padding: 0; list-style: none; }
@media (min-width: 48rem) { .includes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.includes li { position: relative; padding-left: var(--s-5); }
.includes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 16px;
  height: 16px;
  background: var(--accent);
  -webkit-mask: url("/assets/icons/check.svg") center / 16px 16px no-repeat;
  mask: url("/assets/icons/check.svg") center / 16px 16px no-repeat;
}

.facts { display: grid; gap: var(--s-7); }
@media (min-width: 60rem) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6) var(--s-8); } }
.facts h3 { margin-bottom: var(--s-3); }
.facts p { color: var(--muted); max-width: 52ch; }
.facts p + p { margin-top: var(--s-3); }

/* Long-form pages: terms, privacy, refunds */

.doc { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-7); padding-bottom: var(--section); }
@media (min-width: 60rem) {
  .doc { grid-template-columns: 13rem minmax(0, var(--measure)); gap: var(--s-8); align-items: start; }
  .toc { position: sticky; top: var(--s-5); }
}
.toc h2 { font: 500 var(--t-micro) / 1.5 var(--mono); letter-spacing: 0.02em; color: var(--faint); margin-bottom: var(--s-3); }
.toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s-2); }
.toc a { color: var(--muted); text-decoration: none; font-size: var(--t-small); }
.toc a:hover { color: var(--text); }
.toc .toc__sub { padding-left: var(--s-3); }

.prose { max-width: var(--measure); }
.prose h2 { margin-top: var(--s-7); margin-bottom: var(--s-3); font-size: 1.25rem; scroll-margin-top: var(--s-5); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: var(--s-6); margin-bottom: var(--s-3); font-size: var(--t-3); scroll-margin-top: var(--s-5); }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--s-4); }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: var(--s-2); }
.prose li::marker { color: var(--faint); }
.prose strong { font-weight: 600; }
.prose .part { margin-top: var(--s-8); padding-top: var(--s-6); border-top: 1px solid var(--border); font-size: var(--t-2); }

.table-wrap { margin: 0 0 var(--s-5); overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--t-small); line-height: 1.5; }
th, td { padding: var(--s-3) var(--s-4); text-align: left; vertical-align: top; }
thead th { background: var(--sunken); font-weight: 600; white-space: nowrap; }
tbody tr + tr td, tbody tr + tr th { border-top: 1px solid var(--border); }
tbody th { font-weight: 500; }
td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Contact */

.contact { display: grid; gap: var(--s-7); padding-bottom: var(--section); }
@media (min-width: 60rem) { .contact { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-6); } .contact__main { grid-column: 1 / span 6; } .contact__side { grid-column: 8 / span 5; } }
.contact__email { font-size: min(clamp(1.5rem, 1.2rem + 1.4vw, 2rem), calc((100vw - 2rem) / 15.5)); font-weight: 600; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.contact__main p { color: var(--muted); max-width: 52ch; }
.contact__main p + p, .contact__email + p { margin-top: var(--s-4); }
.contact__side h2 { font-size: var(--t-3); line-height: 1.4; letter-spacing: 0; margin-bottom: var(--s-3); }
.contact__side address { font-style: normal; color: var(--muted); }
.contact__side ul { margin: 0; padding-left: 1.25em; color: var(--muted); }
.contact__side ul li + li { margin-top: var(--s-2); }
.contact__side section + section { margin-top: var(--s-6); }

/* Footer */

.site-footer { border-top: 1px solid var(--border); padding-block: var(--s-7) var(--s-8); color: var(--faint); font-size: var(--t-small); }
.site-footer .trading { color: var(--muted); max-width: var(--measure); }
.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--text); }
.site-footer nav ul { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: var(--s-5) 0 0; padding: 0; list-style: none; }
.site-footer nav a { text-decoration: none; }
.site-footer .copyright { margin-top: var(--s-5); }
.site-footer .made-by { margin-top: var(--s-2); }
/* Twinade's crown, the maker's signature: its official mark at the text's size, never redrawn or stretched, in
   Twinade brass (--brass, light and dark above). The words keep the footer's own colour. */
.made-by__mark { display: inline-block; width: 1em; height: 1em; margin-inline-end: var(--s-2); vertical-align: -0.125em; stroke: var(--brass); }

/* 404 */

.not-found { padding-block: var(--s-9) var(--s-10); }
.not-found p { margin-top: var(--s-4); color: var(--muted); max-width: var(--measure); }
.not-found .actions { margin-top: var(--s-6); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
