/* ===== COLOR PALETTES =====
   Each theme is a set of named colors. The page uses the names,
   so swapping the theme repaints everything at once.
   --paper = background, --ink = black, --c1 to --c4 = accent colors */
.theme-1 { --paper: #F2E8D5; --ink: #161616; --c1: #D7322B; --c2: #F2B321; --c3: #1F4E9C; --c4: #2A8C82; }
.theme-2 { --paper: #F2B321; --ink: #161616; --c1: #1F4E9C; --c2: #F2E8D5; --c3: #D7322B; --c4: #161616; }
.theme-3 { --paper: #2A8C82; --ink: #161616; --c1: #F2B321; --c2: #D7322B; --c3: #F2E8D5; --c4: #1F4E9C; }
.theme-4 { --paper: #D7322B; --ink: #161616; --c1: #F2E8D5; --c2: #1F4E9C; --c3: #F2B321; --c4: #2A8C82; }

/* ===== PAGE BASICS ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: 'Space Mono', monospace;
  overflow: hidden;            /* no scrollbars, the screen is a canvas */
  touch-action: none;          /* lets finger-dragging work on phones */
  transition: background-color 0.6s ease;
}

/* Every moving shape fades smoothly when the colors change */
.piece {
  transition: background-color 0.6s ease, border-color 0.6s ease;
  will-change: transform;
}

/* ===== THE STAGE (full screen, centers the letters) ===== */
.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ===== HALFTONE (pop-art dots) =====
   A repeating pattern of little circles. --dot sets the dot color. */
.halftone {
  background-image: radial-gradient(circle, var(--dot, var(--ink)) 32%, transparent 34%);
  background-size: 1.6vmin 1.6vmin;
}

/* ===== BACKGROUND SHAPES ===== */
.backdrop { position: absolute; inset: 0; }
.block { position: absolute; }

.block-sun {                 /* big circle, top left */
  width: 46vmin; height: 46vmin;
  border-radius: 50%;
  background-color: var(--c2);
  top: -12vmin; left: -10vmin;
}
.block-half {                /* half circle, bottom right */
  width: 60vmin; height: 30vmin;
  border-radius: 30vmin 30vmin 0 0;
  background-color: var(--c3);
  bottom: -2vmin; right: -8vmin;
}
.block-square {              /* tilted square, top right */
  width: 28vmin; height: 28vmin;
  background-color: var(--c1);
  top: 12%; right: 10%;
}
.block-bar {                 /* tall slanted bar */
  width: 7vmin; height: 70vmin;
  background-color: var(--c4);
  left: 18%; bottom: -20vmin;
}
.block-dots {                /* dotted circle, bottom left */
  width: 34vmin; height: 34vmin;
  border-radius: 50%;
  --dot: var(--ink);
  bottom: 8%; left: 6%;
}
.block-ring {                /* outlined circle, top middle */
  width: 16vmin; height: 16vmin;
  border-radius: 50%;
  border: 2.5vmin solid var(--ink);
  top: 8%; left: 48%;
}
.block-quarter {             /* dotted quarter circle */
  width: 24vmin; height: 24vmin;
  border-radius: 100% 0 0 0;
  --dot: var(--c3);
  bottom: 3%; left: 42%;
}

/* ===== THE MONOGRAM (the C and K) ===== */
.monogram {
  position: relative;
  z-index: 2;                  /* sits above the background shapes */
  display: flex;
  align-items: center;
  gap: 7vmin;
}

.letter { position: relative; display: block; }

/* --- The C: a ring split into three colored quarters --- */
.letter-c { width: 40vmin; height: 40vmin; }

.c-arc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 9vmin solid transparent;   /* ring thickness; only one side gets color */
}
.c-arc-top    { border-top-color: var(--c1); }
.c-arc-left   { border-left-color: var(--c2); }
.c-arc-bottom { border-bottom-color: var(--c3); }

.c-core {                      /* dotted circle inside the C */
  position: absolute;
  width: 14vmin; height: 14vmin;
  top: 13vmin; left: 13vmin;
  border-radius: 50%;
  --dot: var(--ink);
}

/* --- The K: one straight bar and two angled bars --- */
.letter-k { width: 30vmin; height: 40vmin; }

.k-stem, .k-arm, .k-leg { position: absolute; width: 9vmin; }

.k-stem {
  height: 40vmin;
  top: 0; left: 0;
  background-color: var(--ink);
}
.k-arm {                       /* upper diagonal (angle is set in index.html with data-rot) */
  height: 30vmin;
  top: -5vmin; left: 14.5vmin;
  background-color: var(--c2);
}
.k-leg {                       /* lower diagonal, drawn with dots */
  height: 30vmin;
  top: 15vmin; left: 14.5vmin;
  --dot: var(--c1);
}

/* ===== THE DOTTED CIRCLE THAT FOLLOWS THE MOUSE ===== */
.cursor-blob {
  position: fixed;
  top: 0; left: 0;
  width: 22vmin; height: 22vmin;
  border-radius: 50%;
  --dot: var(--c3);
  mix-blend-mode: multiply;    /* blends with colors underneath like ink */
  pointer-events: none;        /* the mouse "passes through" it */
  z-index: 3;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.cursor-blob.is-active { opacity: 1; }

/* ===== BOTTOM BAR (hint + sound button) ===== */
.hud {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.hint { transition: opacity 0.6s ease; }
.hint.is-hidden { opacity: 0; }

.sound-toggle {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.6rem 1rem;
  color: var(--ink);
  background-color: var(--paper);
  border: 3px solid var(--ink);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.sound-toggle:hover,
.sound-toggle[aria-pressed="true"] {
  background-color: var(--ink);
  color: var(--paper);
}

/* Hides text visually but keeps it for screen readers */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
