:root{
  /* Brand palette */
  --midnight: #010719;      /* dark midnight background - 0F0F12 */
  --navy: #0A152A;      /* deep navy background - #010719  - 0F0F12 #0A152A*/
  --ink:  #0E1B36;      /* card/nav depth */
  --off:  #F4F4F4;      /* off-white text */
  --muted:#AAB6CF;      /* supporting text */
  --pink: #F206C7;      /* hot accent */
  --blue: #3DA6FF;      /* subtle cool accent (optional) */

  /* Layout & rhythm */
  --maxw: 1200px;
  --pad:  clamp(16px, 2.2vw, 28px);
  --gap:  clamp(16px, 2.2vw, 28px);
  --radius: 18px;

  /* Type scale */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --h1: clamp(22px, 3.2vw, 36px);
  --h2: clamp(18px, 2.4vw, 24px);
  --body: 16px;

  /* Effects */
  --glow: 0 0 0 transparent;
  --skew: 0deg;
  --noiseOpacity: 0.08;

  /* Container */
  --container-max: 1200px;                /* room for 3 cards */
  --container-pad: clamp(16px, 4vw, 32px);
  --gap: 28px;

}

* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  background: var(--midnight);
  color: var(--off);
  font-family: var(--font);
  font-size: var(--body);
  line-height: 1.45;
}

a { color: var(--off); text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible{
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

/* HEADER */
.site-header{
  position: relative;
  top: 0;
  z-index: 20;
  display: flex;
  gap: var(--gap);
  align-items: center;
  justify-content: center;   /* centers logo block horizontally */
  padding: 1rem 2rem;
  background: linear-gradient(180deg, rgba(10,21,42,0.95), rgba(10,21,42,0.65));
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(242,6,199,0.15);
}

.site-header .controls {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
}

.logo{
  display: inline-flex;
  gap: 12px;
  align-items: baseline;
  font-weight: 350;
  letter-spacing: .02em;
}
.logo-mark{
  display:inline-grid; place-items:center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--off);
  font-family: var(--mono);
  font-size: 18px;
  transform: rotate(-8deg);
}
.logo-type{ font-size: var(--h1); }
.logo-type em{ font-style: normal; color: var(--pink); }

/* CONTROLS */
.controls{ display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.btn{
  border: 1px solid rgba(242,6,199,0.5);
  background: transparent;
  color: var(--off);
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{ background: var(--pink); transform: translateY(-1px); }
.slider{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}
.slider input{
  accent-color: var(--pink);
  width: 140px;
}

.scroller {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
  overflow-y: auto;
  overflow-x: hidden;
  max-width: var(--container-max, 1100px);
  margin-inline: auto;
  padding: 0;                 /* ← important */
  justify-items: stretch;
}

/* 3-up at wide, 2-up mid, 1-up small */
@media (min-width: 1200px){
  .scroller{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 760px) and (max-width: 1199.98px){
  .scroller{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 759.98px){
  .scroller{ grid-template-columns: 1fr; }
}

/* cards shouldn’t add their own outer margin */
.card{ margin: 0; }

.scroller--vertical {
  overflow-y: hidden;
  padding-bottom: 1rem;
}

/* CARD */
.card{
  background: linear-gradient(180deg, var(--ink), #0B1630);
  border: 1px solid rgba(170,182,207,0.15);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  overflow: hidden;
  position: relative;
  isolation: isolate;
  will-change: transform, box-shadow;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card::after{
  /* subtle pink edge glow */
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  box-shadow: 0 0 0 0 170,182,207,0.15;
  transition: box-shadow .2s ease;
}
.card:hover{
  transform: translateY(-4px) skewY(var(--skew));
  border-color: rgba(242,6,199,0.3);
}
.card:hover::after{ box-shadow: 0 0 0 2px rgba(242,6,199,0.25), 0 8px 24px rgba(242,6,199,0.15) inset; }

.card__link{ display: grid; gap: 14px; padding: 14px; }
.card__thumb{
  height: 180px;
  border-radius: calc(var(--radius) - 6px);
  background: #121E3D;
  position: relative;
  overflow: hidden;
}

/* Title/meta */
.card__title{
  font-size: var(--h2);
  margin: 0;
  letter-spacing: .01em;
}
.card__meta{
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Glitchy hover (text duplication + slight offsets) */
.card:hover .card__title{
  text-shadow:
    0 0 transparent,
    1px 0 0 rgba(242,6,199,0.65),
    -1px 0 0 rgba(61,166,255,0.65);
}

/* Thumb variants for quick placeholders */
.thumb--gradient{
  background: linear-gradient(135deg, var(--pink), #4B1B8E 55%, #0A152A);
}
.thumb--noise::before{
  content:"";
  position:absolute; inset:0;
  background:
    radial-gradient(1200px 400px at 120% -10%, rgba(242,6,199,0.16), transparent 60%),
    radial-gradient(800px 300px at -10% 110%, rgba(61,166,255,0.12), transparent 60%),
    repeating-conic-gradient(from 0deg, rgba(255,255,255,var(--noiseOpacity)) 0 2deg, transparent 0 4deg);
  mix-blend-mode: screen;
}
.thumb--anaglyph{
  background:
    linear-gradient(90deg, rgba(255,0,0,0.25), transparent 30%),
    linear-gradient(270deg, rgba(0,255,255,0.25), transparent 30%),
    #0E1B36;
}
.thumb--mesh{
  background:
    linear-gradient(transparent 0 0),
    #121E3D;
}
.thumb--mesh::before{
  content:"";
  position:absolute; inset:0;
  background:
    linear-gradient(#1E2A4A 1px, transparent 1px) 0 0/22px 22px,
    linear-gradient(90deg, #1E2A4A 1px, transparent 1px) 0 0/22px 22px;
  opacity:.7;
}
.thumb--invert{
  background: linear-gradient(180deg, #F4F4F4, #E8E8E8);
  filter: invert(1) hue-rotate(310deg) saturate(1.2);
}

/* FOOTER */
.site-footer{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--pad);
  color: var(--muted);
  text-align: center;
  border-top: 1px dashed rgba(170,182,207,0.25);
  margin-top: 2rem;
}
.site-footer a{ color: var(--pink); }

.site-footer .container{
  padding-block: 0.25rem 2rem;   /* top/bottom spacing inside the line */
}

/* Responsive niceties */
@media (min-width: 1200px){
  .scroller--horizontal{ grid-auto-columns: 340px; }
}


.project-wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--pad);
}
.project-head{
  margin: 12px 0 24px;
  border-bottom: 1px solid rgba(170,182,207,0.18);
  padding-bottom: 16px;
}
.project-sub{ color: var(--muted); margin:.25rem 0 0; }
.project-meta{ color: var(--muted); font-size:14px; margin:.25rem 0 0; }
.project-summary{ margin-top: 12px; }

.project-links{ display:flex; gap:12px; flex-wrap:wrap; margin-top: 14px; }
.btn--primary{ background: var(--navy); color:#ffffff; border-color: transparent; }
.btn--primary:hover{ filter: brightness(1.05); }

.project-embed{ margin: 28px 0; }
.embed-aspect{ position: relative; width:100%; border-radius: var(--radius); overflow:hidden; background:#0E1B36; }
.embed-aspect iframe{
  position:absolute; inset:0; width:100%; height:100%; border:0;
}


/* Glitchy Title Effect */
.logo-type {
  letter-spacing: 0.04em;
  font-size: clamp(1.2rem, 4vw, 2rem);
  transition:
    opacity 0.15s ease,
    filter 0.15s ease,
    color 0.1s ease;
}

/* RGB channel split */
.logo-type.glitch {
  text-shadow:
    1px 0 rgba(61,166,255,0.6),
   -1px 0 rgba(242,6,199,0.6);
}

/* brief fade */
.logo-type.dim {
  opacity: 0.4;
  filter: brightness(0.6);
}

/* quick hot-pink flare */
.logo-type.flare {
  color: var(--pink);
  text-shadow:
    0 0 8px rgba(242,6,199,0.75),
    0 0 16px rgba(242,6,199,0.5);
}


/* --- CRT jitter + scanlines --- */
.logo-type {
  position: relative;
  will-change: transform, text-shadow, color, filter;
}

@keyframes jitterX {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-0.8px); }
  40%  { transform: translateX(0.8px); }
  60%  { transform: translateX(-0.6px); }
  80%  { transform: translateX(0.6px); }
  100% { transform: translateX(0); }
}

.logo-type.crt {
  animation: jitterX 110ms steps(2, end) infinite;
  /* a touch more RGB split during CRT moments */
  text-shadow:
    1px 0 rgba(61,166,255,0.5),
   -1px 0 rgba(242,6,199,0.5);
}

/* subtle scanline overlay */
.logo-type.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .15;
  mix-blend-mode: overlay;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.06) 0 1px,
      transparent 1px 2px
    );
}


/* --- Project Category Section --- */
.project-category {
  margin-block: 4rem;
  padding-inline: clamp(1rem, 5vw, 3rem);
}

.category-head {
  margin-bottom: 1.5rem;
  text-align: left;
  max-width: 720px;
}

.category-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--fg, #fff);
  margin: 0;
  letter-spacing: 0.02em;
}

.category-sub {
  color: var(--muted, #aab6cf);
  margin-top: 0.4rem;
  font-size: 0.95rem;
  line-height: 1.5;
}


/* Reusable - shared container */
.container{
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* Category section */
/* category head and grid sit in the same container edge */
.project-category .category-head{ max-width: 70ch; margin: 0 0 1.25rem 0; }

/* A vertical grid that aligns with the same container edges */
.project-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
}


/* --- FESTERiNG: card glitch animation --- */
@keyframes cardGlitch {
  0%, 100% { transform: none; filter: none; }
  8%  { transform: translate(-1px, 1px) rotate(-0.3deg); }
  16% { transform: translate(2px, -1px) rotate(0.2deg); }
  24% { filter: hue-rotate(12deg) contrast(1.15) saturate(1.1); }
  32% { transform: translate(-2px, 1px); }
  48% { filter: hue-rotate(-12deg) contrast(1.2) saturate(1.2); }
  64% { transform: translate(1px, -1px) rotate(0.15deg); }
  80% { transform: translate(-1px, 1px); }
}

/* animate the whole card so thumb + text jitter together */
.card.glitching {
  animation: cardGlitch 0.6s steps(2, end) infinite;
  z-index: 2; /* pop above neighbors during agitation */
}

/* add RGB split to the image area for extra glitch pop */
.card.glitching .card__thumb {
  box-shadow: 0 0 0 1px rgba(61,166,255,0.35), 0 0 0 2px rgba(242,6,199,0.35);
  filter: saturate(1.15) contrast(1.1);
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card.glitching { animation: none; }
  .card.glitching .card__thumb { box-shadow: none; filter: none; }
}

/* Only affect embedded sketches on project pages */
.project-embed .embed-aspect {
  /* let the iframe content breathe */
  height: auto;
  overflow: visible;
}

.note--meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
  opacity: 0.8;
}