/* Inputs: Static FINCHIP markup and theme tokens.
 * Outputs: theme presentation and responsive states.
 * Role: Preserves the supplied Finch visual system for the independent homepage. */
:root { --surface-elevated: #fff; --card-gradient-start: #fff; --card-gradient-end: #fff3; --shadow-progressive: 0 4px 12px #5744750f; }
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --text-primary: #f3f2f5; --text-secondary: #c0bdc7; --text-tertiary: #9994a3;
  --copy-color: #bcb7c6; --meta-color: #a8a2b2; --ink: #f3f2f5; --muted: #bcb7c6; --faint: #a8a2b2;
  --surface: #0c0c0f; --paper: #0c0c0f; --surface-elevated: #18171d; --surface-muted: #242229;
  --card-border: #38343e; --divider: #332f39; --line: #38343e; --action: #f3f2f5;
  --card-gradient-start: #18171d; --card-gradient-end: #18171d;
  --shadow-progressive: 0 4px 16px #0004; --shell-shadow: 0 6px 20px #0005, inset 0 1px 0 #ffffff09;
}
.theme-toggle { position: relative; display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; overflow: hidden; border: .8px solid transparent; border-radius: 999px; background: linear-gradient(to bottom, var(--card-gradient-start) 72.6%, var(--card-gradient-end)); color: var(--text-primary); cursor: pointer; transition: border-color .14s ease-out, box-shadow .14s ease-out, transform .14s ease-out; }
.theme-toggle:is(:hover, :focus-visible) { border-color: var(--card-border); box-shadow: var(--shadow-progressive); }
.theme-toggle:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 3px; }
.theme-toggle:active { transform: scale(.96); }
.theme-icon { position: absolute; display: grid; place-items: center; font: 18px/1 var(--font-ui); transition: opacity .14s ease-out, transform .14s ease-out; }
.theme-sun { opacity: 0; transform: scale(.25); }
html[data-theme="dark"] .theme-moon { opacity: 0; transform: scale(.25); }
html[data-theme="dark"] .theme-sun { opacity: 1; transform: scale(1); }
.brand .brand-wordmark-dark { display: none; }
html[data-theme="dark"] .brand-wordmark-light { display: none; }
html[data-theme="dark"] .brand-wordmark-dark { display: block; }
html[data-theme="dark"] .header-shell, html[data-theme="dark"] .mobile-nav { background: var(--surface-elevated); }
html[data-theme="dark"] .mobile-nav a:hover { background: var(--surface-muted); }
html[data-theme="dark"] .protocol-section .protocol-workspace { background: var(--surface-elevated); border-color: var(--card-border); box-shadow: 0 12px 40px #0003; }
html[data-theme="dark"] .protocol-section .protocol-tabs { background: #121116; border-color: var(--card-border); }
html[data-theme="dark"] .protocol-section .protocol-tab[aria-selected="true"], html[data-theme="dark"] .protocol-section .protocol-tab:hover { background: #29252f; border-color: #48404f; box-shadow: none; }
html[data-theme="dark"] .protocol-tab small { color: var(--meta-color); }
html[data-theme="dark"] .eyebrow { background: var(--surface-elevated); border-color: var(--card-border); color: var(--meta-color); box-shadow: none; }
html[data-theme="dark"] .about-intro > .section-label { background: var(--surface-elevated); border-color: var(--card-border); color: var(--meta-color); box-shadow: none; }
html[data-theme="dark"] .status { color: #ebcb94; border-color: #655137; background: #30281c; }
html[data-theme="dark"] .protocol-section .diagram-tile { background: #24212b; border-color: color-mix(in srgb, var(--accent) 50%, var(--card-border)); }
html[data-theme="dark"] .protocol-section .diagram-tile::before, html[data-theme="dark"] .protocol-section .diagram-tile::after { background: var(--surface-elevated); }
html[data-theme="dark"] .protocol-section .diagram-steps::before { background: color-mix(in srgb, var(--accent) 35%, var(--divider)); }
html[data-theme="dark"] .protocol-section .flow-strip, html[data-theme="dark"] .flow-card { border-color: var(--divider); }
html[data-theme="dark"] .diagram-icon .icon-light { stop-color: color-mix(in srgb, var(--accent) 65%, #f3f2f5); }
html[data-theme="dark"] .protocol-section .diagram-step strong, html[data-theme="dark"] .flow-card strong { color: var(--text-primary); }
html[data-theme="dark"] .diagram-step small, html[data-theme="dark"] .protocol-section .diagram-caption { color: var(--meta-color); }
html[data-theme="dark"] .protocol-details-trigger, html[data-theme="dark"] .protocol-popover { background: var(--surface-elevated); }
html[data-theme="dark"] .protocol-popover { box-shadow: 0 16px 42px #0006; }
html[data-theme="dark"] .source-rail { color: var(--text-secondary); }
html[data-theme="dark"] .source-rail:hover { color: var(--text-primary); }
html[data-theme="dark"] .footer-bottom, html[data-theme="dark"] .disclaimer { border-color: var(--divider); color: var(--meta-color); }
html[data-theme="dark"] .disclaimer p { color: var(--meta-color); }
html[data-theme="dark"] .footer-group a:hover, html[data-theme="dark"] .footer-bottom > a:hover { color: var(--text-primary); }
html[data-theme="dark"] .button-dark { color: #171519; background: #efedf2; }
html[data-theme="dark"] .button-dark:hover { background: #d9d4e1; }
html[data-theme="dark"] .hero-section .hero-button-primary, html[data-theme="dark"] .hero-section .hero-button-primary:hover { color: #f3f2f5; background: transparent; }
html[data-theme="dark"] .hero-button-primary::after { background: #211e27; }
html[data-theme="dark"] .direction-art--image img { filter: drop-shadow(0 8px 18px #a78bfa18); }
@media (max-width: 540px) { .header-actions { gap: 3px; } .language-trigger, .theme-toggle { width: 34px; height: 38px; flex-basis: 34px; } .brand-header, .brand-header .brand-wordmark { width: 82px; } }
@media (max-width: 360px) { .brand-header, .brand-header .brand-wordmark { width: 64px; } .header-shell { padding-inline: 8px; } .header-actions { gap: 2px; } .language-trigger, .theme-toggle { width: 30px; flex-basis: 30px; } .visit-link { padding-inline: 7px; font-size: 10px; gap: 3px; } }
@media (prefers-reduced-motion: reduce) { .theme-toggle, .theme-icon { transition: none; } }
