/* ==========================================================================
   anime.css — minimal, safe override layer
   Loaded AFTER styles.css. Only re-skins colors / fonts / borders.
   Zero pseudo-elements on body, zero fixed layers, zero isolation contexts.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;600;700;800&family=Chakra+Petch:wght@400;500;600;700&display=swap');

html, body { overscroll-behavior-y: none; }

/* CRITICAL: styles.css applies `animation: pageIntroFade ... both` on
   .page-intro-fade which animates transform + filter on body. Even
   after the animation completes, `fill: both` keeps computed transform
   at matrix(1,0,0,1,0,0) which is NON-none and makes body the
   containing block for every position:fixed descendant. The modal
   then opens at body's center (~3000px down), and .bg-embers /
   body::before / body::after sized to body produce ~765px of phantom
   scroll past the footer. Kill the animation to fix both bugs. */
body.anime.page-intro-fade,
body.anime .page-intro-fade {
  animation: none !important;
  transform: none !important;
  filter: none !important;
}
body.anime::before,
body.anime::after {
  display: none !important;   /* kill the legacy ember-drift pseudos too */
}

body.anime {
  /* palette shift — lifted a few steps from ink-black for easier reading */
  --bg: #131625;
  --bg-2: #191d2f;
  --surface: #1f2339;
  --surface-hi: #2a2f49;
  --border: #1e2130;
  --border-hi: #2b3046;
  --text: #f4efe3;
  --text-strong: #ffffff;
  --muted: #8c91a5;
  --dim: #4a4f62;

  --accent: #ff2e88;
  --accent-soft: #ff6ab0;
  --accent-warm: #ff6a2b;
  --accent-ember: #ffb074;
  --accent-dim: rgba(255, 46, 136, 0.15);
  --accent-glow: rgba(255, 46, 136, 0.45);
  --accent-wash: rgba(255, 46, 136, 0.08);

  --cyan: #00e5ff;

  --font: "Chakra Petch", "Inter", system-ui, sans-serif;
  --font-display: "Orbitron", "Chakra Petch", system-ui, sans-serif;
  --font-mono: "Chakra Petch", ui-monospace, monospace;

  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

/* Keep the existing .bg-grain / .bg-embers / .bg-aurora layers in
   styles.css — only recolor the aurora radial tones. No new fixed
   elements, no changes to stacking. */
body.anime .bg-aurora::before {
  background: radial-gradient(circle, #ff2e88 0%, transparent 70%);
  opacity: 0.18;
  width: 900px !important;
  height: 900px !important;
}
body.anime .bg-aurora::after {
  background: radial-gradient(circle, #00e5ff 0%, transparent 70%);
  opacity: 0.14;
  width: 760px !important;
  height: 760px !important;
}
/* Subtle grid overlay to add depth over the lifted bg */
body.anime .bg-grain {
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px) !important;
  background-size: 48px 48px !important;
  opacity: 0.5 !important;
  animation: anime-grid-drift 22s linear infinite;
}
@keyframes anime-grid-drift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 48px 48px, 48px 48px; }
}

/* Front-page hero: animated glow ring behind the intro heading */
body.anime section:has(> .wrap > .intro) { position: relative; overflow: hidden; }
body.anime .intro { position: relative; z-index: 1; }
body.anime section:has(> .wrap > .intro)::before {
  content: "";
  position: absolute;
  top: 50%; left: 20%;
  width: 480px; height: 480px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 46, 136, 0.22), transparent 65%);
  filter: blur(40px);
  animation: anime-hero-orb 12s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}
body.anime section:has(> .wrap > .intro)::after {
  content: "";
  position: absolute;
  top: 50%; right: 10%;
  width: 420px; height: 420px;
  border-radius: 50%;
  transform: translate(50%, -50%);
  background: radial-gradient(circle, rgba(0, 229, 255, 0.18), transparent 65%);
  filter: blur(40px);
  animation: anime-hero-orb 14s ease-in-out infinite alternate-reverse;
  pointer-events: none;
  z-index: 0;
}
@keyframes anime-hero-orb {
  0%   { transform: translate(-50%, -50%) scale(1); }
  100% { transform: translate(-45%, -55%) scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  body.anime section:has(> .wrap > .intro)::before,
  body.anime section:has(> .wrap > .intro)::after,
  body.anime .bg-grain { animation: none !important; }
}

/* ---- Typography -------------------------------------------------------- */

body.anime h1,
body.anime h2,
body.anime h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--text-strong);
}
body.anime h1 { line-height: 1.05; }
body.anime h2 { line-height: 1.1; }
body.anime h3 { line-height: 1.2; }

body.anime .mono,
body.anime .eyebrow {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 11px;
}
body.anime .eyebrow { color: var(--cyan); }

body.anime .intro h1,
body.anime .hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 3.2vw, 36px);
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0;
}
/* Slow the per-character reveal down so "Independent maker." is gentler */
body.anime .char-reveal .char {
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
  transition-delay: calc(var(--i, 0) * 50ms);
}
body.anime .intro h1 .accent,
body.anime .hero h1 .accent {
  color: var(--accent);
  text-shadow: none;
}

body.anime .page-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 4vw, 42px);
  text-transform: uppercase;
  line-height: 1.08;
}
body.anime .page-header h1 .accent { color: var(--accent); }

body.anime .category-head h2,
body.anime .section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2.6vw, 28px);
  text-transform: uppercase;
  line-height: 1.15;
  letter-spacing: 0;
}

body.anime .carousel-caption h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 3.2vw, 36px);
  text-transform: uppercase;
  line-height: 1.1;
}

/* ---- Nav --------------------------------------------------------------- */

/* The .nav itself is now `position: fixed` with its own background pill in
   styles.css. anime.css must not add its own bg/border-bottom — that
   stretches a panel across the viewport behind the pill. */
body.anime .nav { background: transparent; border-bottom: none; }

/* IMPORTANT: do NOT shrink .nav-brand to 30×30. The brand is now a
   logo-tile + 2-line wordmark layout (handled in styles.css). The old
   anime override turned the whole brand into a 30×30 favicon block which
   clipped the wordmark and caused the topbar to look "broken". */
body.anime .nav-brand-logo {
  box-shadow: 0 0 0 1px rgba(255, 46, 136, 0.25), 0 0 12px rgba(255, 46, 136, 0.25);
  transition: box-shadow 0.2s var(--ease);
}
body.anime .nav-brand:hover .nav-brand-logo {
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.45), 0 0 16px rgba(0, 229, 255, 0.4);
}
body.anime .nav-links a {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
}
body.anime .nav-links a:hover,
body.anime .nav-links a.active { color: var(--text-strong); }

body.anime .scroll-progress {
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}

/* ---- Buttons ----------------------------------------------------------- */

body.anime .btn {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  background: transparent;
  border-radius: 2px;
  padding: 10px 18px;
}
body.anime .btn:hover {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #06070d;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.3);
}
body.anime .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06070d;
}
body.anime .btn-primary:hover {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(255, 46, 136, 0.35);
}

/* ---- Carousel ---------------------------------------------------------- */

body.anime .carousel {
  border: 1px solid var(--border-hi);
  border-radius: 2px;
}
/* The caption already has a full pink outline (styles.css) — don't add a
   conflicting left border on top. */
body.anime .carousel-caption { border-left: none; }
body.anime .carousel-slide .video-badge {
  background: var(--accent);
  color: #06070d;
  border-radius: 2px;
}
body.anime .carousel-slide .video-badge::before { background: #06070d; }
body.anime .carousel-nav {
  border: 1px solid var(--cyan);
  color: var(--cyan);
  background: rgba(6, 7, 13, 0.7);
  border-radius: 2px;
}
body.anime .carousel-nav:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #06070d;
}
body.anime .carousel-dot { border-radius: 0; width: 18px; height: 3px; background: var(--border-hi); }
body.anime .carousel-dot.active {
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  width: 30px;
}

/* ---- Cards ------------------------------------------------------------- */

body.anime .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
}
body.anime .card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 22px rgba(255, 46, 136, 0.2);
}

/* Tag pill inside card-meta — plain muted text, no background box */
body.anime .card-meta { color: var(--muted); }
body.anime .card-meta .tag { color: var(--accent); }
body.anime .card-meta .sep { color: var(--dim); }

body.anime .card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0;
}

/* ---- Category + Section heads ----------------------------------------- */

body.anime .category-head h2::before,
body.anime .section-head h2::before {
  background: linear-gradient(180deg, var(--accent), var(--cyan));
  width: 4px;
}

body.anime .category-link,
body.anime .section-head-link {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  border-color: var(--border-hi);
}
body.anime .category-link:hover,
body.anime .section-head-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---- Filter / chips ---------------------------------------------------- */

body.anime .filter-btn,
body.anime .chip {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 2px;
}
body.anime .filter-btn.active,
body.anime .chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #06070d;
}

/* ---- Social list ------------------------------------------------------- */

body.anime .social-item .name { color: var(--text-strong); }
body.anime .social-item .handle { color: var(--muted); }
body.anime .social-item:hover {
  background: var(--surface-hi);
}
body.anime .social-item:hover .name { color: var(--accent); }

/* ---- Footer ------------------------------------------------------------ */

body.anime footer {
  border-top: 1px solid var(--border-hi);
  color: var(--muted);
}

/* ---- Modal — surface skin only, leave behavior to styles.css ---------- */

body.anime .modal {
  background: var(--bg-2);
  border: 1px solid var(--accent);
  box-shadow: 0 0 50px rgba(255, 46, 136, 0.35);
  /* Width / max-height managed in styles.css for the new compact modal */
}
/* Hero image fills the box (no letterbox bars) — matches styles.css */
body.anime .modal-hero {
  background: radial-gradient(circle at center, #1f2339, #0e1019);
}
body.anime .modal-hero img,
body.anime .modal-hero video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
/* The modal-side / Stack panel is gone — single column body */
body.anime .modal-body {
  grid-template-columns: 1fr;
}
body.anime .modal h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 6px;
  line-height: 1.15;
}
body.anime .modal-tagline {
  font-size: 12px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
body.anime .modal-desc p {
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 8px;
}
body.anime .modal-close { color: var(--accent); border-color: var(--accent); }
body.anime .modal-close:hover { background: var(--accent); color: #06070d; }


/* ---- Per-card media positioning fixes -------------------------------- */
/* Target specific images by src. For portrait/oddly-framed sources the
   default object-fit:cover crops badly — switch to contain + a dark
   backdrop so the piece is fully visible and centered. */

/* Portrait phone screenshots — contain them so nothing gets chopped */
.card-media img[src$="smart-screen.jpg"],
.card-media img[src$="phone-holder.jpg"],
.card-media img[src$="phoneholder1.jpg"],
.card-media img[src$="cryptomining.jpg"],
.card-media img[src$="toiletdisplay.jpg"] {
  object-fit: contain !important;
  object-position: center center !important;
  background: radial-gradient(circle at center, #12141c, #06070d);
}
/* Cards that wrap these images get the same backdrop so empty bars blend */
.card-media:has(img[src$="smart-screen.jpg"]),
.card-media:has(img[src$="phone-holder.jpg"]),
.card-media:has(img[src$="phoneholder1.jpg"]),
.card-media:has(img[src$="cryptomining.jpg"]),
.card-media:has(img[src$="toiletdisplay.jpg"]) {
  background: radial-gradient(circle at center, #12141c, #06070d) !important;
}

/* China chess — center on the board itself (lower portion of the frame) */
.card-media img[src$="china-chess.jpg"] {
  object-fit: contain !important;
  object-position: center center !important;
  background: radial-gradient(circle at center, #1a1e33, #0e1019) !important;
}

/* Glaces en Seine banner — anchor on the caravan (right side of bannerup.png)
   applies EVERYWHERE the image is used: carousel slide + card-media + modal hero */
img[src$="bannerup.png"] {
  object-fit: cover !important;
  object-position: 72% 50% !important;
}
/* Modal hero shows the same image with the anchor point — cover so it
   fills the box (no letterbox bars). */
.modal-hero img[src$="bannerup.png"] {
  object-fit: cover !important;
  object-position: 72% 50% !important;
}

/* Book grid: single card was stretching to full row width. Cap it. */
body.anime .book-grid {
  grid-template-columns: repeat(auto-fill, minmax(360px, 420px)) !important;
  justify-content: start !important;
}
body.anime .book-card {
  max-width: 560px;
}
/* On phones, drop the 360px-min column so the card can shrink with the
   viewport (otherwise it overflows horizontally on screens < 360px). */
@media (max-width: 720px) {
  body.anime .book-grid {
    grid-template-columns: 1fr !important;
    justify-content: stretch !important;
  }
  body.anime .book-card { max-width: none; }
}

/* Mario large figure — slightly too zoomed. Drop the cover zoom. */
.card-media img[src$="print-2022-1641a.jpg"],
.card-media img[src$="mario.jpg"] {
  object-fit: contain !important;
  object-position: center center !important;
  background: radial-gradient(circle at center, #12141c, #06070d);
}
