/* codex_mirrorfield.css */

body.codex-entry {
  background-color: #1c132b;
  color: #e8ddf0;
  font-family: 'Georgia', serif;
  line-height: 1.7;
  margin: 3em auto;
  max-width: 900px;
  padding: 2em;
  border: 2px solid #5d3d7b;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(125, 91, 161, 0.4);
}

h1, h2, h3 {
  color: #f2e9ff;
  border-bottom: 1px solid #70558a;
  padding-bottom: 0.3em;
  margin-top: 2em;
}

h1 {
  font-size: 2.2em;
  margin-bottom: 0.5em;
}

h2 {
  font-size: 1.8em;
}

h3 {
  font-size: 1.4em;
}

pre {
  background-color: #2d1f41;
  border-left: 4px solid #9466c3;
  color: #d8c3ef;
  padding: 1em;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  margin: 1.5em 0;
}

blockquote {
  background-color: #2e1b3c;
  border-left: 4px solid #aa7bf2;
  padding: 1em;
  margin: 1.5em 0;
  font-style: italic;
  color: #d6c6f0;
}

blockquote footer {
  text-align: right;
  font-style: normal;
  font-size: 0.9em;
  color: #a58cc8;
}

ul, ol {
  padding-left: 2em;
  margin-top: 1em;
}

li {
  margin-bottom: 0.5em;
}

.code-label, .file-path {
  font-size: 0.9em;
  font-family: 'Courier New', monospace;
  color: #c8b0e2;
  background-color: #27183b;
  padding: 0.3em 0.6em;
  display: inline-block;
  margin-top: 0.3em;
  border-radius: 4px;
}

a {
  color: #cbb3ff;
  text-decoration: none;
  border-bottom: 1px dotted #b48de3;
}

a:hover {
  color: #fff;
  background-color: #5c3f75;
  border-bottom: 1px solid #fff;
}

footer.codex-footer {
  margin-top: 4em;
  border-top: 1px solid #533d64;
  padding-top: 1em;
  font-size: 0.9em;
  color: #a999c2;
  text-align: center;
}

.crumbs{
  display:flex; gap:.6rem; justify-content:center; margin: .6rem 0 1.4rem;
}
.crumbs a{
  text-decoration:none; color:#efeaff;
  background:rgba(255,255,255,.05);
  padding:.45rem .8rem; border-radius:999px;
  box-shadow:0 0 0 1px rgba(220,200,255,.14);
}
.crumbs a:hover{
  box-shadow:0 0 0 1px rgba(220,200,255,.32), 0 0 16px rgba(180,150,255,.28);
}

/* 1) Soft focus ring for the three nav pills (keyboard & a11y) */
.nav a {
  position: relative;
  outline: none;
}
.nav a:focus-visible {
  box-shadow:
    0 0 0 2px rgba(30, 12, 60, .9),           /* inner cutout to blend */
    0 0 0 3px rgba(220, 200, 255, .55),        /* main ring */
    0 0 18px rgba(180, 150, 255, .35);         /* glow */
  transform: translateY(-1px);
}

/* Optional: gentle hover pulse (respects reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  .nav a:hover { transform: translateY(-1px); }
  .nav a:hover::after {
    content: "";
    position: absolute; inset: -2px;
    border-radius: 999px;
    box-shadow: 0 0 14px rgba(180,150,255,.25);
    pointer-events: none;
  }
}

/* 2) Mobile spacing + readability tweaks */
@media (max-width: 720px) {
  .wrap { margin: 2.75rem auto; padding: 0 1rem; }
  header h1 { font-size: 1.65rem; }
  .nav { gap: .5rem; margin: .9rem 0 1.4rem; }
  .nav a { padding: .5rem .75rem; font-size: .95rem; }
  .card { padding: .9rem .9rem 1rem; }
  .card h2 { font-size: 1.1rem; }
  .card h3 { font-size: .98rem; }
}

/* 3) Clean in-page jumps (offset for any top spacing) */
#naiyo, #molly, #duo {
  scroll-margin-top: 90px;  /* adjust if you change header spacing */
}

/* (nice-to-have) slightly tighter header block */
header p { max-width: 52ch; margin: .5rem auto 1.1rem; }


/* Active pill style */
.nav a.is-active,
.nav a[aria-current="page"] {
  box-shadow:
    0 0 0 2px rgba(220,200,255,.45),
    0 0 22px rgba(180,150,255,.35);
  background: rgba(255,255,255,.08);
  transform: translateY(-1px);
}

/* Bubble wobble for the content cards */
@media (prefers-reduced-motion: no-preference) {
  .card {
    will-change: transform, box-shadow;
    animation: bubble-float 14s ease-in-out infinite;
    animation-delay: calc(var(--wobble-i, 0) * -1.3s); /* stagger */
  }

  /* pause float while hovering; add a tiny lift */
  .card:hover {
    animation-play-state: paused;
    transform: translateY(-2px) scale(1.01);
  }

  /* jelly wobble on tap/click or when focusing inside */
  .card:active,
  .card:focus-within {
    animation: bubble-jelly .6s ease;
  }

  @keyframes bubble-float {
    0%   { transform: translate3d(0,0,0) rotate(0deg); }
    20%  { transform: translate3d(0,-2px,0) rotate(-0.2deg); }
    50%  { transform: translate3d(0, 2px,0) rotate(0.2deg); }
    80%  { transform: translate3d(0,-1px,0) rotate(-0.1deg); }
    100% { transform: translate3d(0,0,0) rotate(0deg); }
  }

  @keyframes bubble-jelly {
    0%,100% { transform: scale(1); }
    25%     { transform: scale(1.015, .985) rotate(-.2deg); }
    50%     { transform: scale(.985, 1.015) rotate(.2deg); }
    75%     { transform: scale(1.01, .99); }
  }
}

/* Stagger each card’s float (no JS needed) */
#naiyo.card { --wobble-i: 0; }
#molly.card { --wobble-i: 1; }
#duo.card   { --wobble-i: 2; }

@media (prefers-reduced-motion: no-preference){
  .card:hover{ animation-play-state: paused; }
  .card:hover{ box-shadow: 0 0 0 1px rgba(220,200,255,.2), 0 0 18px rgba(180,150,255,.28); }
  .card:hover::after{
    content:""; position:absolute; inset:-2px; border-radius:inherit; pointer-events:none;
    animation: glow 1.2s ease-in-out infinite;
  }
  @keyframes glow{
    0%,100%{ box-shadow: 0 0 20px rgba(180,150,255,.22); }
    50%{    box-shadow: 0 0 32px rgba(180,150,255,.34); }
  }
}

@media (hover:none){
  .card{ animation-duration:20s; } /* gentler on touch devices */
}

.card { position: relative; }

@media (prefers-reduced-motion: no-preference){
  .card:focus-within {
    box-shadow: 0 0 0 1px rgba(220,200,255,.2), 0 0 18px rgba(180,150,255,.28);
  }
  .card:focus-within::after{
    content:""; position:absolute; inset:-2px; border-radius:inherit; pointer-events:none;
    animation: glow 1.2s ease-in-out infinite;
  }
}
