/* LIGHT / DARK MODE. A visitor's choice (button in the header) wins over their device setting.
   To change a colour in either mode, edit the values here or in css/tokens.css. */
:root{--red-text:var(--red)}
:root[data-theme="light"]{
  color-scheme:light;
  --bg:var(--paper);--surface:var(--white);--soft:#F1F0EA;--text:var(--ink);--muted:var(--grey-text);--line:var(--grey);
  --green-tint:#E8F5ED;--green-text:#066B2B;--shadow:0 14px 34px rgba(14,14,16,.12);--red-text:var(--red);
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0E0E10;--surface:#1A1B1E;--soft:#151618;--text:#F4F3EE;--muted:#B5B6BB;--line:#2C2D31;
  --green-tint:#12261A;--green-text:#3DCB74;--shadow:0 14px 34px rgba(0,0,0,.5);--red-text:#FF5C62;
}
@media (prefers-color-scheme: dark){:root:not([data-theme]){--red-text:#FF5C62;color-scheme:dark}}

/* red text uses the lighter red in dark mode so it stays readable */
.marker,.card .num,.pmeta div,.ticks li::before,.faq summary::after{color:var(--red-text)}
.hero .marker,.owner .marker,.final-cta .marker{color:var(--red)}
.final-cta .marker{color:#0E0E10}

/* dark mode touch-ups */
:root[data-theme="dark"] .filters button[aria-pressed="true"]{background:var(--red);border-color:var(--red)}
:root[data-theme="dark"] .map{filter:invert(.92) hue-rotate(180deg) contrast(.9) saturate(.8)}
:root[data-theme="dark"] .work img,:root[data-theme="dark"] .pimg img,:root[data-theme="dark"] .about img{filter:brightness(.92)}
:root[data-theme="dark"] .card:hover,:root[data-theme="dark"] .why-item{box-shadow:var(--shadow)}
::selection{background:var(--red);color:#fff}

/* the toggle button */
.theme-toggle{display:grid;place-items:center;width:42px;height:42px;margin-left:auto;margin-right:.6rem;border-radius:50%;border:2px solid #fff;background:transparent;color:#fff;cursor:pointer;transition:background .2s,transform .2s}
.theme-toggle:hover{background:var(--red);border-color:var(--red);transform:rotate(18deg)}
.theme-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .sun{display:none}
:root[data-theme="dark"] .theme-toggle .sun{display:block}
:root[data-theme="dark"] .theme-toggle .moon{display:none}
@media(min-width:900px){.theme-toggle{order:3;margin:0 0 0 1.2rem;width:38px;height:38px}}
/* soft colour fade only while switching, so normal hover animations are untouched */
html.theme-anim *,html.theme-anim *::before,html.theme-anim *::after{transition:background-color .35s,color .35s,border-color .35s,fill .35s!important}
