@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-display: swap; src: url("assets/fonts/BricolageGrotesque-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 500; font-display: swap; src: url("assets/fonts/HankenGrotesk-Medium.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 600; font-display: swap; src: url("assets/fonts/HankenGrotesk-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Spline Sans Mono"; font-weight: 500; font-display: swap; src: url("assets/fonts/SplineSansMono-Medium.woff2") format("woff2"); }

:root {
    --ink: #1c2436;
    --ink-deep: #0f121c;
    --ink-line: #2b3650;
    --paper: #faf7f1;
    --paper-2: #f3eee4;
    --paper-line: #dcd6c9;
    --text: #1c2436;
    --muted: #5d5c68;
    --vermilion: #e8562f;
    --vermilion-ink: #b83d1c;
    --peach: #f3b39d;
    --bg: var(--paper);
    --card: #fffdf9;
    --line: var(--paper-line);
    --link: var(--vermilion-ink);
    --accent-text: var(--vermilion-ink);
    --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
    --body: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
    --mono: "Spline Sans Mono", ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #16181f;
        --card: #1d2029;
        --line: #2b3042;
        --text: #e9e5dc;
        --muted: #9b9aa4;
        --link: var(--peach);
        --paper-2: #1d2029;
        --accent-text: var(--vermilion);
    }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 500 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
code { font-family: var(--mono); font-size: 0.88em; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
h2 { font-size: clamp(30px, 4vw, 44px); }
h3 { font-size: 20px; margin-bottom: 8px; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.eyebrow { font: 600 13px/1 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 18px; }
.hero .eyebrow { color: #f06a44; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Hero */
.hero {
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(232, 86, 47, 0.28), transparent 60%),
        radial-gradient(700px 400px at -10% 110%, rgba(43, 54, 80, 0.9), transparent 70%),
        var(--ink);
    color: #f3eee4;
    padding-bottom: 96px;
    overflow: hidden;
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font: 600 22px var(--display); }
.brand img { border-radius: 8px; box-shadow: 0 0 0 1px var(--ink-line); }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: #c9c6d0; text-decoration: none; font-weight: 600; font-size: 15px; }
.nav-links a:hover { color: #fff; }

.hero-body { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; padding-top: 56px; }
.hero h1 { font-size: clamp(42px, 6vw, 72px); }
.hero h1 em { font-style: normal; color: var(--vermilion); position: relative; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.04em; height: 0.08em; background: var(--vermilion); border-radius: 1em; opacity: 0.5; }
.lede { font-size: 19px; color: #c9c6d0; max-width: 34em; margin: 24px 0 32px; }

.install { background: var(--ink-deep); border: 1px solid var(--ink-line); border-radius: 14px; overflow: hidden; max-width: 560px; }
.tabs { display: flex; border-bottom: 1px solid var(--ink-line); }
.tabs button { flex: 1; background: none; border: 0; color: #8d93a6; font: 600 14px var(--body); padding: 11px 8px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: #f3eee4; }
.tabs button[aria-selected="true"] { color: #f3eee4; border-bottom-color: var(--vermilion); }
.cmd { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.cmd code { flex: 1; white-space: pre; overflow-x: auto; color: #f3eee4; font-size: 14px; line-height: 1.7; }
.copy { background: var(--ink-line); color: #f3eee4; border: 0; border-radius: 8px; font: 600 13px var(--body); padding: 7px 12px; cursor: pointer; }
.copy:hover { background: #3a4868; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button { display: inline-flex; align-items: center; padding: 13px 22px; border-radius: 999px; font-weight: 600; text-decoration: none; transition: transform 0.15s, background 0.15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--vermilion-ink); color: #fff; box-shadow: 0 8px 24px -8px rgba(232, 86, 47, 0.7); }
.button.primary:hover { background: #a3361a; }
.button.ghost { color: inherit; box-shadow: inset 0 0 0 1px currentColor; opacity: 0.85; }

.trust { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 24px 0 0; padding: 0; list-style: none; color: #c9c6d0; font-size: 15px; }
.trust li::before { content: "✓"; margin-right: 7px; color: #f06a44; }
.trust a { color: inherit; }

/* Hero: the mail window, with a rule laid over its corner */
.hero-visual { position: relative; min-width: 0; margin: 0 0 40px; }
.hero-visual img { border-radius: 14px; border: 1px solid var(--ink-line); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6); }
.hero-visual .window { position: absolute; left: -40px; bottom: -56px; width: min(400px, 66%); transform: rotate(-1deg); }
.hero-visual .window pre { padding: 14px 16px; font-size: 11.5px; }
.hero-copy { min-width: 0; }
.window { background: #11141d; border: 1px solid var(--ink-line); border-radius: 14px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6); overflow: hidden; }
.window-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--ink-line); }
.window-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--ink-line); }
.window-bar b { margin-left: 8px; font: 500 12px var(--mono); color: #8d93a6; }
.window pre { margin: 0; padding: 18px 20px; overflow-x: auto; font: 500 13.5px/1.75 var(--mono); color: #e9e5dc; }
.window pre code { font-size: inherit; }
.terminal { background: #0b0d14; }
.k { color: var(--peach); }
.a { color: #9fb6e6; }
.s { color: #9ccb8f; }
.b { color: #e6b85c; }
.c { color: #8d93a6; }
.p { color: var(--vermilion); }

section { padding: 96px 0 0; }
.section-lede { color: var(--muted); font-size: 19px; max-width: 40em; margin: 16px 0 40px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid.four { grid-template-columns: repeat(4, 1fr); margin-top: 40px; }
.grid article, .grid > a { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.grid p { margin: 0; color: var(--muted); }
.grid article h3::before { content: ""; display: block; width: 28px; height: 4px; border-radius: 2px; background: var(--vermilion); margin-bottom: 16px; }
.grid > a { color: inherit; text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.grid > a:hover { border-color: var(--vermilion); transform: translateY(-2px); }
.grid > a h3::after { content: " →"; color: var(--vermilion); }

/* Mail sorting animation: each mail passes behind its rule into a bin; --i staggers mail, rule and bin together */
.sorter { --pad: 20px; --h: 48px; --row: calc(var(--h) + 10px); position: relative; margin: 0 0 40px; padding: var(--pad); background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.sorter-row { display: grid; grid-template-columns: 30% 1fr 22%; gap: 12px; align-items: center; height: var(--h); margin-bottom: 10px; }
.sorter .rule, .sorter .bin { height: 100%; display: flex; align-items: center; border-radius: 10px; }
.sorter .rule { grid-column: 2; position: relative; z-index: 1; padding: 0 14px; background: var(--paper-2); border: 1px solid var(--line); font-size: 13px; animation: sorter-match 12s calc(var(--i) * 3s) infinite; }
.sorter .rule.none { color: var(--muted); border-style: dashed; }
.sorter .rule.wait { overflow: hidden; line-height: 1.35; }
.sorter .rule.wait::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--vermilion); transform-origin: left; transform: scaleX(0); animation: sorter-wait 12s calc(var(--i) * 3s) infinite; }
.sorter .bin { flex-direction: column; justify-content: center; font-weight: 600; font-size: 15px; line-height: 1.2; border: 1px dashed var(--line); animation: sorter-drop 12s calc(var(--i) * 3s) infinite; }
.sorter .bin code { color: var(--accent-text); font-size: 11px; }
.sorter .mail { position: absolute; left: var(--pad); top: calc(var(--pad) + var(--i) * var(--row)); width: 26%; height: var(--h); display: flex; align-items: center; padding: 0 12px; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--vermilion); border-radius: 8px; box-shadow: 0 8px 20px -10px rgba(15, 18, 28, 0.45); font: 500 13px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: sorter-mail 12s calc(var(--i) * 3s) infinite both; }
.sorter figcaption { margin-top: 8px; color: var(--muted); font-size: 15px; }
@keyframes sorter-mail {
    0% { opacity: 0; left: var(--pad); top: calc(var(--pad) + 1.5 * var(--row)); transform: translateX(-12px); }
    4% { opacity: 1; left: var(--pad); top: calc(var(--pad) + 1.5 * var(--row)); transform: none; }
    10% { left: var(--pad); top: calc(var(--pad) + var(--i) * var(--row)); }
    24% { opacity: 1; left: calc(100% - var(--pad) - 24%); transform: none; }
    28%, 100% { opacity: 0; left: calc(100% - var(--pad) - 24%); top: calc(var(--pad) + var(--i) * var(--row)); transform: scale(0.6); }
}
@keyframes sorter-match {
    0%, 12%, 26%, 100% { border-color: var(--line); }
    15%, 22% { border-color: var(--vermilion); box-shadow: 0 0 0 3px rgba(232, 86, 47, 0.2); }
}
/* Held behind its rule while the older_than timer fills */
.sorter .mail.wait { animation-name: sorter-mail-wait; }
.sorter .wait ~ .bin { animation-delay: calc(var(--i) * 3s + 1.08s); }
@keyframes sorter-mail-wait {
    0% { opacity: 0; left: var(--pad); top: calc(var(--pad) + 1.5 * var(--row)); transform: translateX(-12px); }
    4% { opacity: 1; left: var(--pad); top: calc(var(--pad) + 1.5 * var(--row)); transform: none; }
    10% { left: var(--pad); top: calc(var(--pad) + var(--i) * var(--row)); }
    14%, 32% { left: 40%; }
    36% { opacity: 1; left: calc(100% - var(--pad) - 24%); transform: none; }
    40%, 100% { opacity: 0; left: calc(100% - var(--pad) - 24%); top: calc(var(--pad) + var(--i) * var(--row)); transform: scale(0.6); }
}
@keyframes sorter-wait {
    0%, 14% { transform: scaleX(0); opacity: 1; }
    32% { transform: scaleX(1); opacity: 1; }
    36%, 100% { transform: scaleX(1); opacity: 0; }
}
@keyframes sorter-drop {
    0%, 24%, 34%, 100% { background: transparent; }
    27% { background: rgba(232, 86, 47, 0.14); border-color: var(--vermilion); }
}

/* Comparison */
.table-scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.compare table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 15px; }
.compare th, .compare td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare tbody tr:last-child > * { border-bottom: 0; }
.compare thead th { font-family: var(--display); font-weight: 600; font-size: 16px; }
.compare thead th:nth-child(2), .compare td:nth-child(2) { background: var(--paper-2); }
.compare tbody th { font-weight: 600; }
.compare td { color: var(--muted); }
.compare td.yes { color: var(--text); }
.compare td.yes::before { content: "✓ "; color: var(--accent-text); font-weight: 600; }
.compare td.no::before { content: "✗ "; }
.compare .terminal { max-width: 560px; margin: 24px 0; }

.agent { margin-top: 96px; padding: 96px 0; background: var(--paper-2); border-block: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1fr 1.3fr; gap: 56px; align-items: center; }
.split h2 { margin-bottom: 18px; }
.split p { color: var(--muted); }
.split img { border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 30px 60px -30px rgba(15, 18, 28, 0.45); }
.inline-cmd { background: var(--ink); color: #f3eee4; border-radius: 10px; padding: 14px 18px; overflow-x: auto; font: 500 14px var(--mono); }
.inline-cmd code { font-size: inherit; }
.arrow { font-weight: 600; text-decoration: none; }
.arrow::after { content: " →"; }

.closing { text-align: center; padding: 120px 0 40px; }
.closing p { color: var(--muted); margin: 16px 0 0; }
.closing .cta { justify-content: center; }
.closing .button.ghost { color: var(--text); }

/* Rule examples page */
.hero.compact { padding-bottom: 72px; }
.hero.compact h1 { font-size: clamp(38px, 5vw, 60px); margin-top: 40px; }
.hero.compact .eyebrow { margin-top: 40px; }
.hero.compact h1 + .lede { margin-bottom: 0; }
.hero.compact .newcomer { margin: 16px 0 0; color: #c9c6d0; }
.hero.compact .newcomer a { color: var(--peach); }
.hero.compact .lede a { color: var(--peach); }
.recipes p { max-width: 40em; }
.recipes > section { padding-top: 88px; scroll-margin-top: 16px; }
.recipes h2 { font-size: clamp(30px, 4vw, 40px); margin-bottom: 10px; }
.group-lede { color: var(--muted); margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.recipes article { padding-top: 48px; scroll-margin-top: 16px; }
.recipes h3 { font-size: clamp(22px, 2.6vw, 28px); margin-bottom: 14px; }
.recipes article > p, #test > p { color: var(--muted); }
.recipes .window { margin-top: 20px; }
.recipes .cta .button.ghost { color: var(--text); }
.toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; padding-top: 48px; }
.toc-group { padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.toc-title { display: block; color: var(--accent-text); font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; }
.toc .count { display: none; }
.toc ul { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.toc ul a { color: var(--text); font-size: 15px; line-height: 1.35; text-decoration: none; }
.toc a:hover { color: var(--link); text-decoration: underline; }
.note { color: var(--muted); margin: 32px 0 0; padding-left: 16px; border-left: 3px solid var(--vermilion); }
.note b, .needs b { color: var(--text); }
.recipes article > p.needs { font-size: 15px; padding: 10px 14px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; }
.nav-links a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px var(--vermilion); }
.sorter + .arrow { display: inline-block; margin: -24px 0 40px; }

.footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 80px; padding: 28px 0 40px; color: var(--muted); font-size: 15px; }
.footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--link); }

@media (max-width: 960px) {
    .hero-body, .split { grid-template-columns: 1fr; }
    .grid, .grid.four { grid-template-columns: repeat(2, 1fr); }
    /* Phones and tablets: the mail window comes right after the pitch, before the install box */
    .hero-body { gap: 0; }
    .hero-copy { display: contents; }
    .hero-visual { order: 1; margin: 0 0 72px; }
    .hero .install, .hero .cta, .trust { order: 2; }
    .hero-visual .window { left: 16px; bottom: -40px; }
}
@media (max-width: 600px) {
    .nav-links a:not(:last-child) { display: none; }
    .grid, .grid.four { grid-template-columns: 1fr; }
    .hero { padding-bottom: 64px; }
    .hero-visual { margin-bottom: 32px; }
    .hero-visual .window { position: relative; left: 0; bottom: 0; width: auto; margin-top: -24px; transform: none; }
    section { padding-top: 64px; }
    .sorter { --pad: 12px; --h: 84px; }
    .sorter-row { gap: 8px; grid-template-columns: 30% 1fr 24%; }
    .sorter .rule { padding: 0 8px; font-size: 11px; line-height: 1.3; overflow-wrap: anywhere; }
    .sorter .bin { font-size: 13px; }
    .sorter .mail { padding: 0 8px; font-size: 11px; }
    .toc { grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 32px; }
    .toc-group { padding: 12px 14px; }
    .toc ul { display: none; }
    .toc .count { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; letter-spacing: 0; text-transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .button, .grid > a { transition: none; }
    .sorter .rule, .sorter .rule::after, .sorter .bin, .sorter .mail, .sorter .mail.wait { animation: none; }
}

.cmd code, .inline-cmd, .window pre { scrollbar-width: thin; scrollbar-color: var(--ink-line) transparent; }
