/* =========================================================
   Theme toggle + light theme
   Dark is the base design (styles.css). The light theme overrides tokens and
   the few surfaces that hard-code dark colours. Demo "screens" (dashboard
   panel, solution artwork, simulator stages) stay dark in both themes.
   ========================================================= */

/* ---------- Toggle button ---------- */
.theme-toggle {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 10px; border: 1px solid var(--line); background: transparent;
  color: var(--muted); cursor: pointer; transition: color .2s, border-color .2s, transform .2s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--gold); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-sun { display: none; }
[data-theme="light"] .theme-toggle .i-sun { display: block; }
[data-theme="light"] .theme-toggle .i-moon { display: none; }
.nav__inner { justify-content: flex-start; gap: 16px; }
.nav__inner .nav__links { margin-left: auto; }
.nav__end { display: flex; align-items: center; gap: 10px; }
@media (max-width: 880px) { .nav__end { margin-left: auto; } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* =========================================================
   LIGHT THEME
   ========================================================= */
[data-theme="light"] {
  --ink: #f5f7fa;
  --ink-2: #eaf0f6;
  --text: #0f1f33;
  --muted: #4b5d73;
  --line: rgba(15, 31, 51, 0.11);
  --card: #ffffff;
  --gold-ink: #946100;      /* gold that passes contrast as text on light */
  --red-ink: #b0091e;
  color-scheme: light;
}

/* Surfaces that stay dark in both themes ("screens") keep the dark tokens */
[data-theme="light"] .panel,
[data-theme="light"] .stage,
[data-theme="light"] .sol__art {
  --ink: #0b1624;
  --text: #e8eef5;
  --muted: #9fb0c3;
  --line: rgba(255, 255, 255, 0.09);
  --card: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

/* Text on gold buttons stays dark */
[data-theme="light"] .btn--gold,
[data-theme="light"] .seg[aria-pressed="true"],
[data-theme="light"] .skip { color: #0b1624; }

/* Gold and red used as text */
[data-theme="light"] .eyebrow,
[data-theme="light"] .layer__n,
[data-theme="light"] .card__tags,
[data-theme="light"] .sol__kicker,
[data-theme="light"] .sol__more,
[data-theme="light"] .pipe__n,
[data-theme="light"] .contact__mail,
[data-theme="light"] .footer__cols h4,
[data-theme="light"] .step__dot,
[data-theme="light"] .crumbs a:hover,
[data-theme="light"] .feature a,
[data-theme="light"] .hero__content .tchip--ota .tchip__v { color: var(--gold-ink) !important; }
[data-theme="light"] .contact__mail { border-color: rgba(148, 97, 0, .35); }
[data-theme="light"] .brand__text b { color: var(--red-ink); }
[data-theme="light"] .grad { background-image: linear-gradient(90deg, #c27c00 0%, #d9771c 45%, #b0091e 100%); }
[data-theme="light"] .feature__icon { background: rgba(235, 181, 74, .18); }
[data-theme="light"] .feature__icon svg,
[data-theme="light"] .card__icon svg { stroke: #b07800; }
[data-theme="light"] .ticks li { color: var(--text); }

/* Navigation */
[data-theme="light"] .nav.is-scrolled { background: rgba(255, 255, 255, .86); }
[data-theme="light"] .mobile-menu { background: rgba(255, 255, 255, .97); }
[data-theme="light"] .dd__menu { background: #fff; box-shadow: 0 30px 60px -24px rgba(15, 31, 51, .35); }
[data-theme="light"] .brand__chip { box-shadow: 0 0 0 1px rgba(15, 31, 51, .12); }

/* Hero */
[data-theme="light"] .hero__veil {
  background:
    radial-gradient(ellipse 60% 70% at 15% 50%, rgba(245,247,250,.94) 0%, rgba(245,247,250,.6) 55%, rgba(245,247,250,0) 100%),
    linear-gradient(180deg, rgba(245,247,250,0) 70%, var(--ink) 100%);
}
@media (max-width: 600px) {
  [data-theme="light"] .hero__veil { background: linear-gradient(180deg, rgba(245,247,250,.6) 0%, rgba(245,247,250,.88) 60%, var(--ink) 100%); }
}
[data-theme="light"] .no-webgl .hero { background: radial-gradient(ellipse at 70% 40%, #dde7f2, var(--ink) 70%); }
[data-theme="light"] .hero__lead { color: #33465e; }
[data-theme="light"] .tchip { background: rgba(255, 255, 255, .85); border-color: rgba(15, 31, 51, .1); }
[data-theme="light"] .btn--ghost { border-color: rgba(15, 31, 51, .22); background: rgba(255, 255, 255, .6); }
[data-theme="light"] .hero__scroll { border-color: rgba(15, 31, 51, .3); }
[data-theme="light"] .chip { color: #33465e; background: #fff; }
[data-theme="light"] .phero__bg {
  background: radial-gradient(ellipse 55% 60% at 85% 20%, rgba(235,181,74,.18), transparent 60%), radial-gradient(ellipse 50% 60% at 10% 100%, rgba(176,9,30,.08), transparent 60%);
}

/* Cards and sections */
[data-theme="light"] .layer,
[data-theme="light"] .feature,
[data-theme="light"] .pipe,
[data-theme="light"] .panel-list li,
[data-theme="light"] .sol { background: #fff; box-shadow: 0 10px 30px -22px rgba(15, 31, 51, .45); }
[data-theme="light"] .card { background: #fff; box-shadow: 0 10px 30px -22px rgba(15, 31, 51, .45); }
[data-theme="light"] .svc { background: #fff; }
[data-theme="light"] .svc__item:hover { background: rgba(15, 31, 51, .025); }
[data-theme="light"] .solutions { background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%); }
[data-theme="light"] .flow { background: radial-gradient(circle at 50% 40%, #ffffff, #e6edf5 75%); }
[data-theme="light"] .flow__nodes text { fill: #e8eef5; }
[data-theme="light"] .flow__nodes .node--core text { fill: #0b1624; }
[data-theme="light"] .flow__nodes rect { stroke: rgba(15, 31, 51, .2); }

/* Contact form */
[data-theme="light"] .form { background: #fff; box-shadow: 0 30px 60px -36px rgba(15, 31, 51, .45); }
[data-theme="light"] .form input,
[data-theme="light"] .form select,
[data-theme="light"] .form textarea { background: #f7f9fc; border-color: rgba(15, 31, 51, .16); }
[data-theme="light"] .form select option { background: #fff; }
[data-theme="light"] .contact {
  background: radial-gradient(ellipse 70% 80% at 85% 30%, rgba(176,9,30,.08), transparent 60%), radial-gradient(ellipse 60% 60% at 10% 90%, rgba(235,181,74,.14), transparent 60%);
}
[data-theme="light"] .cta-band { background: radial-gradient(ellipse 60% 80% at 50% 100%, rgba(176,9,30,.08), transparent 60%); }

/* Footer */
[data-theme="light"] .footer { background: #e8eef5; }
[data-theme="light"] .footer__brand img { box-shadow: 0 0 0 1px rgba(15, 31, 51, .1); }

/* Smooth colour change when toggling (not on first paint) */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color .35s ease, border-color .35s ease, color .35s ease, fill .35s ease !important;
}
