/* Sift site styles: the heyife house style (Archivo + IBM Plex Mono, one
   orange accent, a 640px reading column). Shared by the home, docs and proof
   pages. Fonts are served from this site, so no third party sees visitors. */

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

:root {
  --sans: "Archivo", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --bg: #0b0b0c;
  --panel: #111113;
  --panel2: #161618;
  --line: #232327;
  --line2: #34343a;
  --text: #ecebe6;
  --muted: #96958f;
  --dim: #7c7b75;
  --accent: #ff7a45;
  --on-accent: #0b0b0c;
  --radius: 4px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --gut: clamp(20px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); }
a:hover { color: #fff; }
p { margin: 0 0 18px; }
code, pre, .mono { font-family: var(--mono); }
.mono { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.quiet { color: var(--muted); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* Header */
.hdr { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 20px; padding-top: 12px; padding-bottom: 12px; }
.logo { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.logo svg { display: block; height: 28px; width: auto; overflow: visible; }
.hdr-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; margin-left: auto; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.navl { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; transition: color 0.15s ease; }
.navl:hover { color: var(--text); }
.navl[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px var(--accent); }
.hdr-cta { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; transition: border-color 0.15s ease, color 0.15s ease; }
.hdr-cta:hover { border-color: var(--accent); color: var(--accent); }
/* On the agent pages the button is the main action: orange outline, filled on hover */
.hdr-cta-agent { border-color: var(--accent); color: var(--accent); transition: background-color 0.15s ease, color 0.15s ease; }
.hdr-cta-agent:hover { background: var(--accent); color: var(--bg); }
.hdr-cta-agent:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) {
  .hdr-nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; margin-left: 0; border-top: 1px solid var(--line); }
  .hdr-cta { order: 2; }
}

/* Type */
h1 { font-size: clamp(34px, 6vw, 46px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 700; margin: 32px 0 16px; }
h2 { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; margin: 52px 0 12px; scroll-margin-top: 64px; }
.lead { font-size: 19px; }
.byline { display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.pulse { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; animation: pulse 2.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn, .ghost { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; padding: 0 20px; border-radius: var(--radius); cursor: pointer; }
.btn { background: var(--accent); color: var(--on-accent); font-weight: 500; border: 0; transition: background-color 0.15s ease, transform 0.1s ease; }
.btn:hover { background: #ff8c5e; color: var(--on-accent); }
.ghost { background: transparent; color: var(--text); border: 1px solid var(--text); transition: border-color 0.15s ease, color 0.15s ease, transform 0.1s ease; }
.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn:active, .ghost:active { transform: translateY(1px); }
.ghost.small { min-height: 36px; padding: 0 12px; font-size: 11px; color: var(--muted); border-color: var(--line); }
.ghost[disabled] { opacity: 0.6; cursor: default; }

/* Panels and rows */
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.row { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.row:last-child { border-bottom: 0; }
.row .k { flex: 0 0 110px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.row .k.code { flex-basis: 170px; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--text); padding-top: 0; }
.row .v { flex: 1 1 260px; }
.row .k.wide { flex: 0 1 230px; font-family: var(--sans); font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--muted); padding-top: 1px; }
.row .v.quiet { color: var(--muted); }
.row.split { justify-content: space-between; flex-wrap: nowrap; }
.row.split .n { font-family: var(--mono); white-space: nowrap; }
.big { font-family: var(--mono); font-size: 34px; line-height: 1; letter-spacing: -0.02em; min-width: 2.2ch; }
.big small { display: block; font-size: 12px; letter-spacing: 0; color: var(--muted); margin-top: 8px; }
.big.accent { color: var(--accent); }
.nums { display: flex; flex-wrap: wrap; gap: 18px 32px; padding: 18px 16px; transition: opacity 0.25s ease; }

/* Demo */
.demo { margin: 40px 0 8px; }
.demo-q { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.4; }
.demo-q .mono { display: block; margin-bottom: 4px; }
.status { display: flex; align-items: center; gap: 12px; padding: 10px 16px 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.status span:first-child { flex: 1 1 auto; }
.bar { height: 2px; background: var(--line); }
.bar i { display: block; height: 2px; width: 100%; background: var(--accent); }
.demo figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.demo figcaption .accent { color: var(--accent); }

/* Toggle */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.seg button { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; border: 0; padding: 0 14px; min-height: 44px; cursor: pointer; background: transparent; color: var(--muted); transition: background-color 0.15s ease, color 0.15s ease; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.tick { animation: tick-in 0.35s ease-out; }
@keyframes tick-in { 0% { opacity: 0; transform: translateY(4px); } 100% { opacity: 1; transform: none; } }

/* Flow */
.flow { display: flex; flex-wrap: wrap; align-items: stretch; }
.fbox { flex: 1 1 150px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 10px; font-size: 14px; line-height: 1.3; }
.fbox .mono { display: block; margin-bottom: 5px; }
.fbox.act { border-color: var(--accent); background: transparent; }
.fbox.act .mono { color: var(--accent); }
.arrow { flex: 0 0 18px; display: flex; align-items: center; justify-content: center; color: var(--dim); font-family: var(--mono); font-size: 14px; }

/* Cards and notes */
.cards { display: flex; flex-wrap: wrap; gap: 12px; }
.card { flex: 1 1 260px; display: block; text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; transition: border-color 0.15s ease; }
.card:hover { border-color: var(--accent); color: var(--text); }
.card.lead-edge { border-left: 3px solid var(--accent); }
.card .mono { display: block; margin-bottom: 6px; }
.cards + .quiet { margin-top: 14px; font-size: 15px; }
.card span.v { display: block; font-size: 15px; line-height: 1.45; }
.arr { display: inline-block; transition: transform 0.15s ease; }
.card:hover .arr, .nudge:hover .arr { transform: translateX(4px); }
.note { font-size: 14px; line-height: 1.45; color: var(--accent); border-left: 2px solid var(--accent); padding: 2px 0 2px 12px; margin: 0 0 18px; }
.quote { font-size: 15px; line-height: 1.5; border-left: 2px solid var(--text); padding: 2px 0 2px 14px; margin: 0 0 18px; }
.ai { margin-top: 52px; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; font-family: var(--mono); font-size: 13px; line-height: 1.7; color: var(--muted); }
.ai h2 { margin: 0 0 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; color: var(--text); }
.ai p { margin: 0; }
ul.plain { margin: 0 0 18px; padding-left: 20px; }
ul.plain li { margin-bottom: 6px; }

/* Code */
.code-head { display: flex; justify-content: flex-end; margin-bottom: 6px; }
pre.code { margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 16px; font-size: 13px; line-height: 1.7; color: var(--text); overflow-x: auto; }
pre.code.small { font-size: 12px; }

/* Docs layout: a contents rail beside the text on wide screens, a pinned strip on narrow ones */
.doc-grid { display: flex; flex-wrap: wrap; gap: 40px; }
.doc-grid main { flex: 1 1 520px; max-width: 640px; min-width: 0; padding-bottom: 80px; }
.rail { flex: 0 0 150px; align-self: flex-start; padding-top: 40px; display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.rail a { color: var(--muted); text-decoration: none; padding: 7px 0 7px 12px; border-left: 2px solid var(--line); transition: color 0.2s ease, border-color 0.2s ease; }
.rail a:hover { color: var(--text); }
.rail a.on { color: var(--text); border-left-color: var(--accent); }
@media (min-width: 760px) { .rail { position: sticky; top: 0; } }
@media (max-width: 759px) {
  .rail { position: sticky; top: 0; z-index: 5; background: var(--bg); flex: 1 1 100%; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 18px; padding-top: 0; border-bottom: 1px solid var(--line); }
  .rail a { border-left: 0; padding: 12px 0; white-space: nowrap; }
  .rail a.on { box-shadow: inset 0 -2px var(--accent); }
}

/* Footer */
.foot { margin-top: 64px; padding: 20px 0 48px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--text); }
.foot .by { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.foot .by svg { display: block; height: 18px; width: auto; overflow: visible; }
.foot .links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.foot .end { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.foot .social { display: flex; align-items: center; gap: 4px; }
.foot .social a { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 4px; }
.foot .social a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.foot .social svg { width: 15px; height: 15px; fill: currentColor; }

/* The two pixel marks */
.sm .sw, .sm .sd, .hm .lo, .hm .li, .hm .ld { transform-box: view-box; }
.sm.load .sd { animation: sd-land 1s ease-out; }
.sm.hp .sw { animation: sieve 0.6s ease-in-out; }
.sm.hp .sd { animation: ld-hop 1s ease-out; }
.hm.hp .lo { animation: lo-fold 1.5s ease-in-out; }
.hm.hp .li { animation: li-fold 1.5s ease-in-out; }
.hm.hp .ld { animation: ld-hop 1.5s ease-out; }
@keyframes sieve { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-12px); } 40% { transform: translateX(12px); } 60% { transform: translateX(-8px); } 80% { transform: translateX(6px); } }
@keyframes sd-land { 0% { transform: translateY(-60px); opacity: 0; } 40% { transform: translateY(0); opacity: 1; } 55% { transform: translateY(-14px); } 70%, 100% { transform: translateY(0); } }
@keyframes ld-hop { 0%, 36% { transform: translateY(0); } 44% { transform: translateY(-30px); } 54%, 100% { transform: translateY(0); } }
@keyframes lo-fold { 0% { opacity: 1; } 14%, 80% { opacity: 0; } 100% { opacity: 1; } }
@keyframes li-fold { 0%, 14% { transform: translateX(0); } 34%, 60% { transform: translateX(-200px); } 78%, 100% { transform: translateX(0); } }

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

/* Next step on every guide: the by-hand cleaner, one click away */
.next-step { margin: 44px 0 8px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.next-step .ns-k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.next-step .ns-t { font-size: 19px; font-weight: 600; margin: 0 0 6px; }
.next-step .ns-v { margin: 0 0 14px; color: var(--muted); }
.next-step .btn { margin: 0; }
.next-step .ns-alt { margin: 12px 0 0; font-size: 14px; }

/* ===== heyife family layer =====
   The newer heyife look on every page: a full-width top bar that turns
   solid with blur on scroll, heavier headings, square markers, inset rings,
   keycap toggles. The home page adds its own layout on top (home.css). */
body { overflow-x: hidden; overflow-x: clip; }
::selection { background: var(--accent); color: var(--on-accent); }
h1, h2, h3 { text-wrap: balance; }

/* Top bar: full width whatever column it sits in */
.hdr { position: sticky; top: 0; z-index: 40; width: 100vw; max-width: none; margin-left: calc(50% - 50vw); margin-right: 0; min-height: 64px; padding: 10px max(var(--gut), calc((100vw - 1240px) / 2 + var(--gut))); background: var(--bg); border-bottom: 1px solid transparent; transition: background-color .3s ease-out, border-color .3s ease-out; }
.hdr.solid { background: rgba(10, 10, 11, .9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom-color: var(--line); }
.logo svg { height: 24px; }
.hdr-nav { gap: 0 28px; }
.navl { position: relative; }
.navl[aria-current="page"] { box-shadow: none; }
.navl[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 50%; width: 6px; height: 6px; margin-top: -3px; background: var(--accent); }
.hdr-cta { min-height: 34px; padding: 0 13px; border: 0; box-shadow: inset 0 0 0 1px var(--line2); transition: box-shadow .15s ease-out, color .15s ease-out, scale .15s ease-out; }
.hdr-cta:hover { box-shadow: inset 0 0 0 1px var(--muted); color: var(--text); }
.hdr-cta:active { scale: .96; }
.hdr-cta-agent { box-shadow: none; background: var(--accent); color: var(--on-accent); font-weight: 500; }
.hdr-cta-agent:hover { box-shadow: none; background: #ff8a5c; color: var(--on-accent); }
.hdr-cta-agent:focus-visible { outline-color: var(--text); }
@media (max-width: 640px) {
  .hdr { position: relative; padding-top: 6px; padding-bottom: 0; }
  .navl[aria-current="page"]::before { display: none; }
  .navl[aria-current="page"] { box-shadow: inset 0 -2px var(--accent); }
}

/* A faint dot grid behind the top of each reading page */
body:not(.home)::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 520px; z-index: -1; pointer-events: none; background-image: radial-gradient(var(--line2) 1px, transparent 1.2px); background-size: 20px 20px; opacity: .45; -webkit-mask-image: radial-gradient(ellipse 55% 75% at 50% 0%, #000 15%, transparent 70%); mask-image: radial-gradient(ellipse 55% 75% at 50% 0%, #000 15%, transparent 70%); }

/* Type */
h1 { font-size: clamp(36px, 4.8vw, 60px); line-height: 1.02; letter-spacing: -.045em; font-weight: 700; margin: 48px 0 18px; }
h2 { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.15; letter-spacing: -.03em; font-weight: 700; scroll-margin-top: 88px; }
.byline { border-bottom-color: var(--line); }

/* Buttons */
.btn, .ghost { border-radius: 4px; transition: background-color .15s ease-out, box-shadow .15s ease-out, color .15s ease-out, scale .15s ease-out; }
.btn:hover { background: #ff8a5c; }
.ghost { border: 0; box-shadow: inset 0 0 0 1px var(--line2); }
.ghost:hover { box-shadow: inset 0 0 0 1px var(--muted); color: var(--text); }
.btn:active, .ghost:active { transform: none; scale: .96; }
.ghost.small { box-shadow: inset 0 0 0 1px var(--line); }
.ghost.small:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }

/* Panels, cards and notes: rings, not borders */
.panel, .card, .fbox, .ai, pre.code, .next-step { border: 0; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.panel, .fbox, pre.code, .next-step { background: var(--panel); }
.card { transition: box-shadow .2s ease-out, background-color .2s ease-out; }
.card:hover { box-shadow: inset 0 0 0 1px var(--line2); background: var(--panel2); }
.card.lead-edge { border-left: 0; box-shadow: inset 3px 0 0 var(--accent), inset 0 0 0 1px var(--line); }
.card.lead-edge:hover { box-shadow: inset 3px 0 0 var(--accent), inset 0 0 0 1px var(--line2); }
.card:hover .arr { color: var(--accent); }
.fbox.act { box-shadow: inset 0 0 0 1px var(--accent); }
.next-step .ns-k { display: flex; align-items: center; gap: 10px; }
.next-step .ns-k::before { content: ""; width: 8px; height: 8px; background: var(--accent); flex: none; }
.next-step .ns-t { font-size: 22px; font-weight: 700; letter-spacing: -.03em; }

/* Toggles as keycaps */
.seg { gap: 4px; border: 0; overflow: visible; }
.seg button { min-height: 40px; border-radius: 3px; background: #141417; box-shadow: inset 0 0 0 1px var(--line2), inset 0 -3px 0 #0a0a0b; transition: background-color .12s, color .12s, scale .12s; }
.seg button + button { border-left: 0; }
.seg button:hover { color: var(--text); }
.seg button:active { scale: .96; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); box-shadow: inset 0 -3px 0 #b8b7b1; }

/* Docs contents rail sits under the top bar */
@media (min-width: 760px) { .rail { top: 88px; } }
@media (min-width: 641px) and (max-width: 759px) { .rail { top: 64px; } }
.rail a.on { border-left-color: var(--accent); }

/* Footer */
.foot { margin-top: 96px; }
.foot .social a { width: 40px; height: 40px; transition: color .15s, background-color .15s; }
.foot .social a:hover { background: var(--panel2); }
.foot .social a:focus-visible { outline-color: var(--text); }

/* Motion: the page title rises in, transform and opacity only */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
body:not(.home) h1, body:not(.home) .eyebrow, body:not(.home) .lede { animation: rise .9s var(--ease-out) both; }
body:not(.home) .eyebrow { animation-delay: 60ms; }
body:not(.home) h1 { animation-delay: 120ms; }
body:not(.home) .lede { animation-delay: 260ms; }
