/* ===== Headline typewriter ===== */
.hero-title .hl:last-child { display: block !important; margin-top: .05em; }
.hero-title .hl:last-child .hl-in { display: inline-block; }
.tw-word { font-size: 1.55em; line-height: 1.05; display: inline-block; min-height: 1.05em; }
.tw-word { color: #ff1a1a; text-shadow: 0 0 24px rgba(255, 26, 26, .55); white-space: nowrap; }
.tw-word::after {
  content: ""; display: inline-block; width: .08em; height: .9em; margin-left: .06em;
  background: #ff1a1a; vertical-align: -.08em; box-shadow: 0 0 12px #ff1a1a;
  animation: tw-blink .9s steps(1) infinite;
}
.tw-word.is-busy::after { animation: none; }
@keyframes tw-blink { 50% { opacity: 0; } }
.tw-word.is-flash { animation: tw-flash .5s ease-out; }
@keyframes tw-flash {
  0% { text-shadow: 0 0 0 #fff, 0 0 40px #ff1a1a; filter: brightness(2); }
  100% { text-shadow: 0 0 24px rgba(255, 26, 26, .55); filter: none; }
}

/* ===== Scroll / side reveals ===== */
.ax-reveal { opacity: 0; transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1), filter .8s; filter: blur(6px); }
.ax-reveal.from-l { transform: translateX(-60px); }
.ax-reveal.from-r { transform: translateX(60px); }
.ax-reveal.from-b { transform: translateY(40px) scale(.97); }
.ax-reveal.is-in { opacity: 1; transform: none; filter: none; }

/* ===== Side beams on the page edges ===== */
.ax-side { position: fixed; top: 0; bottom: 0; width: 2px; z-index: 1; pointer-events: none; background: linear-gradient(transparent, rgba(255, 26, 26, .12), transparent); }
.ax-side.l { left: 10px; } .ax-side.r { right: 10px; }
.ax-side::before {
  content: ""; position: absolute; left: -1px; width: 4px; height: 140px; border-radius: 4px;
  background: linear-gradient(transparent, #ff1a1a, transparent); box-shadow: 0 0 16px #ff1a1a;
  animation: ax-beam 4.5s cubic-bezier(.6,0,.4,1) infinite;
}
.ax-side.r::before { animation-delay: -2.25s; animation-direction: reverse; }
@keyframes ax-beam { from { top: -150px; } to { top: 100%; } }

/* ===== Floating embers ===== */
.ax-embers { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ax-embers i {
  position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%;
  background: #ff2a2a; box-shadow: 0 0 8px #ff1a1a; opacity: 0;
  animation: ax-rise linear infinite;
}
@keyframes ax-rise {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: .9; }
  100% { transform: translate(var(--dx), -110vh); opacity: 0; }
}

/* ===== Cards: tilt + spotlight ===== */
:is(.card, .ch-card) { transform-style: preserve-3d; transition: transform .25s ease, box-shadow .25s ease; will-change: transform; }
:is(.card, .ch-card)::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 40, 40, .22), transparent 60%);
  opacity: 0; transition: opacity .3s;
}
:is(.card, .ch-card):hover::before { opacity: 1; }
:is(.card, .ch-card):hover { box-shadow: 0 18px 50px -18px rgba(255, 26, 26, .6), 0 0 0 1px rgba(255, 26, 26, .5); }
:is(.card, .ch-card):hover .card-logo { animation: ax-logo-bob 1.6s ease-in-out infinite; }
@keyframes ax-logo-bob { 50% { transform: translateY(-4px) rotate(-4deg); } }

/* ===== Card unlock animation (signed in) ===== */
:is(.card, .ch-card).ax-unlocking { animation: ax-press .7s cubic-bezier(.3,1.5,.5,1); z-index: 5; }
@keyframes ax-press {
  0% { transform: scale(1); }
  20% { transform: scale(.94); }
  55% { transform: scale(1.05); filter: brightness(1.4); }
  100% { transform: scale(1); }
}
.ax-ring {
  position: absolute; left: var(--x); top: var(--y); width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border: 2px solid #ff2a2a; border-radius: 50%; pointer-events: none; z-index: 6;
  box-shadow: 0 0 20px #ff1a1a, inset 0 0 12px #ff1a1a;
  animation: ax-ring .7s ease-out forwards;
}
.ax-ring.b { animation-delay: .12s; border-color: #fff; }
@keyframes ax-ring { to { transform: scale(55); opacity: 0; } }
.ax-scan {
  position: absolute; left: 0; right: 0; height: 3px; top: 0; z-index: 6; pointer-events: none;
  background: #ff2a2a; box-shadow: 0 0 18px 4px #ff1a1a;
  animation: ax-scan .6s cubic-bezier(.7,0,.3,1) forwards;
}
@keyframes ax-scan { from { top: 0; opacity: 1; } to { top: 100%; opacity: .2; } }
.ax-unlock-tag {
  position: absolute; left: 50%; top: 50%; z-index: 7; pointer-events: none;
  font: 600 13px/1 "Geist Mono", monospace; letter-spacing: .2em; color: #fff;
  padding: 8px 12px; border: 1px solid #ff2a2a; background: rgba(20, 0, 0, .85); border-radius: 6px;
  box-shadow: 0 0 24px rgba(255, 26, 26, .7);
  animation: ax-tag .7s cubic-bezier(.2,1.4,.4,1) forwards;
}
@keyframes ax-tag {
  0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; }
  40% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -80%) scale(1); opacity: 0; }
}
.ax-spark {
  position: absolute; left: var(--x); top: var(--y); width: 4px; height: 4px; border-radius: 50%;
  background: #ff4a4a; box-shadow: 0 0 8px #ff1a1a; pointer-events: none; z-index: 7;
  animation: ax-spark .65s ease-out forwards;
}
@keyframes ax-spark { to { transform: translate(var(--sx), var(--sy)) scale(.2); opacity: 0; } }

/* ===== Buttons: shine sweep ===== */
.lib-cta a, .lib-cta button { position: relative; overflow: hidden; }
.lib-cta a::after, .lib-cta button::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .25), transparent);
  transform: skewX(-20deg); animation: ax-shine 3.5s ease-in-out infinite;
}
.lib-cta > :nth-child(2)::after { animation-delay: 1.75s; }
@keyframes ax-shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }

/* ===== Filter chips: pop ===== */
[data-filter] { transition: transform .2s; }
[data-filter]:active { transform: scale(.92); }
[data-filter][aria-pressed="true"] { animation: ax-chip .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes ax-chip { 40% { transform: scale(1.12); } }

/* ===== Page open: decrypt sequence ===== */
.ax-open { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; overflow: hidden; }
.ax-open .ax-half {
  position: absolute; left: 0; right: 0; height: 50.5%; background: #070000;
  animation: ax-half-out .55s cubic-bezier(.8,0,.2,1) .95s forwards;
}
.ax-open .ax-half.t { top: 0; border-bottom: 2px solid #ff1a1a; box-shadow: 0 2px 30px #ff1a1a; }
.ax-open .ax-half.b { bottom: 0; border-top: 2px solid #ff1a1a; box-shadow: 0 -2px 30px #ff1a1a; --dir: 1; }
@keyframes ax-half-out { to { transform: translateY(calc(var(--dir, -1) * 105%)); } }
.ax-open .ax-slice {
  position: absolute; left: 0; right: 0; background: rgba(255, 26, 26, .55); mix-blend-mode: screen;
  animation: ax-slice .9s steps(6) forwards;
}
@keyframes ax-slice {
  0% { transform: translateX(-100%); opacity: 1; }
  50% { transform: translateX(20%); }
  100% { transform: translateX(100%); opacity: 0; }
}
.ax-open .ax-core {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 2;
  font: 600 clamp(14px, 2.4vw, 22px)/1.3 "Geist Mono", monospace; letter-spacing: .25em; color: #fff;
  animation: ax-core-out .3s ease-in .9s forwards;
}
.ax-open .ax-core b { display: block; color: #ff1a1a; font-size: 2.2em; letter-spacing: .08em; text-shadow: 0 0 30px #ff1a1a; margin-top: 8px; }
.ax-open .ax-bar { width: min(340px, 70vw); height: 3px; margin: 18px auto 0; background: rgba(255, 26, 26, .2); overflow: hidden; }
.ax-open .ax-bar i { display: block; height: 100%; background: #ff1a1a; box-shadow: 0 0 12px #ff1a1a; animation: ax-bar .8s cubic-bezier(.6,0,.2,1) forwards; transform-origin: left; transform: scaleX(0); }
@keyframes ax-bar { to { transform: scaleX(1); } }
@keyframes ax-core-out { to { opacity: 0; transform: translate(-50%, -50%) scale(1.4); filter: blur(8px); } }
.ax-open .ax-flash { position: absolute; inset: 0; background: #ff1a1a; opacity: 0; animation: ax-flash .5s ease-out .9s; }
@keyframes ax-flash { 0% { opacity: .7; } 100% { opacity: 0; } }

.ax-enter [data-pp], .ax-enter .pp-head, .ax-enter .pp-side li, .ax-enter #cp-banner, .ax-enter #cp-title, .ax-enter #cp-desc {
  animation: ax-rise-in .7s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes ax-rise-in { from { opacity: 0; transform: translateY(30px) scale(.98); filter: blur(6px); } }

/* app.js re-hides the phone account box after login; society.js owns sign-in now */
html.is-society-signed-in .m-acct[hidden] { display: flex !important; }
html.is-society-signed-in .mobile-foot .m-login { display: none !important; }

/* styles.css squashes every animation to .01ms under reduced motion; these win on specificity so the effects still run */
@media (prefers-reduced-motion: reduce) {
  html .tw-word::after { animation: tw-blink .9s steps(1) infinite !important; }
  html .tw-word.is-busy::after { animation: none !important; }
  html .tw-word.is-flash { animation: tw-flash .5s ease-out !important; }
  html .ax-reveal { transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1), filter .8s !important; }
  html .ax-side::before { animation: ax-beam 4.5s cubic-bezier(.6,0,.4,1) infinite !important; }
  html .ax-side.r::before { animation: ax-beam 4.5s cubic-bezier(.6,0,.4,1) -2.25s infinite reverse !important; }
  html .ax-embers i { animation-name: ax-rise !important; animation-timing-function: linear !important; animation-iteration-count: infinite !important; animation-duration: var(--dur) !important; animation-delay: var(--del) !important; }
  html :is(.card, .ch-card) { transition: transform .25s ease, box-shadow .25s ease !important; }
  html :is(.card, .ch-card):hover .card-logo { animation: ax-logo-bob 1.6s ease-in-out infinite !important; }
  html :is(.card, .ch-card).ax-unlocking { animation: ax-press .7s cubic-bezier(.3,1.5,.5,1) !important; }
  html .ax-ring { animation: ax-ring .7s ease-out forwards !important; }
  html .ax-ring.b { animation: ax-ring .7s ease-out .12s forwards !important; }
  html .ax-scan { animation: ax-scan .6s cubic-bezier(.7,0,.3,1) forwards !important; }
  html .ax-unlock-tag { animation: ax-tag .7s cubic-bezier(.2,1.4,.4,1) forwards !important; }
  html .ax-spark { animation: ax-spark .65s ease-out forwards !important; }
  html .lib-cta a::after, html .lib-cta button::after { animation: ax-shine 3.5s ease-in-out infinite !important; }
  html .lib-cta > :nth-child(2)::after { animation-delay: 1.75s !important; }
  html [data-filter][aria-pressed="true"] { animation: ax-chip .45s cubic-bezier(.3,1.6,.5,1) !important; }
  html .ax-open .ax-half { animation: ax-half-out .55s cubic-bezier(.8,0,.2,1) .95s forwards !important; }
  html .ax-open .ax-slice { animation-name: ax-slice !important; animation-duration: .9s !important; animation-timing-function: steps(6) !important; animation-fill-mode: forwards !important; animation-iteration-count: 1 !important; animation-delay: var(--del) !important; }
  html .ax-open .ax-core { animation: ax-core-out .3s ease-in .9s forwards !important; }
  html .ax-open .ax-bar i { animation: ax-bar .8s cubic-bezier(.6,0,.2,1) forwards !important; }
  html .ax-open .ax-flash { animation: ax-flash .5s ease-out .9s !important; }
  html .ax-enter [data-pp], html .ax-enter .pp-head, html .ax-enter .pp-side li, html .ax-enter #cp-banner, html .ax-enter #cp-title, html .ax-enter #cp-desc { animation: ax-rise-in .7s cubic-bezier(.2,.8,.2,1) both !important; }
}
