/* =========================================================================
   reDesign - core system: tokens, base, textures, cursor, marquee, buttons
   ========================================================================= */

:root {
  /* anchors */
  --ink: #0B0B0B;
  --bone: #F2ECDD;
  --bone-2: #E7DEC6;

  /* electric palette */
  --lime:    #C7F23D;
  --magenta: #FF1D8E;
  --cyan:    #19E0E6;
  --yellow:  #FFD500;
  --violet:  #6E2BF0;
  --orange:  #FF5B22;

  /* role assignments (overridable by Tweaks) */
  --c1: var(--lime);
  --c2: var(--magenta);
  --c3: var(--cyan);
  --c4: var(--yellow);
  --c5: var(--violet);

  /* fonts */
  --f-head: 'Anton', 'Arial Narrow', sans-serif;
  --f-disp: 'Bricolage Grotesque', system-ui, sans-serif;
  --f-serif: 'Instrument Serif', Georgia, serif;
  --f-body: 'Space Grotesk', system-ui, sans-serif;
  --f-mono: 'Space Mono', ui-monospace, monospace;

  /* motion scale (Tweaks: maximal=1, punchy=0.7, refined=0.4) */
  --motion: 1;
  --grain-opacity: 0.07;

  --page-bg: var(--ink);
  --gutter: clamp(16px, 4vw, 64px);
  --maxw: 1440px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--bone);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.45;
  overflow-x: clip;
  transition: background-color 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-font-smoothing: antialiased;
}

/* hide default cursor only when custom cursor is active (desktop, fine pointer) */
body.cc-on,
body.cc-on a,
body.cc-on button,
body.cc-on input,
body.cc-on textarea { cursor: none; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--c2); color: var(--ink); }

/* ---- typographic primitives -------------------------------------------- */
.kicker {
  font-family: var(--f-mono);
  font-size: clamp(11px, 1vw, 13px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.serif-it { font-family: var(--f-serif); font-style: italic; font-weight: 400; }

.giant {
  font-family: var(--f-head);
  font-weight: 400;
  line-height: 0.82;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0;
}

.stroke {
  -webkit-text-stroke: 2px currentColor;
  color: transparent;
}
.stroke-bone { -webkit-text-stroke: 2px var(--bone); color: transparent; }
.stroke-ink  { -webkit-text-stroke: 2px var(--ink);  color: transparent; }

/* =========================================================================
   GRAIN + HALFTONE TEXTURES
   ========================================================================= */
.grain {
  position: fixed; inset: 0; z-index: 9000; pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* reusable halftone dot field (apply as a background) */
.halftone {
  background-image: radial-gradient(currentColor 22%, transparent 23%);
  background-size: 14px 14px;
  background-position: 0 0;
}

/* =========================================================================
   PAGE LOADER - covers the slow first paint, fades out once loaded.
   Hidden by default; only revealed when JS is present (html.js) so a no-JS
   visitor is never trapped behind it. JS removes it on window load.
   ========================================================================= */
.loader { display: none; }
html.js .loader {
  position: fixed; inset: 0; z-index: 10000;
  display: grid; place-items: center; overflow: hidden;
  background: var(--ink);
  /* exit: slide the whole sheet down out of view */
  transition: transform .7s cubic-bezier(.7, 0, .2, 1);
}
/* hero-style giant stroked word behind the mark */
.loader__word {
  position: absolute; inset: 0; z-index: 0;
  display: grid; place-items: center;
  font-family: var(--f-head); text-transform: uppercase; font-size: 34vw;
  color: transparent; -webkit-text-stroke: 2px rgba(199, 242, 61, .16);
  line-height: 1; white-space: nowrap; pointer-events: none;
}
/* lift the grain film above the content, exactly like the hero */
html.js .loader .grain { z-index: 2; }
.loader__inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
}
.loader__mark {
  position: relative; display: inline-block;
  font-family: var(--f-head); text-transform: uppercase;
  font-size: clamp(48px, 11vw, 120px); line-height: .8; letter-spacing: -.01em;
  color: var(--bone);
}
.loader__mark b { color: var(--c1); font-weight: inherit; }
/* the brand's hand-drawn underline, used as the animated progress line */
.loader__underline {
  position: absolute; left: 0; bottom: -.24em; width: 100%; height: .32em;
  overflow: visible; pointer-events: none;
}
.loader__underline path { stroke-dasharray: 100; stroke-dashoffset: 100; }
@media (prefers-reduced-motion: no-preference) {
  .loader__underline path { animation: loader-draw 1.5s ease-in-out infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .loader__underline path { stroke-dashoffset: 0; }
}
@keyframes loader-draw {
  0%   { stroke-dashoffset: 100; }
  45%  { stroke-dashoffset: 0; }
  55%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -100; }
}
/* exit state - sheet slid down, then dropped from layout entirely */
.loader.is-done { transform: translateY(100%); }
.loader.is-gone { display: none; }

/* =========================================================================
   CUSTOM CURSOR
   ========================================================================= */
#cursor, #cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 9500; display: none;
  pointer-events: none; will-change: translate; mix-blend-mode: difference;
}
html.motion-live #cursor, html.motion-live #cursor-dot { display: block; }
#cursor {
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border: 2px solid var(--bone); border-radius: 50%;
  transition: transform .22s cubic-bezier(.34, 1.7, .5, 1), background-color .2s;
}
#cursor.is-hot  { transform: scale(1.7); background: var(--bone); }
#cursor.is-down { transform: scale(.78); }
#cursor.is-hot.is-down { transform: scale(1.45); }
#cursor-dot {
  width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px;
  background: var(--bone); border-radius: 50%;
}
.cursor-trail {
  position: fixed; top: 0; left: 0; z-index: 9400; pointer-events: none;
  width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  mix-blend-mode: difference; background: var(--bone);
}
#cursor-label {
  position: fixed; top: 0; left: 0; z-index: 9500; pointer-events: none;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink); background: var(--c1); padding: 3px 7px; border-radius: 2px;
  opacity: 0; transition: opacity .2s; white-space: nowrap; will-change: transform;
}
#cursor-label.show { opacity: 1; }
@media (hover: none), (pointer: coarse) {
  #cursor, #cursor-dot, .cursor-trail, #cursor-label { display: none !important; }
  body.cc-on, body.cc-on * { cursor: auto !important; }
}

/* =========================================================================
   EMBEDDED COLOR CONFIGURATOR
   ========================================================================= */
.cfg { position: fixed; left: 18px; bottom: 18px; z-index: 8200; font-family: var(--f-body); }
.cfg__tab {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  background: var(--ink); color: var(--bone);
  border: 3px solid var(--ink); border-radius: 999px; padding: 9px 16px 9px 11px;
  font-family: var(--f-disp); font-weight: 800; text-transform: uppercase; font-size: 13px;
  box-shadow: 4px 4px 0 rgba(0,0,0,.5);
  transition: transform .15s cubic-bezier(.34,1.8,.5,1), box-shadow .15s;
}
.cfg__tab:hover { transform: translateY(-2px) rotate(-1.5deg); box-shadow: 6px 6px 0 rgba(0,0,0,.5); }
.cfg.open .cfg__tab { display: none; }
.cfg__dots { display: inline-flex; }
.cfg__dots i { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--ink); margin-left: -6px; }
.cfg__dots i:first-child { margin-left: 0; }

.cfg__body {
  width: 272px; background: var(--bone); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 6px; padding: 14px;
  box-shadow: 8px 8px 0 var(--ink);
}
.cfg__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cfg__head b { font-family: var(--f-disp); font-weight: 800; text-transform: uppercase; font-size: 15px; }
.cfg__close { border: none; background: var(--ink); color: var(--bone); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 17px; line-height: 1; display: grid; place-items: center; }
.cfg__presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cfg__preset { display: flex; flex-direction: column; gap: 5px; align-items: stretch; cursor: pointer; background: #fff; border: 2px solid var(--ink); border-radius: 4px; padding: 7px; transition: transform .12s; }
.cfg__preset:hover { transform: translateY(-2px); }
.cfg__preset.on { box-shadow: 0 0 0 2px var(--ink) inset; background: var(--bone-2); }
.cfg__swatchset { display: flex; height: 18px; border: 1.5px solid var(--ink); border-radius: 2px; overflow: hidden; }
.cfg__swatchset i { flex: 1; }
.cfg__preset em { font-family: var(--f-mono); font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; text-align: left; }
.cfg__divider { display: flex; align-items: center; gap: 8px; margin: 12px 0 8px; font-family: var(--f-mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: color-mix(in srgb, var(--ink) 55%, transparent); }
.cfg__divider span { flex: none; }
.cfg__divider::before, .cfg__divider::after { content: ""; height: 2px; background: var(--ink); flex: 1; opacity: .25; }
.cfg__swatches { display: flex; gap: 7px; }
.cfg__swatch { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.cfg__swatch input { width: 100%; height: 32px; border: 2px solid var(--ink); border-radius: 4px; padding: 0; background: none; cursor: pointer; }
.cfg__swatch input::-webkit-color-swatch-wrapper { padding: 2px; }
.cfg__swatch input::-webkit-color-swatch { border: none; border-radius: 2px; }
.cfg__swatch input::-moz-color-swatch { border: none; border-radius: 2px; }
.cfg__swatch span { font-family: var(--f-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.cfg__reset { width: 100%; margin-top: 12px; border: 2px solid var(--ink); background: var(--c1); color: var(--ink); font-family: var(--f-disp); font-weight: 800; text-transform: uppercase; font-size: 12px; padding: 9px; border-radius: 4px; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.cfg__reset:hover { transform: translateY(-2px); box-shadow: 3px 3px 0 var(--ink); }
@media (max-width: 600px) {
  .cfg { left: 10px; bottom: 10px; }
  .cfg__body { width: calc(100vw - 24px); }
}

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
  --btn-bg: var(--c1);
  --btn-fg: var(--ink);
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--f-disp); font-weight: 800;
  font-size: clamp(16px, 1.4vw, 21px);
  letter-spacing: -0.01em;
  padding: 0.85em 1.4em;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 3px solid var(--ink);
  border-radius: 2px;
  box-shadow: 6px 6px 0 var(--ink);
  position: relative; cursor: pointer;
  transition: transform .12s cubic-bezier(.34,1.8,.64,1), box-shadow .12s, background-color .2s;
  text-transform: uppercase;
}
.btn:hover { transform: translate(-3px,-3px); box-shadow: 10px 10px 0 var(--ink); }
.btn:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 var(--ink); }
.btn .arrow { transition: transform .2s cubic-bezier(.34,1.8,.64,1); }
.btn:hover .arrow { transform: translateX(5px) rotate(0deg); }
.btn-ghost {
  --btn-bg: transparent; --btn-fg: var(--bone);
  border-color: var(--bone); box-shadow: 6px 6px 0 color-mix(in srgb, var(--bone) 40%, transparent);
}

/* focus states - accessible + on-brand */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px dashed var(--c3);
  outline-offset: 3px;
}

/* magnetic elements use the individual `translate` prop so it composes with
   each element's own :hover transform (buttons translate on hover) */
[data-magnetic], [data-magnetic-soft] {
  transition: translate .25s cubic-bezier(.34, 1.6, .5, 1);
}
.cursor-trail { opacity: 0; transition: opacity .3s; }
body.trail-on .cursor-trail { opacity: 1; }

/* =========================================================================
   MARQUEE
   ========================================================================= */
.marquee {
  overflow: hidden; width: 100%;
  border-top: 4px solid var(--ink); border-bottom: 4px solid var(--ink);
  background: var(--c4);
  color: var(--ink);
}
.marquee + .marquee { border-top: none; }
.marquee__track {
  display: flex; width: max-content;
  will-change: transform;
  animation: marq var(--dur, 26s) linear infinite;
}
.marquee--rev .marquee__track { animation-direction: reverse; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  font-family: var(--f-head); text-transform: uppercase;
  font-size: clamp(34px, 6vw, 78px); line-height: 1;
  padding: 0.18em 0.35em; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 0.35em;
}
.marquee__item .dot {
  width: 0.32em; height: 0.32em; border-radius: 50%;
  background: var(--ink); display: inline-block; flex: none;
}
.marquee__item.is-stroke { -webkit-text-stroke: 2px var(--ink); color: transparent; }
@keyframes marq { to { transform: translateX(-50%); } }

/* =========================================================================
   STICKERS / TAPE / SCRIBBLE UTILITIES
   ========================================================================= */
.sticker {
  font-family: var(--f-disp); font-weight: 800; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(0,0,0,.55);
  will-change: transform;
}
.sticker--round { border-radius: 50%; }
.tape {
  display: none;
  position: absolute; width: 120px; height: 34px;
  background: color-mix(in srgb, var(--c4) 78%, transparent);
  box-shadow: 0 1px 6px rgba(0,0,0,.25);
  backdrop-filter: blur(1px);
}
.tape::before, .tape::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 7px;
  background-image: linear-gradient(135deg, rgba(255,255,255,.45) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.45) 50%, rgba(255,255,255,.45) 75%, transparent 75%);
  background-size: 7px 7px;
}
.tape::before { left: 0; } .tape::after { right: 0; }

/* duotone / mesh placeholder blocks */
.ph {
  position: relative; overflow: hidden; background: var(--ink);
  isolation: isolate;
}
.ph__mesh {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 80% at 20% 15%, var(--c2) 0%, transparent 60%),
    radial-gradient(70% 90% at 85% 30%, var(--c3) 0%, transparent 55%),
    radial-gradient(80% 80% at 60% 95%, var(--c1) 0%, transparent 55%),
    var(--ink);
  filter: saturate(1.15);
}
.ph__dots {
  position: absolute; inset: 0; opacity: .22;
  color: var(--ink);
  background-image: radial-gradient(currentColor 26%, transparent 27%);
  background-size: 9px 9px;
}
.ph__label {
  position: absolute; left: 10px; bottom: 9px; z-index: 2;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--bone);
  background: rgba(0,0,0,.55); padding: 3px 7px; border-radius: 2px;
}

/* =========================================================================
   HERO LOAD-ASSEMBLE + PARALLAX LAYERS + IDLE FLOAT
   uses individual transform props so parallax(translate), assemble(scale/rotate)
   and idle-float(transform) never collide
   ========================================================================= */
/* Content is visible by default. Only when JS confirms the animation timeline
   is actually live (html.anim, added pre-paint, kept only if a probe advances)
   do we hide-then-animate. This guarantees content shows in print, reduced-motion,
   frozen/offscreen iframes, and no-JS. */
.anim .asm {
  opacity: 0;
  scale: var(--from-scale, .6);
  rotate: var(--from-rot, 0deg);
}
html.anim.loaded .asm {
  animation: asm-in .8s cubic-bezier(.34, 1.56, .5, 1) var(--d, 0s) forwards;
}
@keyframes asm-in {
  to { opacity: 1; scale: 1; rotate: var(--rot, 0deg); }
}

.layer { will-change: translate; }
.floaty {
  animation: floaty var(--fdur, 6s) ease-in-out infinite;
  will-change: transform;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(var(--famp, -10px)); }
}

@media (prefers-reduced-motion: reduce) {
  .floaty { animation: none !important; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .marquee__track { animation: none !important; }
  #cursor, #cursor-dot, .cursor-trail { display: none !important; }
  body.cc-on, body.cc-on * { cursor: auto !important; }
}
