/* Brumm Labs look for the pages that are not themed by a list (landing, legal, notice pages).
   Tokens and components follow the brummlabs.de site (see specs/012-brummlabs-design/research/design.md).
   Every rule is scoped under body.brand so it can never leak onto themed pages. */

@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter Fallback"; src: local(Arial); ascent-override: 90.44%; descent-override: 22.52%; line-gap-override: 0%; size-adjust: 107.12%; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url(/fonts/jetbrains-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url(/fonts/jetbrains-mono-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono Fallback"; src: local(Arial); ascent-override: 75.79%; descent-override: 22.29%; line-gap-override: 0%; size-adjust: 134.59%; }

body.brand {
  --color-bg-primary: #0a0a0f;
  --color-bg-secondary: #12121a;
  --color-bg-tertiary: #1a1a25;
  --color-bg-surface: #22222e;
  --color-text-primary: #f0f0f5;
  --color-text-secondary: #a0a0b0;
  --color-text-tertiary: #8585a0;
  --color-accent-blue: #3b82f6;
  --color-accent-purple: #8b5cf6;
  --color-accent-cyan: #06b6d4;
  --color-border-default: #2a2a38;
  --color-border-hover: #3a3a4a;
  --color-border-focus: #3b82f6;
  --color-success: #22c55e;
  --color-error: #ef4444;
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px;
  --spacing-xs: 4px; --spacing-sm: 8px; --spacing-md: 16px; --spacing-lg: 32px; --spacing-xl: 64px; --spacing-2xl: 96px;
  --font-sans: "Inter", "Inter Fallback", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gradient-brand: linear-gradient(135deg, #3b82f6, #8b5cf6, #06b6d4);
  --btn-from: #2563eb; /* darker than the accent blue so white button text reaches 4.5:1 (see brand-contrast test) */
  --btn-to: #7c3aed;
  --btn-danger: #b91c1c; /* white text 6.5:1 */
  color-scheme: dark;
}

/* ---------- Base ---------- */
body.brand { margin: 0; overflow-x: clip; background: var(--color-bg-primary); color: var(--color-text-primary); font: 16px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; }
body.brand *, body.brand *::before, body.brand *::after { box-sizing: border-box; }
body.brand [hidden] { display: none !important; }
body.brand a { color: var(--color-accent-blue); text-decoration: none; }
body.brand a:hover { text-decoration: underline; }
/* Links inside running text must not rely on color alone (WCAG 1.4.1). */
body.brand main p a:not(.button-link), body.brand main li a, body.brand .site-footer .lp-provider a { text-decoration: underline; text-underline-offset: 2px; }
body.brand h1, body.brand h2, body.brand h3 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.02em; overflow-wrap: break-word; hyphens: auto; }
body.brand p { margin: 0 0 12px; }
body.brand .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body.brand :focus-visible { outline: 2px solid var(--color-accent-blue); outline-offset: 2px; }
body.brand .mono, body.brand code { font-family: var(--font-mono); }
body.brand code { background: var(--color-bg-tertiary); padding: 1px 6px; border-radius: var(--radius-sm); font-size: .85em; overflow-wrap: anywhere; }
body.brand [data-motif] svg { display: block; width: 100%; height: auto; overflow: visible; }

body.brand .skip-link { position: absolute; left: 12px; top: -64px; z-index: 200; padding: 10px 16px; border-radius: var(--radius-lg); background: var(--color-bg-surface); color: var(--color-text-primary); }
body.brand .skip-link:focus { top: 8px; text-decoration: none; }

/* ---------- Header and footer ---------- */
body.brand .site-header { position: fixed; inset: 0 0 auto 0; z-index: 100; height: 60px; border-bottom: 1px solid var(--color-border-default); background: rgba(10, 10, 15, .85); backdrop-filter: blur(12px); }
body.brand .site-header-inner { max-width: 1100px; height: 100%; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
body.brand .site-logo { display: flex; align-items: center; }
body.brand .site-logo img { display: block; width: 90px; height: 45px; }
body.brand .site-nav { display: flex; align-items: center; gap: 24px; }
body.brand .site-nav a { position: relative; font-size: 14px; font-weight: 500; color: var(--color-text-secondary); transition: color .2s; }
body.brand .site-nav a:hover { color: var(--color-text-primary); text-decoration: none; }
@media (max-width: 47.99rem) { body.brand .site-nav a:not(.nav-cta) { display: none; } body.brand .site-nav a.nav-cta { color: var(--color-text-primary); } }
@media (hover: hover) {
  body.brand .site-nav a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px; background: var(--color-accent-purple); transform: scaleX(0); transform-origin: 0; transition: transform .2s ease-out; }
  body.brand .site-nav a:hover::after { transform: scaleX(1); }
}

body.brand .site-footer { border-top: 1px solid var(--color-border-default); padding: 32px 24px; margin-top: 80px; }
body.brand .site-footer-inner { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; font-size: 14px; color: var(--color-text-tertiary); }
body.brand .site-footer p { margin: 0; }
body.brand .site-footer a { color: inherit; transition: color .2s; }
body.brand .site-footer a:hover { color: var(--color-text-secondary); text-decoration: none; }
body.brand .legal-links { display: flex; gap: 16px; align-items: center; }

/* ---------- Layout ---------- */
body.brand main { max-width: 1100px; margin: 0 auto; padding: 100px 24px 0; }
body.brand main.legal, body.brand main.notice { padding-top: 112px; }
body.brand main.legal > * { max-width: 75ch; }
body.brand main.notice { max-width: 800px; }
body.brand section { margin-top: 72px; }
@media (min-width: 48rem) { body.brand section { margin-top: 112px; } }

/* ---------- Buttons ---------- */
body.brand button, body.brand a.button-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 12px 28px; border: 0; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--btn-from), var(--btn-to), var(--btn-from)); background-size: 200% 100%; background-position: 0 0; color: #fff;
  font: 600 14px var(--font-sans); cursor: pointer; text-decoration: none; transition: background-position .3s, opacity .2s, transform .2s;
}
@media (hover: hover) { body.brand button:hover:not(:disabled), body.brand a.button-link:hover { background-position: 100% 0; transform: translateY(-1px); opacity: .95; text-decoration: none; } }
body.brand button:disabled { opacity: .5; cursor: default; }
body.brand button.secondary { background: transparent; color: var(--color-text-primary); border: 1px solid var(--color-border-default); }
@media (hover: hover) { body.brand button.secondary:hover:not(:disabled) { background: var(--color-bg-tertiary); border-color: var(--color-border-hover); transform: none; opacity: 1; } }
body.brand .btn-shimmer { position: relative; overflow: hidden; }
body.brand .btn-shimmer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #0000 0%, #ffffff26 50%, #0000 100%); transform: translateX(-100%); animation: brand-shimmer 3s ease-in-out 1.5s infinite; }
@keyframes brand-shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
body.brand button.danger { background: var(--btn-danger); }
body.brand button.danger:hover:not(:disabled) { background: #991b1b; }
body.brand .row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

/* ---------- Fields ---------- */
body.brand label { display: block; margin: 16px 0 4px; font-size: 14px; font-weight: 500; color: #fff; }
body.brand input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%; min-height: 44px; padding: 12px 16px; background: var(--color-bg-surface); color: #fff; border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg); font: 400 14px var(--font-sans); transition: border-color .2s, box-shadow .2s;
}
body.brand input:not([type="checkbox"]):not([type="radio"]):hover { border-color: var(--color-border-hover); }
body.brand input:not([type="checkbox"]):not([type="radio"]):focus { outline: none; border-color: var(--color-border-focus); box-shadow: 0 0 0 3px rgba(59, 130, 246, .15); }
body.brand select { width: 100%; min-height: 44px; padding: 10px 14px; background: var(--color-bg-surface); color: #fff; border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); font: 400 14px var(--font-sans); }
body.brand select:hover { border-color: var(--color-border-hover); }
body.brand select:focus { outline: none; border-color: var(--color-border-focus); box-shadow: 0 0 0 3px rgba(59, 130, 246, .15); }
body.brand .panel { padding: 24px; background: var(--color-bg-secondary); border: 1px solid var(--color-border-default); border-radius: var(--radius-xl); }
body.brand .panel h3.sub, body.brand h3.sub { margin-top: 28px; }
body.brand dialog { background: var(--color-bg-secondary); color: var(--color-text-primary); border: 1px solid var(--color-border-default); border-radius: var(--radius-xl); padding: 24px; }
body.brand dialog::backdrop { background: rgba(0, 0, 0, .7); }
body.brand input[readonly] { color: var(--color-text-secondary); }
body.brand .toggle { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 8px 0 0; font-weight: 500; }
body.brand .toggle input { width: 20px; height: 20px; margin: 0; accent-color: var(--color-accent-blue); }
body.brand .hint { margin: 6px 0 0; font-size: 13px; color: var(--color-text-secondary); }
body.brand .error, body.brand .error-inline { color: var(--color-error); font-size: 14px; margin: 12px 0 0; }
body.brand .success { color: var(--color-success); font-size: 14px; margin: 12px 0 0; }
body.brand .card { padding: 28px; background: var(--color-bg-secondary); border: 1px solid var(--color-border-default); border-radius: var(--radius-xl); }
body.brand .share { display: flex; gap: 8px; align-items: stretch; }
body.brand .share input { flex: 1; min-width: 0; }
body.brand .toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; padding: 10px 18px; border-radius: var(--radius-lg); background: var(--color-bg-surface); border: 1px solid var(--color-border-default); transition: opacity .2s, transform .2s; z-index: 300; }
body.brand .toast.show { opacity: 1; transform: translate(-50%, 0); }
body.brand .lp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Recovery code (recovery.js, shared with themed pages) ---------- */
body.brand .recovery-code { font-family: var(--font-mono); font-size: 22px; font-weight: 700; letter-spacing: .06em; text-align: center; padding: 16px 12px; margin: 12px 0; background: var(--color-bg-secondary); border: 1px solid var(--color-border-default); border-radius: var(--radius-xl); word-break: break-all; color: var(--color-accent-cyan); }
body.brand dialog.recovery-dialog { background: var(--color-bg-secondary); color: var(--color-text-primary); border: 1px solid var(--color-border-default); border-radius: var(--radius-xl); max-width: 420px; padding: 24px; }
body.brand dialog.recovery-dialog::backdrop { background: rgba(0, 0, 0, .7); }

/* ---------- Landing page ---------- */
body.brand .lp-hero { position: relative; display: block; padding: 40px 0 0; text-align: left; }
body.brand .hero-glow { position: absolute; z-index: -1; inset: -120px 0 auto 0; height: 520px; background: radial-gradient(#3b82f626, #0000 70%); pointer-events: none; }
body.brand .lp-eyebrow { margin: 0 0 12px; font: 500 13px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--color-accent-purple); }
body.brand .lp-hero h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 700; line-height: 1.1; margin-bottom: 20px; }
body.brand .gradient-text { background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
body.brand .lp-lead { max-width: 600px; font-size: 18px; line-height: 1.625; color: var(--color-text-secondary); }
body.brand .landing h2, body.brand section > h2 { font-size: clamp(28px, 3.5vw, 40px); font-weight: 700; }
body.brand h3 { font-size: 20px; font-weight: 600; }

body.brand .lp-steps { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
body.brand .lp-steps li { display: grid; align-content: start; gap: 8px; padding: 24px; background: var(--color-bg-secondary); border: 1px solid var(--color-border-default); border-radius: var(--radius-xl); transition: transform .3s ease-out; }
@media (hover: hover) { body.brand .lp-steps li:hover { transform: translateY(-2px); } }
body.brand .lp-steps strong { font: 600 20px var(--font-mono); color: var(--color-accent-cyan); }
body.brand .lp-steps li > span { font-size: 15px; line-height: 1.7; color: var(--color-text-secondary); }


body.brand .lp-closed { padding: 14px 16px; border-radius: var(--radius-lg); background: var(--color-bg-tertiary); font-weight: 500; }
body.brand .lp-done h3 { font-size: 24px; }
body.brand #agent-key-box { margin-top: 20px; padding-top: 8px; border-top: 1px solid var(--color-border-default); }
body.brand .lp-assistant { margin-top: 20px; padding: 16px 20px; background: var(--color-bg-tertiary); border-radius: var(--radius-xl); }

/* Tabs and steps of the AI section */
body.brand .tabs { display: flex; gap: 8px; margin: 16px 0 12px; }
body.brand .tabs [role="tab"] { background: transparent; border: 1px solid var(--color-border-default); color: var(--color-text-secondary); padding: 8px 20px; }
body.brand .tabs [role="tab"][aria-selected="true"] { background: var(--color-bg-surface); color: var(--color-text-primary); border-color: var(--color-border-focus); transform: none; }
body.brand .steps ol { margin: 0 0 16px; padding-left: 20px; color: var(--color-text-secondary); }
body.brand .steps li { margin-bottom: 8px; }
body.brand .steps strong { color: var(--color-text-primary); }

/* Theme carousel: the cards keep the tokens of the theme they preview */
body.brand .lp-designs { border: 0; padding: 0; margin: 20px 0 0; min-width: 0; }
body.brand .theme-card {
  position: relative; flex: 0 0 132px; scroll-snap-align: start; display: grid; gap: 2px; justify-items: center; text-align: center; margin: 0; padding: 10px 8px 12px;
  background: var(--bg); color: var(--ink); font: 700 14px var(--font-body); border: 3px solid var(--line); border-radius: 16px; cursor: pointer;
}
body.brand .theme-card:has(input:checked) { border-color: var(--color-accent-blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, .35); }
body.brand .theme-card:has(input:focus-visible) { outline: 2px solid var(--color-accent-blue); outline-offset: 3px; }
body.brand .theme-card input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; cursor: pointer; }
body.brand .theme-card .tc-art { width: 84px; height: 84px; display: block; }
body.brand .theme-card .tc-art svg { display: block; width: 100%; height: 100%; overflow: visible; }
body.brand .theme-card .tc-group { font-size: 12px; font-weight: 600; color: var(--muted); }
body.brand .theme-card .tc-check { position: absolute; top: 6px; right: 8px; font-size: 14px; color: var(--accent); visibility: hidden; }
body.brand .theme-card:has(input:checked) .tc-check { visibility: visible; }

/* Default tokens for the previews (capybara = the app default; other themes override them via [data-theme]). :where() keeps specificity at zero. */
:where(body.brand .theme-card, body.brand .lp-mock) { --bg-dot: #f1e4d2; --bg: #fbf4ea; --card: #fffdf9; --ink: #3a2a1f; --muted: #8a7563; --line: #eedfcc; --accent: #e07a2f; --accent-hover: #c96a22; --accent-ink: #fff; --accent-soft: #fde6d2; --mint: #3f9e7c; --mint-soft: #e2f3ea; --pink: #e2557a; --radius: 20px; --font-body: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif; }
@media (prefers-color-scheme: dark) {
  :where(body.brand .theme-card[data-theme="capybara"], body.brand .lp-mock) { --bg-dot: #2a221c; --bg: #1f1915; --card: #2b231d; --ink: #f5ebe0; --muted: #bba792; --line: #3d322a; --accent: #f39a52; --accent-hover: #ffad6a; --accent-ink: #24190f; --accent-soft: #4a3020; --mint: #7fd3b0; --mint-soft: #213a30; }
}

/* ---------- Legal and notice pages ---------- */
body.brand main.legal h1 { font-size: clamp(24px, 8vw, 30px); font-weight: 700; margin-bottom: 32px; }
body.brand main.legal h2 { font-size: 20px; font-weight: 600; margin: 32px 0 12px; }
body.brand main.legal h3 { font-size: 18px; font-weight: 600; margin: 24px 0 8px; }
body.brand main.legal p, body.brand main.legal li { color: var(--color-text-secondary); line-height: 1.625; }
body.brand main.legal ul { padding-left: 22px; margin: 0 0 12px; }
body.brand main.legal a:hover { text-decoration: underline; }
body.brand .legal-notice { margin-bottom: 32px; padding: 14px 16px; border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); background: var(--color-bg-tertiary); color: var(--color-text-primary); }
body.brand main.notice h1 { font-size: clamp(24px, 6vw, 36px); font-weight: 700; margin-bottom: 12px; }
body.brand main.notice .intro { color: var(--color-text-secondary); font-size: 18px; }
body.brand main.notice .closed-message { margin-top: 16px; padding: 16px 20px; background: var(--color-bg-secondary); border: 1px solid var(--color-border-default); border-radius: var(--radius-xl); }
body.brand main.notice .login { max-width: 480px; }
body.brand main.notice .empty { margin: 0; padding: 32px 24px; text-align: center; font-size: 18px; color: var(--color-text-secondary); background: var(--color-bg-secondary); border: 1px solid var(--color-border-default); border-radius: var(--radius-xl); }

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