/* ============================================================
   School Study Games — Apple-inspired theme
   Clean surfaces · Liquid-Glass chrome · springy, bubbly motion
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Hanken+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
  /* ---- Surfaces & ink ---- */
  --bg:        #fbfbfd;
  --surface:   #ffffff;
  --surface-2: #f5f5f7;
  --ink:       #1d1d1f;
  --ink-2:     #6e6e73;
  --ink-3:     #86868b;
  --hair:      rgba(0, 0, 0, .10);
  --hair-2:    rgba(0, 0, 0, .06);

  /* ---- Liquid glass ---- */
  --glass:        rgba(255, 255, 255, .68);
  --glass-strong: rgba(255, 255, 255, .82);
  --glass-blur:   saturate(180%) blur(20px);

  /* ---- Accents (let the game art carry the color) ---- */
  --blue:   #0071e3;
  --blue-2: #0077ed;
  --pink:   #ff2d78;
  --cyan:   #21d4c4;
  --green:  #34c759;
  --yellow: #ffcc00;
  --orange: #ff7a45;

  /* legacy aliases so the game pages keep resolving */
  --cream: var(--surface-2);
  --paper: var(--surface);

  /* ---- Structure ---- */
  --border:    1px solid var(--hair);
  --outline:   2px solid #111;         /* the black card outline */
  --radius:    16px;
  --radius-sm: 11px;
  --radius-lg: 24px;
  --wrap: 1180px;

  /* ---- Soft, diffuse depth ---- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 12px rgba(0, 0, 0, .05);
  --shadow:    0 6px 16px rgba(0, 0, 0, .06), 0 18px 40px rgba(0, 0, 0, .10);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, .10), 0 30px 70px rgba(0, 0, 0, .16);

  /* ---- Motion curves ---- */
  --ease-out:    cubic-bezier(.16, 1, .3, 1);     /* smooth Apple ease-out */
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1); /* bubbly overshoot      */
  --ease-io:     cubic-bezier(.65, 0, .35, 1);    /* in-out                */

  /* ---- Type ---- */
  --font: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI",
          Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", "Hanken Grotesk", -apple-system,
                  BlinkMacSystemFont, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(0, 113, 227, .18); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* Gradient highlight words */
.hl,
.hl-pink {
  background: linear-gradient(120deg, var(--pink), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Scroll-reveal primitive */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  border: var(--outline);
  border-radius: 999px;
  padding: 12px 23px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  -webkit-tap-highlight-color: transparent;
  transition: transform .55s var(--ease-spring), box-shadow .4s var(--ease-out),
              background .25s var(--ease-out), color .25s var(--ease-out);
}
.btn:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(-1px) scale(.96); transition-duration: .12s; }
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--blue-2); box-shadow: var(--shadow); }
.btn-ghost {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-color: var(--hair);
  color: var(--ink);
}
.btn-sm { padding: 9px 18px; font-size: .92rem; }
.btn-lg { padding: 16px 32px; font-size: 1.08rem; }

/* ===== Header — Liquid Glass ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--hair-2);
  transition: background .4s var(--ease-out), box-shadow .4s var(--ease-out), border-color .4s;
}
/* specular hairline along the top edge */
.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95), transparent);
  opacity: .7;
  pointer-events: none;
}
.site-header.scrolled {
  background: var(--glass-strong);
  box-shadow: 0 1px 0 var(--hair-2), 0 10px 34px rgba(0, 0, 0, .06);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  transition: height .4s var(--ease-out);
}
.site-header.scrolled .header-inner { height: 54px; }

.logo { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.logo-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .3px;
  color: #fff;
  background: var(--blue);
  border: var(--outline);
  border-radius: 10px;
  padding: 6px 8px;
}
.logo-text { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -.02em; }
.logo-accent { color: var(--pink); }

.nav { display: flex; gap: 2px; margin-left: auto; }
.nav-link {
  text-decoration: none;
  color: var(--ink-2);
  font-weight: 500;
  font-size: .95rem;
  padding: 8px 14px;
  border-radius: 10px;
  transition: color .25s var(--ease-out), background .25s var(--ease-out);
}
.nav-link:hover { color: var(--ink); background: rgba(0, 0, 0, .05); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, .05);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 14px;
  transition: background .25s var(--ease-out), border-color .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.search:focus-within {
  background: var(--surface);
  border-color: var(--hair);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, .12);
}
.search-icon { font-size: .85rem; opacity: .55; }
.search input {
  border: none;
  background: transparent;
  font: inherit;
  font-size: .9rem;
  color: var(--ink);
  width: 150px;
  outline: none;
}
.search input::placeholder { color: var(--ink-3); }

/* ===== Scroll progress ===== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  z-index: 60;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: 0 0 10px rgba(0, 113, 227, .55);
  transition: width .1s linear;
}

/* ===== Store layout ===== */
.store { padding: 26px 0 110px; }
.store-section { margin-top: 52px; }
.store-section:first-of-type { margin-top: 6px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -.02em;
}
.section-title .accent { color: var(--blue); }

/* ===== Featured: Game of the Day ===== */
.feature-nav { display: flex; gap: 8px; }
.feat-arrow {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 999px;
  border: var(--outline);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .5s var(--ease-spring), background .25s var(--ease-out), box-shadow .3s var(--ease-out);
}
.feat-arrow:hover { transform: translateY(-2px) scale(1.06); box-shadow: var(--shadow); }
.feat-arrow:active { transform: scale(.9); transition-duration: .1s; }

.feature {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: var(--outline);
  box-shadow: var(--shadow);
  background: var(--surface);
  min-height: 400px;
  isolation: isolate;
}

/* live animated aurora wash behind the slide */
.aurora { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: .5;
  will-change: transform;
  transition: background 1.1s var(--ease-out);
}
.aurora span:nth-child(1) { width: 560px; height: 560px; left: -8%;  top: -34%;    background: var(--a1, #70c5ce); animation: drift1 20s var(--ease-io) infinite; }
.aurora span:nth-child(2) { width: 480px; height: 480px; right: -6%; top: -22%;    background: var(--a2, #a0e0a0); animation: drift2 24s var(--ease-io) infinite; }
.aurora span:nth-child(3) { width: 420px; height: 420px; left: 34%;  bottom: -42%; background: var(--a3, #ffd3a0); animation: drift3 28s var(--ease-io) infinite; }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(46px,32px) scale(1.16); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-52px,24px) scale(1.1); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(34px,-46px) scale(1.22); } }

/* slides stack in one grid cell → track sizes to content, active one cross-fades in */
.feature-track { position: relative; z-index: 1; display: grid; }
.feature-slide {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 12px;
  padding: 22px;
  opacity: 0;
  transform: translateY(16px) scale(.985);
  pointer-events: none;
  /* outgoing slide fades out fast so it doesn't ghost under the incoming one */
  transition: opacity .3s var(--ease-out), transform .45s var(--ease-out);
}
.feature-slide.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  /* incoming slide ramps in slightly delayed, after the outgoing has cleared */
  transition: opacity .6s var(--ease-out) .12s, transform .7s var(--ease-out);
}

.feature-media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 320px;
  background: rgba(255, 255, 255, .34);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55), var(--shadow-sm);
}
.feature-shot {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 20%;
  image-rendering: pixelated;
  transition: opacity .55s var(--ease-out);
}
.feature-shot-action { opacity: 0; }
.feature:hover .feature-shot-action { opacity: 1; }             /* hover to preview gameplay */
.feature-slide.is-active .feature-shot { animation: kenburns 16s var(--ease-io) infinite alternate; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.09); } }

.feature-body { display: flex; flex-direction: column; justify-content: center; padding: 12px 20px; }
.feature-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-display);
  font-weight: 600; font-size: .78rem; letter-spacing: .5px; text-transform: uppercase;
  color: var(--ink-2);
}
.feature-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.02;
  margin: 10px 0 12px;
}
.feature-blurb { color: var(--ink-2); font-size: 1.06rem; max-width: 42ch; }
.feature-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; }
.feature-chips span {
  background: var(--surface);
  border: 1.5px solid #111;
  border-radius: 999px;
  padding: 5px 13px;
  font-family: var(--font-display);
  font-size: .82rem; font-weight: 500;
  color: var(--ink);
}
.feature-play { align-self: flex-start; }

.feature-dots { position: absolute; z-index: 2; left: 30px; bottom: 20px; display: flex; gap: 8px; }
.feature-dot {
  width: 9px; height: 9px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, .2);
  cursor: pointer;
  transition: width .5s var(--ease-spring), background .3s var(--ease-out);
}
.feature-dot.is-active { width: 28px; background: var(--ink); }

/* ===== Bento mosaic ===== */
.game-grid.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  grid-auto-flow: dense;
  gap: 18px;
}

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chip {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .9rem;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid #111;
  border-radius: 999px;
  padding: 8px 15px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .55s var(--ease-spring), color .25s var(--ease-out),
              background .25s var(--ease-out), border-color .25s var(--ease-out), box-shadow .3s var(--ease-out);
}
.chip:hover { transform: translateY(-2px); background: var(--surface-2); }
.chip.is-active {
  background: var(--ink);
  color: #fff;
  border-color: #111;
  box-shadow: var(--shadow-sm);
}

/* ===== Image-forward cards ===== */
.game-card {
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--outline);
  box-shadow: var(--shadow-sm);
  background: var(--surface-2);
  /* opacity handles the staggered reveal (delay via --rd); transform drives tilt/spring */
  transition: opacity .7s var(--ease-out) var(--rd, 0ms),
              transform .5s var(--ease-spring),
              box-shadow .45s var(--ease-out);
}
.game-card:hover { box-shadow: var(--shadow-lg); }
.game-card.big  { grid-column: span 2; grid-row: span 2; }
.game-card.wide { grid-column: span 2; }
.game-card.tall { grid-row: span 2; }

/* pointer-driven 3D tilt (vars set in JS) */
.game-card.tilt:hover {
  transform: perspective(820px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px);
}

.card-media { position: absolute; inset: 0; overflow: hidden; }
.card-media.placeholder-media { display: grid; place-items: center; }
.thumb-shot {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 68%;
  image-rendering: pixelated;
  transition: transform .8s var(--ease-out), opacity .4s var(--ease-out);
  will-change: transform, opacity;
}
.thumb-cover { z-index: 1; }
.thumb-action { z-index: 0; }
.game-card.is-live:hover .thumb-cover { opacity: 0; }             /* reveal the action shot */
.game-card.is-live:hover .thumb-shot  { transform: scale(1.09); } /* Ken-Burns zoom */

.thumb-icon { font-size: 2.9rem; opacity: .92; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .16)); }
.big .thumb-icon  { font-size: 4.6rem; }
.wide .thumb-icon { font-size: 3.6rem; }

/* shine sweep on hover */
.shine {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .38) 48%, transparent 62%);
  transform: translateX(-120%);
}
.game-card:hover .shine { animation: shine .9s var(--ease-out); }
@keyframes shine { to { transform: translateX(120%); } }

.thumb-tag {
  position: absolute;
  top: 11px; left: 11px;
  z-index: 3;
  background: var(--ink);
  border: var(--outline);
  color: #fff;
  font-family: var(--font-display);
  font-size: .66rem; font-weight: 600;
  letter-spacing: .4px; text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.badge-new {
  position: absolute;
  top: 11px; right: 11px;
  z-index: 3;
  background: var(--pink);
  color: #fff;
  border: var(--outline);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600; font-size: .66rem;
  letter-spacing: .5px;
  padding: 4px 9px;
}

.card-overlay {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 15px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, .82), rgba(0, 0, 0, .34) 55%, transparent);
  color: #fff;
}
.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -.01em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .55);
}
.big .card-title  { font-size: 1.6rem; }
.wide .card-title { font-size: 1.25rem; }
.tall .card-title { font-size: 1.2rem; }

.play-pill {
  flex: none;
  background: var(--blue);
  color: #fff;
  border: var(--outline);
  font-family: var(--font-display);
  font-size: .72rem; font-weight: 600;
  letter-spacing: .3px; text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  transform: translateY(6px);
  opacity: 0;
  transition: transform .5s var(--ease-spring), opacity .35s var(--ease-out);
}
.game-card:hover .play-pill { transform: none; opacity: 1; }
.soon-pill {
  flex: none;
  background: #fff;
  color: var(--ink);
  border: var(--outline);
  font-family: var(--font-display);
  font-size: .68rem; font-weight: 600;
  letter-spacing: .3px; text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
}

.more-note { text-align: center; margin-top: 40px; color: var(--ink-2); }
.more-note a { color: var(--blue); font-weight: 500; text-decoration: none; }
.more-note a:hover { text-decoration: underline; }

/* ===== Store responsive ===== */
@media (max-width: 1024px) {
  .game-grid.bento { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .feature-slide { grid-template-columns: 1fr; }
  .feature-media { min-height: 210px; }
  .feature-body { padding: 8px 8px 4px; }
  .feature-dots { left: 20px; bottom: 14px; }
  .game-grid.bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 158px; }
}
@media (max-width: 440px) {
  .game-grid.bento { gap: 12px; }
  .game-card.wide { grid-column: span 2; }
}

/* ===== Footer ===== */
.site-footer {
  background: var(--surface-2);
  color: var(--ink-2);
  border-top: 1px solid var(--hair);
  padding: 56px 0 30px;
  font-size: .9rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--hair);
}
.footer-brand { max-width: 300px; }
.footer-brand p { margin-top: 14px; color: var(--ink-3); }
.footer-nav { display: flex; gap: 54px; flex-wrap: wrap; }
.footer-nav h4 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 12px;
  color: var(--ink-3);
  font-weight: 600;
}
.footer-nav a {
  display: block;
  color: var(--ink);
  text-decoration: none;
  font-weight: 400;
  padding: 4px 0;
  transition: color .2s var(--ease-out);
}
.footer-nav a:hover { color: var(--blue); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 22px;
  color: var(--ink-3);
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .nav { display: none; }
  .search { display: none; }
  .header-inner { justify-content: space-between; }
}
@media (max-width: 560px) {
  .games-section { padding-top: 22px; }
  .footer-nav { gap: 32px; }
}

/* ===== Portal transition (entering a game) ===== */
.portal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.portal.active { opacity: 1; visibility: visible; pointer-events: all; }

/* dark vignette that closes in around the portal mouth */
.portal-veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--px, 50%) var(--py, 50%),
              transparent 0, transparent 7%, rgba(6, 8, 16, .55) 44%, rgba(4, 6, 12, .97) 100%);
  opacity: 0;
}
.portal.active .portal-veil { animation: p-veil 1.2s var(--ease-out) forwards; }
@keyframes p-veil { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: 1; } }

/* concentric discs that grow from the click point */
.portal-disc {
  position: absolute;
  left: var(--px, 50%);
  top: var(--py, 50%);
  width: 64vmax; height: 64vmax;
  margin: -32vmax 0 0 -32vmax;
  border-radius: 50%;
  transform: scale(0);
  will-change: transform, opacity;
}

/* glowing ring tunnel — the "flying through" layer */
.portal-tunnel {
  background: repeating-radial-gradient(circle at center,
    var(--pc1, #0071e3) 0 8px,
    transparent 8px 20px,
    var(--pc2, #21d4c4) 20px 28px,
    transparent 28px 44px);
  mix-blend-mode: screen;
  opacity: 0;
}
.portal.active .portal-tunnel { animation: p-dive 1.2s cubic-bezier(.55, 0, .85, .35) forwards; }
@keyframes p-dive {
  0%   { transform: scale(.05) rotate(0deg); opacity: 0; }
  15%  { opacity: .95; }
  100% { transform: scale(10) rotate(200deg); opacity: 1; }
}

/* spinning colour swirl */
.portal-swirl {
  background: conic-gradient(from 0deg,
    var(--pc1, #0071e3), var(--pc2, #21d4c4), var(--pc3, #70c5ce), var(--pc1, #0071e3));
  filter: blur(8px);
  opacity: 0;
}
.portal.active .portal-swirl { animation: p-swirl 1.2s cubic-bezier(.5, 0, .8, .4) forwards; }
@keyframes p-swirl {
  0%   { transform: scale(0) rotate(0deg); opacity: 0; }
  18%  { opacity: .9; }
  100% { transform: scale(5.5) rotate(-620deg); opacity: .35; }
}

/* bright core that whites out into the game page */
.portal-core {
  position: absolute;
  left: var(--px, 50%);
  top: var(--py, 50%);
  width: 26vmax; height: 26vmax;
  margin: -13vmax 0 0 -13vmax;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, var(--pc1, #0071e3) 45%, transparent 72%);
  transform: scale(0);
  opacity: 0;
}
.portal.active .portal-core { animation: p-core 1.2s ease-in forwards; }
@keyframes p-core {
  0%   { transform: scale(0); opacity: 0; }
  25%  { opacity: .85; }
  70%  { transform: scale(1.4); opacity: .7; }
  100% { transform: scale(9); opacity: 1; }
}

/* the page gets pulled in behind the portal */
body.portaling .site-header,
body.portaling .store,
body.portaling .site-footer {
  transition: transform 1s var(--ease-io), filter 1s var(--ease-io), opacity 1s var(--ease-io);
  transform: scale(1.18);
  filter: blur(7px);
  opacity: .45;
  pointer-events: none;
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
