/* ==========================================================================
   COLE LABS — shared foundation
   Used by the hub (index.html) and every themed page in /pages.
   Each page overrides the --theme-* tokens in its own css/themes/*.css.
   ========================================================================== */

:root {
  /* Brand */
  --lab-purple: #6a1fb8;
  --lab-purple-deep: #1c0636;
  --lab-violet: #b77cff;
  --lab-green: #39ff6a;
  --lab-green-glow: rgba(57, 255, 106, 0.55);
  --lab-yellow: #ffe94a;
  --lab-pink: #ff4fc3;

  /* Theme tokens (pages override these) */
  --theme-bg: #1c0636;
  --theme-ink: #fff;
  --theme-panel: rgba(18, 6, 34, 0.9);
  --theme-panel-ink: #fff;
  --theme-accent: var(--lab-green);
  --theme-accent-2: var(--lab-yellow);
  --theme-border: #000;
  --theme-heading-font: 'Bangers', cursive;

  /* Type */
  --font-body: 'Nunito', system-ui, sans-serif;
  --font-sign: 'Bangers', cursive;
  --font-logo: 'Creepster', cursive;
  --fs-body: 1.05rem;
  --lh-body: 1.6;

  --radius: 14px;
  --shadow-pop: 6px 6px 0 #000;
  --content-max: 1080px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--theme-bg);
  color: var(--theme-ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 4px solid var(--lab-green); outline-offset: 4px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Pop buttons — chunky cartoon buttons used everywhere
   -------------------------------------------------------------------------- */
.btn-pop {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--font-sign);
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  color: #000;
  background: var(--theme-accent-2);
  border: 4px solid #000;
  border-radius: 10px;
  padding: .55em 1.3em;
  min-height: 48px;
  box-shadow: var(--shadow-pop);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.btn-pop:hover { transform: translate(-3px, -3px) rotate(-1deg); box-shadow: 9px 9px 0 #000; }
.btn-pop:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }
.btn-pop--hazard {
  color: #fff;
  -webkit-text-stroke: 1.5px #000; paint-order: stroke fill;
  text-shadow: 2px 2px 0 #000;
  background: repeating-linear-gradient(45deg, #ffd400 0 14px, #111 14px 28px);
}
.btn-pop--hazard:hover { animation: hazard-scroll .6s linear infinite; }
@keyframes hazard-scroll { to { background-position: 39.6px 0; } }

/* --------------------------------------------------------------------------
   Warp curtain — two halves of the storm slam shut, then split open
   -------------------------------------------------------------------------- */
.warp-curtain { position: fixed; inset: 0; z-index: 9000; pointer-events: none; display: grid; place-items: center; }
.warp-curtain__door {
  position: absolute; left: 0; right: 0; height: 50.5%;
  background: #12031f var(--storm) center / cover no-repeat;
  transition: translate .5s cubic-bezier(.7, 0, .3, 1);
}
.warp-curtain__door--top { top: 0; translate: 0 -101%; border-bottom: 4px solid #39ff6a; box-shadow: 0 0 30px #39ff6a; background-position: center top; }
.warp-curtain__door--bottom { bottom: 0; translate: 0 101%; border-top: 4px solid #39ff6a; box-shadow: 0 0 30px #39ff6a; background-position: center bottom; }
.warp-curtain__label {
  position: relative; z-index: 2; opacity: 0;
  font-family: 'Rye', 'Creepster', serif; font-size: clamp(1.8rem, 6vw, 4.2rem); text-align: center;
  color: #39ff6a; text-shadow: 0 0 20px var(--lab-green-glow), 4px 4px 0 #000;
  transition: opacity .2s .25s;
}
.warp-curtain.is-closed { pointer-events: all; }
.warp-curtain.is-closed .warp-curtain__door { translate: 0 0; }
.warp-curtain.is-closed .warp-curtain__label { opacity: 1; }

/* --------------------------------------------------------------------------
   Wizard mascot — follows you to every page
   -------------------------------------------------------------------------- */
.wizard {
  position: fixed; right: 14px; bottom: 10px; z-index: 800;
  width: 110px; background: none; border: 0; cursor: pointer;
  animation: wizard-hover 3.4s ease-in-out infinite;
}
.wizard img { width: 100%; filter: drop-shadow(0 0 12px var(--lab-green-glow)); }
.wizard__speech {
  position: absolute; right: 70%; bottom: 92%;
  width: max-content; max-width: 220px;
  background: #fff; color: #111;
  border: 3px solid #000; border-radius: 14px;
  padding: .4em .8em;
  font: 800 .9rem/1.3 var(--font-body);
  box-shadow: 4px 4px 0 #000;
  text-align: left;
}
.wizard__speech::after {
  content: ''; position: absolute; right: 12px; bottom: -12px;
  border: 8px solid transparent; border-top-color: #000;
}
.wizard.is-zapped img { animation: wizard-zap .5s; }
@keyframes wizard-hover { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
@keyframes wizard-zap { 30% { transform: scale(1.25) rotate(-12deg); filter: hue-rotate(120deg) drop-shadow(0 0 30px #39ff6a); } }

/* Docked: small, inside the top bar, no speech bubble */
.wizard--docked {
  position: relative; right: auto; bottom: auto; z-index: auto;
  width: 52px; height: 52px; animation: none; flex: none;
}
.wizard--docked .wizard__speech { display: none; }
.wizard--docked img { filter: drop-shadow(0 0 6px var(--lab-green-glow)); }
/* Mini: narrow screens with no home for him — a small button, no bubble */
.wizard--mini { width: 58px; }
.wizard--mini .wizard__speech { display: none; }
/* Free in the gutter: bubble sits ABOVE him, inside the gutter */
.wizard:not(.wizard--docked) .wizard__speech { right: 0; bottom: 100%; margin-bottom: 10px; max-width: 150px; }
.wizard:not(.wizard--docked) .wizard__speech::after { right: 30px; }

.lab-toast {
  position: fixed; left: 50%; top: 84px; translate: -50% 0; z-index: 9600;
  max-width: min(90vw, 440px); padding: .5em 1em; pointer-events: none;
  background: #f2ead3; color: #0d0418; font-weight: 900; text-align: center;
  border: 3px solid #0d0418; box-shadow: 4px 4px 0 #39ff6a;
  animation: toast 3.2s ease forwards;
}
@keyframes toast { 0% { opacity: 0; translate: -50% -20px; } 10%, 85% { opacity: 1; translate: -50% 0; } 100% { opacity: 0; } }

/* --------------------------------------------------------------------------
   Modals — retro "window" style
   -------------------------------------------------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 9500;
  display: none; place-items: center; padding: 16px;
  background: rgba(10, 0, 25, .72);
  backdrop-filter: blur(3px);
}
.modal.is-open { display: grid; }
.modal__window {
  width: min(560px, 100%); max-height: 90vh; overflow: auto;
  background: #e9e3f5; color: #111;
  border: 4px solid #000; border-radius: 10px;
  box-shadow: 10px 10px 0 #000, 0 0 40px var(--lab-green-glow);
  animation: modal-pop .35s cubic-bezier(.3,1.6,.5,1);
}
@keyframes modal-pop { from { transform: scale(.6) rotate(-4deg); opacity: 0; } }
.modal__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1em;
  background: linear-gradient(90deg, #4b0fa0, #8a2be2);
  color: #fff; padding: .45em .6em .45em 1em;
  font-family: var(--font-sign); font-size: 1.35rem; letter-spacing: .05em;
}
.modal__close {
  width: 36px; height: 36px; border: 3px solid #000; border-radius: 6px;
  background: #ff4f6d; color: #fff; font-weight: 900; cursor: pointer;
}
.modal__body { padding: 1.2em 1.4em 1.5em; }
.modal__body h3 { font-family: var(--font-sign); font-size: 1.8rem; letter-spacing: .03em; margin-bottom: .3em; }
.modal__body p + p { margin-top: .6em; }
.modal__price { font-weight: 900; font-size: 1.2rem; color: #5a12b0; }

.quote-form { display: grid; gap: .3em; }
.quote-form label { font-weight: 800; margin-top: .5em; }
.quote-form input, .quote-form select, .quote-form textarea {
  width: 100%; padding: .55em .7em;
  border: 3px solid #000; border-radius: 8px;
  font: inherit; background: #fff;
}
.quote-form .btn-pop { margin-top: 1em; justify-self: start; }
.quote-form__note { font-size: .85rem; color: #444; margin-top: .4em; }

/* --------------------------------------------------------------------------
   Themed page shell (pages/*.html)
   -------------------------------------------------------------------------- */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.page-bar {
  position: sticky; top: 0; z-index: 500;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px;
  background: var(--theme-panel);
  border-bottom: 4px solid #000;
}
.page-bar .btn-pop { font-size: 1.1rem; padding: .35em .9em; }
.realm-hop { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.realm-hop a {
  display: block; padding: .25em .7em;
  border: 3px solid #000; border-radius: 999px;
  background: rgba(255,255,255,.92); color: #111;
  font-weight: 800; font-size: .85rem; text-decoration: none;
}
.realm-hop a:hover { background: var(--theme-accent-2); }
.realm-hop a[aria-current="page"] { background: var(--theme-accent); color: #000; }

.page-main {
  position: relative; z-index: 1;
  max-width: var(--content-max); margin: 0 auto;
  padding: 32px 16px 160px;
  display: grid; gap: 36px;
}

.page-hero { text-align: center; }
.page-hero__kicker {
  display: inline-block; font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
  font-size: .85rem; padding: .3em .9em; border: 3px solid #000; border-radius: 999px;
  background: var(--theme-accent); color: #000; box-shadow: 3px 3px 0 #000;
}
.page-hero h1 {
  font-family: var(--theme-heading-font);
  font-size: clamp(2.6rem, 8vw, 5.2rem); line-height: 1;
  margin: .25em 0 .2em;
}
.page-hero__lede { max-width: 62ch; margin: 0 auto; font-size: 1.15rem; }

.panel {
  background: var(--theme-panel); color: var(--theme-panel-ink);
  border: 4px solid var(--theme-border); border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 22px;
}
.panel h2 {
  font-family: var(--theme-heading-font);
  font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.1; margin-bottom: .5em;
}

.price-list { list-style: none; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.price-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1em;
  padding: .7em 1em; border: 3px solid #000; border-radius: 10px;
  background: var(--theme-accent-2); color: #000; font-weight: 800;
}
.price-list em { font-style: normal; font-weight: 900; font-size: 1.15rem; white-space: nowrap; }

.gallery { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card {
  display: block; width: 100%; padding: 0; font: inherit;
  text-align: left; cursor: pointer;
  background: var(--theme-panel); color: var(--theme-panel-ink);
  border: 4px solid var(--theme-border); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); overflow: hidden;
  transition: transform .2s;
}
.card:nth-child(odd):hover { transform: rotate(-2deg) scale(1.03); }
.card:nth-child(even):hover { transform: rotate(2deg) scale(1.03); }
.card__art { aspect-ratio: 4 / 3; overflow: hidden; border-bottom: 4px solid var(--theme-border); position: relative; }
.card__art img { width: 100%; height: 100%; object-fit: cover; }
.card__art--soon {
  display: grid; place-items: center; text-align: center;
  font-size: 3.4rem;
  background: var(--soon-bg, repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 12px, transparent 12px 24px), var(--theme-accent));
}
.card__art--soon span { display: block; font: 900 .75rem/1 var(--font-body); letter-spacing: .15em; margin-top: .6em; color: #000; background: #fff; padding: .35em .6em; border: 2px solid #000; border-radius: 4px; }
.card__text { display: block; padding: 14px 16px 18px; }
.card__art { display: block; }
.card__title { display: block; font-family: var(--theme-heading-font); font-size: 1.45rem; line-height: 1.1; margin-bottom: .3em; }
.card__price { display: block; margin-top: .5em; font-weight: 900; color: var(--theme-accent); }

.steps { list-style: none; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: step; }
.steps li { position: relative; padding: 14px 16px 14px 64px; border: 3px solid var(--theme-border); border-radius: 12px; background: rgba(255,255,255,.06); }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 12px; top: 12px; width: 40px; height: 40px;
  display: grid; place-items: center; border: 3px solid #000; border-radius: 50%;
  background: var(--theme-accent); color: #000; font-weight: 900; font-size: 1.2rem;
}
.steps strong { display: block; font-size: 1.05rem; }

.cta { text-align: center; }
.cta p { margin-bottom: 1em; font-size: 1.15rem; }

/* Prev / next realm arrows (a nod to the Carrey-site arrows) */
.realm-arrows { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.realm-arrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--font-sign); font-size: 1.3rem; letter-spacing: .05em; text-decoration: none;
  padding: .3em .9em; border: 3px solid #000; border-radius: 999px;
  background: #fff; color: #111; box-shadow: 4px 4px 0 #000;
}
.realm-arrow:hover { background: var(--lab-green); }

@media (max-width: 600px) {
  .page-bar { position: static; }
}

/* Motion switch (injected into the top bar) */
.motion-toggle {
  position: fixed; left: 10px; bottom: 10px; z-index: 850;
  font: 800 .8rem var(--font-body); padding: .35em .8em; cursor: pointer;
  border: 3px solid #000; border-radius: 999px; background: #fff; color: #111;
  box-shadow: 3px 3px 0 #000;
}
.motion-toggle[aria-pressed="true"] { background: var(--lab-green); }

/* Calm mode: everything still drifts, just slower; no flashes or strobing */
html[data-motion="calm"] .storm-flash { display: none; }
html[data-motion="calm"] .wizard,
html[data-motion="calm"] .island { animation-duration: 12s; }
