/* ============================================================
   minimac.com — refined
   Palette system driven by body[data-palette] + body[data-fx]
   ============================================================ */

@font-face {
    font-family: 'Maratype';
    src: url('assets/Maratype.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* Self-hosted, subset wordmark/UI fonts (was 24 Google families / ~846KB / 46
   cross-origin requests; now ~79KB of same-origin woff2, no third-party calls).
   Display faces are subset to the wordmark glyphs (Minimac.com); Share Tech Mono
   keeps full printable ASCII for the contact box + source consoles. Regenerate
   with /tmp/subset_fonts.py only if a face or the wordmark text ever changes. */
@font-face{font-family:'UnifrakturMaguntia';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/unifrakturmaguntia.woff2') format('woff2');}
@font-face{font-family:'Cinzel Decorative';font-style:normal;font-weight:900;font-display:swap;src:url('assets/fonts/cinzel-decorative.woff2') format('woff2');}
@font-face{font-family:'New Rocker';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/new-rocker.woff2') format('woff2');}
@font-face{font-family:'Pirata One';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/pirata-one.woff2') format('woff2');}
@font-face{font-family:'Uncial Antiqua';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/uncial-antiqua.woff2') format('woff2');}
@font-face{font-family:'Metamorphous';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/metamorphous.woff2') format('woff2');}
@font-face{font-family:'Caesar Dressing';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/caesar-dressing.woff2') format('woff2');}
@font-face{font-family:'Rye';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/rye.woff2') format('woff2');}
@font-face{font-family:'Fredericka the Great';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/fredericka-the-great.woff2') format('woff2');}
@font-face{font-family:'IM Fell English SC';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/im-fell-english-sc.woff2') format('woff2');}
@font-face{font-family:'Monoton';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/monoton.woff2') format('woff2');}
@font-face{font-family:'Bungee';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/bungee.woff2') format('woff2');}
@font-face{font-family:'Abril Fatface';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/abril-fatface.woff2') format('woff2');}
@font-face{font-family:'Righteous';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/righteous.woff2') format('woff2');}
@font-face{font-family:'Faster One';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/faster-one.woff2') format('woff2');}
@font-face{font-family:'Jim Nightshade';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/jim-nightshade.woff2') format('woff2');}
@font-face{font-family:'Almendra SC';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/almendra-sc.woff2') format('woff2');}
@font-face{font-family:'Glass Antiqua';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/glass-antiqua.woff2') format('woff2');}
@font-face{font-family:'VT323';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/vt323.woff2') format('woff2');}
@font-face{font-family:'Press Start 2P';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/press-start-2p.woff2') format('woff2');}
@font-face{font-family:'Special Elite';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/special-elite.woff2') format('woff2');}
@font-face{font-family:'Silkscreen';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/silkscreen.woff2') format('woff2');}
@font-face{font-family:'Share Tech Mono';font-style:normal;font-weight:400;font-display:swap;src:url('assets/fonts/share-tech-mono.woff2') format('woff2');}

:root {
    /* tunable via Tweaks */
    --glow: 0;             /* wordmark neon glow strength 0..1 */
    --wm-blur: 1.5px;      /* wordmark blur (soft-focus default) */
    --console-op: 0.6;     /* source-console opacity */
    --motion: 1;           /* motion master multiplier */
}

/* ---------- Palettes ---------- */
body {
    /* REFINED (default) — tinted near-black calms the lime vibration */
    --accent:    #c2fe0b;          /* signature acid lime          */
    --accent-2:  #5b1cff;          /* electric violet              */
    --bg:        #0a0b16;          /* blue-violet near-black        */
    --bg-tint:   rgba(91, 28, 255, 0.10);
    --ink:       #c2fe0b;
    --rule:      rgba(194, 254, 11, 0.42);
    --cross:     rgba(194, 254, 11, 0.42);
    --console:   #c2fe0b;
    --box-bg:    rgba(91, 28, 255, 0.16);
    --box-border:rgba(194, 254, 11, 0.50);
    --box-title-bg: #c2fe0b;
    --box-title-fg: #1a0142;
}

body[data-palette="classic"] {
    /* the original site, untouched */
    --accent:    #c2fe0b;
    --accent-2:  #5200ff;
    --bg:        #000000;
    --bg-tint:   transparent;
    --ink:       #c2fe0b;
    --rule:      rgba(194, 254, 11, 0.50);
    --cross:     rgba(194, 254, 11, 0.50);
    --console:   #c2fe0b;
    --box-bg:    rgba(82, 0, 255, 0.25);
    --box-border:rgba(194, 254, 11, 1);
    --box-title-bg: #c2fe0b;
    --box-title-fg: #5200ff;
}

body[data-palette="dusk"] {
    /* deeper, warmer, gentlest contrast */
    --accent:    #cdf25a;          /* slightly toned lime          */
    --accent-2:  #7a47ff;
    --bg:        #0c0a1a;           /* deep indigo                  */
    --bg-tint:   rgba(122, 71, 255, 0.12);
    --ink:       #d7f679;
    --rule:      rgba(205, 242, 90, 0.34);
    --cross:     rgba(205, 242, 90, 0.34);
    --console:   #cdf25a;
    --box-bg:    rgba(122, 71, 255, 0.18);
    --box-border:rgba(205, 242, 90, 0.45);
    --box-title-bg: #cdf25a;
    --box-title-fg: #241046;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body { background: var(--bg); }

body {
    font-family: 'Maratype', 'Share Tech Mono', ui-monospace, monospace;
    min-height: 300vh;
    width: 100vw;
    color: var(--ink);
    position: relative;
    overflow-x: hidden;
}

/* flowing background image */
body::before {
    content: '';
    position: fixed;
    top: -15%;
    left: -15%;
    width: 130%;
    height: 150%;
    background-image: url('assets/background.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(3px) saturate(0.92);
    z-index: -2;
    will-change: transform;
}

/* tint + vignette overlay — unifies image, bg colour and lime */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(135% 105% at 50% 45%, transparent 58%, color-mix(in srgb, var(--bg) 70%, transparent) 100%),
        var(--bg-tint);
}

/* ---------- Wordmark ---------- */
h1 {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20vw;
    font-weight: 300;
    letter-spacing: 0.01em;
    white-space: nowrap;
    z-index: 10;
    filter: blur(var(--wm-blur));
    text-shadow:
        0 0 calc(18px * var(--glow)) rgba(194, 254, 11, calc(0.55 * var(--glow))),
        0 0 calc(46px * var(--glow)) rgba(194, 254, 11, calc(0.30 * var(--glow)));
    color: var(--accent);
}

h1 span { transition: font-family 0s; }

/* ---------- Contact box ---------- */
#contact-box {
    position: fixed;
    top: 70vh;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Share Tech Mono', ui-monospace, monospace;
    font-size: 17px;
    letter-spacing: 0.04em;
    z-index: 10;
    background-color: var(--box-bg);
    border: 1.5px solid var(--box-border);
    border-radius: 3px;
    backdrop-filter: blur(7px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35),
                0 0 0 1px rgba(0, 0, 0, 0.18);
    transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                top  0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#contact-title {
    background-color: var(--box-title-bg);
    color: var(--box-title-fg);
    font-size: 10px;
    letter-spacing: 0.26em;
    padding: 5px 11px;
    display: flex;
    align-items: center;
    gap: 7px;
    text-transform: uppercase;
    cursor: grab;
    border-radius: 1px 1px 0 0;
}
#contact-title::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--box-title-fg);
    border-radius: 50%;
    opacity: 0.55;
}

#contact-box.dragging,
#contact-box.dragging * {
    cursor: grabbing !important;
    transition: none !important;
}

#contact-body {
    padding: 16px 30px 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

#contact-body a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.18s ease, text-shadow 0.18s ease;
}
#contact-body a:hover {
    opacity: 1;
    text-shadow: 0 0 12px rgba(194, 254, 11, 0.6);
}
/* keyboard focus indicator (mouse clicks inside the draggable box don't trigger :focus-visible) */
#contact-body a:focus-visible {
    opacity: 1;
    text-shadow: 0 0 12px rgba(194, 254, 11, 0.6);
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.contact-icon {
    height: 1.7em;
    width: auto;
    image-rendering: pixelated;
}

/* ---------- h-rules flanking the box ---------- */
.h-rule {
    position: fixed;
    left: 0;
    width: 100vw;
    height: 1.5px;
    background-color: var(--rule);
    z-index: 9;
    pointer-events: none;
}

/* ---------- Source consoles ---------- */
#console, #console2 {
    position: fixed;
    font-family: ui-monospace, 'Share Tech Mono', monospace;
    font-size: 12px;
    line-height: 1.45;
    color: var(--console);
    opacity: var(--console-op);
    padding: 1vw;
    max-width: 38vw;
    max-height: 78vh;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    z-index: 4;
    scrollbar-width: none;
    mix-blend-mode: screen;
}
#console::-webkit-scrollbar,
#console2::-webkit-scrollbar { display: none; }

#console  { top: 2vw;    left: 2vw; }
#console2 { bottom: 2vw; right: 2vw; transform: rotate(180deg); }

body[data-consoles="off"] #console,
body[data-consoles="off"] #console2 { display: none; }

/* ---------- Corner registration crosses ---------- */
.corner-cross {
    position: fixed;
    width: 26px;
    height: 26px;
    pointer-events: none;
    z-index: 10;
}
.corner-cross::before,
.corner-cross::after {
    content: '';
    position: absolute;
    background-color: var(--cross);
}
.corner-cross::before {
    width: 100%; height: 1.5px;
    top: 50%; left: 0;
    transform: translateY(-50%);
}
.corner-cross::after {
    width: 1.5px; height: 100%;
    left: 50%; top: 0;
    transform: translateX(-50%);
}
#cross-tl { top: 6px; left: 6px; }
#cross-tr { top: 6px; right: 6px; }
#cross-bl { bottom: 6px; left: 6px; }
#cross-br { bottom: 6px; right: 6px; }

/* ---------- Corporate ticker (ironic marquee) ---------- */
#ticker {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 24px;
    overflow: hidden;
    z-index: 6;
    display: none;
    pointer-events: none;
    background: var(--bg-tint);
    border-bottom: 1px solid rgba(194, 254, 11, 0.16);
    backdrop-filter: blur(2px);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
            mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}
body[data-ticker="on"] #ticker { display: block; }
body[data-ticker="on"] #console { top: 34px; }
#ticker .track {
    display: inline-flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--accent);
    opacity: 0.78;
    will-change: transform;
    animation: tickerScroll 70s linear infinite;
}
#ticker .track > span { padding: 0 16px; }
@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
body[data-motion="off"] #ticker .track { animation: none; }

/* ---------- Targeting reticle ---------- */
#reticle {
    position: fixed;
    inset: 0;
    z-index: 12;
    pointer-events: none;
    display: none;
}
body[data-reticle="on"] #reticle { display: block; }
#reticle .r-v, #reticle .r-h { position: fixed; background: rgba(194, 254, 11, 0.32); }
#reticle .r-v { top: 0; left: 0; width: 1px; height: 100vh; transform: translateX(-100px); }
#reticle .r-h { top: 0; left: 0; width: 100vw; height: 1px; transform: translateY(-100px); }
#reticle .r-xy {
    position: fixed; top: 0; left: 0;
    font-family: 'Share Tech Mono', monospace; font-size: 10px; letter-spacing: 0.1em;
    color: var(--accent); background: var(--bg-tint); padding: 2px 5px;
    transform: translate(-300px, -300px); white-space: nowrap;
}
#reticle .r-dot {
    position: fixed; top: 0; left: 0; width: 9px; height: 9px;
    margin: -4.5px 0 0 -4.5px; border: 1.5px solid var(--accent); opacity: 0.85;
    transform: translate(-300px, -300px);
}
#reticle .r-lock {
    position: fixed; top: 0; left: 0; width: 0; height: 0; display: none;
    transition: left .12s cubic-bezier(.2,.8,.2,1), top .12s cubic-bezier(.2,.8,.2,1),
                width .12s cubic-bezier(.2,.8,.2,1), height .12s cubic-bezier(.2,.8,.2,1);
}
body[data-reticle="on"] #reticle .r-lock.active { display: block; }
#reticle .r-lock i { position: absolute; width: 12px; height: 12px; border: 1.6px solid var(--accent); }
#reticle .r-lock i.tl { left: -3px;  top: -3px;    border-right: 0; border-bottom: 0; }
#reticle .r-lock i.tr { right: -3px; top: -3px;    border-left: 0;  border-bottom: 0; }
#reticle .r-lock i.bl { left: -3px;  bottom: -3px; border-right: 0; border-top: 0; }
#reticle .r-lock i.br { right: -3px; bottom: -3px; border-left: 0;  border-top: 0; }

@media (hover: none) { #reticle { display: none !important; } }

/* ---------- CRT / scanline overlay ---------- */
#crt {
    position: fixed;
    inset: 0;
    z-index: 30;
    pointer-events: none;
    display: none;
}
body[data-crt="on"] #crt { display: block; }
#crt::before {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg,
        rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px,
        rgba(0,0,0,0.16) 3px, rgba(0,0,0,0) 4px);
    animation: crtFlicker 4.5s steps(60) infinite;
}
#crt::after {
    content: '';
    position: absolute; left: 0; right: 0; top: -24vh; height: 24vh;
    background: linear-gradient(rgba(194,254,11,0), rgba(194,254,11,0.045), rgba(194,254,11,0));
    animation: crtSweep 7.5s linear infinite;
}
@keyframes crtFlicker { 0%,100%{opacity:0.92} 7%{opacity:0.78} 50%{opacity:1} 53%{opacity:0.85} }
@keyframes crtSweep { from { transform: translateY(0); } to { transform: translateY(150vh); } }
body[data-motion="off"] #crt::before,
body[data-motion="off"] #crt::after { animation: none; }

/* ---------- Wordmark RGB glitch burst ---------- */
@keyframes wmGlitch {
    0%   { transform: translate(-50%, -50%); }
    18%  { transform: translate(calc(-50% - 3px), -50%); text-shadow: -3px 0 rgba(255,0,90,0.85), 3px 0 rgba(0,230,255,0.85); }
    36%  { transform: translate(calc(-50% + 4px), -50%) skewX(-3deg); text-shadow: 3px 0 rgba(255,0,90,0.7), -3px 0 rgba(0,230,255,0.7); }
    54%  { transform: translate(calc(-50% - 2px), -50%); text-shadow: -2px 0 rgba(255,0,90,0.6), 2px 0 rgba(0,230,255,0.6); }
    72%  { transform: translate(-50%, -50%) skewX(2deg); }
    100% { transform: translate(-50%, -50%); }
}
h1.glitching { animation: wmGlitch 0.36s steps(2) 1; }

@keyframes wmTear {
    0%   { clip-path: inset(0 0 0 0);    transform: translate(-50%, -50%); }
    20%  { clip-path: inset(0 0 62% 0);  transform: translate(calc(-50% + 9px), -50%); }
    42%  { clip-path: inset(46% 0 30% 0); transform: translate(calc(-50% - 11px), -50%); filter: blur(calc(var(--wm-blur) + 2.5px)); }
    64%  { clip-path: inset(74% 0 0 0);  transform: translate(calc(-50% + 6px), -50%); }
    82%  { clip-path: inset(0 0 0 0);    transform: translate(-50%, -50%); }
    100% { clip-path: inset(0 0 0 0);    transform: translate(-50%, -50%); }
}
h1.tearing { animation: wmTear 0.32s steps(3) 1; }

/* ---------- Fake telemetry HUD ---------- */
#telemetry {
    position: fixed; top: 40px; right: 16px; z-index: 11;
    display: none;
    font-family: 'Share Tech Mono', monospace; font-size: 10px; letter-spacing: 0.06em;
    color: var(--accent);
    background: var(--box-bg);
    border: 1px solid rgba(194, 254, 11, 0.26);
    padding: 9px 11px; min-width: 180px;
    backdrop-filter: blur(6px);
    line-height: 1.75; opacity: 0.94;
    white-space: nowrap;
}
body[data-telemetry="on"] #telemetry { display: block; }
#telemetry .tl-row { display: flex; justify-content: space-between; gap: 16px; }
#telemetry .tl-row > span:first-child { opacity: 0.6; }
#telemetry .tl-dot { animation: tlBlink 1.4s steps(1) infinite; }
#telemetry .tl-spark { letter-spacing: 0; }
@keyframes tlBlink { 50% { opacity: 0.15; } }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    h1 { font-size: 26vw; }
    #console, #console2 { max-width: 62vw; font-size: 10px; opacity: calc(var(--console-op) * 0.7); }
    #console2 { display: none; }
    #contact-box { font-size: 15px; }
    #contact-body { padding: 14px 20px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    #contact-box { transition: none; }
    /* belt-and-suspenders: kill the (currently-off) marquee/CRT keyframes too */
    #ticker .track,
    #crt::before,
    #crt::after { animation: none !important; }
}
