/*
 * Blockhouse CMS marketing site — built on the admin app's "Luminous v2" tokens
 * (apps/admin/src/styles/global.css): Inter, warm paper + ink, a quiet dotted field,
 * hairlines instead of shadows, pill buttons, sentence-case labels, mono only for real codes.
 */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius-xs: 6px; --radius-sm: 8px; --radius-md: 12px; --radius-lg: 18px; --radius-xl: 22px; --radius-full: 999px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --content-max: 1240px;
}
:root, [data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f2; --bg-subtle: #f7f7f5; --bg-muted: #f0f0ee; --bg-inset: #ebebe8; --bg-elevated: #ffffff;
  --bg-hover: rgba(0,0,0,.04); --bg-active: rgba(0,0,0,.065);
  --material: rgba(244,244,242,.82);
  --field-dot: rgba(0,0,0,.06); --field-glow: #ffffff;
  --fg: #0b0b0b; --fg-secondary: #555555; --fg-tertiary: #6b6b6b; --fg-quaternary: #b8b8b4;
  --fg-on-accent: #ffffff; --fg-inverse: #ffffff; --bg-inverse: #151516;
  --border: rgba(0,0,0,.08); --border-strong: rgba(0,0,0,.15);
  --border-focus: color-mix(in srgb, var(--fg) 62%, transparent);
  --accent: #2f63d6; --accent-hover: #2556c2; --accent-subtle: rgba(47,99,214,.09);
  --green: #12924f; --green-subtle: rgba(18,146,79,.1);
  --amber: #a86400; --amber-subtle: rgba(168,100,0,.1);
  --red: #c8303c; --purple: #6f4fe0; --purple-subtle: rgba(111,79,224,.1);
  --teal: #0c8a8a; --teal-subtle: rgba(12,138,138,.1);
  --gray-subtle: rgba(0,0,0,.05);
  --dim: #8a8a86;
}
[data-theme="dark"], .invert {
  color-scheme: dark;
  --bg: #0b0b0c; --bg-subtle: #19191a; --bg-muted: #1d1d1f; --bg-inset: #222224; --bg-elevated: #141415;
  --bg-hover: rgba(255,255,255,.05); --bg-active: rgba(255,255,255,.08);
  --material: rgba(11,11,12,.8);
  --field-dot: rgba(255,255,255,.05); --field-glow: rgba(255,255,255,.06);
  --fg: #f5f5f5; --fg-secondary: #a3a3a3; --fg-tertiary: #858585; --fg-quaternary: #454545;
  --fg-on-accent: #0b0b0c; --fg-inverse: #0b0b0c; --bg-inverse: #f4f4f5;
  --border: rgba(255,255,255,.08); --border-strong: rgba(255,255,255,.16);
  --accent: #8fb4ff; --accent-hover: #a9c5ff; --accent-subtle: rgba(143,180,255,.13);
  --green: #6cf2a8; --green-subtle: rgba(108,242,168,.12);
  --amber: #ffcf7a; --amber-subtle: rgba(255,207,122,.12);
  --red: #ff7d86; --purple: #b9a3ff; --purple-subtle: rgba(185,163,255,.13);
  --teal: #7fd8e6; --teal-subtle: rgba(127,216,230,.12);
  --gray-subtle: rgba(255,255,255,.06);
  --dim: #6e6e6e;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100dvh; overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--field-glow), transparent 70%),
    radial-gradient(var(--field-dot) 1px, transparent 1.3px) 0 0 / 16px 16px,
    var(--bg);
  background-attachment: fixed;
  color: var(--fg); font-family: var(--font-sans); font-size: 15px; line-height: 1.55;
  letter-spacing: -0.011em; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.022em; line-height: 1.2; text-wrap: balance; }
p { text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
code, pre { font-family: var(--font-mono); }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: 0; }
.tabular { font-variant-numeric: tabular-nums; }

.wrap { position: relative; max-width: var(--content-max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Marketing type scale on top of the app's */
.display { font-size: clamp(42px, 7.2vw, 88px); line-height: 1.0; letter-spacing: -0.048em; font-weight: 600; }
.h2 { font-size: clamp(32px, 4.6vw, 56px); line-height: 1.04; letter-spacing: -0.042em; font-weight: 600; }
.h3 { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.15; letter-spacing: -0.03em; font-weight: 600; }
.dim { color: var(--dim); }
.lede { font-size: clamp(16px, 1.5vw, 19px); line-height: 1.5; color: var(--fg-secondary); letter-spacing: -0.015em; }
.label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--fg-secondary); }
.label::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }

/* Buttons (pill, as in the app; marketing sizes) */
.btn { --h: 40px; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 18px; border-radius: var(--radius-full); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .12s ease, opacity .12s ease, transform .12s var(--ease-out), box-shadow .12s ease; }
.btn:active { transform: scale(.97); }
.btn-lg { --h: 48px; padding: 0 24px; font-size: 15px; }
.btn-sm { --h: 32px; padding: 0 12px; font-size: 13px; }
.btn-primary { background: var(--bg-inverse); color: var(--fg-inverse); }
.btn-primary:hover { opacity: .88; }
.btn-accent { background: var(--accent); color: var(--fg-on-accent); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-secondary { color: var(--fg); box-shadow: inset 0 0 0 1px var(--border-strong); background: transparent; }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-ghost { color: var(--fg-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--fg); }
.btn .arr { transition: transform .2s var(--ease-out); }
.btn:hover .arr { transform: translateX(3px); }
.icon-btn { width: 32px; height: 32px; border-radius: var(--radius-full); display: grid; place-items: center; color: var(--fg-secondary); }
.icon-btn:hover { background: var(--bg-hover); color: var(--fg); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--radius-full); font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--gray-subtle); color: var(--fg-secondary); }
.badge.blue { background: var(--accent-subtle); color: var(--accent); }
.badge.green { background: var(--green-subtle); color: var(--green); }
.badge.amber { background: var(--amber-subtle); color: var(--amber); }
.badge.purple { background: var(--purple-subtle); color: var(--purple); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Cards */
.card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); min-width: 0; }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; border-radius: var(--radius-full); background: var(--bg-inset); }
.seg button { height: 32px; padding: 0 14px; border-radius: var(--radius-full); font-size: 13px; font-weight: 500; color: var(--fg-secondary); display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--bg-elevated); color: var(--fg); box-shadow: 0 0 0 1px var(--border); }
.select { appearance: none; height: 38px; padding: 0 34px 0 14px; border-radius: var(--radius-full); border: 0; box-shadow: inset 0 0 0 1px var(--border-strong); background: transparent url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23858585' stroke-width='1.5'><path d='M1 1l4 4 4-4'/></svg>") no-repeat right 14px center; font-size: 13px; font-weight: 500; cursor: pointer; }
.select option { background: var(--bg-elevated); color: var(--fg); }

/* Skip link + nav */
.skip { position: absolute; left: 12px; top: -48px; z-index: 60; padding: 8px 14px; border-radius: var(--radius-full); background: var(--bg-inverse); color: var(--fg-inverse); font-size: 13px; font-weight: 500; }
.skip:focus { top: 12px; }
.site-head { position: sticky; top: 0; z-index: 30; background: var(--material); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-head.scrolled { border-bottom-color: var(--border); }
.site-head nav { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-size: 16px; color: var(--fg); }
.logo-tile { width: 26px; height: 26px; border-radius: 7px; background: var(--bg-inverse); color: var(--fg-inverse); display: grid; place-items: center; }
.logo-name { display: inline-flex; align-items: baseline; gap: .32em; white-space: nowrap; }
.logo-name b { font-weight: 600; letter-spacing: -0.03em; }
.logo-name small { font-size: .62em; font-weight: 600; letter-spacing: .06em; }
.nav-links { display: none; gap: 2px; margin-left: 18px; }
.nav-links a { padding: 7px 12px; border-radius: var(--radius-full); font-size: 14px; color: var(--fg-secondary); font-weight: 500; }
.nav-links a:hover { background: var(--bg-hover); color: var(--fg); }
.nav-links a[aria-current="page"] { color: var(--fg); background: var(--bg-active); }
@media (min-width: 960px) { .nav-links { display: flex; } }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.hide-sm { display: none !important; } @media (min-width: 600px) { .hide-sm { display: inline-flex !important; } }

/* Sections */
section { padding: 88px 0; position: relative; }
@media (min-width: 900px) { section { padding: 128px 0; } }
.sec-head { display: grid; gap: 16px; margin-bottom: 44px; max-width: 760px; }
.sec-head.center { margin-left: auto; margin-right: auto; text-align: center; justify-items: center; }
.sec-head.split { max-width: none; }
@media (min-width: 960px) { .sec-head.split { grid-template-columns: 1.2fr 1fr; align-items: end; gap: 48px; } }
.invert { background: var(--bg); color: var(--fg); }
.invert-band { background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(255,255,255,.06), transparent 70%),
    radial-gradient(var(--field-dot) 1px, transparent 1.3px) 0 0 / 16px 16px, var(--bg); }
[data-theme="dark"] .invert-band { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background-color: #0f0f10; }

/* Ticks */
.ticks { display: grid; gap: 10px; }
.ticks li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; font-size: 14.5px; color: var(--fg-secondary); }
.ticks li::before { content: ""; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; background: var(--green-subtle) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='9' height='7' fill='none' stroke='%2312924f' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M1 3.6l2.3 2.2L8 1.2'/></svg>") no-repeat center; }

/* Final CTA + footer */
.final { text-align: center; }
.final .btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 32px; }
footer.site { border-top: 1px solid var(--border); padding: 56px 0 40px; font-size: 14px; color: var(--fg-tertiary); }
footer.site .cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
footer.site .brand-col { grid-column: 1 / -1; }
@media (min-width: 720px) { footer.site .cols { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1040px) { footer.site .cols { grid-template-columns: 1.6fr repeat(5, 1fr); } footer.site .brand-col { grid-column: auto; } }
footer.site h5 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--fg); }
footer.site ul { display: grid; gap: 9px; }
footer.site a:hover, .link-btn:hover { color: var(--fg); }
.link-btn { font-size: inherit; color: inherit; text-align: left; }
footer.site .base-links { display: flex; gap: 18px; }
footer.site .base { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; }

/* Segmented links (legal tabs) */
.seg a { height: 32px; padding: 0 14px; border-radius: var(--radius-full); font-size: 13px; font-weight: 500; color: var(--fg-secondary); display: inline-flex; align-items: center; }
.seg a:hover { color: var(--fg); }
.seg a[aria-current="page"] { background: var(--bg-elevated); color: var(--fg); box-shadow: 0 0 0 1px var(--border); }

/* Cookie banner + settings dialog */
.consent { position: fixed; z-index: 50; left: 16px; right: 16px; bottom: 16px; max-width: 440px; padding: 18px; display: grid; gap: 14px;
  background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: 0 18px 50px -20px rgba(0,0,0,.28); animation: consent-in .5s var(--ease-out) both; }
@media (min-width: 600px) { .consent { left: 24px; bottom: 24px; } }
@keyframes consent-in { from { opacity: 0; transform: translateY(12px); } }
.consent-text b { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.consent-text p { font-size: 13.5px; color: var(--fg-secondary); line-height: 1.5; }
.consent a, .consent-dialog a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.consent-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.consent-btns .btn-primary { flex: 1 1 0; }
.consent-dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-xl); background: var(--bg-elevated); color: var(--fg); box-shadow: 0 30px 80px -24px rgba(0,0,0,.35); }
.consent-dialog::backdrop { background: rgba(10,10,10,.36); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.consent-dialog form { padding: 22px; display: grid; gap: 14px; }
.cd-head { display: flex; align-items: center; justify-content: space-between; }
.cd-head h2 { font-size: 18px; }
.cd-intro, .cd-note { font-size: 13.5px; color: var(--fg-secondary); }
.cd-note { color: var(--fg-tertiary); }
.cd-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-subtle); }
.cd-row b { display: block; font-size: 14px; font-weight: 600; }
.cd-row span { font-size: 13px; color: var(--fg-secondary); }
.cd-btns { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.switch { position: relative; flex: none; width: 38px; height: 22px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--bg-inset); box-shadow: inset 0 0 0 1px var(--border-strong); transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-elevated); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s var(--ease-out); }
.switch input:checked + i { background: var(--fg); box-shadow: none; }
.switch input:checked + i::after { transform: translateX(16px); background: var(--bg); }
.switch input:disabled + i { opacity: .55; }
.switch input:focus-visible + i { outline: 2px solid var(--border-focus); outline-offset: 2px; }

/* Legal pages */
.legal-head { padding: 64px 0 40px; display: grid; gap: 16px; justify-items: start; border-bottom: 1px solid var(--border); }
@media (min-width: 900px) { .legal-head { padding: 96px 0 48px; } }
.legal-head .lede { max-width: 62ch; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--fg-tertiary); }
.legal-head .seg { margin-top: 8px; }
.legal-grid { display: grid; gap: 32px; padding: 40px 0 112px; }
@media (min-width: 960px) { .legal-grid { grid-template-columns: 220px minmax(0, 1fr); gap: 64px; padding-top: 56px; } }
.toc { display: none; }
@media (min-width: 960px) { .toc { display: block; position: sticky; top: 96px; align-self: start; max-height: calc(100dvh - 120px); overflow: auto; } }
.toc p { font-size: 12.5px; font-weight: 600; color: var(--fg); margin-bottom: 10px; }
.toc ol { display: grid; gap: 2px; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 1px solid transparent; font-size: 13px; color: var(--fg-tertiary); line-height: 1.4; }
.toc a:hover { color: var(--fg); }
.toc a[aria-current] { color: var(--fg); border-left-color: var(--fg); }
.prose { max-width: 74ch; font-size: 15.5px; line-height: 1.7; color: var(--fg-secondary); }
.prose > * + * { margin-top: 14px; }
.prose h2 { margin-top: 56px; padding-top: 8px; font-size: 22px; letter-spacing: -0.025em; color: var(--fg); scroll-margin-top: 88px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 28px; font-size: 16px; color: var(--fg); }
.prose strong { color: var(--fg); font-weight: 600; }
.prose a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 22px; display: grid; gap: 6px; }
.prose ul { list-style: disc; } .prose ol { list-style: decimal; }
.prose li::marker { color: var(--fg-quaternary); }
.prose .summary { padding: 18px 20px; border-radius: var(--radius-md); background: var(--bg-elevated); border: 1px solid var(--border); color: var(--fg-secondary); }
.prose .summary b { display: block; color: var(--fg); margin-bottom: 6px; }
.prose .summary ul { margin-top: 8px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-elevated); }
.prose table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.5; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.prose th { font-weight: 600; color: var(--fg); background: var(--bg-subtle); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose td code { font-size: 12.5px; color: var(--fg); white-space: nowrap; }
.prose .btn { text-decoration: none; color: var(--fg-inverse); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
