/*
 * NOSHI theme layer. Load after styles.css and the page's component CSS.
 * API: set data-theme="dark" on <html>; remove it or use "light" for the
 * unchanged light design. Selection, persistence and welcome motion live in welcome.js.
 * No automatic media-query override: the visitor's explicit choice is authoritative.
 */

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #17161B;
  --bg: #17161B;
  --ink: #FAF9F7;
  --pink: #F3B5CA;
  --rose: #F3B5CA;
  --muted: #C5BDC8;
  --line: #69616F;
  --theme-surface: #26222B;
  --theme-surface-hover: #332C38;
  --theme-control-line: #9A8FA1;
  --theme-brand-ink: #25232A;
  --theme-brand-paper: #FAF9F7;
  --theme-error: #F3B5CA;
}

:root[data-theme="dark"] ::selection {
  color: var(--theme-brand-ink);
  background: var(--pink);
}

/* Owned, transparent logo assets retain their original outlines. */
:root[data-theme="dark"] .brand img,
:root[data-theme="dark"] .final-cta > img {
  filter: brightness(0) invert(1);
}

:root[data-theme="dark"] .review-strip,
:root[data-theme="dark"] .workflow-illustration,
:root[data-theme="dark"] .diagram,
:root[data-theme="dark"] .notice {
  background: var(--theme-surface);
}

:root[data-theme="dark"] .hero-lead,
:root[data-theme="dark"] .prose {
  color: var(--muted);
}

:root[data-theme="dark"] .service-row:hover {
  background: var(--theme-surface);
}

/* A pink action always uses graphite text, independent of the page ink token. */
:root[data-theme="dark"] .btn {
  color: var(--theme-brand-ink);
}

:root[data-theme="dark"] .btn-secondary {
  color: var(--ink);
}

:root[data-theme="dark"] .btn-secondary:hover {
  color: var(--paper);
  background: var(--ink);
}

:root[data-theme="dark"] .btn-ink {
  color: var(--paper);
}

:root[data-theme="dark"] .btn-ink:hover {
  color: var(--paper);
  background: #E6DCE3;
  border-color: #E6DCE3;
}

:root[data-theme="dark"] .prose a.btn {
  color: var(--theme-brand-ink);
}

:root[data-theme="dark"] .prose a.btn-secondary {
  color: var(--ink);
}

:root[data-theme="dark"] .prose a.btn-secondary:hover,
:root[data-theme="dark"] .prose a.btn-ink {
  color: var(--paper);
}

/* These intentionally contrasting brand sections retain their own foregrounds. */
:root[data-theme="dark"] .approach-band {
  background: var(--theme-brand-ink);
  color: var(--theme-brand-paper);
}

:root[data-theme="dark"] .process-tabs [role="tab"][aria-selected="true"] {
  color: var(--theme-brand-paper);
}

:root[data-theme="dark"] .roi-section {
  color: var(--theme-brand-ink);
}

:root[data-theme="dark"] .roi-section .btn-ink {
  background: var(--theme-brand-ink);
  border-color: var(--theme-brand-ink);
  color: var(--theme-brand-paper);
}

:root[data-theme="dark"] .roi-section .btn-ink:hover {
  background: #403C45;
  border-color: #403C45;
}

:root[data-theme="dark"] .roi-section :is(a, button):focus-visible {
  outline-color: var(--theme-brand-ink);
}

:root[data-theme="dark"] .film-frame {
  background: var(--theme-brand-ink);
}

/* SVG foregrounds are coordinated; the pink geometry itself is unchanged. */
:root[data-theme="dark"] .hero-art .art-domain {
  fill: var(--theme-brand-ink);
}

:root[data-theme="dark"] .workflow-illustration [fill="#25232A"] {
  fill: var(--ink);
}

:root[data-theme="dark"] .workflow-illustration [stroke="#25232A"] {
  stroke: var(--ink);
}

:root[data-theme="dark"] .workflow-illustration [stroke="#FAF9F7"] {
  stroke: var(--theme-brand-ink);
}

/* Native controls, placeholders and browser-provided menus share the chosen theme. */
:root[data-theme="dark"] :is(input, select, textarea) {
  border-color: var(--theme-control-line);
}

:root[data-theme="dark"] :is(input, textarea)::placeholder {
  color: var(--muted);
  opacity: 1;
}

:root[data-theme="dark"] :is(select option, select optgroup) {
  color: var(--ink);
  background: var(--paper);
}

:root[data-theme="dark"] select,
:root[data-theme="dark"] .booking-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='m1 1 6 6 6-6' fill='none' stroke='%23FAF9F7' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

:root[data-theme="dark"] dialog::backdrop {
  background: rgba(0, 0, 0, .72);
}

/* The calculator deliberately owns tokens rather than inheriting site colors. */
:root[data-theme="dark"] .n-calculator {
  --calc-paper: var(--paper);
  --calc-ink: var(--ink);
  --calc-pink: var(--pink);
  --calc-rose: var(--pink);
  --calc-muted: var(--muted);
  --calc-rule: var(--line);
}

:root[data-theme="dark"] .n-calc-button:hover {
  background: var(--theme-surface-hover);
}

:root[data-theme="dark"] .n-calc-button-primary:hover {
  background: var(--pink);
  border-color: var(--pink);
  color: var(--theme-brand-ink);
}

:root[data-theme="dark"] .n-calc-error {
  color: var(--theme-error);
  border-color: var(--theme-error);
}

:root[data-theme="dark"] .n-calculator [aria-invalid="true"] {
  outline-color: var(--theme-error);
}

:root[data-theme="dark"] .n-calc-rate-input input,
:root[data-theme="dark"] .n-calc-entry :is(input, select) {
  border-color: var(--theme-control-line);
}

:root[data-theme="dark"] .n-calc-chart rect {
  stroke: var(--calc-ink);
}

:root[data-theme="dark"] .n-calc-chart rect[fill="#25232A"] {
  fill: var(--calc-ink);
}

:root[data-theme="dark"] .n-calc-chart path {
  stroke: var(--calc-rule);
}

/* Booking keeps error, review, transfer and disabled states legible. */
:root[data-theme="dark"] .booking-connection-note {
  background: var(--theme-surface);
}

:root[data-theme="dark"] .booking-field :is(input, select, textarea) {
  border-color: var(--theme-control-line);
}

:root[data-theme="dark"] .booking-field input:disabled {
  background: var(--theme-surface);
  color: var(--muted);
}

:root[data-theme="dark"] :is(
  .booking-hint,
  .booking-privacy-note,
  .booking-contact p,
  .booking-transfer-details dt,
  .booking-review-details dt
) {
  color: var(--muted);
}

:root[data-theme="dark"] .booking-field-error {
  color: var(--theme-error);
}

:root[data-theme="dark"] .booking-field [aria-invalid="true"] {
  border-color: var(--theme-error);
}

:root[data-theme="dark"] :is(
  .booking-location,
  .booking-contact,
  .booking-transfer,
  .booking-review-details,
  .booking-review-details > div
) {
  border-color: var(--line);
}

:root[data-theme="dark"] .booking-button-secondary:hover {
  background: var(--theme-surface-hover);
}

:root[data-theme="dark"] .booking-error-box {
  border-color: var(--theme-error);
  background: #382532;
}

:root[data-theme="dark"] .booking-error-box a {
  color: var(--pink);
}

/* The Jelly canvas is an independently lit ivory studio, not a page surface.
 * Its stage, HUD and material colors intentionally remain art-directed in jelly.css.
 */
:root[data-theme="dark"] .jelly-stage :is(button, a, canvas):focus-visible {
  outline-color: #8B3154;
}

:root[data-theme="dark"] .jelly-unavailable {
  background: var(--paper);
  color: var(--ink);
}

:root[data-theme="dark"] .jelly-unavailable img {
  filter: brightness(0) invert(1);
}

:root[data-theme="dark"] .jelly-unavailable :is(button, a):focus-visible {
  outline-color: var(--pink);
}
