/* Judetopia — palette sampled from the Alien Mode and Emergence print sheets */
:root {
  /* the table the zines are lying on */
  --desk: #22142e;
  --desk-2: #2d1b3d;
  --on-desk: #f3ecf6;
  --on-desk-soft: #c4b3d1;

  /* ballpoint inks */
  --ink: #1b1420;
  --magenta: #b0126f;
  --hot: #e0258f;
  --violet: #4a1f9a;
  --green: #3fb34a;
  --red: #d8282c;
  --navy: #2b2f8f;
  --yolk: #ffd21f;

  /* paper stock */
  --lilac: #c8b7da;
  --pink: #d8a9d0;
  --mauve: #c38eae;
  --teal: #8fb2a9;
  --peri: #9d9ace;
  --sky: #a6d5f3;
  --powder: #a9c4e8;
  --aqua: #a6cfcf;
  --mint: #b9d2a8;
  --leaf: #a6c999;
  --peach: #f8c39a;
  --salmon: #f9c9bc;
  --butter: #eceda0;
  --olive: #b2b19a;
  --bone: #ebe8ef;
  --eye-green: #4dd27f; /* sampled from the homepage eye */
  --edge: var(--ink); /* every box and button border */

  /* bold outlines, like the Third Eye Charms logo */
  --line: 4px;
  --line-thin: 3px;
  --round: 20px;
  --rule-color: rgba(196, 179, 209, .3);

  --f-type: 'Courier Prime', ui-monospace, 'Courier New', monospace;
  --f-loud: 'Luckiest Guy', 'Arial Black', system-ui, sans-serif;
  --f-thin: 'Josefin Sans', system-ui, sans-serif;

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --eye-cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='20' viewBox='0 0 30 20'%3E%3Cpath d='M2 10Q15-2 28 10Q15 22 2 10Z' fill='%23fff' stroke='%23b0126f' stroke-width='2.4'/%3E%3Ccircle cx='15' cy='10' r='4.6' fill='%234a1f9a'/%3E%3Ccircle cx='15' cy='10' r='1.8' fill='%231b1420'/%3E%3C/svg%3E") 15 10, auto;
  --eye-cursor-go: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='20' viewBox='0 0 30 20'%3E%3Cpath d='M2 10Q15-2 28 10Q15 22 2 10Z' fill='%23ffd21f' stroke='%233fb34a' stroke-width='2.4'/%3E%3Ccircle cx='15' cy='10' r='5.2' fill='%23b0126f'/%3E%3Ccircle cx='15' cy='10' r='2' fill='%231b1420'/%3E%3C/svg%3E") 15 10, pointer;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--desk); }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--f-type);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--on-desk);
  background:
    radial-gradient(ellipse 70% 50% at 15% 0%, rgba(176, 18, 111, .22), transparent 70%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(63, 179, 74, .12), transparent 70%),
    var(--desk);
  overflow-x: hidden;
  cursor: var(--eye-cursor);
  /* every page is framed by thick bands of the homepage eye's green */
  border-inline: clamp(10px, 2.2vw, 28px) solid var(--eye-green);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--grain);
  opacity: .35;
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }
a, button, [role="button"], summary { cursor: var(--eye-cursor-go); }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; }
:focus-visible { outline: 3px dashed var(--yolk); outline-offset: 4px; }
::selection { background: var(--hot); color: #fff; }

main { flex: 1; overflow-x: clip; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- type ---------- */
.loud {
  font-family: var(--f-loud);
  font-weight: 400;
  line-height: .95;
  letter-spacing: .01em;
  text-transform: uppercase;
}
/* two-ink misregistration, like a riso print that slipped */
.riso {
  color: var(--ink);
  text-shadow: .06em .06em 0 var(--hot), -.035em -.03em 0 var(--green);
}
.riso-light {
  color: var(--on-desk);
  text-shadow: .06em .06em 0 var(--magenta), -.035em -.03em 0 var(--green);
}
.thin {
  font-family: var(--f-thin);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: .22em;
}
.yolk-title {
  font-family: var(--f-loud);
  text-transform: uppercase;
  color: var(--yolk);
  -webkit-text-stroke: .055em var(--ink);
  paint-order: stroke fill;
  text-shadow: .07em .07em 0 var(--violet);
  letter-spacing: .02em;
  line-height: 1;
}

/* ---------- header ---------- */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  padding: 1.1rem max(16px, calc((100% - 1180px) / 2)) .9rem;
}
.logo {
  display: inline-flex;
  align-items: center;
  font-family: var(--f-loud);
  font-size: 2rem;
  line-height: 1;
  text-decoration: none;
  color: var(--on-desk);
  text-shadow: .06em .06em 0 var(--magenta), -.035em -.03em 0 var(--green);
}
.logo img {
  height: 1.25em;
  width: auto;
  margin: -.2em .02em 0;
  transition: transform .4s cubic-bezier(.3, 1.6, .5, 1);
}
.logo:hover img { transform: rotate(-18deg) scale(1.12); }

.site-nav { display: flex; gap: .55rem; flex-wrap: wrap; list-style: none; }
.nav-link {
  display: inline-block;
  padding: .42rem .95rem .38rem;
  font-family: var(--f-type);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: var(--chip, var(--butter));
  border: var(--line) solid var(--edge);
  border-radius: 999px;
  transition: transform .2s, background .2s;
  white-space: nowrap;
}
.nav-link:hover { transform: translateY(-2px); }
.nav-link[aria-current="page"] {
  text-decoration: underline solid var(--magenta);
  text-decoration-thickness: 4px;
  text-underline-offset: 5px;
}
/* each page keeps its own colour, wherever it sits in the menu */
.nav-link[href="zines.html"] { --chip: var(--pink); }
.nav-link[href="tuba.html"] { --chip: var(--mint); }
.nav-link[href="bug.html"] { --chip: var(--sky); }
.nav-link[href="artifacts.html"] { --chip: var(--peach); }

/* ---------- paper ---------- */
.paper {
  position: relative;
  color: var(--ink);
  background: var(--stock, var(--bone));
  isolation: isolate;
}
.paper::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  mix-blend-mode: multiply;
  opacity: .28;
  pointer-events: none;
  z-index: 3;
}
.shadowed { box-shadow: 0 1px 0 rgba(0,0,0,.25), 0 22px 50px -18px rgba(0,0,0,.65); }
.boxed { border: var(--line) solid var(--edge); border-radius: var(--round); }
/* a thick divider bar with rounded ends, drawn along the top of the element */
.ruled { position: relative; }
.ruled::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: var(--line); border-radius: 999px; background: var(--rule-color); }

.sticker {
  filter: drop-shadow(0 3px 0 rgba(255,255,255,.9)) drop-shadow(0 -2px 0 rgba(255,255,255,.9)) drop-shadow(2px 0 0 rgba(255,255,255,.9)) drop-shadow(-2px 0 0 rgba(255,255,255,.9)) drop-shadow(0 10px 14px rgba(0,0,0,.35));
}

/* ---------- page heads ---------- */
.page-head { padding: 2.5rem 0 1.5rem; }
.page-head h1 { font-size: clamp(3rem, 11vw, 7rem); }
.page-head p {
  max-width: 34rem;
  margin-top: 1rem;
  color: var(--on-desk-soft);
  font-size: 1.02rem;
}

/* ---------- footer ---------- */
.site-foot {
  margin-top: 4rem;
  padding: 2.5rem 16px 2rem;
  text-align: center;
  color: var(--on-desk-soft);
  font-size: .85rem;
}
.foot-mark {
  width: 150px;
  margin: 0 auto .9rem;
  filter: invert(1);
  opacity: .9;
}
.foot-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .4rem 1.25rem;
  margin-top: .9rem;
  list-style: none;
}
.foot-links a { color: var(--on-desk); text-underline-offset: 4px; text-decoration-color: var(--magenta); }
.foot-links a:hover { color: var(--yolk); }

/* ---------- motion ---------- */
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes crawl { 0%, 100% { translate: 0 0; } 50% { translate: 5px -7px; } }
@keyframes blink { 0%, 92%, 100% { scale: 1 1; } 95% { scale: 1 .1; } }
@keyframes pop-in { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }

@media (max-width: 700px) {
  .site-head { justify-content: center; text-align: center; }
  .site-nav { justify-content: center; }
  .site-nav { gap: .45rem; }
  .nav-link { font-size: .7rem; letter-spacing: .04em; padding: .38rem .6rem .34rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- button eyes: a side quest ---------- */
.be-layer { position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 60; --be-size: 42px; }
.be {
  position: absolute;
  width: var(--be-size);
  height: var(--be-size);
  padding: 0;
  border-radius: 50%;
  rotate: var(--r, 0deg);
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45));
  transition: scale .2s, filter .3s;
  animation: be-wobble 5s ease-in-out infinite;
}
.be[hidden] { display: none; }
.be:hover, .be:focus-visible { scale: 1.18; }
.be img, .be-mini img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.be-layer.in-the-dark .be { filter: brightness(.4) saturate(.6) drop-shadow(0 3px 4px rgba(0, 0, 0, .45)); }
.be-layer.in-the-dark .be:hover, .be-layer.in-the-dark .be:focus-visible { filter: drop-shadow(0 0 10px rgba(224, 37, 143, .6)); }
@keyframes be-wobble { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }

/* stand-in sewing button, used until an image is set */
.drawn {
  position: relative;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, .55), transparent 38%),
    radial-gradient(circle, var(--c) 0 60%, color-mix(in srgb, var(--c) 70%, #000) 63% 100%);
}
.drawn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: .75;
  background:
    radial-gradient(circle at 39% 39%, var(--ink) 0 7%, transparent 8%),
    radial-gradient(circle at 61% 39%, var(--ink) 0 7%, transparent 8%),
    radial-gradient(circle at 39% 61%, var(--ink) 0 7%, transparent 8%),
    radial-gradient(circle at 61% 61%, var(--ink) 0 7%, transparent 8%);
}

.be-hud {
  position: fixed;
  z-index: 80;
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .6rem;
  font-family: var(--f-type);
}
.be-hud[hidden] { display: none; }
.be-tin {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .85rem .4rem .45rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .85rem;
  color: var(--ink);
  background: var(--butter);
  border: var(--line) solid var(--edge);
  box-shadow: 3px 3px 0 var(--magenta);
}
.be-ico { display: block; width: 26px; height: 26px; border-radius: 50%; }
.be-toast {
  max-width: 260px;
  padding: .6rem .8rem;
  font-size: .82rem;
  line-height: 1.4;
  color: var(--bone);
  background: var(--ink);
  border: var(--line-thin) solid var(--yolk);
  border-radius: 12px;
  opacity: 0;
  translate: 0 8px;
  transition: opacity .3s, translate .3s;
  pointer-events: none;
}
.be-toast.on { opacity: 1; translate: 0 0; }
.be-toast:empty { display: none; }
.be-panel {
  width: min(330px, calc(100vw - 28px));
  max-height: min(70vh, 560px);
  overflow: auto;
  padding: .9rem 1.1rem 1.1rem;
  color: var(--ink);
  background: var(--bone);
  border: var(--line) solid var(--edge);
  border-radius: var(--round);
  box-shadow: 5px 5px 0 var(--violet);
}
.be-panel[hidden] { display: none; }
.be-top { display: flex; justify-content: space-between; align-items: center; }
.be-top h2 { font-family: var(--f-loud); font-weight: 400; text-transform: uppercase; font-size: 1.4rem; }
.be-x { width: 36px; height: 36px; font-size: 1.5rem; line-height: 1; border: var(--line) solid var(--edge); border-radius: 50%; background: var(--butter); }
.be-sum { font-size: .85rem; line-height: 1.45; margin: .3rem 0 .7rem; }
.be-where { list-style: none; font-size: .82rem; margin-bottom: .9rem; }
.be-where li { display: flex; justify-content: space-between; padding: .3rem 0; border-bottom: 1px dashed rgba(27, 20, 32, .25); }
.be-where a { color: var(--magenta); font-weight: 700; }
.be-where li.done span::after { content: ' \2713'; color: #1f6f2c; }
.be-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); gap: 6px; }
.be-grid li { aspect-ratio: 1; border-radius: 50%; border: 1.5px dashed rgba(27, 20, 32, .35); }
.be-grid li:has(.be-mini) { border: 0; }
.be-mini { display: block; width: 100%; height: 100%; border-radius: 50%; rotate: var(--r, 0deg); }
.be-burst { position: fixed; z-index: 90; width: 30px; height: 30px; pointer-events: none; }
.be-foot { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; font-size: .78rem; }
.be-foot button { padding: .3rem .8rem; font-weight: 700; border: var(--line) solid var(--edge); border-radius: 999px; background: var(--butter); }
.be-reset.sure { color: var(--red); font-weight: 700; }
/* the prize: a button-eye cursor */
html.be-complete {
  --eye-cursor: url("img/buttons/cursor.png") 16 16, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='12' fill='%23e0258f' stroke='%231b1420' stroke-width='2'/%3E%3Cg fill='%231b1420'%3E%3Ccircle cx='10.5' cy='10.5' r='2'/%3E%3Ccircle cx='17.5' cy='10.5' r='2'/%3E%3Ccircle cx='10.5' cy='17.5' r='2'/%3E%3Ccircle cx='17.5' cy='17.5' r='2'/%3E%3C/g%3E%3C/svg%3E") 14 14, auto;
  --eye-cursor-go: url("img/buttons/cursor.png") 16 16, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='12' fill='%23ffd21f' stroke='%231b1420' stroke-width='2'/%3E%3Cg fill='%231b1420'%3E%3Ccircle cx='10.5' cy='10.5' r='2'/%3E%3Ccircle cx='17.5' cy='10.5' r='2'/%3E%3Ccircle cx='10.5' cy='17.5' r='2'/%3E%3Ccircle cx='17.5' cy='17.5' r='2'/%3E%3C/g%3E%3C/svg%3E") 14 14, pointer;
}
@media (max-width: 700px) { .be-layer { --be-size: 36px; } }
