/* Additions for the Razor site (loaded after site.css). */
.form-card .hp{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}
.form-status.is-success{color:#1d7a46;font-weight:700}
.form-status.is-error{margin:12px 0 0;padding:12px 16px;border-radius:14px;background:#fff0f6;color:#a3165f;font-size:15px}
.form-status.is-error p{margin:0 0 4px;font-weight:700}
.form-status.is-error ul{margin:0;padding-left:18px}
.button.submit[aria-busy=true]{opacity:.7;pointer-events:none}
.error-page{padding:80px 0 120px;text-align:center}
.error-page .button{margin:28px auto 0}
.privacy h2{margin-top:32px}

/* ---------------------------------------------------------------------------
   Section layout fixes.
   fidelity-v7 pins many sections to fixed heights (calc(N * var(--u))) to match
   the reference raster. When real text/fonts need more room, content spills
   into the next section. Keep those heights as minimums instead.
   --------------------------------------------------------------------------- */
@media (min-width:900px){
  .home-story{height:auto;min-height:calc(216 * var(--u))}
  .join-strip{height:auto;min-height:calc(82 * var(--u))}
  .library-tools{height:auto;min-height:calc(70 * var(--u))}
  .page-games .games-bottom{height:auto;min-height:calc(200 * var(--u))}
  .page-games .card-copy{height:auto;min-height:calc(252 * var(--u))}
  .story-grid{height:auto;min-height:calc(283 * var(--u))}
  .values{height:auto;min-height:calc(172 * var(--u))}
  .spirit-banner{height:auto;min-height:calc(230 * var(--u))}
  .idea-banner{height:auto;min-height:calc(126 * var(--u))}
  .talents{height:auto;min-height:calc(262 * var(--u))}
  .steps{height:auto;min-height:calc(190 * var(--u))}
  .application-panel{height:auto;min-height:calc(377 * var(--u))}
  .page-contact .contact-topics{height:auto;min-height:calc(151 * var(--u))}
  .topics{height:auto;min-height:calc(112 * var(--u))}
  .faq-panel{height:auto;min-height:calc(191 * var(--u))}
  .conversation-banner{height:auto;min-height:calc(99 * var(--u))}
  .page-contact .contact-body aside{height:auto;min-height:calc(486 * var(--u))}
  .features{height:auto;min-height:calc(135 * var(--u))}
  .page-gummora .features{height:auto;min-height:calc(139 * var(--u))}
  .page-quadpop .features{height:auto;min-height:calc(102 * var(--u))}
  .cross-games{height:auto;min-height:calc(64 * var(--u))}
  .page-orbitsort .cross-games{height:auto;min-height:calc(101 * var(--u))}
  .page-quadpop .cross-games{height:auto;min-height:calc(50 * var(--u))}
  .page-gummora .cross-games{height:auto;min-height:calc(55 * var(--u))}

  /* Consistent rhythm between stacked sections (overrides per-page margins). */
  main .wrap > section ~ section,
  main .wrap > section ~ .join-strip{margin-top:calc(28 * var(--u))!important}
}
@media (max-width:899px){
  main .wrap > section ~ section{margin-top:24px!important}
}

/* ---------------------------------------------------------------------------
   Buttons: about half the size the reference scale produced (65-76px tall,
   25-29px text at 1440px). !important is needed to beat the many per-page
   button rules in the legacy stack.
   --------------------------------------------------------------------------- */
.button{
  height:clamp(36px,2.5vw,44px)!important;
  min-width:0!important;
  padding:0 clamp(16px,1.4vw,24px)!important;
  font-size:clamp(14px,1vw,16px)!important;
  border-radius:999px!important;
  gap:6px;
}
.header-cta{height:clamp(34px,2.3vw,40px)!important}
.card-copy .button{width:auto!important}
.submit{width:100%!important}

/* Careers application panel: the cloud art sits in the panel's bottom-left corner,
   clipped by the panel's rounded corner, instead of floating inside the padded aside. */
@media (min-width:900px){
  .application-panel{position:relative;isolation:isolate}
  .application-panel aside{background:none}
  .application-panel aside h2,.application-panel aside p{position:relative;z-index:2}
  .application-panel::before{
    content:'';position:absolute;left:0;bottom:0;z-index:0;pointer-events:none;
    width:46%;height:78%;
    background:url('../images/v7/footer-island-clouds.webp') left bottom/cover no-repeat;
    -webkit-mask-image:linear-gradient(to bottom,transparent,#000 38%);
            mask-image:linear-gradient(to bottom,transparent,#000 38%);
  }
  .application-panel .form-card{position:relative;z-index:1}
  .application-panel .application-art{z-index:1}
}

/* ---------------------------------------------------------------------------
   Overall scale. fidelity-v7 sizes everything in --u = 1/1024 of the viewport,
   so the whole page grew linearly with the screen (h1 98px, body 28px at 1920).
   Layout stays fluid (full width with gutters); only the growth rate of --u
   drops above ~1024px: 1u = 1px at 1024, ~1.12px at 1440, ~1.26px at 1920.
   --------------------------------------------------------------------------- */
:root{--u:min(0.09765625vw,calc(0.7px + 0.0293vw))}
@media (min-width:900px){
  /* Remaining viewport-relative sizes, converted to the scale unit. */
  .hero-wave{height:calc(110 * var(--u))}
  .page-contact .hero-wave{height:calc(135 * var(--u))}
  .conversation-banner:before,.conversation-banner:after{background-size:calc(650 * var(--u)) auto}
}

/* ---------------------------------------------------------------------------
   Fluid page, fixed-proportion compositions. Illustrated scenes were positioned
   in % of the container, so on wide screens they stretched while their heights
   (in --u) did not. Size them in --u instead (values = the original % of the
   1024u reference, or 960u for .wrap children) and anchor them to the right.
   Identical to the old layout up to 1024px, where 1u == 1% of 1024.
   --------------------------------------------------------------------------- */
@media (min-width:900px){
  /* Home hero: game panels + mascot scene (was 100% of the .wrap = 960u). */
  .home-game-scene{left:auto!important;right:0!important;width:calc(960 * var(--u))!important}

  /* Home game cards: show exactly the source crop, centred in the card. */
  .page-home .card-media>.reference-window{width:calc(var(--src-w) * var(--u))!important;margin-inline:auto}

  /* Scene heroes (careers, contact, games): mascot art. */
  .scene-hero:not(.games) .hero-art{width:calc(835 * var(--u));right:calc(-86 * var(--u))}
  .page-careers .hero-art{width:calc(883 * var(--u));right:calc(-115 * var(--u))}
  .page-contact .hero-art{width:calc(854 * var(--u))!important;right:calc(-96 * var(--u))!important}
  .scene-hero.games .hero-art{width:calc(461 * var(--u));right:calc(-10 * var(--u))}

  /* Game heroes: gameplay window (was % of the full-bleed 1024u hero). */
  .page-gummora .gameplay-hero{left:auto;right:calc(54 * var(--u));width:calc(392 * var(--u))}
  .page-orbitsort .gameplay-hero{left:auto;right:calc(88 * var(--u));width:calc(385 * var(--u))}
  .page-quadpop .gameplay-hero{left:auto;right:calc(56 * var(--u));width:calc(342 * var(--u))}
}

/* ---------------------------------------------------------------------------
   Full-screen heroes: each page opens on a hero that fills the viewport below
   the header (--header-h is measured by site.js); the next sections follow on
   scroll. Heroes never shrink below their designed height, so nothing is
   clipped on short screens. Content is centred vertically; mascot art stays
   anchored to the bottom (offsets converted from % of the old fixed height).
   --------------------------------------------------------------------------- */
:root{--hero-h:calc(100svh - var(--header-h,84px))}
@media (min-width:900px){
  /* Home */
  .home-hero{height:auto;min-height:max(var(--hero-h),calc(482 * var(--u)));padding-block:0;align-items:center}
  .home-game-scene{top:50%!important;transform:translateY(-50%)}

  /* Scene heroes: about, careers, contact, games */
  .scene-hero .hero-inner,.page-about .scene-hero .hero-inner,.page-contact .scene-hero .hero-inner{
    height:auto!important;min-height:max(var(--hero-h),calc(490 * var(--u)))!important;align-items:center!important}
  .scene-hero.games .hero-inner{min-height:max(var(--hero-h),calc(249 * var(--u)))!important}
  .scene-hero .hero-inner .hero-copy,.page-careers .scene-hero .hero-copy,.page-contact .scene-hero .hero-copy{
    padding-top:0!important;padding-bottom:calc(90 * var(--u))!important}
  .scene-hero:not(.games) .hero-art{bottom:calc(-83 * var(--u))}
  .page-careers .hero-art{bottom:calc(-93 * var(--u))}
  .page-contact .hero-art{bottom:calc(-86 * var(--u))!important}
  .scene-hero.games .hero-art{height:calc(371 * var(--u));bottom:calc(-65 * var(--u))}

  /* Game pages */
  .page-gummora .game-hero-inner{height:max(var(--hero-h),calc(684 * var(--u)))}
  .page-orbitsort .game-hero-inner{height:max(var(--hero-h),calc(650 * var(--u)))}
  .page-quadpop .game-hero-inner{height:max(var(--hero-h),calc(707 * var(--u)))}
  .game-hero-copy,.page-orbitsort .game-hero-copy,.page-quadpop .game-hero-copy{top:50%!important;transform:translateY(-50%)}
  .gameplay-hero,.page-gummora .gameplay-hero,.page-orbitsort .gameplay-hero,.page-quadpop .gameplay-hero{top:50%!important;transform:translateY(-50%)}
}
@media (min-width:900px){
  /* The first section used to tuck into the hero with a negative margin; with a
     full-screen hero that left its heading cut off at the bottom of the screen. */
  .scene-hero + .wrap,.game-hero + .wrap{margin-top:0!important}
  .page-careers .talent-section,.page-contact .contact-topics{margin-top:calc(8 * var(--u))!important}
  .page-contact .contact-topics>h2{margin-top:calc(16 * var(--u))!important}
}

/* ---------------------------------------------------------------------------
   Header nav: the current page looks like a pressed button, using the same
   glossy pill art as the site buttons (ui/button-purple, cropped to the pill by
   tools/import_v7.py). border-image keeps the rounded caps from stretching.
   Replaces the mixed per-page styles (underline / pale pill / flat purple).
   --------------------------------------------------------------------------- */
#site-nav a,
.page-games #site-nav a[aria-current],
.page-careers #site-nav a[aria-current],
.page-contact #site-nav a[aria-current]{
  --pill-h:44px;
  position:relative;display:inline-flex;align-items:center;justify-content:center;
  height:var(--pill-h);padding:0 calc(var(--pill-h) * .45)!important;
  border:0 solid transparent!important;border-radius:999px!important;
  background:none!important;box-shadow:none!important;color:#350965;
  transition:transform .12s ease;
}
@media (min-width:900px){
  #site-nav a,
  .page-games #site-nav a[aria-current],
  .page-careers #site-nav a[aria-current],
  .page-contact #site-nav a[aria-current]{--pill-h:calc(38 * var(--u))}
}
#site-nav a:hover:not([aria-current]){
  border-image:url('../images/ui/nav-pill-hover.webp') 0 48 fill / 0 calc(var(--pill-h) / 2)!important;
}
#site-nav a[aria-current],
.page-games #site-nav a[aria-current],
.page-careers #site-nav a[aria-current],
.page-contact #site-nav a[aria-current]{
  border-image:url('../images/ui/nav-pill-active.webp') 0 48 fill / 0 calc(var(--pill-h) / 2)!important;
  color:#fff!important;text-shadow:0 1px 1px #3c007866;
}
/* Pressed: a soft inner shadow over the pill art. */
#site-nav a[aria-current]::after{
  content:'';position:absolute;inset:0;border-radius:999px;pointer-events:none;
  box-shadow:inset 0 2px 5px #2a006066,inset 0 -1px 0 #ffffff33;
}

/* ---------------------------------------------------------------------------
   One header for every page. fidelity-v7 gave the header a different height
   per page (64u-76u) and a floating rounded box on Gummora/Quad Pop, so logo,
   menu and button jumped 3-10px (and 20px sideways) between pages.
   --------------------------------------------------------------------------- */
@media (min-width:900px){
  .site-header,.page-gummora .site-header,.page-quadpop .site-header{
    padding:0!important;background:rgba(255,255,255,.95)!important;box-shadow:0 2px 14px #774dbc12!important}
  .header-inner,.page-home .header-inner,.page-games .header-inner,.page-orbitsort .header-inner,
  .page-gummora .header-inner,.page-quadpop .header-inner{
    height:calc(76 * var(--u))!important;padding-inline:0!important;margin-block:0!important;
    background:none!important;border-radius:0!important;box-shadow:none!important}
}
