/* INSEE hub: shared look + motion for the sign-in and releases pages (index/flasher/decrypt keep their inline copy).
   Motion only animates transform, opacity and filter; everything is off under prefers-reduced-motion. */
:root { --page:#F5C518; --surf-0:#0F1115; --surf-2:#262A33; --line:rgba(255,255,255,.10);
  --txt-0:#F4F5F7; --txt-1:#C5C8CF; --txt-2:#8A8F9A; --acc:#F5C518; --ok:#4ADE80; --crit:#F87171; --r-sm:8px; --r-md:16px;
  --font-ui:"INSEE Text",Manrope,Geist,Satoshi,Aptos,"SF Pro Text","Segoe UI",system-ui,sans-serif;
  --font-display:"INSEE Display","Space Grotesk",Satoshi,"Aptos Display","Segoe UI",system-ui,sans-serif;
  --font-mono:"INSEE Mono","JetBrains Mono","IBM Plex Mono",ui-monospace,Consolas,Menlo,monospace;
  --ease-out:cubic-bezier(.16,1,.3,1); --ease-soft:cubic-bezier(.33,1,.68,1); --acc-glow:rgba(245,197,24,.4);
  --glass:linear-gradient(180deg,rgba(34,37,45,.72),rgba(19,21,26,.82));
  --depth:inset 0 1px 0 rgba(255,255,255,.06),0 24px 50px -12px rgba(0,0,0,.55),0 8px 24px -6px rgba(0,0,0,.36);
  color-scheme: dark; }
@view-transition { navigation: auto; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--surf-0); color: var(--txt-0); font: 17px/1.5 var(--font-ui); }
a { color: var(--acc); }
:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
[hidden] { display: none !important; }

/* living background: grid + two slow glows */
html::before, body::before, body::after { content: ""; position: fixed; z-index: -1; pointer-events: none; }
html::before { inset: 0; background: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0/48px 48px, linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px) 0 0/48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0, #000 15%, transparent 75%); mask-image: radial-gradient(ellipse 90% 70% at 50% 0, #000 15%, transparent 75%); }
body::before { width: 80vmax; height: 80vmax; left: -30vmax; top: -36vmax; opacity: .7; background: radial-gradient(closest-side, rgba(245,197,24,.18), rgba(245,197,24,.05) 55%, transparent);
  animation: fx-drift-a 44s var(--ease-soft) infinite alternate; transition: opacity 1.2s var(--ease-out); }
body::after { width: 72vmax; height: 72vmax; right: -32vmax; bottom: -38vmax; opacity: .65; background: radial-gradient(closest-side, rgba(42,164,222,.11), rgba(245,197,24,.05) 50%, transparent);
  animation: fx-drift-b 56s var(--ease-soft) infinite alternate; transition: opacity 1.2s var(--ease-out); }
html.fx-live body::before, html.fx-live body::after { opacity: 1; }

/* header: drops in, logo blurs in, one sheen sweep (again on hover); stays put across page transitions */
header { position: relative; overflow: hidden; color: #111421; border-bottom: 4px solid #111421; view-transition-name: hub-header;
  background: linear-gradient(105deg, #F5C518, #FFD43A 50%, #F5C518); box-shadow: 0 10px 40px -12px rgba(245,197,24,.35); animation: fx-drop .8s var(--ease-out) backwards; }
header::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(135deg, rgba(17,20,33,.045) 0 1px, transparent 1px 9px); }
header::after { content: ""; position: absolute; top: -20%; bottom: -20%; left: 0; width: 28%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.7), transparent); transform: translateX(-130%) skewX(-18deg); animation: fx-sweep 1.5s .7s var(--ease-out) backwards; }
header:hover::after { animation: fx-sweep2 1.3s var(--ease-out); }
header > div { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 18px; }
header img { width: 120px; height: auto; flex: none; animation: fx-logo .9s .15s var(--ease-out) backwards; }
header h1 { margin: 0; font: 800 1.3rem/1.2 var(--font-display); animation: fx-in-x .8s .25s var(--ease-out) backwards; }
header small { font-weight: 700; opacity: .8; }

main { max-width: 880px; margin: 0 auto; padding: 12px 16px 40px; }
footer { max-width: 880px; margin: 0 auto; padding: 0 16px 32px; color: var(--txt-2); font-size: .85rem; }
.back { display: inline-flex; align-items: center; gap: .4em; margin: .4em 0 .2em; text-decoration: none; font-weight: 700; }
.back::before { content: "\2190"; transition: transform .3s var(--ease-out); }
.back:hover::before { transform: translateX(-4px); }

/* glass panel with a gradient hairline */
.glass { position: relative; border-radius: var(--r-md); background: var(--glass); box-shadow: var(--depth);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); }
.glass::before { content: ""; position: absolute; inset: -1px; padding: 1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(245,197,24,.5), rgba(255,255,255,.06) 28%, transparent 55%, rgba(245,197,24,.18));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }

/* rotating light around a card's edge: a spinning conic square behind an opaque inner face (transform only); z-index -1 is free for decoration */
.ring { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r-md); }
.ring::before { content: ""; position: absolute; z-index: -3; left: 50%; top: 50%; width: 200%; aspect-ratio: 1; translate: -50% -50%;
  background: conic-gradient(from 0deg, transparent 0 62%, rgba(245,197,24,.0) 66%, rgba(245,197,24,.9) 76%, #fff3b0 78%, rgba(42,164,222,.5) 84%, transparent 92%);
  animation: fx-spin 7s linear infinite; }
.ring::after { content: ""; position: absolute; z-index: -2; inset: 1.5px; border-radius: calc(var(--r-md) - 1.5px); background: linear-gradient(180deg, #1d2027, #121419 70%); }

/* staggered entrance: set --i on each element */
.rise { animation: fx-rise .8s calc(.25s + var(--i, 0) * 70ms) var(--ease-out) backwards; }

button, .btn { font: 700 1em var(--font-ui); padding: .62em 1.2em; border: 0; border-radius: var(--r-sm); color: #111421; cursor: pointer;
  background: linear-gradient(180deg, #FFD84A, #F5C518 60%, #E9B90F); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(0,0,0,.12), 0 8px 20px -6px var(--acc-glow);
  transition: transform .16s var(--ease-out), box-shadow .3s var(--ease-out), filter .2s; -webkit-tap-highlight-color: transparent; }
button:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 14px 32px -8px rgba(245,197,24,.6), 0 0 0 4px rgba(245,197,24,.12); }
button:active:not(:disabled) { transform: scale(.965); }
button:disabled { filter: grayscale(.6) brightness(.7); cursor: progress; }
button.ghost { background: transparent; color: var(--txt-1); box-shadow: inset 0 0 0 1px var(--line); }
input { width: 100%; min-width: 0; font: 1em var(--font-ui); color: var(--txt-0); padding: .7em .85em; border-radius: var(--r-sm);
  background: rgba(12,14,18,.72); border: 1px solid rgba(197,200,207,.3); transition: border-color .2s, box-shadow .3s var(--ease-out); }
input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 4px rgba(245,197,24,.16); }
label { display: block; font-weight: 700; font-size: .9rem; margin: .9em 0 .35em; color: var(--txt-1); }
.note { color: var(--txt-2); font-size: .88rem; }
.err { color: #000; background: var(--crit); padding: .55em .7em; border-radius: var(--r-sm); font-weight: 700; white-space: pre-wrap; }
.shake { animation: fx-shake .45s var(--ease-out); }

/* skeleton shimmer while loading */
.skel { height: 1em; border-radius: 6px; background: linear-gradient(90deg, rgba(255,255,255,.05) 25%, rgba(255,255,255,.13) 50%, rgba(255,255,255,.05) 75%) 0 0/300% 100%; animation: fx-shimmer 1.4s linear infinite; }

@keyframes fx-drift-a { to { transform: translate3d(14vmax, 10vmax, 0) scale(1.12); } }
@keyframes fx-drift-b { to { transform: translate3d(-12vmax, -9vmax, 0) scale(1.08); } }
@keyframes fx-drop { from { transform: translate3d(0, -100%, 0); } }
@keyframes fx-logo { from { opacity: 0; transform: translate3d(-16px, 0, 0) scale(.92); filter: blur(6px); } }
@keyframes fx-in-x { from { opacity: 0; transform: translate3d(18px, 0, 0); filter: blur(4px); } }
@keyframes fx-sweep { from { transform: translateX(-130%) skewX(-18deg); } to { transform: translateX(460%) skewX(-18deg); } }
@keyframes fx-sweep2 { from { transform: translateX(-130%) skewX(-18deg); } to { transform: translateX(460%) skewX(-18deg); } }
@keyframes fx-rise { from { opacity: 0; transform: translate3d(0, 18px, 0) scale(.985); filter: blur(3px); } }
@keyframes fx-spin { to { rotate: 1turn; } }
@keyframes fx-shimmer { to { background-position: -150% 0; } }
@keyframes fx-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes fx-pop { 50% { transform: scale(1.12); } }
::view-transition-old(root) { animation: .25s var(--ease-out) both fx-vt-out; }
::view-transition-new(root) { animation: .45s var(--ease-out) both fx-vt-in; }
@keyframes fx-vt-out { to { opacity: 0; transform: translateY(-8px) scale(.99); } }
@keyframes fx-vt-in { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
