/* The founder's note (founder.js): the "Why this exists" card in Start and the letter it opens, a native <dialog>. Tokens from site.css.
   Light: a paper-toned sheet. Dark: a charcoal sheet with a faint scanline. The only motion is a short fade, gone under
   reduced motion. Phone first: one column, no sideways scroll, the letter scrolls inside its own window. */
:root{--f-paper:#f7f3e6;--f-paper-2:#efe9d6;--f-ink:#1b1d1a;--f-ink-2:#3f443f;--f-muted:#6a6f68;--f-rule:rgba(27,29,26,.16);--f-scan:none;--f-grid:radial-gradient(circle at 1px 1px,rgba(27,29,26,.075) 1px,transparent 1.5px) 0 0/18px 18px;--f-scrim:rgba(23,25,27,.46)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--f-paper:#121614;--f-paper-2:#0e1110;--f-ink:#ecebe4;--f-ink-2:#c7cbc2;--f-muted:#9aa197;--f-rule:rgba(236,235,228,.14);--f-scan:repeating-linear-gradient(180deg,rgba(255,255,255,.028) 0 1px,transparent 1px 3px);--f-grid:none;--f-scrim:rgba(0,0,0,.6)}}
:root[data-theme="dark"]{--f-paper:#121614;--f-paper-2:#0e1110;--f-ink:#ecebe4;--f-ink-2:#c7cbc2;--f-muted:#9aa197;--f-rule:rgba(236,235,228,.14);--f-scan:repeating-linear-gradient(180deg,rgba(255,255,255,.028) 0 1px,transparent 1px 3px);--f-grid:none;--f-scrim:rgba(0,0,0,.6)}

/* ---- the card, in Start's "How it works" ---- */
.why{display:grid;grid-template-columns:minmax(0,1fr);gap:14px 22px;align-items:center;margin:30px 0 34px;padding:18px 18px 20px;border:1px solid var(--line);border-radius:10px;background:var(--win);box-shadow:3px 3px 0 var(--line);position:relative;overflow:hidden;min-width:0}
.why::before{content:"";position:absolute;left:0;top:0;bottom:0;width:6px;background:var(--lime);border-right:1px solid var(--line)}
.why-mark{display:block;width:min(100%,168px);height:auto;color:var(--ink);margin-left:6px}
.why-copy{min-width:0;display:grid;gap:8px;justify-items:start}
.why-copy .eyebrow{margin:0}
.why-copy h3{font-size:clamp(18px,2.2vw,22px);line-height:1.15;letter-spacing:-.02em;margin:0;text-wrap:balance}
@media (min-width:640px){.why{grid-template-columns:168px minmax(0,1fr);padding:20px 24px 22px 22px}}
/* the tile: a desktop icon (the clay 3D set's look, desk.css tokens) with its name under it, like the icons on the desk */
.founder-tile{display:inline-flex;flex-direction:column;align-items:center;gap:5px;margin:2px 0 6px;padding:6px 10px 5px;background:none;border:0;border-radius:8px;font:inherit;color:var(--ink);cursor:pointer;text-decoration:none;-webkit-touch-callout:none}
.founder-tile .i3d{width:64px;height:64px;display:block;stroke:none;fill:none;stroke-width:1;transition:transform var(--fast) var(--ease),filter var(--fast)}
.founder-tile:hover .i3d,.founder-tile:focus-visible .i3d{transform:translateY(-3px) scale(1.05);filter:drop-shadow(0 0 10px var(--lime-soft))}
.founder-tile:active .i3d{transform:translateY(-1px) scale(1.02)}
.founder-tile-name{font-family:var(--display);font-weight:600;font-size:12.5px;white-space:nowrap;padding:1px 6px;border-radius:4px;background:var(--paper-2);border:1px solid transparent;transition:background var(--fast)}
.founder-tile:hover .founder-tile-name,.founder-tile:focus-visible .founder-tile-name{background:var(--lime);color:var(--lime-ink);border-color:var(--line)}
.founder-tile:focus-visible{outline:2px solid var(--lime);outline-offset:2px}
@media (prefers-reduced-motion:reduce){.founder-tile .i3d,.founder-tile-name{transition:none}.founder-tile:hover .i3d,.founder-tile:focus-visible .i3d,.founder-tile:active .i3d{transform:none;filter:none}}
html[data-motion="reduce"] .founder-tile .i3d{transition:none}
html[data-motion="reduce"] .founder-tile:hover .i3d,html[data-motion="reduce"] .founder-tile:focus-visible .i3d,html[data-motion="reduce"] .founder-tile:active .i3d{transform:none;filter:none}

/* ---- the letter ---- */
dialog.founder{margin:auto;padding:0;border:0;background:transparent;color:var(--f-ink);width:min(100vw - 20px,760px);max-width:none;max-height:none;overflow:visible}
dialog.founder::backdrop{background:var(--f-scrim);backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}
html[data-transparency="reduce"] dialog.founder::backdrop{backdrop-filter:none;-webkit-backdrop-filter:none}
.founder-win{display:flex;flex-direction:column;max-height:calc(100dvh - 20px);max-height:calc(100vh - 20px);background:var(--f-paper);color:var(--f-ink);border:1px solid var(--line);border-radius:10px;box-shadow:6px 6px 0 var(--line),0 40px 80px -24px rgba(0,0,0,.55);overflow:hidden;position:relative}
.founder-win .tb{flex:none;height:30px;display:flex;align-items:center;gap:8px;padding:0 8px;background:var(--f-paper-2);border-bottom:1px solid var(--line);user-select:none}
.founder-win .tb .box{width:13px;height:13px;border:1px solid var(--line);background:var(--f-paper);border-radius:3px;flex:none;padding:0;cursor:pointer;color:var(--f-ink);display:grid;place-items:center}
.founder-win .tb .box svg{width:9px;height:9px;stroke:currentColor;stroke-width:2;fill:none;opacity:0;transition:opacity var(--fast)}
.founder-win .tb .box:hover svg,.founder-win .tb .box:focus-visible svg{opacity:1}
.founder-win .tb .box:hover{background:var(--lime)}
.founder-win .tb .box:focus-visible{outline:2px solid var(--lime);outline-offset:2px}
.founder-win .tb .stripes{flex:1;height:12px;background:repeating-linear-gradient(180deg,var(--line) 0 1px,transparent 1px 3px);opacity:.5;border-radius:1px}
.founder-win .tb .title{font-family:var(--mono);font-weight:600;font-size:12px;letter-spacing:.02em;padding:0 10px;white-space:nowrap;color:var(--f-ink)}
.founder-letter{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:24px 20px 30px;background:var(--f-scan),var(--f-grid),var(--f-paper);outline:none;scrollbar-gutter:stable}
.founder-letter:focus-visible{box-shadow:inset 0 0 0 2px var(--lime)}
.founder-body{max-width:62ch;margin:0 auto}
/* the letterhead: wordmark and company on the left, site and date on the right, a lime rule under it; it scrolls with the letter */
.founder-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px 16px;flex-wrap:wrap;padding:0 0 14px;margin:0 0 26px;border-bottom:2px solid var(--lime)}
.founder-head-l{display:grid;gap:4px;min-width:0}
.founder-wordmark{display:flex;align-items:center;gap:8px;font-family:var(--display);font-weight:800;font-size:18px;letter-spacing:-.02em;color:var(--f-ink);line-height:1}
.founder-gem{width:22px;height:22px;display:block;flex:none}
.founder-gem rect{fill:var(--lime);stroke:var(--line);stroke-width:2}
.founder-head .eyebrow{margin:0;color:var(--f-muted)}
.founder-head-r{display:grid;gap:3px;text-align:right;margin-left:auto}
.founder-foot{margin-top:24px;padding-top:12px;border-top:1px solid var(--f-rule)}
.founder-body .why-mark{width:min(100%,200px);color:var(--f-ink);margin:0 0 22px}
.founder-body .eyebrow{color:var(--f-muted);margin-bottom:8px}
.founder-body h2{font-size:clamp(26px,4.4vw,36px);line-height:1.05;letter-spacing:-.03em;margin:0 0 18px;color:var(--f-ink)}
.founder-body p{font-family:var(--body);font-size:17px;line-height:1.72;color:var(--f-ink-2);margin:0 0 18px;max-width:62ch}
.founder-body p a{color:var(--f-ink);text-decoration-color:var(--lime);text-decoration-thickness:2px;text-underline-offset:3px}
.founder-body p a:hover{background:var(--lime);color:var(--lime-ink)}
/* the sign-off: the handwritten signature, the printed name, then the role in the eyebrow style */
.founder-sign{display:grid;gap:4px;justify-items:start;margin:26px 0 0;padding-top:18px;border-top:1px solid var(--f-rule)}
.founder-sig{display:block;width:220px;max-width:60%;height:auto;margin:0 0 6px}
.founder-name{font-family:var(--display);font-weight:700;font-size:17px;letter-spacing:-.01em;color:var(--f-ink)}
.founder-sign .eyebrow{margin:0;color:var(--f-muted)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .founder-sig{filter:invert(1)}}
:root[data-theme="dark"] .founder-sig{filter:invert(1)}   /* black ink reads on the dark sheet */
.founder-body .founder-fine{font-family:var(--mono);font-size:12.5px;font-weight:500;letter-spacing:.04em;line-height:1.6;color:var(--f-muted);margin:0}
.founder-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:22px}
.founder-win .btn{background:var(--f-paper);color:var(--f-ink)}
.founder-win .btn.primary{background:var(--lime);color:var(--lime-ink)}
@media (min-width:640px){.founder-letter{padding:40px 44px 44px}}

/* the fade: in with the dialog, none at all under reduced motion */
dialog.founder[open]{animation:founder-in .22s ease-out}
dialog.founder[open]::backdrop{animation:founder-fade .22s ease-out}
@keyframes founder-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes founder-fade{from{opacity:0}to{opacity:1}}
@media (prefers-reduced-motion:reduce){dialog.founder[open],dialog.founder[open]::backdrop{animation:none}}
html[data-motion="reduce"] dialog.founder[open],html[data-motion="reduce"] dialog.founder[open]::backdrop{animation:none}

/* the page behind holds still while the letter is open (the desk never scrolls; the Simple view does) */
body.founder-on{overflow:hidden}
