/* Koko Love — colour themes. Follows the device (day/night) unless the visitor picks one with the toggle. */

/* Fonts, served from this site (no outside requests). Latin subsets of EB Garamond (400–500) and Inter Tight 600. */
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("fonts/eb-garamond-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/inter-tight-600-latin.woff2") format("woff2"); }

/* Dark (default) */
:root {
  color-scheme: dark;
  --bg: #000;            /* page */
  --ink: #f2f0ec;        /* body text */
  --muted: #9a9690;      /* secondary text: dates, OUT NOW, small labels  (7:1 on black) */
  --ghost: #5a5752;      /* unlit lyric lines (3:1) */
  --line-dim: #b3aea6;   /* lyric line on hover */
  --rule: #1f1e1c;       /* thin dividers */
  --track: #2e2c29;      /* empty part of the progress line */
  --fade: rgba(0, 0, 0, 0);
  --accent: #fe553a;     /* signature orange — identical in both modes */
}

/* Light: device in light mode (unless the visitor chose dark) … */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #dcdcdc;        /* grey sampled from the liner-notes image */
    --ink: #000;
    --muted: #4f4f4f;     /* 6:1 on the grey */
    --ghost: #7a7a7a;     /* 3:1 */
    --line-dim: #3a3a3a;
    --rule: #c4c4c4;
    --track: #b8b8b8;
    --fade: rgba(220, 220, 220, 0);
  }
}
/* … or the visitor chose light with the toggle */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #dcdcdc;
  --ink: #000;
  --muted: #4f4f4f;
  --ghost: #7a7a7a;
  --line-dim: #3a3a3a;
  --rule: #c4c4c4;
  --track: #b8b8b8;
  --fade: rgba(220, 220, 220, 0);
}

/* Smooth switch between modes (skipped for visitors who prefer less motion) */
html.theme-anim, html.theme-anim * { transition: background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease !important; }
@media (prefers-reduced-motion: reduce) { html.theme-anim, html.theme-anim * { transition: none !important; } }

/* The day/night toggle — top-left corner, on every page */
.theme-toggle {
  position: fixed; z-index: 60;
  top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left));
  width: 40px; height: 40px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%; color: var(--ink); cursor: pointer;
}
/* Orange on hover only where there is a real hover (mouse / trackpad) — on phones a tap would otherwise leave it orange */
@media (hover: hover) { .theme-toggle:hover { color: var(--accent); } }
.theme-toggle:focus-visible { color: var(--accent); }
.theme-toggle:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; }
/* Yin-yang icon: fine outline, one half filled; turns 180° between modes */
.theme-toggle .yy { width: 22px; height: 22px; overflow: visible; transition: transform .5s cubic-bezier(.4, 0, .2, 1); }
.theme-toggle .ring { fill: none; stroke: currentColor; stroke-width: 1.3; }
.theme-toggle .yin, .theme-toggle .dot-out { fill: currentColor; }
.theme-toggle .dot-in { fill: var(--bg); }
:root[data-mode="light"] .theme-toggle .yy { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .theme-toggle .yy { transition: none; } }
