/* Wren — design tokens and components. Light/dark via prefers-color-scheme, overridable with [data-theme]. */
:root {
  --bg: #ffffff; --bg-alt: #f5f5f7; --surface: #f5f5f7; --text: #1d1d1f; --text-2: #6e6e73; --text-3: #86868b;
  --line: rgba(0,0,0,.08); --accent: #0071e3; --brand: #e8642c; --accent-2: #ffb35c; --link: #0066cc; --nav: rgba(255,255,255,.72);
  --grad: linear-gradient(100deg, #ff9a4d 0%, #f2603e 45%, #b8442a 100%);
  --shadow: 0 30px 80px -30px rgba(20,20,60,.35);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --w: 1024px; --w-wide: 1260px; --r: 28px;
  --ease: cubic-bezier(.16,1,.3,1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #000; --bg-alt: #101012; --surface: #161617; --accent: #0071e3; --brand: #ff9a4d; --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #6e6e73;
  --line: rgba(255,255,255,.1); --link: #2997ff; --nav: rgba(0,0,0,.7); --shadow: 0 30px 80px -30px rgba(0,0,0,.9);
  --grad: linear-gradient(100deg, #ffd27a 0%, #ff9a4d 45%, #f2603e 100%);
}}
:root[data-theme="dark"] {
  --bg: #000; --bg-alt: #101012; --surface: #161617; --accent: #0071e3; --brand: #ff9a4d; --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #6e6e73;
  --line: rgba(255,255,255,.1); --link: #2997ff; --nav: rgba(0,0,0,.7); --shadow: 0 30px 80px -30px rgba(0,0,0,.9);
  --grad: linear-gradient(100deg, #ffd27a 0%, #ff9a4d 45%, #f2603e 100%);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.47 var(--font); letter-spacing: -.022em;
  -webkit-font-smoothing: antialiased; transition: background .4s var(--ease), color .4s var(--ease); }
a { color: var(--link); text-decoration: none; } a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 16px; top: 12px; z-index: 99; background: var(--surface); padding: 8px 14px; }

/* Local nav */
.nav { position: sticky; top: 0; z-index: 50; background: var(--nav); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.nav-in { max-width: var(--w); margin: 0 auto; height: 52px; padding: 0 22px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; font-size: 21px; letter-spacing: .011em; margin-right: auto; }
.brand img { width: 26px; height: 26px; } .brand:hover { text-decoration: none; }
.nav a.l { color: var(--text-2); font-size: 12px; letter-spacing: 0; } .nav a.l:hover, .nav a.l[aria-current] { color: var(--text); text-decoration: none; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 980px; background: var(--accent);
  color: #fff !important; font-weight: 400; padding: 4px 11px; font-size: 12px; letter-spacing: -.01em; border: 0; cursor: pointer; transition: transform .2s var(--ease), filter .2s; }
.pill:hover { text-decoration: none; background: #0077ed; } .pill:active { transform: scale(.97); }
.pill.lg { font-size: 17px; padding: 11px 22px; letter-spacing: -.022em; }
.theme { background: none; border: 0; color: var(--text-2); cursor: pointer; padding: 6px; display: grid; place-items: center; border-radius: 50%; }
.theme:hover { color: var(--text); } .theme svg { width: 16px; height: 16px; }
@media (max-width: 640px) { .nav a.l.hide-s { display: none; } }

/* Type */
.eyebrow { font-size: 21px; line-height: 1.19; font-weight: 600; color: var(--text); margin: 0 0 6px; letter-spacing: .011em; }
.h-hero { font-size: clamp(48px, 7.4vw, 96px); line-height: 1.04; font-weight: 600; letter-spacing: -.015em; margin: 0; }
.h1 { font-size: clamp(40px, 5.4vw, 72px); line-height: 1.055; font-weight: 600; letter-spacing: -.015em; margin: 0; }
.h2 { font-size: clamp(32px, 4vw, 48px); line-height: 1.08; font-weight: 600; letter-spacing: -.003em; margin: 0; }
.h3 { font-size: clamp(21px, 2.2vw, 28px); line-height: 1.14; font-weight: 600; letter-spacing: .007em; margin: 0 0 8px; }
.lead { font-size: clamp(19px, 2vw, 24px); line-height: 1.33; font-weight: 400; color: var(--text-2); letter-spacing: .009em; }
.lead b, .lead strong { color: var(--text); font-weight: 600; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--text-2); } .small { font-size: 12px; line-height: 1.33; color: var(--text-3); letter-spacing: -.01em; }

/* Layout */
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 22px; }
.wide { max-width: var(--w-wide); margin: 0 auto; padding: 0 22px; }
.sec { padding: clamp(90px, 14vw, 160px) 0; }
.alt { background: var(--bg-alt); }
.center { text-align: center; }
.js .reveal { opacity: 0; transform: translateY(30px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } * { animation: none !important; } }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 64px; }
.tile { background: var(--surface); border-radius: var(--r); padding: 40px 36px; }
.tile p { color: var(--text-2); margin: 0; } .tile .ico { font-size: 34px; margin-bottom: 18px; display: block; }

/* Legal / prose pages */
.doc-hero { padding: 110px 0 40px; }
.prose { max-width: 692px; margin: 0 auto; padding: 0 22px 120px; }
.prose h2 { font-size: 32px; line-height: 1.12; letter-spacing: -.03em; margin: 72px 0 14px; }
.prose h3 { font-size: 21px; margin: 36px 0 8px; letter-spacing: -.015em; }
.prose p, .prose li { color: var(--text-2); } .prose strong { color: var(--text); font-weight: 600; }
.prose ul { padding-left: 1.1em; } .prose li { margin: 6px 0; }
.callout { background: var(--surface); border-radius: 22px; padding: 28px 30px; margin: 34px 0; }
.callout p { margin: 0; color: var(--text); font-size: 19px; line-height: 1.4; font-weight: 500; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0 0; padding: 0; list-style: none; justify-content: center; }
.toc a { display: inline-block; padding: 6px 14px; border-radius: 980px; border: 1px solid var(--line); color: var(--text-2); font-size: 14px; }
.toc a:hover { color: var(--text); text-decoration: none; border-color: var(--text-3); }

/* Forms */
.form { display: grid; gap: 14px; max-width: 560px; margin: 48px auto 0; text-align: left; }
.field { position: relative; }
.field input, .field textarea, .field select { width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--text-3); border-radius: 12px; padding: 24px 16px 10px; transition: border-color .2s, box-shadow .2s; appearance: none; }
.field textarea { min-height: 170px; resize: vertical; }
.field label { position: absolute; left: 17px; top: 17px; color: var(--text-3); pointer-events: none; transition: all .2s var(--ease); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label, .field select + label { top: 7px; font-size: 12px; }
.hp { position: absolute; left: -5000px; }
.status { min-height: 24px; font-size: 15px; text-align: center; }
.status.ok { color: #30a46c; } .status.err { color: #e5484d; }

/* Footer */
.foot { background: var(--bg-alt); padding: 26px 0 40px; font-size: 12px; color: var(--text-3); }
.foot .notes { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.foot .notes p { margin: 0 0 8px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; } .foot nav a { color: var(--text-2); }
.foot .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
code { font: 14px/1.4 ui-monospace, "SF Mono", Menlo, monospace; background: var(--bg-alt); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; color: var(--text); word-break: break-word; }
.foot .notes:empty { display: none; }
.doc-hero .small { font-size: 14px; }
