/* wickedstyles.css
   Mobile-first responsive base styles
   Includes reset, typography, layout, form, and utility helpers.
*/

/* fraunces-latin-wght-normal */
@font-face {
  font-family: 'Fraunces Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(https://cdn.jsdelivr.net/fontsource/fonts/fraunces:vf@5.3.0/latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  font-family: "Fraunces Variable", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color-scheme: light;
  color: var(--text);
  background: var(--page);
  font-size: 16px;
  tab-size: 4;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --glitch-red: #ff4757;
  --glitch-cyan: #00d9ff;
  --page: #fafafa;
  --surface: #ffffff;
  --text: #111111;
  --muted-text: #4b5563;
  --border: #e5e7eb;
  --field-border: #d1d5db;
  --button-text: #111111;
  --menu: #333333;
  --header-bg: #eef2ef;
  --header-text: #111111;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #101214;
  --surface: #1b1f23;
  --text: #f4f7f5;
  --muted-text: #b7c1bc;
  --border: #39443e;
  --field-border: #536059;
  --button-text: #101214;
  --menu: #202924;
  --header-bg: #000000;
  --header-text: #ffffff;
}

/* Reset and sensible defaults */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  text-rendering: optimizeLegibility;
}

body > :not(.background-logo) {
  position: relative;
  z-index: 1;
}

.background-logo {
  inset: 0;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  width: 100%;
  z-index: 0;
}

.background-logo img {
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  width: 100%;
  filter: grayscale(1) brightness(0);
}

:root[data-theme="dark"] .background-logo img {
  filter: grayscale(1) brightness(0) invert(0.72);
  opacity: 0.18;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;

}


button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: solid 1px var(--text);
  background: #a8ffd9;
  color: var(--button-text);
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  outline: 1 rem solid;
  outline-color: #000000;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

body {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  padding: 0;
  margin: 0 1rem 0; 
  font-weight: 700;
  line-height: 1.2;
}

h1,
h2,
h3 {
  font-family: 'Fraunces Variable', serif;
}

p {
  padding: 0;
  margin: 0 1rem 0; 
}

img {
  border-style: none;
}

button,
input,
select,
textarea {
  border-radius: 0.375rem;
  margin: 1rem 1.5rem 1rem;
}

/* Utility classes */


.container {
  width: min(1160px, calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
}

.layout-grid {
  display: grid;
  gap: 1.5rem;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.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;
}

/* Page structure */
.site-header,
.site-footer {
  padding: 1.25rem 0;
}

.site-header {
  background: var(--header-bg);
  color: var(--header-text);
}

.site-topbar {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: 0 auto;
  width: min(1160px, calc(100% - 2rem));
}

.site-title-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
}

.site-title-group h1,
.site-title-group p {
  margin: 0;
}

.site-title-group h1,
.site-title-group .small-logo {
  white-space: nowrap;
}

.theme-toggle {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--text);
  color: var(--page);
}

.site-footer {
  background: #111;
  color: #eee;
}

.site-main {
  padding: 2rem 0;
}

.hero {
  padding: 1rem 0;
}

.hero h1 {
  font-size: clamp(2.25rem, 4vw, 4rem);
  margin-bottom: 1rem;
}

.hero p {
  max-width: 50rem;
  color: var(--muted-text);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.card h2 {
  margin-top: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  background: #2563eb;
  color: #fff;
  transition: background 0.2s ease, transform 0.2s ease;
}

.button:hover,
.button:focus-visible {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.button.secondary {
  background: #f3f4f6;
  color: var(--button-text);
}

input,
textarea,
select {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--field-border);
  background: var(--surface);
  color: var(--text);
}

input:focus,
textarea:focus,
select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.field-group {
  display: grid;
  gap: 0.75rem;
}

/* Responsive layout */
@media (min-width: 640px) {
  .layout-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero {
    padding: 1rem 0;
  }
}

@media (min-width: 1024px) {
  .site-header,
  .site-footer {
    padding: 1.75rem 0;
  }

  .hero {
    padding: 0;
  }

  .layout-grid-2,
  .layout-grid-3 {
    gap: 2rem;
  }

  .hero-content {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    align-items: center;
    gap: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.hamburger-menu {
  position: relative;
  display: inline;
}

.hamburger {
  cursor: pointer;
  font-size: 24px;
}

.off-screen-menu {
  position: fixed;
  top: 0;
  left: -100%; /* Initially off-screen */
  width: 300px;
  height: 100%;
  background: var(--menu);
  color: white;
  transition: left 0.3s ease;
  z-index: 1000;
}

.off-screen-menu.open {
  left: 0; /* Slide into view */
}

.off-screen-menu a {
  display: block; /* Ensures items are arranged vertically */
  padding: 10px 20px;
  text-decoration: none;
  color: var(--text);
}

.glitch-text {
    animation: text-glitch 6s ease-in-out infinite;
}

@keyframes text-glitch {
    0%,
    92%,
    100% {
        transform: translateX(0);
        text-shadow: none;
    }
    93% {
        transform: translateX(-2px);
        text-shadow:
            2px 0 var(--glitch-cyan),
            -2px 0 var(--glitch-red);
    }
    94% {
        transform: translateX(2px);
        text-shadow:
            -2px 0 var(--glitch-cyan),
            2px 0 var(--glitch-red);
    }
    95% {
        transform: translateX(-1px);
        text-shadow:
            1px 0 var(--glitch-cyan),
            -1px 0 var(--glitch-red);
    }
    96% {
        transform: translateX(1px);
        text-shadow: none;
    }
}

/* Container sizing */
.chromatic-wrapper {
  position: relative;
  display: inline-block;
  overflow: hidden;
  background-color: #000; /* Optional: prevents bright background bleeding */
}

/* Base image styling */
.layer-main {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Position overlays directly on top of base image */
.layer-red,
.layer-cyan {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Prevents overlay from blocking mouse interactions */
}

/* Ensure inner overlay images fill the wrapper */
.layer-red img,
.layer-cyan img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 🔴 RED CHANNEL ISOLATION */
.layer-red {
  background-color: #ff0000; /* Pure Red background */
  mix-blend-mode: screen;    /* Combines red light with layers beneath */
  animation: chromatic-red 0.12s steps(2) infinite;
}

.layer-red img {
  mix-blend-mode: multiply;  /* Strips out green & blue, leaving only red */
}

/* 🔵 CYAN CHANNEL ISOLATION */
.layer-cyan {
  background-color: #00ffff; /* Pure Cyan background */
  mix-blend-mode: screen;    /* Combines cyan light with layers beneath */
  animation: chromatic-cyan 0.15s steps(2) infinite;
}

.layer-cyan img {
  mix-blend-mode: multiply;  /* Strips out red, leaving only cyan */
}

/* Keyframe animations for jittering offset */
@keyframes chromatic-red {
  0%, 100% {
    transform: translate(2px, 1px);
  }
  50% {
    transform: translate(3px, 0);
  }
}

@keyframes chromatic-cyan {
  0%, 100% {
    transform: translate(-2px, -1px);
  }
  50% {
    transform: translate(-3px, 1px);
  }
}