/* ============================================================
   enchantments.css — magical interaction layer
   ------------------------------------------------------------
   Currently powers: the watching portrait on the homepage.

   Tuning the eye positions for your hero photo:
     1. Open / with #debug-portrait appended to the URL.
        Two red rings will mark where the pupils sit.
     2. Adjust the four custom properties below until each ring
        sits over a real eye in the photo.
     3. Reload without the hash to see the finished version.
   ============================================================ */

/* ---------- Wizarding portrait ---------- */
/* The portrait gets a brass frame, a cursor-following spotlight, and a
   nameplate underneath. JS sets --tilt-x / --tilt-y / --mx / --my. */

.profile-image-container.is-enchanted {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --mx: 50%;
  --my: 50%;
  padding: 12px;
  background:
    linear-gradient(135deg,
      #8b6822 0%,
      #d6b577 18%,
      #f1d599 32%,
      #b08c3d 52%,
      #6b4a16 68%,
      #c8a058 84%,
      #8b6822 100%);
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 230, 170, 0.35),
    inset 0 0 0 3px rgba(50, 30, 8, 0.55),
    inset 0 0 0 4px rgba(255, 220, 150, 0.18),
    0 30px 80px rgba(0, 0, 0, 0.45);
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transform-style: preserve-3d;
  transition: transform 60ms linear;
  position: relative;
}

.profile-image-container.is-enchanted img {
  border-radius: 8px;
  display: block;
  transform: none; /* override the legacy scale(1.02) */
  position: relative;
  z-index: 1;
}

.profile-image-container.is-enchanted::before {
  /* Soften the inherited blue/purple blur in framed mode so the brass reads. */
  opacity: 0.12 !important;
  filter: blur(36px);
}
.profile-image-container.is-enchanted:hover::before {
  opacity: 0.22 !important;
}

.portrait-glow {
  position: absolute;
  inset: 12px;
  border-radius: 8px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.85;
  background: radial-gradient(
    circle 220px at var(--mx, 50%) var(--my, 50%),
    rgba(255, 230, 160, 0.28),
    rgba(255, 220, 130, 0.1) 28%,
    transparent 60%
  );
  mix-blend-mode: screen;
  transition: opacity 180ms ease;
}

.portrait-plate {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 16px auto 0;
  padding: 6px 22px;
  background:
    linear-gradient(180deg, #d6b577 0%, #b08c3d 50%, #8b6822 100%);
  color: #1d1404;
  border-radius: 4px;
  border: 1px solid rgba(50, 30, 8, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 200, 0.45),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 8px 22px rgba(0, 0, 0, 0.25);
  font-family: 'HarryP', 'Poppins', cursive;
  font-size: 19px;
  letter-spacing: 0.14em;
  text-shadow: 0 1px 0 rgba(255, 230, 180, 0.4);
  text-align: center;
  transform: translateZ(0);
}

.portrait-plate__sep { opacity: 0.55; }
.portrait-plate__year { letter-spacing: 0.22em; }

/* Centre the plate under the photo regardless of the parent's flex/grid. */
.hero-image,
.about-image {
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.dark-mode .profile-image-container.is-enchanted {
  box-shadow:
    inset 0 0 0 1px rgba(255, 230, 170, 0.4),
    inset 0 0 0 3px rgba(20, 14, 4, 0.7),
    inset 0 0 0 4px rgba(255, 220, 150, 0.2),
    0 30px 80px rgba(0, 0, 0, 0.6);
}

@media (max-width: 600px) {
  .profile-image-container.is-enchanted { padding: 8px; }
  .portrait-glow { inset: 8px; }
  .portrait-plate { font-size: 16px; padding: 5px 18px; margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .profile-image-container.is-enchanted {
    transition: none;
    transform: none !important;
  }
  .portrait-glow { display: none; }
}


/* ============================================================
   Drawn-spell engine
   ============================================================ */

/* Wand FAB — fixed bottom-right, breathes gently when idle. */
.wand-fab {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 215, 130, 0.5);
  background: radial-gradient(circle at 30% 30%, #2b2118 0%, #120c08 70%);
  color: #ffe6a8;
  font-size: 18px;
  cursor: pointer;
  z-index: 9998;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(0, 0, 0, 0.15) inset,
    0 0 18px rgba(255, 200, 100, 0.15);
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
  display: grid;
  place-items: center;
}
.wand-fab:hover { transform: translateY(-2px) rotate(-8deg); }
.wand-fab:focus-visible { outline: 2px solid #ffd66b; outline-offset: 3px; }
.wand-fab i { transition: transform 200ms ease; }

body.wand-mode-on .wand-fab {
  background: radial-gradient(circle at 30% 30%, #4a3818 0%, #1a1208 70%);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 215, 130, 0.5) inset,
    0 0 32px rgba(255, 200, 100, 0.55);
}
body.wand-mode-on .wand-fab i { transform: rotate(-22deg) scale(1.05); }

/* Drawing canvas — lives above everything, but only intercepts
   pointer events while wand mode is on. */
.spell-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9990;
  pointer-events: none;
  touch-action: none;
  background: transparent;
  transition: background 220ms ease;
}
body.wand-mode-on .spell-canvas {
  pointer-events: auto;
  background: radial-gradient(ellipse at center, rgba(8, 6, 18, 0.55) 0%, rgba(8, 6, 18, 0.78) 100%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  cursor: crosshair;
}

/* Hint panel — visible while wand mode is on. Three glyph buttons
   that play a ghost-trace preview of the template path. */
.spell-hint {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%, -16px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 16px;
  border-radius: 999px;
  background: rgba(20, 16, 28, 0.88);
  border: 1px solid rgba(255, 215, 130, 0.3);
  color: #f3e6c4;
  z-index: 9999;
  opacity: 0;
  pointer-events: none; /* panel chrome is non-interactive */
  transition: opacity 280ms ease, transform 280ms ease;
  max-width: calc(100vw - 32px);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.spell-hint.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.spell-hint__label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.75;
  white-space: nowrap;
  padding-right: 4px;
  border-right: 1px solid rgba(255, 215, 130, 0.2);
}

.spell-hint__btn {
  pointer-events: auto; /* only the buttons are interactive */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 8px;
  border: 1px solid rgba(255, 215, 130, 0.18);
  background: rgba(40, 30, 50, 0.55);
  color: #ffe6a8;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.spell-hint__btn:hover,
.spell-hint__btn:focus-visible {
  background: rgba(70, 50, 30, 0.85);
  border-color: rgba(255, 215, 130, 0.55);
  outline: none;
  transform: translateY(-1px);
}
.spell-hint__btn:active { transform: translateY(0); }
.spell-hint__btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(255, 200, 100, 0.4));
}

@media (max-width: 720px) {
  .spell-hint { gap: 6px; padding: 6px 10px; }
  .spell-hint__label { display: none; } /* icons are self-explanatory */
  .spell-hint__btn { padding: 6px; font-size: 11px; }
  .spell-hint__btn svg { width: 16px; height: 16px; }
  .spell-hint__btn span { display: none; } /* icon-only on narrow screens */
}
@media (max-width: 380px) {
  .spell-hint { gap: 4px; padding: 5px 8px; }
  .spell-hint__btn { padding: 5px; }
  .spell-hint__btn svg { width: 14px; height: 14px; }
}

/* Caption — names the spell after a successful cast. */
.spell-caption {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translate(-50%, 8px);
  font-family: 'HarryP', 'Poppins', cursive;
  font-size: 44px;
  letter-spacing: 0.04em;
  color: #ffe6a8;
  text-shadow: 0 0 24px rgba(255, 200, 100, 0.6);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 320ms ease, transform 320ms ease;
}
.spell-caption.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Full-screen flash — used by Lumos / Nox. */
.spell-flash {
  position: fixed;
  inset: 0;
  z-index: 9995;
  pointer-events: none;
  opacity: 0;
  transition: opacity 320ms ease-out;
}
.spell-flash.is-firing { opacity: 1; }

/* Revelio — highlight every internal link on the page. */
@keyframes revelio-pulse {
  from { box-shadow: 0 1px 0 rgba(255, 200, 100, 0.4); }
  to   { box-shadow: 0 2px 0 rgba(255, 200, 100, 0.95); }
}
body.revelio-active a[href]:not([href^='http']):not([href^='mailto']):not([href^='tel']) {
  background: linear-gradient(transparent 60%, rgba(255, 215, 130, 0.4) 60%);
  box-shadow: 0 1px 0 rgba(255, 200, 100, 0.4);
  animation: revelio-pulse 900ms ease-in-out infinite alternate;
  border-radius: 2px;
}

/* Patronus parchment overlay. */
.patronus-overlay {
  position: fixed;
  inset: 0;
  z-index: 9997;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, rgba(245, 230, 200, 0.35) 0%, rgba(20, 12, 30, 0.6) 80%);
  opacity: 0;
  transition: opacity 480ms ease;
  pointer-events: none;
}
.patronus-overlay.is-visible { opacity: 1; }
.patronus-card {
  max-width: min(560px, 90vw);
  padding: 36px 40px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f6e8c5 0%, #e9d5a6 100%);
  color: #3a2a18;
  text-align: center;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(120, 80, 30, 0.3) inset;
  transform: translateY(8px) scale(0.98);
  transition: transform 480ms ease;
  font-family: 'Poppins', serif;
}
.patronus-overlay.is-visible .patronus-card { transform: none; }
.patronus-mark {
  font-family: 'HarryP', 'Poppins', cursive;
  font-size: 28px;
  letter-spacing: 0.06em;
  margin: 0 0 16px;
  color: #6b3c12;
}
.patronus-quote {
  font-size: 22px;
  line-height: 1.4;
  margin: 0 0 8px;
  font-style: italic;
}
.patronus-attrib {
  font-size: 14px;
  margin: 0;
  color: #5a4220;
}

/* Patronus — soft-blue summoned glow on whatever is being summoned. */
@keyframes patronus-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180, 220, 255, 0); }
  50%      { box-shadow: 0 0 0 12px rgba(180, 220, 255, 0.4); }
}
.patronus-summoned {
  animation: patronus-glow 1.6s ease-in-out 2;
  border-radius: 14px;
  position: relative;
}
body.dark-mode .patronus-summoned {
  animation-name: patronus-glow-dark;
}
@keyframes patronus-glow-dark {
  0%, 100% { box-shadow: 0 0 0 0 rgba(140, 200, 255, 0); }
  50%      { box-shadow: 0 0 0 14px rgba(140, 200, 255, 0.45); }
}

/* Tempus persistent corner widget. */
.tempus-widget {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  min-width: 196px;
  padding: 10px 14px 10px 14px;
  background: linear-gradient(180deg, #f6e8c5 0%, #e3c184 100%);
  color: #3a2a18;
  border: 1px solid rgba(120, 80, 30, 0.4);
  border-radius: 6px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  z-index: 9996;
  font-family: 'Poppins', sans-serif;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 280ms ease, transform 280ms ease;
}
.tempus-widget.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.tempus-widget__title {
  font-family: 'HarryP', 'Poppins', cursive;
  font-size: 18px;
  letter-spacing: 0.06em;
  margin: 0 0 6px;
  color: #6b3c12;
}
.tempus-widget__close {
  position: absolute;
  top: 4px;
  right: 6px;
  background: none;
  border: none;
  color: #6b3c12;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.tempus-widget__close:hover { background: rgba(120, 80, 30, 0.15); }
.tempus-widget__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tempus-widget__list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(80, 50, 20, 0.25);
}
.tempus-widget__list li:last-child { border-bottom: none; }
.tempus-widget__loc {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}
.tempus-widget__time {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .tempus-widget {
    top: max(70px, calc(env(safe-area-inset-top) + 60px));
    right: max(12px, env(safe-area-inset-right));
    min-width: 174px;
  }
}

/* Tempus clock overlay (legacy — kept for safety; unused since the
   widget replaced it, but harmless if a stale path triggers it). */
.tempus-overlay {
  position: fixed;
  inset: 0;
  z-index: 9997;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, rgba(245, 230, 200, 0.3) 0%, rgba(20, 12, 30, 0.6) 80%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 380ms ease;
}
.tempus-overlay.is-visible { opacity: 1; }
.tempus-card {
  min-width: min(340px, 86vw);
  padding: 26px 32px;
  background: linear-gradient(180deg, #f6e8c5 0%, #e3c184 100%);
  border: 1px solid rgba(120, 80, 30, 0.4);
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  color: #3a2a18;
  text-align: center;
  transform: translateY(8px) scale(0.98);
  transition: transform 380ms ease;
}
.tempus-overlay.is-visible .tempus-card { transform: none; }
.tempus-mark {
  font-family: 'HarryP', 'Poppins', cursive;
  font-size: 28px;
  letter-spacing: 0.08em;
  margin: 0 0 16px;
  color: #6b3c12;
}
.tempus-clocks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.tempus-clocks li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 14px;
  border-bottom: 1px dashed rgba(80, 50, 20, 0.3);
  font-family: 'Poppins', monospace;
  font-size: 14px;
  letter-spacing: 0.06em;
}
.tempus-clocks li:last-child { border-bottom: none; }
.tempus-loc { text-transform: uppercase; opacity: 0.7; }
.tempus-time { font-size: 18px; font-variant-numeric: tabular-nums; }

/* Alohomora unlock overlay. */
.alohomora-overlay {
  position: fixed;
  inset: 0;
  z-index: 9997;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, rgba(255, 220, 150, 0.18) 0%, rgba(8, 6, 18, 0.7) 80%);
  opacity: 0;
  transition: opacity 360ms ease;
  pointer-events: auto;
}
.alohomora-overlay.is-visible { opacity: 1; }
.alohomora-card {
  text-align: center;
  padding: 28px 32px;
  background: linear-gradient(180deg, #f6e8c5 0%, #e9d5a6 100%);
  border-radius: 6px;
  border: 1px solid rgba(120, 80, 30, 0.4);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  transform: translateY(8px);
  transition: transform 360ms ease;
}
.alohomora-overlay.is-visible .alohomora-card { transform: none; }
.alohomora-mark {
  font-family: 'HarryP', 'Poppins', cursive;
  font-size: 26px;
  letter-spacing: 0.06em;
  margin: 0 0 16px;
  color: #6b3c12;
}
.alohomora-cta {
  display: inline-block;
  padding: 10px 22px;
  background: linear-gradient(180deg, #6b3c12 0%, #3a2008 100%);
  color: #ffe6a8 !important;
  text-decoration: none;
  border-radius: 4px;
  font-family: 'HarryP', 'Poppins', cursive;
  font-size: 18px;
  letter-spacing: 0.1em;
  border: 1px solid rgba(255, 220, 150, 0.4);
}
.alohomora-cta:hover { filter: brightness(1.1); }

/* Morsmordre — Dark Mark in the sky. */
.morsmordre-overlay {
  position: fixed;
  inset: 0;
  z-index: 9997;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center,
    rgba(20, 60, 30, 0.6) 0%,
    rgba(8, 14, 10, 0.92) 80%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 480ms ease;
}
.morsmordre-overlay.is-visible { opacity: 1; }
.morsmordre-mark {
  width: min(280px, 60vw);
  height: auto;
  color: #4ade80;
  filter:
    drop-shadow(0 0 12px rgba(74, 222, 128, 0.7))
    drop-shadow(0 0 36px rgba(74, 222, 128, 0.45));
  transform: scale(0.86);
  transition: transform 800ms cubic-bezier(.2, .8, .2, 1);
  animation: morsmordre-pulse 2.2s ease-in-out infinite;
}
.morsmordre-overlay.is-visible .morsmordre-mark { transform: scale(1); }
@keyframes morsmordre-pulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(74,222,128,0.7)) drop-shadow(0 0 36px rgba(74,222,128,0.45)); }
  50%      { filter: drop-shadow(0 0 18px rgba(74,222,128,0.95)) drop-shadow(0 0 60px rgba(74,222,128,0.6)); }
}

/* Wingardium Leviosa — float for project tiles, service cards, stats. */
@keyframes leviosa-float {
  0%   { transform: translateY(0)    rotate(0deg); }
  25%  { transform: translateY(-12px) rotate(-1.4deg); }
  50%  { transform: translateY(-6px)  rotate(0.6deg); }
  75%  { transform: translateY(-14px) rotate(1.5deg); }
  100% { transform: translateY(0)    rotate(0deg); }
}
body.leviosa-active .project-card,
body.leviosa-active .service-card,
body.leviosa-active .stat-item,
body.leviosa-active .now-block {
  animation: leviosa-float 2.4s ease-in-out infinite;
  /* Stagger so they don't all bob in unison */
}
body.leviosa-active .project-card:nth-child(2n)  { animation-delay: 0.3s; }
body.leviosa-active .project-card:nth-child(3n)  { animation-delay: 0.6s; }
body.leviosa-active .service-card:nth-child(2n)  { animation-delay: 0.4s; }
body.leviosa-active .service-card:nth-child(3n)  { animation-delay: 0.8s; }
body.leviosa-active .stat-item:nth-child(2n)     { animation-delay: 0.2s; }
body.leviosa-active .stat-item:nth-child(3n)     { animation-delay: 0.5s; }
body.leviosa-active .stat-item:nth-child(4n)     { animation-delay: 0.7s; }
body.leviosa-active .now-block:nth-child(2n)     { animation-delay: 0.35s; }
body.leviosa-active .now-block:nth-child(3n)     { animation-delay: 0.7s; }

/* Avada Kedavra — Thanos-snap style dissolve.
   Green flash → page blurs/fades while emerald particles scatter
   upward and outward → smooth recovery. */

.avada-flash {
  position: fixed;
  inset: 0;
  z-index: 10000; /* above particles, briefly the brightest layer */
  pointer-events: none;
  background: radial-gradient(circle at center,
    rgba(120, 240, 160, 1) 0%,
    rgba(74, 222, 128, 0.85) 45%,
    rgba(10, 30, 18, 0.6) 100%);
  opacity: 0;
  transition: opacity 220ms ease-out;
  mix-blend-mode: screen;
}
.avada-flash.is-firing { opacity: 1; }

/* Each shatter target gets detached and gravity-falls off the bottom
   of the viewport with random rotation and slight horizontal drift. */
.avada-falling {
  animation:
    avada-tremor 240ms ease-out var(--fall-delay, 0ms),
    avada-fall var(--fall-duration, 1500ms) cubic-bezier(.55, 0, .95, .45) calc(var(--fall-delay, 0ms) + 240ms) forwards;
  transform-origin: center center;
  pointer-events: none !important;
}

@keyframes avada-tremor {
  0%   { transform: translate(0, 0)        rotate(0deg); }
  25%  { transform: translate(-3px, 1px)   rotate(-1.2deg); }
  50%  { transform: translate(2px, -1px)   rotate(1deg); }
  75%  { transform: translate(-2px, 0)     rotate(-0.6deg); }
  100% { transform: translate(0, 0)        rotate(0deg); }
}

@keyframes avada-fall {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--fall-x, 0), 115vh) rotate(var(--fall-rot, 0deg));
    opacity: 0.45;
  }
}

/* Killed body — no overlays remain, just a deep black void where the
   page used to be. The fallen elements have left, the chrome has
   fallen, and the body background fades to near-black so the empty
   page looks dead instead of just empty. */
body.avada-killed {
  background: #050507 !important;
  transition: background 1.4s ease 0.3s;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .avada-falling { animation: none !important; opacity: 0 !important; }
  body.avada-killed { transition: background 400ms ease; }
}

/* Imperio — text shimmer + slight purple glow on controlled paragraphs. */
body.imperio-active .imperio-target {
  position: relative;
  color: #b39ddb;
  text-shadow:
    0 0 10px rgba(150, 100, 255, 0.45),
    0 0 22px rgba(150, 100, 255, 0.25);
  animation: imperio-shimmer 2.6s ease-in-out infinite;
  letter-spacing: 0.02em;
}
@keyframes imperio-shimmer {
  0%, 100% { letter-spacing: 0.02em; opacity: 0.9; }
  50%      { letter-spacing: 0.08em; opacity: 1; }
}
body.imperio-active .imperio-target::before {
  content: "";
  position: absolute;
  inset: -4px -8px;
  border-radius: 6px;
  background: radial-gradient(ellipse at center, rgba(120, 80, 220, 0.18), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* Dark-spell hint button — tinted ever so slightly to mark it. */
.spell-hint__btn--dark {
  border-color: rgba(74, 222, 128, 0.3) !important;
  color: #b9f6ca !important;
  background: rgba(20, 36, 24, 0.6) !important;
}
.spell-hint__btn--dark:hover,
.spell-hint__btn--dark:focus-visible {
  background: rgba(28, 60, 36, 0.85) !important;
  border-color: rgba(74, 222, 128, 0.6) !important;
}
.spell-hint__btn--dark svg {
  filter: drop-shadow(0 0 4px rgba(74, 222, 128, 0.5)) !important;
}

/* Allow the hint panel to scroll horizontally if buttons overflow. */
.spell-hint {
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.spell-hint::-webkit-scrollbar { height: 4px; }
.spell-hint::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 130, 0.3);
  border-radius: 2px;
}

/* HarryP webfont — used for spell captions and Patronus heading. */
@font-face {
  font-family: 'HarryP';
  src: url('/fonts/harryp.TTF') format('truetype');
  font-display: swap;
}

/* Mobile tweaks. */
@media (max-width: 640px) {
  .wand-fab { width: 48px; height: 48px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .spell-caption { font-size: 36px; bottom: 84px; }
  .patronus-card { padding: 28px 22px; }
  .patronus-quote { font-size: 18px; }
  .patronus-mark { font-size: 24px; }
  .spell-hint { font-size: 12px; padding: 8px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .wand-fab, .spell-canvas, .patronus-overlay, .patronus-card,
  .spell-caption, .spell-hint, .spell-flash {
    transition: none !important;
    animation: none !important;
  }
  body.revelio-active a { animation: none !important; }
}


/* ============================================================
   Chocolate Frog project flips
   Cards with [data-frog-edition] only — leaves other cards alone.
   ============================================================ */

.project-card[data-frog-edition] {
  /* Override the existing overflow:hidden so the back face can rotate
     out of the box during the flip without being clipped. */
  overflow: visible;
  perspective: 1400px;
  background: transparent;
  padding: 0;
  display: block;
}

.project-card[data-frog-edition] .project-card__inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 700ms cubic-bezier(.4, .8, .3, 1);
}

.project-card[data-frog-edition].is-flipped .project-card__inner {
  transform: rotateY(180deg);
}

.project-card[data-frog-edition] .project-card__face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
}

.project-card[data-frog-edition] .project-card__face--front {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
}

.project-card[data-frog-edition] .project-card__face--back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  display: grid;
  place-items: center;
  padding: 1.75rem;
  text-align: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 235, 180, 0.5), transparent 60%),
    linear-gradient(180deg, #f6e8c5 0%, #e9d5a6 100%);
  color: #3a2a18;
  border: 1px solid rgba(120, 80, 30, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 220, 150, 0.4) inset;
}

.project-card[data-frog-edition].project-card--featured .project-card__face--back {
  /* Featured cards span the grid; let the back match. */
  min-height: 100%;
}

/* Subtle hint that the card is interactive — a small flip glyph
   only visible on hover (desktop) or always on touch. */
.project-card[data-frog-edition] .project-card__face--front::after {
  content: "";
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(200, 140, 50, 0.18) 0%, transparent 70%);
  background-image:
    radial-gradient(circle, rgba(200, 140, 50, 0.18) 0%, transparent 70%),
    linear-gradient(45deg, transparent 45%, currentColor 45%, currentColor 55%, transparent 55%);
  opacity: 0.25;
  transition: opacity 200ms ease;
  pointer-events: none;
}
.project-card[data-frog-edition]:hover .project-card__face--front::after { opacity: 0.55; }

.frog-card {
  width: 100%;
}
.frog-card__edition {
  font-family: 'HarryP', 'Poppins', cursive;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: #6b3c12;
  margin-bottom: 8px;
  opacity: 0.85;
}
.frog-card__seal {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  color: #6b3c12;
  margin-bottom: 12px;
  filter: drop-shadow(0 1px 0 rgba(255, 235, 180, 0.6));
}
.frog-card__quote {
  font-family: 'Poppins', serif;
  font-style: italic;
  font-size: 18px;
  line-height: 1.45;
  margin: 0 0 12px;
  color: #3a2a18;
}
.frog-card__stat {
  font-size: 13px;
  letter-spacing: 0.02em;
  margin: 0 0 16px;
  color: #5a4220;
}
.frog-card__caption {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 0;
  color: #6b3c12;
  opacity: 0.7;
}

@media (max-width: 600px) {
  .project-card[data-frog-edition] .project-card__face--front,
  .project-card[data-frog-edition] .project-card__face--back { padding: 1.4rem; }
  .frog-card__quote { font-size: 16px; }
  .frog-card__edition { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .project-card[data-frog-edition] .project-card__inner { transition: none; }
}


/* ============================================================
   Marauder's Map mode
   ============================================================ */

/* Suppress iOS callout / selection on the activation surfaces. */
.logo, .mobile-logo, .portrait-plate {
  -webkit-user-select: none;
          user-select: none;
  -webkit-touch-callout: none;
}

/* Tiny cursor hint that the plate is interactive on long-press. */
.portrait-plate {
  cursor: pointer;
  transition: filter 200ms ease, transform 200ms ease;
}
.portrait-plate:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.portrait-plate:active {
  transform: translateY(0);
  filter: brightness(0.96);
}

/* Parchment overlay that tints the entire viewport. Sits below
   interactive UI (z-index 4) so the page is still usable. */
.marauders-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 600ms ease;
  background:
    radial-gradient(circle at 28% 18%, rgba(190, 130, 50, 0.18), transparent 55%),
    radial-gradient(circle at 78% 82%, rgba(110, 60, 20, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(245, 215, 150, 0.18) 0%, rgba(200, 150, 80, 0.32) 100%);
  mix-blend-mode: multiply;
}

body.marauders-mode-on .marauders-overlay { opacity: 1; }

/* Footprint trail — left/right alternation gives a real walking gait. */
.mm-footprint {
  position: fixed;
  width: 16px;
  height: 24px;
  margin-left: -8px;
  margin-top: -12px;
  pointer-events: none;
  z-index: 9994;
  opacity: 0;
  color: rgba(60, 35, 12, 0.65);
  animation: mm-foot 1900ms ease-out forwards;
  filter: drop-shadow(0 0 4px rgba(255, 220, 160, 0.4));
}
.mm-footprint svg { width: 100%; height: 100%; fill: currentColor; }
.mm-footprint--l { transform: rotate(-12deg); }
.mm-footprint--r { transform: rotate(12deg); }

@keyframes mm-foot {
  0%   { opacity: 0;    }
  20%  { opacity: 0.85; }
  100% { opacity: 0;    }
}

/* Activation / deactivation ribbon — handwritten style. */
.marauders-ribbon {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  font-family: 'HarryP', 'Poppins', cursive;
  font-size: clamp(28px, 6vw, 48px);
  color: #3a2a18;
  text-shadow: 0 1px 0 rgba(255, 235, 180, 0.5);
  text-align: center;
  padding: 18px 28px;
  background: linear-gradient(180deg, rgba(246, 232, 197, 0.95) 0%, rgba(233, 213, 166, 0.95) 100%);
  border: 1px solid rgba(120, 80, 30, 0.4);
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  max-width: calc(100vw - 32px);
  transition: opacity 320ms ease, transform 320ms ease;
}
.marauders-ribbon.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* While Marauder's Map is active, prefix sidebar nav items with a
   small footprint glyph. Subtle but signals you're "tracking" pages. */
body.marauders-mode-on .nav-menu .nav-link::before {
  content: "•";
  display: inline-block;
  margin-right: 8px;
  color: rgba(60, 35, 12, 0.7);
  transform: translateY(-1px);
}
body.marauders-mode-on .nav-menu .nav-link.active::before {
  content: "↟";
  color: #6b3c12;
}

@media (prefers-reduced-motion: reduce) {
  .marauders-overlay, .mm-footprint, .marauders-ribbon {
    transition: none !important;
    animation: none !important;
  }
}


/* ============================================================
   Platform 9 3/4 sign — homepage, evening only
   ============================================================ */
.platform-934 {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: max(20px, env(safe-area-inset-left));
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  background: linear-gradient(180deg, #6e1410 0%, #4a0a08 100%);
  color: #f3e6c4;
  border-radius: 6px;
  border: 1px solid rgba(255, 220, 150, 0.3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  text-decoration: none;
  font-family: 'HarryP', 'Poppins', cursive;
  font-size: 14px;
  letter-spacing: 0.06em;
  z-index: 9996;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms ease, transform 600ms ease;
  max-width: calc(100vw - 96px);
}
.platform-934.is-visible { opacity: 1; transform: none; }
.platform-934:hover { filter: brightness(1.1); }
.platform-934__num {
  font-size: 28px;
  line-height: 1;
  color: #ffd66b;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}
.platform-934__msg {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

@media (max-width: 480px) {
  .platform-934 { padding: 8px 12px; }
  .platform-934__num { font-size: 22px; }
  .platform-934__msg { font-size: 11px; }
}


/* ============================================================
   Idle wand pulse — beckons to undiscovered visitors
   ============================================================ */
@keyframes wand-beckon {
  0%   { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(255, 200, 100, 0.6); }
  60%  { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 18px rgba(255, 200, 100, 0); }
  100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(255, 200, 100, 0); }
}
.wand-fab.is-beckoning {
  animation: wand-beckon 1.6s ease-out 1;
}
.wand-fab.is-beckoning i {
  animation: wand-beckon-tip 1.6s ease-out 1;
}
@keyframes wand-beckon-tip {
  0%, 100% { transform: rotate(0); }
  20%      { transform: rotate(-12deg); }
  40%      { transform: rotate(8deg); }
  60%      { transform: rotate(-6deg); }
}

