/* WTech — palettes et sélecteur de thème communs aux quinze pages. */
:root {
  color-scheme: dark;
  --theme-text: #f8f8f4;
  --theme-muted: #bdbdc4;
  --theme-border: rgba(255, 255, 255, .18);
  --theme-control: rgba(255, 255, 255, .07);
  --theme-control-hover: rgba(255, 255, 255, .14);
  --theme-focus: #f8f8f4;
}

html[data-theme="light"] {
  color-scheme: light;
  --black: #f7f7f4;
  --black-2: #ffffff;
  --white: #17181d;
  --bg: #f7f7f4;
  --surface: #ffffff;
  --panel: #ffffff;
  --panel-2: #eceef0;
  --text: #17181d;
  --muted: #5b5e67;
  --accent: #17181d;
  --line: rgba(25, 28, 36, .14);
  --stroke: rgba(25, 28, 36, .14);
  --line-dark: rgba(25, 28, 36, .14);
  --glass: rgba(255, 255, 255, .8);
  --shadow: 0 24px 65px rgba(25, 28, 36, .07);
  --silver-1: #35373e;
  --silver-2: #202127;
  --silver-3: #08090c;
  --silver: #3c3f48;
  --theme-text: #17181d;
  --theme-muted: #5b5e67;
  --theme-border: rgba(25, 28, 36, .16);
  --theme-control: rgba(25, 28, 36, .045);
  --theme-control-hover: rgba(25, 28, 36, .09);
  --theme-focus: #17181d;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--theme-border);
  border-radius: 999px;
  background: var(--theme-control);
  color: var(--theme-text);
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: var(--theme-control-hover); transform: translateY(-1px); }
.theme-toggle:active { transform: translateY(0); }
.theme-toggle:focus-visible { outline: 2px solid var(--theme-focus); outline-offset: 4px; }
.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.theme-toggle .theme-moon { display: none; }
html[data-theme="light"] .theme-toggle .theme-sun { display: none; }
html[data-theme="light"] .theme-toggle .theme-moon { display: block; }
.header-actions, .topbar-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

@media (max-width: 680px) {
  .nav, .site-header, .topbar-inner { gap: 8px; }
  .nav-actions, .header-actions, .topbar-actions { gap: 7px; }
  .site-header .header-cta { padding-inline: 10px; }
}
@media (max-width: 380px) {
  .site-header .header-cta { font-size: .7rem; padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
  .theme-toggle:hover { transform: none; }
}

/* Accueil — fonds lumineux et surfaces translucides. */
html[data-theme="light"] body { background: var(--bg); color: var(--text); }
html[data-theme="light"] ::selection { background: #d9dde4; color: #17181d; }
html[data-theme="light"] .bg-slide.active { opacity: .18; }
html[data-theme="light"] .bg-mesh {
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, .9), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(219, 224, 232, .35), transparent 30%),
    linear-gradient(180deg, rgba(247, 247, 244, .78), rgba(247, 247, 244, .94) 55%, #f7f7f4);
}
html[data-theme="light"] .grain { opacity: .07; }
html[data-theme="light"] :is(.nav, .site-header, .topbar) {
  background: rgba(255, 255, 255, .87);
  border-color: var(--line);
  box-shadow: 0 8px 32px rgba(25, 28, 36, .08);
}
html[data-theme="light"] :is(.nav-links, .header-links) { color: #454851; }
html[data-theme="light"] :is(.nav-links a:hover, .header-links a:hover, .crumbs a:hover, .muted-link:hover) {
  color: var(--text);
}
html[data-theme="light"] .btn { background: rgba(25, 28, 36, .045); }
html[data-theme="light"] .btn:hover { background: rgba(25, 28, 36, .09); border-color: rgba(25, 28, 36, .3); }
html[data-theme="light"] :is(.btn.primary, .header-cta, .button, .mobile-action) {
  background: linear-gradient(135deg, #35373e, #17181d 70%);
  color: #ffffff;
  border-color: #17181d;
  box-shadow: 0 10px 26px rgba(25, 28, 36, .12);
}
html[data-theme="light"] :is(.btn.primary:hover, .header-cta:hover, .button:hover) {
  background: linear-gradient(135deg, #454851, #17181d 70%);
  box-shadow: 0 12px 30px rgba(25, 28, 36, .17);
}
html[data-theme="light"] .btn.dark { background: #17181d; color: #fff; }
html[data-theme="light"] .btn.ghost-white { background: #fff; color: #17181d; border-color: rgba(25, 28, 36, .18); }
html[data-theme="light"] .button.outline { background: #fff; color: var(--text); border-color: var(--line); box-shadow: none; }
html[data-theme="light"] :is(.eyebrow, .category, .badge) { color: #454851; background: rgba(25, 28, 36, .035); }
html[data-theme="light"] :is(.dot, .category .spot, .demo-status::before) { background: #343740; box-shadow: 0 0 12px rgba(25, 28, 36, .12); }
html[data-theme="light"] :is(.hero-copy, .sub, .card p, .shift-main p, .shift-item span, .standard-copy p, .standard-item span, .offer-card p, .article-card p, .article-feature-copy p, .demo-body p) {
  color: #555861;
}
html[data-theme="light"] :is(.micro, .kicker, .shift-item small, .standard-item small, .offer-card small, .article-card small, .article-feature-copy small, .demo-type, .demo-note, .hint) {
  color: #656873;
}
html[data-theme="light"] :is(.micro strong, .title, .card h3, .arrow, .shift-main h3, .shift-item strong, .standard-item strong, .offer-card h3, .offer-price, .article-card h3, .article-card span, .demo-link, .demo-status, .pricing-note p, .field label) {
  color: var(--text);
}
html[data-theme="light"] :is(.card, .panel, .price, .pricing-note, .shift-main, .shift-item, .offer-card, .standard-box, .article-card, .article-feature, .demo-card) {
  background: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(239, 241, 242, .87));
  border-color: var(--line);
  box-shadow: var(--shadow);
}
html[data-theme="light"] :is(.price:hover, .offer-card:hover, .article-card:hover, .article-feature:hover, .demo-card:hover) {
  background: #ffffff;
  border-color: rgba(25, 28, 36, .3);
  box-shadow: 0 26px 65px rgba(25, 28, 36, .11);
}
html[data-theme="light"] #articles-pme .article-feature-second { border-color: var(--line); }
html[data-theme="light"] :is(.card::after, .pricing-note::after, .shift-main::after, .offer-card::after) { opacity: .3; }
html[data-theme="light"] .icon { background: rgba(25, 28, 36, .04); }
html[data-theme="light"] .panel.dark-side { background: linear-gradient(180deg, #fff, #e4e6e9); }
html[data-theme="light"] .panel.light-side { background: #f3f1ec; }
html[data-theme="light"] .price.featured,
html[data-theme="light"] .offer-card.featured { background: linear-gradient(145deg, #e1e3e7, #fff); border-color: #b8bdc5; }
html[data-theme="light"] .standard-list { background: rgba(25, 28, 36, .12); }
html[data-theme="light"] .standard-item { background: #fff; }
html[data-theme="light"] .pricing-pill { background: rgba(25, 28, 36, .045); color: var(--text); border-color: var(--line); }
html[data-theme="light"] .pricing-pill.domain { background: #fff2cd; color: #735200; border-color: #e4cb83; }
html[data-theme="light"] .pricing-pill.hosting { background: #ffebeb; color: #a02828; border-color: #edc1c1; }
html[data-theme="light"] .pricing-pill.maintenance { background: #e9ebee; color: #454851; }
html[data-theme="light"] .article-feature-copy > span { border-color: rgba(25, 28, 36, .35); }
html[data-theme="light"] .articles-pagination button { background: rgba(25, 28, 36, .04); color: var(--text); }
html[data-theme="light"] .articles-pagination button:hover:not(:disabled) { background: rgba(25, 28, 36, .08); border-color: rgba(25, 28, 36, .3); }
html[data-theme="light"] .articles-pagination button.active { background: #17181d; color: #fff; border-color: #17181d; }
html[data-theme="light"] .cta-box { border-color: var(--line); box-shadow: 0 30px 80px rgba(25, 28, 36, .1); }
html[data-theme="light"] :is(footer, .footer) { color: #656873; }
html[data-theme="light"] :is(.foot strong, .foot a, .footer strong, .footer a:hover) { color: var(--text); }

/* Le matériel et les incrustations sur les vidéos gardent leur contraste. */
html[data-theme="light"] .device-stage { color: #f8f8f4; }
html[data-theme="light"] .laptop { box-shadow: 0 35px 85px rgba(25, 28, 36, .27), inset 0 1px 0 rgba(255, 255, 255, .18); }
html[data-theme="light"] .phone { box-shadow: 0 25px 65px rgba(25, 28, 36, .25); }
html[data-theme="light"] :is(.demo-play, .demo-duration) { color: #fff; }
html[data-theme="light"] .demo-card:hover .demo-play { color: #050505; }

/* Fenêtre de projet, champs et menu personnalisé. */
html[data-theme="light"] .modal { background: rgba(28, 31, 38, .4); }
html[data-theme="light"] .modal-box { background: linear-gradient(180deg, #fff, #f3f4f5); box-shadow: 0 35px 100px rgba(25, 28, 36, .24); }
html[data-theme="light"] :is(.close, .field textarea, .custom-select-trigger) { background: #fff; color: var(--text); border-color: var(--line); }
html[data-theme="light"] .field textarea::placeholder { color: #656873; }
html[data-theme="light"] .custom-select-trigger { box-shadow: 0 8px 24px rgba(25, 28, 36, .05); }
html[data-theme="light"] .custom-select-trigger:hover { border-color: #8d929d; background: #f6f7f8; }
html[data-theme="light"] .custom-select.open .custom-select-trigger { border-color: #8d929d; box-shadow: 0 0 0 4px rgba(25, 28, 36, .06); }
html[data-theme="light"] .custom-select-menu { background: #fff; border-color: var(--line); box-shadow: 0 20px 55px rgba(25, 28, 36, .16); }
html[data-theme="light"] .custom-select-option { color: #454851; }
html[data-theme="light"] .custom-select-option:hover { background: #eef0f3; color: var(--text); }
html[data-theme="light"] .custom-select-option.is-selected { background: #17181d; color: #fff; }
html[data-theme="light"] .custom-select-menu::-webkit-scrollbar-thumb { background: #a4a9b2; }
html[data-theme="light"] :is(.field textarea, .custom-select-trigger):focus-visible { outline: 2px solid var(--theme-focus); outline-offset: 3px; }

/* Articles — lecture, sommaire, tableaux et liens. */
html[data-theme="light"] .progress:not(input) { background: linear-gradient(90deg, #7f8592, #17181d); }
html[data-theme="light"] .top::before { background: radial-gradient(ellipse 70% 60% at 78% 35%, #dfe3e980, transparent), radial-gradient(ellipse 60% 50% at 2% 20%, #ffffffbb, transparent); }
html[data-theme="light"] :is(.crumbs, .meta, .article-figure figcaption, .aside-eyebrow, .closing .eyebrow) { color: #656873; }
html[data-theme="light"] :is(.intro, .prose p, .prose em, .aside nav a, .aside-box p, .closing p, .prose ol, .prose ul, .prose td, .related-guide p) { color: #4f535d; }
html[data-theme="light"] :is(.meta b, .prose > p:first-child, .prose strong, .prose h3, .prose a, .prose th, .prose td:nth-child(2), .related-guide a) { color: var(--text); }
html[data-theme="light"] .prose a { text-decoration-color: #969da8; }
html[data-theme="light"] .prose a:hover { text-decoration-color: var(--text); }
html[data-theme="light"] .prose li::marker { color: #454851; }
html[data-theme="light"] :is(.aside-box, .related-guide) { background: linear-gradient(145deg, #fff, #eff1f3); border-color: var(--line); }
html[data-theme="light"] .related-guide small { color: #656873; }
html[data-theme="light"] :is(.aside nav a:hover, .aside nav a.active) { border-color: #17181d; color: #17181d; }
html[data-theme="light"] .hero-image { border-color: var(--line); box-shadow: 0 25px 70px rgba(25, 28, 36, .13); }
html[data-theme="light"] .hero-image figcaption { color: #f8f8f4; }
html[data-theme="light"] .prose table { background: #fff; border-color: var(--line); }
html[data-theme="light"] :is(.prose th, .prose td) { border-color: var(--line); }
html[data-theme="light"] .prose th { background: #e9ecf0; }
html[data-theme="light"] .closing::before { background: radial-gradient(ellipse, #dfe3e9aa, transparent 70%); }

/* Démonstrations — seul l'environnement du lecteur change de palette. */
html[data-theme="light"] :is(.back-link, .contact-link) { background: rgba(25, 28, 36, .04); }
html[data-theme="light"] :is(.back-link:hover, .contact-link:hover) { background: rgba(25, 28, 36, .08); }
html[data-theme="light"] .topbar .brand span { color: #656873; }
html[data-theme="light"] :is(.lead, .notice, .feature-list li, .stat-line, .next-label) { color: #555861; }
html[data-theme="light"] :is(.notice strong, .stat-line strong, .next-arrow) { color: var(--text); }
html[data-theme="light"] .notice { background: #fff; border-color: var(--line); }
html[data-theme="light"] .side-card { background: linear-gradient(145deg, #fff, #f0f2f4); box-shadow: var(--shadow); }
html[data-theme="light"] .feature-list li::before { background: #454851; box-shadow: none; }
html[data-theme="light"] .stat-line { border-color: var(--line); }
html[data-theme="light"] .player-wrap { color-scheme: dark; color: #f8f8f4; border-color: rgba(25, 28, 36, .2); box-shadow: 0 25px 70px rgba(25, 28, 36, .17); }
