/* The seal coin — same idea as Men in Motion's (MenInMotion/assets/css/coin.css).
   Ministry of Social Services seal on the face, the CORE Horizon seal on the back. It rests on each side for
   about six seconds, then turns over like a tossed coin: two and a half turns, lifting a little as it goes.
   The discs between the faces are its rim. A ring of words turns slowly around it.
   Rim discs are <s>, not <i>: several intros style ".seal i" and would catch them. */
.coin-ring { /* Men in Motion's size: a 420px ring, coin 13% inside it. It gives way on short windows so the page never scrolls
     (90vh - 470px is what is left of the hero once the headline, ticker and footer have their room; a page with an
     extra line under the headline sets --coin-trim). */
  --coin: clamp(210px, 90vh - 470px - var(--coin-trim, 0px), 420px);
  position: relative; width: var(--coin); aspect-ratio: 1; margin: 0 0 12px calc(var(--coin) * -.07); }
main .wrap .sub { display: none; }   /* the ring of words already carries the full name */
.coin-ring .words { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; animation: spin 48s linear infinite; }
.coin-ring .words text { font: 800 16.5px var(--display); fill: var(--steel); text-transform: uppercase; }
.coin-ring .words .dot { fill: var(--teal); }
.coin { position: absolute; inset: 13%; perspective: 1400px; filter: drop-shadow(0 24px 30px rgba(22, 50, 92, .32)); }
.coin.once { inset: 0; }
.coin-in { display: block; position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: coin-turn 18s infinite, coin-lift 18s infinite; }
.coin-in img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; margin: 0; border-radius: 50%; background: #fff; opacity: 1;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; transform: translateZ(5px); animation: none; }
.coin-in img.coin-back { transform: rotateY(180deg) translateZ(5px); }
.coin-in s { position: absolute; inset: .6%; border-radius: 50%; background: #16325c; }
.coin-in s:nth-of-type(even) { background: #245086; }
.coin-in s:nth-of-type(1) { transform: translateZ(-4px); } .coin-in s:nth-of-type(2) { transform: translateZ(-3px); } .coin-in s:nth-of-type(3) { transform: translateZ(-2px); }
.coin-in s:nth-of-type(4) { transform: translateZ(-1px); } .coin-in s:nth-of-type(5) { transform: translateZ(0); } .coin-in s:nth-of-type(6) { transform: translateZ(1px); }
.coin-in s:nth-of-type(7) { transform: translateZ(2px); } .coin-in s:nth-of-type(8) { transform: translateZ(3px); } .coin-in s:nth-of-type(9) { transform: translateZ(4px); }

/* 900deg is two and a half turns, so it lands on the other face; 1800deg is five, back where it began. */
@keyframes coin-turn {
  0%, 36% { transform: rotateY(0deg); animation-timing-function: cubic-bezier(.5, 0, .2, 1); }
  50%, 86% { transform: rotateY(900deg); animation-timing-function: cubic-bezier(.5, 0, .2, 1); }
  100% { transform: rotateY(1800deg); }
}
@keyframes coin-lift { 0%, 36%, 50%, 86%, 100% { scale: 1; } 43%, 93% { scale: 1.07; } }

/* Opening titles: one toss, Ministry → CORE, and it stays there. */
.coin.once .coin-in { animation: coin-once 1.7s cubic-bezier(.5, 0, .2, 1) .9s forwards; }
@keyframes coin-once { 50% { scale: 1.07; } to { transform: rotateY(900deg); } }

/* ── Header ───────────────────────────────────────────────────────────────────────────────────────────
   The white bar is gone. The header floats over the top of the scene, so the splash runs edge to edge:
   the name on the left, and one glass capsule on the right holding the time, the service desk and help.
   The seal lives on the coin, so no logo here. (core.css still styles the original home-page.html.) */
body { display: flex; flex-direction: column; min-height: 100vh; }
body > main { flex: 1 0 auto; }
body > main:not(.hero) { display: flex; flex-direction: column; } body > main:not(.hero) > .hero { flex: 1 0 auto; }
.nav { background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; margin-bottom: -76px; pointer-events: none; }
.nav::before { display: none; }
.nav .wrap { height: 76px; } .nav .wrap > * { pointer-events: auto; }
.nav ~ main.hero, .nav ~ main > .hero { padding-top: 66px; }
.nav .brand .ring, .nav .brand .org small { display: none; }
.nav .brand { gap: 14px; }
.nav .brand .wm { font-size: 24px; }
.nav .brand .bar { height: 22px; background: rgba(22, 50, 92, .22); }
.nav .brand .org b { font: 600 13px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--slate); }
.nav-r { gap: 0; padding: 4px; border-radius: 99px; background: rgba(255, 255, 255, .58); border: 1px solid rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px); box-shadow: 0 10px 26px -14px rgba(22, 50, 92, .35), inset 0 1px 0 rgba(255, 255, 255, .9); }
.nav-r .pill, .nav-r .ibtn { height: 36px; border: 0; background: none; border-radius: 99px; box-shadow: none; }
.nav-r .ibtn { width: 36px; }
.nav-r .pill + .pill, .nav-r .pill + .ibtn { position: relative; margin-left: 9px; }
.nav-r .pill + .pill::before, .nav-r .pill + .ibtn::before { content: ""; position: absolute; left: -5px; top: 9px; bottom: 9px; width: 1px; background: rgba(22, 50, 92, .16); }
.nav-r a.pill:hover { background: rgba(255, 255, 255, .9); box-shadow: none; }
.nav.scrolled { background: none; box-shadow: none; }
.nav.scrolled .brand { padding: 6px 14px 6px 12px; margin-left: -12px; border-radius: 99px; background: rgba(255, 255, 255, .7); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
@media (max-width: 900px) { .nav-r .pill + .pill, .nav-r .pill + .ibtn { margin-left: 2px; } .nav-r .pill + .pill::before, .nav-r .pill + .ibtn::before { display: none; } .nav-r .pill { width: 36px; } }

@media (max-width: 900px) { .coin-ring { --coin: min(240px, 62vw); margin: 0 auto 14px; } }

/* Scene picker (/assets/front/scenes.js): a button in the header capsule, and a sheet of every home scene under it. */
.nav-r button { font: inherit; color: inherit; cursor: pointer; }
.nav-r button.pill:hover, .nav-r button.ibtn:hover { background: rgba(255, 255, 255, .9); color: var(--navy); }
.nav-r .ibtn + .ibtn { margin-left: 2px; }
#scenes { position: fixed; inset: 76px 24px auto auto; margin: 0; width: min(620px, 100vw - 24px); max-height: calc(100vh - 96px); overflow: auto; padding: 20px 20px 16px;
  border: 1px solid rgba(255, 255, 255, .95); border-radius: 24px; background: rgba(255, 255, 255, .93); -webkit-backdrop-filter: saturate(1.5) blur(18px); backdrop-filter: saturate(1.5) blur(18px);
  box-shadow: 0 34px 80px -24px rgba(15, 35, 64, .55), 0 2px 8px rgba(15, 35, 64, .08); color: var(--navy); }
#scenes:popover-open { animation: sc-in .4s var(--ease) both; }
#scenes::backdrop { background: rgba(15, 35, 64, .22); }
@keyframes sc-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
#scenes h2 { font: 800 19px var(--display); letter-spacing: -.02em; }
#scenes h3 { margin: 18px 0 0; font: 800 15px var(--display); letter-spacing: -.01em; }
.sc small { margin-top: -5px; padding: 0 4px; font: 500 11px var(--display); color: var(--steel); }
#scenes p { margin: 4px 0 14px; font-size: 13.5px; color: var(--slate); }
.sc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sc { position: relative; display: grid; gap: 7px; padding: 5px 5px 8px; border: 1.5px solid transparent; border-radius: 15px; background: none; color: var(--slate); font: inherit; text-align: left; cursor: pointer;
  animation: sc-tile .5s var(--ease) both; animation-delay: calc(var(--i) * 22ms + 80ms); transition: background .25s, border-color .25s; }
@keyframes sc-tile { from { opacity: 0; transform: translateY(8px); } }
.sc b { padding: 0 4px; font: 600 12.5px/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-pic { display: block; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--row); box-shadow: 0 0 0 1px rgba(22, 50, 92, .1); }
.sc-pic img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.sc-any { display: grid; place-items: center; color: #fff; background: conic-gradient(from 210deg, #1c7c8c, #4fc3f7, #f5b83d, #e8508b, #7a4bc2, #1c7c8c); }
.sc-any svg { width: 30px; height: 30px; stroke-width: 2; filter: drop-shadow(0 2px 4px rgba(15, 35, 64, .35)); transition: transform .5s var(--ease); }
.sc:hover { background: rgba(22, 50, 92, .05); color: var(--navy); } .sc:hover img { transform: scale(1.07); } .sc:hover .sc-any svg { transform: rotate(180deg); }
.sc:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.sc[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-bg); color: var(--teal-dark); }
.sc[aria-pressed="true"]::after { content: "Yours"; position: absolute; left: 11px; top: 11px; padding: 3px 8px; border-radius: 99px; background: var(--teal); color: #fff; font: 700 10px var(--display); letter-spacing: .08em; text-transform: uppercase; }
.sc.now .sc-pic { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--navy); }
.sc.now b::after { content: " · on now"; font-weight: 500; opacity: .7; }
.sc[data-scene=""][aria-pressed="true"]::after { content: "On"; }
@media (max-width: 620px) { .sc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } #scenes { padding: 16px 12px 12px; } .sc b { white-space: normal; } }
@media (prefers-reduced-motion: reduce) { #scenes:popover-open, .sc { animation: none; } }

/* The lanyard threads through the slot in the pass: below the clasp the strap carries on into the hole (it used to stop short of it). */
.face .slot { background: #c3ced9; box-shadow: inset 0 2px 4px rgba(15, 35, 64, .45), 0 1px 0 #fff; }
.face .slot::before { content: ""; position: absolute; left: 50%; top: -9px; width: 22px; height: 16px; margin-left: -11px; border-radius: 0 0 2px 2px;
  background: linear-gradient(180deg, transparent 45%, rgba(8, 20, 40, .6)), repeating-linear-gradient(180deg, rgba(255,255,255,.18) 0 2px, transparent 2px 6px), linear-gradient(90deg, var(--navy) 0 34%, var(--teal) 34% 66%, var(--navy) 66%);
  box-shadow: 0 0 0 1px rgba(15, 35, 64, .15); }

/* Scene sound (assets/front/sound.js): the speaker beside Help. It pulses while playing and nudges while the browser holds the sound back. */
#sound { position: relative; } #sound[aria-pressed="true"] { color: #d6246e; }
#sound[aria-pressed="true"]:not(.wait) svg { animation: thump var(--beat, 1.6s) ease-out infinite; } @keyframes thump { 0% { transform: scale(1.22); } 60%, 100% { transform: scale(1); } }
#sound.wait { animation: nudge 1.6s ease-in-out infinite; } @keyframes nudge { 50% { box-shadow: 0 0 0 6px rgba(214, 36, 110, .2); } }
#sound.wait::after { content: "Click anywhere to start the sound"; position: absolute; top: 48px; right: -44px; white-space: nowrap; padding: 7px 12px; border-radius: 99px; background: var(--navy); color: #fff; font: 600 12px var(--display); box-shadow: 0 10px 24px -8px rgba(15, 35, 64, .5); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { #sound, #sound svg { animation: none !important; } }

/* Phones: the coin is already centred, so the date, greeting and anything under them centre with it. */
@media (max-width: 900px) {
  main .wrap > div:has(> .coin-ring) { text-align: center; }
  main .wrap > div:has(> .coin-ring) > * { margin-left: auto; margin-right: auto; justify-content: center; }
}

/* Production home: the mockup badge and its replay buttons stay out of sight (register keeps its design switcher). */
html[data-sound] .mockbar { display: none !important; }
