/* ══════════════════════════════════════════════════════════════
   CLAUDPHIC — THEME TOKENS (dark + light)
   ──────────────────────────────────────────────────────────────
   Loaded BEFORE claudphic.css so these are the base values and
   claudphic.css's own :root block only fills in what's missing.

   How the switch works: <html data-theme="light"> swaps the token
   values below, and every colour in the stylesheets reads from a
   token — including the rgba() ones, via the *-rgb triplets
   (rgba(var(--fg-rgb),.08) instead of rgba(255,255,255,.08)).
   Nothing is hardcoded, so one attribute flips the whole site.
   ══════════════════════════════════════════════════════════════ */

:root,
html[data-theme="dark"]{
  color-scheme:dark;

  --bg:#05060a;
  --bg-2:#0a0c12;
  --bg-3:#0e1119;
  --ink:#f2f1ec;
  --ink-dim:rgba(242,241,236,.62);
  --ink-faint:rgba(242,241,236,.38);

  --buyer:#8b7bff;
  --buyer-deep:#14067F;
  --seller:#3ce6b0;

  --line:rgba(242,241,236,.09);
  --glass:rgba(255,255,255,.03);
  --glass-brd:rgba(255,255,255,.08);

  /* rgba() building blocks — let every translucent colour follow the theme */
  --bg-rgb:5,6,10;
  --fg-rgb:255,255,255;
  --ink-rgb:242,241,236;

  --on-accent:#04120c;        /* text sitting on a --seller fill */
  --on-ink:#05060a;           /* text sitting on an --ink fill   */
  --warn:#ffb86b;
  --danger:#ff8f8f;
  --grain-opacity:.05;
  --plate-blend:screen;       /* how the hero artwork meets the page */
}

html[data-theme="light"]{
  color-scheme:light;

  --bg:#f6f6f3;
  --bg-2:#efeeea;
  --bg-3:#e7e6e1;
  --ink:#0b0d12;
  --ink-dim:rgba(11,13,18,.66);
  --ink-faint:rgba(11,13,18,.45);

  --buyer:#5b45e0;
  --buyer-deep:#2a1bb8;
  --seller:#0a9a71;

  --line:rgba(11,13,18,.12);
  --glass:rgba(11,13,18,.028);
  --glass-brd:rgba(11,13,18,.11);

  --bg-rgb:246,246,243;
  --fg-rgb:11,13,18;
  --ink-rgb:11,13,18;

  --on-accent:#ffffff;
  --on-ink:#f6f6f3;
  --warn:#9a5a06;
  --danger:#c0392b;
  --grain-opacity:.028;
  --plate-blend:multiply;
}

/* ── cross-fade on switch ─────────────────────────────────────
   Only while .theme-anim is on, so normal hovers stay snappy. */
html.theme-anim,
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after{
  transition:background-color .5s ease,background-image .5s ease,color .5s ease,
             border-color .5s ease,fill .5s ease,stroke .5s ease,box-shadow .5s ease !important;
  animation-play-state:paused !important;
}
/* the circular reveal replaces the cross-fade where it's supported */
html.theme-vt.theme-anim,
html.theme-vt.theme-anim *,
html.theme-vt.theme-anim *::before,
html.theme-vt.theme-anim *::after{transition:none !important}
::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}
::view-transition-old(root){z-index:0}
::view-transition-new(root){z-index:1}

/* ── the toggle ───────────────────────────────────────────── */
.theme-toggle{
  position:relative;width:38px;height:38px;flex:none;border-radius:50%;
  display:grid;place-items:center;cursor:pointer;
  border:1px solid var(--glass-brd);background:var(--glass);
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  color:var(--ink);
  transition:border-color .35s,background .35s,transform .45s var(--ease);
}
.theme-toggle:hover{border-color:var(--seller);transform:scale(1.07)}
.theme-toggle:active{transform:scale(.95)}
.theme-toggle svg{width:17px;height:17px;display:block;overflow:visible}
/* two icons crossfade/rotate through each other */
.theme-toggle .ti{position:absolute;transition:opacity .45s var(--ease),transform .55s var(--ease)}
.theme-toggle .ti-sun{opacity:0;transform:rotate(-70deg) scale(.5)}
.theme-toggle .ti-moon{opacity:1;transform:rotate(0) scale(1)}
html[data-theme="light"] .theme-toggle .ti-sun{opacity:1;transform:rotate(0) scale(1)}
html[data-theme="light"] .theme-toggle .ti-moon{opacity:0;transform:rotate(70deg) scale(.5)}

/* The right-hand controls are grouped so the nav keeps exactly three
   flex children — otherwise space-between stops centring .nav-links. */
.nav-right{display:flex;align-items:center;gap:14px}

@media (max-width:1080px){
  .nav-right{gap:12px}
  nav .theme-toggle{width:36px;height:36px}
}

/* in the mobile sheet it becomes a full-width row */
#mobileMenu .theme-toggle{
  width:100%;height:auto;border-radius:16px;padding:18px 20px;margin-top:22px;
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  font-family:var(--mono);font-size:11px;letter-spacing:.22em;text-transform:uppercase;
  color:var(--ink-dim);
}
#mobileMenu .theme-toggle .tt-ico{position:relative;width:20px;height:20px;display:grid;place-items:center;flex:none}
#mobileMenu .theme-toggle:hover{transform:none;color:var(--ink)}
