/* ===== Theme colours — tweak these to restyle the whole site ===== */
:root {
  --bg: #0a0a0c;
  --bg-2: #121216;
  --panel: #16161b;
  --red: #ff2a3a;
  --red-soft: #ff5a66;
  --text: #ece6e7;
  --muted: #b3a8aa;
  --line: rgba(255, 42, 58, .35);
  --glow: 0 0 6px rgba(255, 42, 58, .8), 0 0 18px rgba(255, 42, 58, .5), 0 0 40px rgba(255, 42, 58, .25);
  --box-glow: 0 0 0 1px var(--line), 0 0 18px rgba(255, 42, 58, .25);
  --mono: "Share Tech Mono", "VT323", ui-monospace, "Courier New", monospace;
  --display: "VT323", "Share Tech Mono", ui-monospace, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 42, 58, .18), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red-soft); }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 5px var(--red); border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -3rem; z-index: 100; background: var(--red); color: #000; padding: .5rem 1rem; font-family: var(--mono); }
.skip-link:focus { top: 1rem; }

/* ===== CRT scanlines + flicker overlay ===== */
.crt {
  pointer-events: none; position: fixed; inset: 0; z-index: 50;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.22) 2px 3px);
  mix-blend-mode: multiply;
  animation: flicker 6s infinite steps(1);
}
.crt::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,.55) 100%);
}
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: .85; } 48% { opacity: 1; } 82% { opacity: .9; } 83% { opacity: 1; } }

/* ===== Header / nav ===== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(10, 10, 12, .82); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { max-width: var(--max); margin: 0 auto; padding: .8rem 1.25rem; display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: var(--display); font-size: 1.9rem; line-height: 1; color: var(--red); text-decoration: none; text-shadow: var(--glow); }
.nav-links { list-style: none; display: flex; gap: 1.75rem; margin: 0; padding: 0; }
.nav-links a { font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em; font-size: .9rem; color: var(--text); text-decoration: none; }
.nav-links a:hover { color: var(--red-soft); text-shadow: var(--glow); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--red); font-size: 1.5rem; line-height: 1; padding: .25rem .65rem; border-radius: 4px; cursor: pointer; }

/* ===== Hero ===== */
.hero-wrap { position: relative; max-width: var(--max); margin: 0 auto; }
.hero {
  min-height: calc(100vh - 64px); min-height: calc(100svh - 64px);
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  max-width: var(--max); margin: 0 auto; padding: 1.25rem 1.25rem 2rem;
}
.glitch {
  position: relative; margin: 0;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(4.5rem, min(11vw, 15svh), 8rem); line-height: .85; letter-spacing: .04em;
  color: var(--red); text-shadow: var(--glow);
}
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
}
.glitch::before, .glitch::after { opacity: 0; text-shadow: none; }
.glitch::before { color: #ffb3b8; clip-path: inset(10% 0 55% 0); animation: glitch 4s infinite steps(1); }
.glitch::after { color: #b3001a; clip-path: inset(60% 0 5% 0); animation: glitch 5.3s infinite steps(1) .7s; }
/* Layers are invisible most of the time and only "jump" for a few frames */
@keyframes glitch {
  0%, 89%, 100% { opacity: 0; transform: translate(0); }
  90% { opacity: .8; transform: translate(-6px, 1px); }
  92% { opacity: .8; transform: translate(5px, -1px); }
  94% { opacity: .6; transform: translate(-3px, 0); }
  96% { opacity: 0; }
}
.tagline { font-family: var(--mono); font-size: clamp(1.15rem, 3vw, 1.6rem); text-transform: uppercase; letter-spacing: .14em; margin: 1rem 0 .45rem; color: var(--text); }
.cursor { color: var(--red); animation: blink 1s infinite steps(1); }
@keyframes blink { 50% { opacity: 0; } }
.sub { max-width: 38rem; color: var(--muted); margin: 0 auto 1.4rem; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }

/* ===== Hologram wolf head (centred above the name) =====
   Only opacity / transform / clip-path are animated, so it stays cheap. */
.hero { position: relative; z-index: 1; }
.holo {
  --holo-o: 1;
  position: relative; z-index: 0; pointer-events: none; flex: none;
  /* ~50% of the screen height on desktop, capped by width on narrow screens */
  height: clamp(240px, 48svh, 560px); width: auto; max-width: 76vw; aspect-ratio: 800 / 1006;
  margin: 0 auto 1rem;
}
.holo::before { /* soft red bloom behind the head */
  content: ""; position: absolute; inset: 10%; z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 42, 58, .35), transparent);
}
.holo-img {
  width: 100%; height: 100%; display: block;
  opacity: var(--holo-o);
  filter: saturate(1.3) brightness(1.35) drop-shadow(0 0 18px rgba(255, 42, 58, .55));
  animation: holo-flicker 7.3s infinite steps(1, end);
}
.holo-glitch {
  position: absolute; inset: 0; opacity: 0;
  background: url("assets/hero/wolf-head.webp") center / contain no-repeat;
  mix-blend-mode: screen;
}
.holo-r { filter: saturate(2.2) brightness(1.9); animation: holo-slice-r 7.3s infinite steps(1, end); }
.holo-c { filter: hue-rotate(180deg) saturate(2.2) brightness(1.6); animation: holo-slice-c 7.3s infinite steps(1, end); }
.holo-scan { /* scanlines + a slow rolling band, clipped to the head shape by a mask */
  position: absolute; inset: 0;
  -webkit-mask: url("assets/hero/wolf-head.webp") center / contain no-repeat;
          mask: url("assets/hero/wolf-head.webp") center / contain no-repeat;
  background:
    linear-gradient(to bottom, transparent 0 40%, rgba(255, 90, 100, .18) 48%, transparent 56%) 0 0 / 100% 300% no-repeat,
    repeating-linear-gradient(to bottom, rgba(0,0,0,.4) 0 1px, transparent 1px 3px);
  animation: holo-roll 5.5s linear infinite;
}
/* Irregular "failing neon" timeline: mostly on, dips, hard cut-outs, stutters back */
@keyframes holo-flicker {
  0%    { opacity: var(--holo-o); }
  11%   { opacity: calc(var(--holo-o) * .55); }
  12%   { opacity: var(--holo-o); }
  31%   { opacity: 0; }
  32%   { opacity: calc(var(--holo-o) * .8); }
  33%   { opacity: 0; }
  35%   { opacity: var(--holo-o); }
  52%   { opacity: calc(var(--holo-o) * .4); }
  53.5% { opacity: var(--holo-o); }
  71%   { opacity: 0; }
  76%   { opacity: 0; }
  77%   { opacity: calc(var(--holo-o) * .5); }
  78%   { opacity: 0; }
  79.5% { opacity: var(--holo-o); }
  91%   { opacity: calc(var(--holo-o) * .7); }
  92%   { opacity: var(--holo-o); }
}
@keyframes holo-slice-r {
  0%, 100% { opacity: 0; }
  30%   { opacity: .6; clip-path: inset(18% 0 64% 0); transform: translateX(-14px); }
  31%   { opacity: .8; clip-path: inset(55% 0 30% 0); transform: translateX(10px); }
  32%   { opacity: 0; }
  51%   { opacity: .7; clip-path: inset(40% 0 45% 0); transform: translateX(-8px); }
  52%   { opacity: 0; }
  79.5% { opacity: .6; clip-path: inset(8% 0 78% 0); transform: translateX(16px); }
  80.5% { opacity: .7; clip-path: inset(62% 0 20% 0); transform: translateX(-12px); }
  81.5% { opacity: 0; }
}
@keyframes holo-slice-c {
  0%, 100% { opacity: 0; }
  30%   { opacity: .7; clip-path: inset(22% 0 60% 0); transform: translateX(12px); }
  31%   { opacity: .6; clip-path: inset(58% 0 27% 0); transform: translateX(-9px); }
  32%   { opacity: 0; }
  79.5% { opacity: .7; clip-path: inset(12% 0 74% 0); transform: translateX(-14px); }
  80.5% { opacity: 0; }
}
@keyframes holo-roll { from { background-position: 0 100%, 0 0; } to { background-position: 0 -200%, 0 0; } }

.btn {
  display: inline-block; font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em;
  font-size: .95rem; padding: .85rem 1.4rem; border: 1px solid var(--red); border-radius: 3px;
  color: var(--text); text-decoration: none; background: transparent;
  transition: box-shadow .2s, background .2s, color .2s;
}
.btn:hover { box-shadow: var(--box-glow), inset 0 0 12px rgba(255, 42, 58, .3); color: #fff; }
.btn-primary { background: var(--red); color: #0a0a0c; font-weight: 600; box-shadow: 0 0 18px rgba(255, 42, 58, .45); }
.btn-primary:hover { background: #ff4452; color: #0a0a0c; box-shadow: 0 0 28px rgba(255, 42, 58, .7); }

/* ===== Sections ===== */
.section { max-width: var(--max); margin: 0 auto; padding: 5rem 1.25rem; scroll-margin-top: 60px; }
.section-title {
  font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 6vw, 3.4rem); line-height: 1;
  margin: 0 0 2rem; color: var(--text); text-transform: uppercase; letter-spacing: .06em;
}
.section-title span { color: var(--red); text-shadow: var(--glow); margin-right: .3em; }

/* Responsive 16:9 video */
.video-frame {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  background: #000;
  border: 1px solid var(--red); border-radius: 6px; overflow: hidden;
  box-shadow: 0 0 30px rgba(255, 42, 58, .3), 0 0 80px rgba(255, 42, 58, .12);
}
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; background: #000; }
.unmute {
  position: absolute; top: .75rem; right: .75rem; z-index: 2;
  font-family: var(--mono); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(10, 10, 12, .8); color: var(--text); border: 1px solid var(--red); border-radius: 3px;
  padding: .45rem .8rem; cursor: pointer; box-shadow: 0 0 12px rgba(255, 42, 58, .35);
}
.unmute:hover { background: var(--red); color: #0a0a0c; }
.section-intro { color: var(--muted); margin: -1rem 0 2rem; }
.caption { font-family: var(--mono); color: var(--muted); margin: 1rem 0 0; font-size: .95rem; }

/* Animation + stills grids */
.grid { /* flex-wrap so an incomplete last row is centred instead of left hanging */
  --cols: 3; --gap: 1.5rem;
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap);
}
.grid > li { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); min-width: 0; }
@media (max-width: 960px) { .grid { --cols: 2; } }
.card {
  background: var(--panel); border: 1px solid rgba(255, 42, 58, .2); border-radius: 6px; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover, .card:focus-within { transform: translateY(-4px); border-color: var(--red); box-shadow: var(--box-glow), 0 12px 30px rgba(0,0,0,.5); }
.card-btn {
  all: unset; box-sizing: border-box; position: relative; display: block; width: 100%; cursor: pointer;
  aspect-ratio: 4 / 3; background: #000; overflow: hidden;
}
/* Cover-crop in the grid (works for 16:9, square and 9:16 alike); the lightbox shows the full frame */
.card-btn img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; transition: filter .25s, transform .4s; filter: saturate(.92) brightness(.92); }
.card-btn:hover img, .card-btn:focus-visible img { filter: saturate(1.1) brightness(1.08); transform: scale(1.03); }
.card-btn:focus-visible { outline: 2px solid #fff; outline-offset: -4px; box-shadow: inset 0 0 0 6px var(--red); }
.card-btn::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(10,10,12,.55), transparent 45%);
}
.badge {
  position: absolute; left: .7rem; bottom: .6rem; z-index: 1;
  font-family: var(--mono); font-size: .8rem; letter-spacing: .08em; color: #fff;
  background: rgba(10, 10, 12, .75); border: 1px solid var(--line); border-radius: 3px; padding: .15rem .5rem;
  text-shadow: 0 0 6px rgba(255, 42, 58, .8);
}
.card-body { padding: .85rem 1.1rem .95rem; }
.card-title { margin: 0; font-family: var(--mono); font-weight: 400; text-transform: uppercase; letter-spacing: .1em; color: var(--red-soft); font-size: 1.05rem; }
.card-caption { color: var(--muted); font-family: var(--mono); font-size: .85rem; letter-spacing: .06em; margin: .2rem 0 0; }

/* Stills: justified rows. Each card's width follows its image's shape (--ar = width / height,
   set on the <li>), so portrait, square and landscape pieces sit side by side in date order
   with no cropping (very tall or very wide pieces are clamped and only slightly trimmed).
   .card-dark  = art on black: black tile so the edges vanish
   .card-matte = art on white/light: shown on a dark mat with a thin frame */
.grid.grid-stills { --row: 235px; }
.grid-stills > li { flex: var(--ar, 1) 1 calc(var(--ar, 1) * var(--row)); max-width: calc(var(--ar, 1) * var(--row) * 1.35); }
.grid-stills::after { content: ""; flex: 999 1 0; } /* stops the last row from stretching */
.grid-stills .card-btn { aspect-ratio: var(--ar, 1); }
.grid-stills .card-btn img { object-fit: cover; object-position: center 35%; }
.grid-stills .card-btn::after { display: none; }
.card-portrait .card-btn img { object-position: center 30%; }
.card-dark .card-btn { background: #000; }
.card-dark .card-btn img { filter: none; }
.card-dark .card-btn:hover img { filter: brightness(1.12); }
@media (max-width: 960px) { .grid.grid-stills { --row: 200px; } }
@media (max-width: 720px) { .grid.grid-stills { --row: 120px; } .grid-stills > li { max-width: none; } }

/* "Show more" button under long grids */
.grid > li.is-collapsed { display: none; }
.show-more-wrap { display: flex; justify-content: center; margin-top: 2rem; }
.show-more { cursor: pointer; background: transparent; }
/* Matted artwork: light-background art sits on a dark mat with a thin frame, never recoloured */
.card-matte .card-btn { background: radial-gradient(ellipse at center, #1d1d23, #111115); padding: 1.1rem; display: flex; align-items: center; justify-content: center; }
.card-matte .card-btn img {
  filter: none; border: 1px solid rgba(255, 255, 255, .14); border-radius: 2px;
  box-shadow: 0 0 0 4px #0c0c0f, 0 0 0 5px rgba(255, 42, 58, .35), 0 10px 30px rgba(0, 0, 0, .6);
  width: auto; height: auto; max-width: 100%; max-height: 100%;
}
.card-matte .card-btn:hover img { filter: none; transform: scale(1.02); }

/* About terminal */
.terminal {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 1.75rem;
  box-shadow: inset 0 0 40px rgba(255, 42, 58, .06);
  max-width: 52rem;
}
.terminal p { margin: 0 0 1rem; }
.term-line { font-family: var(--mono); color: var(--muted); }
.prompt { color: var(--red); text-shadow: 0 0 8px rgba(255, 42, 58, .6); }
.skills { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.skills li { font-family: var(--mono); font-size: .9rem; border: 1px solid var(--line); padding: .3rem .7rem; border-radius: 3px; color: var(--text); }

/* Contact */
.contact p { color: var(--muted); margin: 0 0 1.5rem; }
.email { text-transform: none; letter-spacing: .04em; font-size: 1.1rem; }
.socials { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-wrap: wrap; gap: 1rem 2rem; }
.socials a { font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.socials a:hover { color: var(--red-soft); text-shadow: var(--glow); border-color: var(--red); }

.footer { border-top: 1px solid var(--line); text-align: center; padding: 2rem 1.25rem; font-family: var(--mono); color: var(--muted); font-size: .85rem; }
.footer p { margin: 0; }

/* Lightbox */
.lightbox {
  max-height: 94vh; overflow: auto;
  border: 1px solid var(--red); border-radius: 6px; padding: 0; background: var(--bg-2); color: var(--text);
  max-width: min(1100px, 94vw); width: fit-content; min-width: min(560px, 94vw);
  box-shadow: 0 0 40px rgba(255, 42, 58, .4);
}
.lightbox::backdrop { background: rgba(0, 0, 0, .85); backdrop-filter: blur(3px); }
.lightbox figure { margin: 0; }
.lb-media { background: #000; display: flex; justify-content: center; align-items: center; }
/* contain = never crop; portrait (9:16) videos get letterboxed sides instead of being cut off */
.lb-media video, .lb-media img { display: block; max-width: 100%; max-height: 78vh; width: auto; height: auto; object-fit: contain; }
.lb-media video { min-width: min(100%, 320px); }
@media (max-width: 720px) {
  .lb-media video, .lb-media img { max-height: 62vh; }
  .lightbox.is-matte .lb-media img { max-height: 58vh; }
  .lightbox figcaption { font-size: .9rem; }
}
.lightbox.is-matte .lb-media { background: #141418; padding: clamp(.75rem, 3vw, 2rem); }
.lightbox.is-matte .lb-media img { border: 1px solid rgba(255,255,255,.14); box-shadow: 0 0 0 5px #0c0c0f, 0 0 0 6px rgba(255,42,58,.35); max-height: 72vh; }
.lightbox figcaption { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .25rem; }
.lightbox strong { font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--red-soft); }
.lightbox figcaption span { color: var(--muted); }
.lb-close {
  position: absolute; top: .6rem; right: .6rem; z-index: 2; width: 2.5rem; height: 2.5rem;
  background: rgba(10,10,12,.85); color: var(--text); border: 1px solid var(--red); border-radius: 50%;
  font-size: 1.1rem; cursor: pointer;
}
.lb-close:hover { box-shadow: var(--box-glow); }

/* ===== Mobile ===== */
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: rgba(10, 10, 12, .97); border-bottom: 1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 1rem 1.25rem; border-top: 1px solid rgba(255,42,58,.12); }
  .section { padding: 3.5rem 1.25rem; }
  .grid-stills { --gap: .9rem; }
  .grid-stills .card-body { padding: .6rem .7rem .8rem; }
  .grid-stills .card-title { font-size: .9rem; }
  .grid-stills .card-caption { font-size: .8rem; }
  .card-matte .card-btn { padding: .6rem; }
  .grid-anim { --cols: 2; --gap: .9rem; }
  .grid-anim .card-body { padding: .6rem .7rem .8rem; }
  .grid-anim .card-title { font-size: .9rem; }
  .grid-anim .card-caption { font-size: .8rem; }
  .terminal { padding: 1.25rem; }
  .hero { min-height: auto; padding: 1.75rem 1.25rem 3rem; }
  .holo { width: 76vw; height: auto; }
  .glitch { font-size: 26vw; }
}

/* ===== Respect reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .holo-img { opacity: .9; }
  .holo-glitch { display: none; }
  .card:hover, .card:focus-within, .card-btn:hover img { transform: none; }
}
