/* Tracehaus light theme + toggle. Dark stays the default; light is opt-in via
   <html data-theme="light">, set by theme.js and remembered in localStorage.
   Every page defines its own palette variables, so the light theme is mostly a
   variable swap (union of the names used across pages) plus a short list of
   hard-coded colours below. */

html[data-theme="light"]{
  color-scheme:light;
  /* surfaces */
  --bg:#F6F5F0; --bg2:#EEEDE6; --bg3:#FFFFFF; --bg4:#E8E7DF; --sf:#FFFFFF;
  --dark:#F6F5F0; --surface:#FFFFFF; --surface2:#EEEDE6;
  /* lines */
  --bd:#DAD8CF; --bd2:#8E8B7E; --border:#DAD8CF; --border2:#8E8B7E;
  /* text */
  --tx:#15150F; --tx2:#52524B; --tx3:#68685F; --tx-soft:#45453F; --body:#3A3A34;
  --text:#15150F; --muted:#52524B; --muted2:#68685F;
  /* drawing office: paper, ink, lime as a highlighter. Lime is unreadable as text
     on paper, so text and outlines use dark olive; lime stays as a fill under ink. */
  --ac:#4D6600; --accent:#4D6600; --accent2:#3F5400; --accent-dim:#3F5400;
  --ac-dim:rgba(77,102,0,.08); --ac-glow:rgba(77,102,0,.22); --accent-bg:rgba(77,102,0,.08);
  --warn:#A8480B; --err:#B3261E;
  --lime:#C8FF00; --ink:#15150F;
}
html[data-theme="dark"]{color-scheme:dark}

/* ── hard-coded colours that variables don't reach ── */
html[data-theme="light"] ::selection{background:#C8FF00;color:#15150F}
html[data-theme="light"] #cur{border-color:#4D6600}
/* translucent nav / header / overlay chrome (was rgba of the dark bg) */
html[data-theme="light"] nav,
html[data-theme="light"] .desktop-nav,
html[data-theme="light"] .m-header{background:rgba(246,245,240,.92)}
html[data-theme="light"] .m-tabbar{background:rgba(246,245,240,.96)}
html[data-theme="light"] .nav-dd-menu a{background:rgba(255,255,255,.98);border-color:var(--bd)}
html[data-theme="light"] .nav-dd-menu a:hover{color:var(--ac)}
html[data-theme="light"] .title-block,
html[data-theme="light"] .vseg,
html[data-theme="light"] .v-legend,
html[data-theme="light"] .vis-tools button,
html[data-theme="light"] .plate-tag,
html[data-theme="light"] .v-lbl{background:rgba(255,255,255,.88)}
html[data-theme="light"] .compare .handle::after{background:rgba(246,245,240,.8)}
html[data-theme="light"] .modal-bd{background:rgba(21,21,15,.45)}
html[data-theme="light"] #wp{box-shadow:0 16px 64px rgba(21,21,15,.18)}
html[data-theme="light"] #wb{box-shadow:0 2px 12px rgba(21,21,15,.25)}
html[data-theme="light"] .embed{box-shadow:0 12px 60px rgba(21,21,15,.08)}
/* hero: faint drafting grid fading out from the centre, in place of the dark glow */
html[data-theme="light"] .home-hero::before{background:linear-gradient(rgba(21,21,15,.05) 1px,transparent 1px) 0 0/32px 32px,linear-gradient(90deg,rgba(21,21,15,.05) 1px,transparent 1px) 0 0/32px 32px;-webkit-mask-image:radial-gradient(ellipse 70% 60% at 50% 45%,#000 0%,transparent 75%);mask-image:radial-gradient(ellipse 70% 60% at 50% 45%,#000 0%,transparent 75%)}
html[data-theme="light"] .hero-glow{background:radial-gradient(ellipse,rgba(77,102,0,.06) 0%,transparent 70%)}
html[data-theme="light"] #page-store .prod-vis{background:radial-gradient(120% 90% at 50% 35%,#FFFFFF 0%,var(--bg2) 60%)}
html[data-theme="light"] .pack-vis{background:var(--bg2)}
html[data-theme="light"] .draft{background:repeating-linear-gradient(-45deg,#F1F0DE 0 10px,#EAE9D2 10px 20px);border-bottom-color:#C9CC8A}
/* text that was a fixed light grey */
html[data-theme="light"] .legal p,
html[data-theme="light"] .legal li{color:#3A3A34}
html[data-theme="light"] .chat-ta::placeholder{color:#66665D}
html[data-theme="light"] .chat-ta{background:#FFFFFF;border-color:var(--bd2)}
html[data-theme="light"] .chat-ta:focus{border-color:var(--ink)}
html[data-theme="light"] .embed-hint,
html[data-theme="light"] .scroll-cue{color:var(--tx2)}
/* accent fills: lime under ink, like a highlighter mark on a drawing */
html[data-theme="light"] .chat-msg.user,
html[data-theme="light"] .btn-ac,
html[data-theme="light"] .nav-cta,
html[data-theme="light"] .badge-rec,
html[data-theme="light"] .m-find-btn,
html[data-theme="light"] .m-quote-btn,
html[data-theme="light"] .send-btn{background:var(--lime);color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
html[data-theme="light"] .send-btn svg{stroke:var(--ink)}
html[data-theme="light"] .photo-btn:hover{background:var(--lime);color:var(--ink)}
html[data-theme="light"] .photo-btn:hover svg{stroke:var(--ink)}
/* logo in ink: a lime mark vanishes on paper */
html[data-theme="light"] .nav-logo svg,
html[data-theme="light"] .m-header-logo svg{fill:var(--ink)!important}
/* materials guide badges: tinted fills were lime/amber on near-black */
html[data-theme="light"] .opt.selected,
html[data-theme="light"] .lib-filter.active,
html[data-theme="light"] .m-opt.selected,
html[data-theme="light"] .m-lib-chip.active{background:rgba(77,102,0,.1)}
html[data-theme="light"] .mat-card.match,
html[data-theme="light"] .m-mat-card.match{border-color:rgba(77,102,0,.45)}
html[data-theme="light"] .badge-cf{background:rgba(77,102,0,.1);border-color:rgba(77,102,0,.35)}
html[data-theme="light"] .badge-gf{background:rgba(160,110,0,.1);color:#8A5E00;border-color:rgba(160,110,0,.35)}
html[data-theme="light"] .badge-esd{background:rgba(30,90,200,.08);color:#2A5BB5;border-color:rgba(30,90,200,.3)}
html[data-theme="light"] .badge-hot{background:rgba(200,50,30,.08);color:#B3261E;border-color:rgba(200,50,30,.3)}
html[data-theme="light"] .tag.good{color:#1F7A3E;background:rgba(31,122,62,.1)}
html[data-theme="light"] .tag.bad{color:#B3261E;background:rgba(179,38,30,.08)}
html[data-theme="light"] .badge.demo{color:#8A5E00;border-color:#D9B66A}
html[data-theme="light"] .badge.sample{border-color:rgba(77,102,0,.45)}

/* ── toggle button ── */
.th-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:36px;height:36px;padding:0;margin:0 0 0 12px;background:none;border:1px solid transparent;color:var(--tx2,#8C8C85);font:inherit;cursor:pointer!important;transition:border-color .15s,color .15s}
.th-toggle:hover{border-color:var(--bd2,#3A3A36);color:var(--tx,#EDEDEA)}
.th-toggle:focus-visible{outline:2px solid var(--ac,#C8FF00);outline-offset:2px}
.th-toggle svg{width:16px;height:16px;display:block;pointer-events:none}
.th-toggle .th-sun{display:none}
html[data-theme="light"] .th-toggle .th-sun{display:block}
html[data-theme="light"] .th-toggle .th-moon{display:none}
/* toggle + CTA grouped at the right of the nav */
.th-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.th-actions .th-toggle{margin:0}
/* floating fallback when a page has no nav to hold it */
.th-toggle.th-float{position:fixed;top:12px;right:12px;margin:0;z-index:3000;background:var(--bg,#0D0D0B)}
@media (max-width:760px){.th-toggle{margin-left:4px;width:44px;height:44px}}

/* inline-styled lime that has to follow the accent */
html[data-theme="light"] .pick-art .pa-f,
html[data-theme="light"] .pick-art .pa-f path{fill:var(--bg2)}

/* hero drawing, drafted in pencil: quiet ink lines, olive scan rays, lime hit points outlined in ink */
html[data-theme="light"] .hero-art .ha-ln{stroke:#A9A699}
html[data-theme="light"] .hero-art .ha-cl,
html[data-theme="light"] .hero-art .ha-dim,
html[data-theme="light"] .hero-art .ha-tb{stroke:#C4C1B5}
html[data-theme="light"] .hero-art text{fill:#8E8B7E}
html[data-theme="light"] .hero-art .ha-ray{stroke:rgba(77,102,0,.5)}
html[data-theme="light"] .hero-art .ha-ac{fill:var(--lime);stroke:var(--ink);stroke-width:.6}
@media(max-width:900px){
  html[data-theme="light"] .hero-art .ha-ln{stroke:#8E8B7E}
  html[data-theme="light"] .hero-art .ha-ray{stroke:rgba(77,102,0,.7)}
}
/* the deviation map is a dark render: show it in a scan-viewer well in both themes */
html[data-theme="light"] .proof-fig{background:#161614}
html[data-theme="light"] .proof-fig figcaption{color:#B5B3A8}
html[data-theme="light"] .chat-msg.user.not-sent,
html[data-theme="light"] .not-sent>.chat-msg.user{box-shadow:none}
html[data-theme="light"] .embed.offline .send-btn,
html[data-theme="light"] #wp.offline .send-btn{box-shadow:none}
