/* Correctif visuel: lisibilité sans contour blanc et fond Matrix visible. */
:root {
  --ly-page-bg: #010401;
  --ly-panel-bg: rgba(0, 0, 0, .72);
  --ly-panel-border: rgba(114, 255, 141, .58);
  --ly-text: #f3fff5;
  --ly-muted: #d7ffdc;
  --ly-accent: #00ff41;
  --ly-accent-strong: #72ff8d;
  --ly-control-bg: rgba(0, 0, 0, .9);
  --ly-control-text: #ffffff;
  --ly-focus: #ffffff;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --ly-page-bg: #f7fbf8;
    --ly-panel-bg: rgba(255, 255, 255, .93);
    --ly-panel-border: rgba(12, 91, 45, .3);
    --ly-text: #102217;
    --ly-muted: #385341;
    --ly-accent: #0b6f35;
    --ly-accent-strong: #075528;
    --ly-control-bg: #ffffff;
    --ly-control-text: #102217;
    --ly-focus: #001f0a;
  }
}

:root[data-theme="light"] {
  --ly-page-bg: #f7fbf8;
  --ly-panel-bg: rgba(255, 255, 255, .93);
  --ly-panel-border: rgba(12, 91, 45, .3);
  --ly-text: #102217;
  --ly-muted: #385341;
  --ly-accent: #0b6f35;
  --ly-accent-strong: #075528;
  --ly-control-bg: #ffffff;
  --ly-control-text: #102217;
  --ly-focus: #001f0a;
}

:root[data-theme="dark"] {
  --ly-page-bg: #010401;
  --ly-panel-bg: rgba(0, 0, 0, .72);
  --ly-panel-border: rgba(114, 255, 141, .58);
  --ly-text: #f3fff5;
  --ly-muted: #d7ffdc;
  --ly-accent: #00ff41;
  --ly-accent-strong: #72ff8d;
  --ly-control-bg: rgba(0, 0, 0, .9);
  --ly-control-text: #ffffff;
  --ly-focus: #ffffff;
}

html {
  background: var(--ly-page-bg) !important;
}

body {
  background: transparent !important;
  color: var(--ly-text) !important;
}

#root,
.app {
  position: relative;
  z-index: 1;
}

.matrix-background {
  z-index: 0 !important;
  opacity: .75;
}

:root[data-theme="light"] .matrix-background {
  opacity: .16;
}

:root[data-theme="dark"] .matrix-background {
  opacity: .85;
}

.header,
.contact,
.projets,
.home .projects .preview-card,
.authentication {
  background: var(--ly-panel-bg) !important;
  border: 1px solid var(--ly-panel-border) !important;
  color: var(--ly-text) !important;
  backdrop-filter: blur(1px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .26) !important;
}

.header,
.header h1,
.header h2,
.header a,
.header button,
.home h1,
.home p,
.contact,
.contact h2,
.footer,
.footer a,
.projets,
.authentication {
  color: var(--ly-text) !important;
  text-shadow: none !important;
}

:root[data-theme="dark"] .header h1,
:root[data-theme="dark"] .home h1,
:root[data-theme="dark"] .footer a {
  color: var(--ly-accent) !important;
  text-shadow: 0 0 8px rgba(0, 255, 65, .42) !important;
}

.home p,
.contact__textarea textarea::placeholder,
.contact__textarea input::placeholder,
.contact__form textarea::placeholder,
.contact__form input::placeholder,
.projets form input::placeholder,
.projets form textarea::placeholder {
  color: var(--ly-muted) !important;
  opacity: 1;
}

.home .filters select,
.home .filters button,
.contact__buttons .contact__button,
.contact__send,
.contact__textarea textarea,
.contact__textarea input,
.contact__textarea select,
.contact__form textarea,
.contact__form input,
.contact__form select,
.projets form input,
.projets form textarea,
.projets form select,
.projets form button,
.authentication form input,
.authentication form button {
  background: var(--ly-control-bg) !important;
  color: var(--ly-control-text) !important;
  border-color: var(--ly-accent-strong) !important;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--ly-focus) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(0, 255, 65, .65) !important;
}

.theme-toggle {
  background: var(--ly-control-bg) !important;
  color: var(--ly-control-text) !important;
  border-color: var(--ly-accent-strong) !important;
  min-width: 138px;
  text-align: center;
}

.theme-toggle:hover {
  background: var(--ly-accent-strong) !important;
  color: #000000 !important;
}
