/* Approved white theme, shared by the local site and the isolated light preview. */
:root[data-site-design][data-theme='light-preview'] {
  color-scheme: only light;
  --surface: #ffffff; --void: #ffffff; --paper: #343c43; --ink: #343c43;
  --muted: #59636c; --blue: #425f73; --teal: #425f73; --gold: #425f73;
  --glass: #edf1f3; --field: #f0f2f2; --steel: #e8edef;
  --plate: #e3e9ec; --plate-ink: #343c43; --plate-muted: #59636c;
  --line: #343c4333; background: var(--surface); color: var(--ink);
}
html[data-theme='light-preview'] body { background: var(--surface); color: var(--ink); }
html[data-theme='light-preview'] .hybrid-home {
  --hybrid-ink: #343c43; --hybrid-blue: #edf1f3; --hybrid-ground: #343c43;
}
html[data-theme='light-preview'] :is(.site-header-shell,.nitida-shell) {
  --paper: #343c43; --muted: #59636c; --teal: #425f73; --gold: #425f73;
  color: var(--ink);
}
html[data-theme='light-preview'] :is(.cinematic-intro,.cinema-media,.threshold-page) { background: var(--surface); }
/* Only the drawn circuit is inverted: photographs, covers and video pixels are untouched. */
/* Clip the inverted canvas ground to white, retaining the darker moving lines. */
html[data-theme='light-preview'] #background-canvas { filter: invert(1) hue-rotate(180deg) brightness(1.08) blur(.6px); opacity: .85; }
html[data-theme='light-preview'] .circuit-fallback { filter: invert(1) hue-rotate(180deg) brightness(1.08) blur(.6px); opacity: .85; }
html[data-theme='light-preview'] .cinema-shade { background: transparent; }
html[data-theme='light-preview'] :is(.opening-brand img,.site-header-shell .brand img) { filter: brightness(0) opacity(.76); }
/* WAAPI sets a white-logo filter; override only its colour, never the reveal opacity. */
html[data-theme='light-preview'] .opening-brand img { filter: brightness(0) opacity(.76) !important; }
html[data-theme='light-preview'] :is(.opening-tagline,.opening-topics,.opening-control,.motion-control,.motion-note,.minimal-nav a,.language-nav a,.brand-expansion,.site-contact-link,.mobile-menu summary) { color: var(--ink) !important; }
html[data-theme='light-preview'] .opening-tagline { color: #343c43 !important; }
html[data-theme='light-preview'] .opening-topics a { color: #425f73 !important; }
html[data-theme='light-preview'] :is(.opening-control,.motion-control,.site-contact-link) { background: transparent; border-color: #59636c70; }
html[data-theme='light-preview'] :is(.opening-topics a:hover,.mobile-menu nav a:hover,.mobile-menu nav button:hover) { background: #e3e9ec !important; color: #343c43 !important; }
html[data-theme='light-preview'] :is(.site-preview-strip,.frontier-footer,.mobile-menu nav#site-navigation) { background: #edf1f3 !important; color: var(--ink); }
html[data-theme='light-preview'] .site-preview-strip { flex-wrap: wrap; gap: 4px 20px; }
html[data-theme='light-preview'] .light-comparison { color: #425f73; margin-left: auto; min-height: 32px; display: inline-flex; align-items: center; }
html[data-theme='light-preview'] .mobile-menu nav#site-navigation { box-shadow: 0 12px 45px #343c431c; border-color: #343c4333; }
html[data-theme='light-preview'] #site-navigation :is(a,button,span,strong,p,small) { color: var(--ink) !important; }
html[data-theme='light-preview'] #site-navigation :is(.menu-group-title,.menu-link-copy small,.menu-language-label) { color: var(--muted) !important; }
html[data-theme='light-preview'] #site-navigation :is(.menu-top,.menu-utilities,.menu-destination,.menu-languages,.brand-expansion) { border-color: #343c4333; }
html[data-theme='light-preview'] #site-navigation .menu-top { background: #edf1f3; }
html[data-theme='light-preview'] :is(a:hover,.project-permalink,.text-link,.quiet-link,.footer-nav a,.site-footer-bottom a) { color: var(--blue) !important; }
html[data-theme='light-preview'] :focus-visible { outline-color: #425f73 !important; }
html[data-theme='light-preview'] .frontier-skip { background: #edf1f3; color: #343c43; }
html[data-theme='light-preview'] :is(input,textarea,select) { color: #343c43 !important; background: #fff !important; border-color: #707b83 !important; accent-color: #425f73; }
html[data-theme='light-preview'] :is(input,textarea)::placeholder { color: #59636c; }
html[data-theme='light-preview'] :is(.registration-preview,.contact-preview,.contact-form,.contact-status,.privacy-panel,.privacy-dialog) { background: var(--field) !important; color: var(--ink) !important; }
html[data-theme='light-preview'] :is(.content-shell,.frontier-footer) :is(h1,h2,h3,h4,p,li,dt,dd,label,legend,summary) { color: var(--ink); }
html[data-theme='light-preview'] :is(.journal-identity,.journal-logo-panel) { background: #edf1f3 !important; color: #343c43; }
html[data-theme='light-preview'] .journal-identity :is(p,a,span,h2,h3) { color: #343c43 !important; }
html[data-theme='light-preview'] :is(.content-shell,.privacy-panel,.privacy-dialog) button { background: #e3e9ec; color: #343c43; border-color: #59636c; }
html[data-theme='light-preview'] .light-service-note { padding: 20px; background: #edf1f3; color: #343c43; }
html[data-theme='light-preview'] .blog-shell,
html[data-theme='light-preview'] .blog-shell :is(h1,h2,h3,p,a,span,summary,button,figcaption,time,li) { color: #343c43 !important; }
html[data-theme='light-preview'] .blog-filters button { background: #edf1f3; }
html[data-theme='light-preview'] :is(.privacy-banner,.privacy-draft) { background: #edf1f3; color: #343c43; }
html[data-theme='light-preview'] .privacy-banner :is(p,h2,button,a) { color: #343c43; }
html[data-theme='light-preview'] .privacy-banner button { background: #e3e9ec; }
@media (max-width:600px) {
  html[data-theme='light-preview'] .site-preview-strip { font-size: 12px; padding-block: 6px; }
}

/* Never substitute a different circuit while the definitive geometry loads. */
html[data-theme='light-preview'][data-opening='pending'] .circuit-fallback { display: block; background: none; filter: none; opacity: 1; }
html[data-theme='light-preview'][data-opening='pending'] #background-canvas { visibility: hidden; }

html[data-theme='light-preview'][data-opening='pending'] .circuit-fallback::after { content: 'Loading...'; position: absolute; top: 100px; left: 24px; font-size: 13px; color: #59636c; }
html[data-theme='light-preview'][data-opening='pending']:lang(it) .circuit-fallback::after { content: 'Caricamento...'; }

html[data-theme="light-preview"] .analysis-development { grid-column: 1 / -1; max-width: 75ch; }

/* The mobile drawer covers the opening controls, including on short viewports. */
@media (max-width:600px) {
  html[data-theme='light-preview'] .site-header-shell[data-compact='true'] .mobile-menu nav#site-navigation {
    inset: 0 !important; width: 100% !important; height: 100dvh; max-height: 100dvh;
    border: 0; border-radius: 0; padding: 20px 24px; z-index: 1000;
  }
  html[data-theme='light-preview']:has(.mobile-menu[open]) :is(.opening-control,.motion-control) { visibility: hidden; }
}
