/* Thinfinitly. Gold-on-black InfinitLy look, DiceCo footer. */
:root {
  --bg: #0b0904; --ink: #f4efe2; --muted: #b9b09a; --gold: #f6c518; --gold-2: #ffd84d; --gold-deep: #b98c00;
  --card: rgba(20, 16, 8, .72); --line: rgba(246, 197, 24, .22); --danger: #ff8a7a; --ok: #7be3a4;
  --r: 16px;
  --t: 1; /* animation time scale */
  /* One lock unit. The whole lock (incl. the sliding tags) is 600 x 450 units and scales as one piece. */
  --u: min(1px, calc(92vw / 600), calc(48vh / 450));
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg) url("media/bg-poster.jpg") center / cover fixed no-repeat;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex; flex-direction: column;
}
.bg-video { position: fixed; inset: 0; width: 100vw; height: 100vh; object-fit: cover; z-index: -2; pointer-events: none; }
.bg-veil { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, rgba(11,9,4,.15) 0%, rgba(11,9,4,.55) 60%, rgba(11,9,4,.85) 100%); }
a { color: var(--gold-2); }
.gold { color: var(--gold); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #000; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 3px; border-radius: 10px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px clamp(14px, 4vw, 32px); }
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 1.35rem; letter-spacing: .01em; }
.brand-by { white-space: nowrap; font-size: .72rem; color: var(--muted); letter-spacing: .04em; margin-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); padding: 6px 8px 6px 12px; border-radius: 999px; font-size: .9rem; backdrop-filter: blur(6px); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.who { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.link-btn { background: none; border: 0; color: var(--gold-2); font: inherit; cursor: pointer; padding: 4px 6px; text-decoration: underline; }

main { flex: 1; width: 100%; max-width: 920px; margin: 0 auto; padding: 0 clamp(14px, 4vw, 28px) 24px; }
.hero { text-align: center; margin-top: clamp(4px, 2vh, 20px); }
h1 { font-size: clamp(1.7rem, 5.2vw, 3rem); line-height: 1.12; margin: 0 0 10px; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.lede { color: var(--muted); max-width: 40em; margin: 0 auto; font-size: clamp(1rem, 2.4vw, 1.12rem); text-wrap: pretty; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px;
  font: 600 1rem/1 inherit; font-family: inherit; cursor: pointer; text-decoration: none; border: 1px solid transparent; transition: transform .15s ease, background .2s, box-shadow .2s; }
.btn:active { transform: translateY(1px); }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1b1400; box-shadow: 0 6px 24px rgba(246,197,24,.25); }
.btn-gold:hover { box-shadow: 0 8px 30px rgba(246,197,24,.4); }
.btn-ghost { background: rgba(255,255,255,.04); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: rgba(246,197,24,.1); }
.btn-small { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--ink); width: 38px; height: 38px; border-radius: 50%; font-size: 1.5rem; line-height: 1; cursor: pointer; }

/* Stage + status */
.stage-wrap { display: flex; flex-direction: column; align-items: center; margin-top: clamp(4px, 2vh, 18px); }
.status { min-height: 1.6em; margin: 6px 0 10px; text-align: center; color: var(--ink); font-weight: 500; }
.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; flex-direction: column; }
#signed-in-actions { flex-direction: row; }
.hint { margin: 0; color: var(--muted); font-size: .9rem; }

/* ===== The lock: the ORIGINAL InfinitLy choreography, timings 1:1, rebuilt in lock units =====
   Every duration/delay is multiplied by --t (1 normally; shortened for reduced-motion users). */
.lock-stage { position: relative; z-index: 2; width: calc(600 * var(--u)); height: calc(450 * var(--u)); }
.lock { position: absolute; left: calc(75 * var(--u)); top: 0; width: calc(450 * var(--u)); height: calc(450 * var(--u)); }
.lock img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.lock-body { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; }

/* clasp / shackle: opens 0.8s ease-in-out; closes 1.0s ease-in-out after a 2.5s pause (rods tuck in first) */
.shackle { position: absolute; left: calc(112 * var(--u)); top: calc(47 * var(--u)); width: calc(210 * var(--u)); z-index: 10; pointer-events: none; overflow: visible; }
.shackle img { transform-origin: left bottom; transition: transform calc(1s * var(--t)) ease-in-out calc(2.5s * var(--t)); }
.shackle.open img { transform: rotate(-35deg); transition: transform calc(.8s * var(--t)) ease-in-out; }

/* keyhole turns 25deg */
.keyhole { position: absolute; left: calc(208 * var(--u)); top: calc(278 * var(--u)); width: calc(30 * var(--u)); z-index: 5; pointer-events: none; }
.keyhole img { transform-origin: center center; }
.keyhole.turn-right img { animation: keyTurnRight calc(.3s * var(--t)) ease-in-out forwards; }
.keyhole.turn-back img { animation: keyTurnBack calc(.3s * var(--t)) ease-in-out forwards; }

/* L glows limegreen, y glows purple */
.letter { position: absolute; top: calc(200 * var(--u)); width: calc(30 * var(--u)); z-index: 5; pointer-events: none; overflow: visible; transition: opacity calc(.4s * var(--t)) ease; }
.letter-l { left: calc(143 * var(--u)); }
.letter-y { left: calc(275 * var(--u)); }
.letter-l.pulse img { animation: pulseL calc(.5s * var(--t)) ease-in-out 1; }
.letter-y.pulse img { animation: pulseY calc(.5s * var(--t)) ease-in-out 1; }

/* sliding rods: out 1.5s ease after 1.0s; back in slowly (5.7s right, 6.2s left) */
.rod { position: absolute; top: calc(194 * var(--u)); width: calc(130 * var(--u)); z-index: 2; pointer-events: none; }
.rod-right { left: calc(374 * var(--u)); transform: translateX(calc(-156 * var(--u))); transition: transform calc(5.7s * var(--t)) ease; }
.rod-left { left: calc(-5 * var(--u)); transform: translateX(calc(100 * var(--u))); transition: transform calc(6.2s * var(--t)) ease; }
.lock.open .rod-right { transform: translateX(calc(-64 * var(--u))); transition: transform calc(1.5s * var(--t)) ease calc(1s * var(--t)); }
.lock.open .rod-left { transform: translateX(calc(-8 * var(--u))); transition: transform calc(1.5s * var(--t)) ease calc(1s * var(--t)); }

/* ENCRYPT / DECRYPT eyes: slide out (1.5s ease, 1.0s delay) and swing down 0 -> 90deg */
.tag { position: absolute; top: calc(179 * var(--u)); width: calc(100 * var(--u)); padding: 0; margin: 0; border: 0; background: none; z-index: 3;
  cursor: pointer; border-radius: 50%; opacity: 1;
  transition: transform calc(1.5s * var(--t)) ease calc(1s * var(--t)), opacity calc(.4s * var(--t)) ease calc(.3s * var(--t)); }
.tag-encrypt { left: calc(444 * var(--u)); transform: translateX(calc(-200 * var(--u))); }
.tag-decrypt { left: calc(-85 * var(--u)); transform: translateX(calc(200 * var(--u))); }
.lock.open .tag-encrypt { transform: translateX(calc(-30 * var(--u))); }
.lock.open .tag-decrypt { transform: translateX(calc(2 * var(--u))); }
.tag-encrypt img { transform: rotate(0deg); transform-origin: 0 50%; transition: transform calc(1.5s * var(--t)) ease; }
.lock.open .tag-encrypt img { transform: rotate(90deg); transition: transform calc(1.5s * var(--t)) ease calc(1s * var(--t)); }
.tag-decrypt img { transform: rotate(0deg); transform-origin: 100% 50%; transition: transform calc(1.5s * var(--t)) ease calc(1s * var(--t)); }
.lock.open .tag-decrypt img { transform: rotate(90deg); }
.lock:not(.open) .tag { pointer-events: none; }
.tag:hover img, .tag:focus-visible img { filter: drop-shadow(0 0 10px rgba(246,197,24,.7)) brightness(1.1); }

.lock-hit { position: absolute; left: calc(90 * var(--u)); top: calc(45 * var(--u)); width: calc(266 * var(--u)); height: calc(340 * var(--u));
  z-index: 11; background: transparent; border: 0; cursor: pointer; border-radius: calc(60 * var(--u)); }
.lock-hit:hover ~ .lock-body, .lock:hover .lock-body { filter: drop-shadow(0 0 18px rgba(246,197,24,.35)); }
.lock.busy .lock-body { animation: breathe 1.4s ease-in-out infinite; }

@keyframes keyTurnRight { from { transform: rotate(0deg); } to { transform: rotate(25deg); } }
@keyframes keyTurnBack { from { transform: rotate(25deg); } to { transform: rotate(0deg); } }
@keyframes pulseL { 0%,100% { transform: scale(1); filter: drop-shadow(0 0 0px limegreen) brightness(1); } 50% { transform: scale(1.3); filter: drop-shadow(0 0 8px limegreen) brightness(1.5); } }
@keyframes pulseY { 0%,100% { transform: scale(1); filter: drop-shadow(0 0 0px purple) brightness(1); } 50% { transform: scale(1.3); filter: drop-shadow(0 0 8px purple) brightness(1.5); } }
@keyframes breathe { 0%,100% { filter: drop-shadow(0 0 6px rgba(246,197,24,.2)); } 50% { filter: drop-shadow(0 0 22px rgba(246,197,24,.6)); } }

/* ===== Sign-in shingle: swings until you sign in, then flips over to "Signed in" (was the wallet shingle) ===== */
.account { display: grid; justify-items: end; align-items: center; perspective: 1000px; transform-origin: top center; will-change: transform; }
.account > * { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform calc(.8s * var(--t)) ease-in-out; }
.account .face-front { transform: rotateY(0deg); z-index: 2; }
.account .face-back { transform: rotateY(180deg); z-index: 1; }
.account.flipped .face-front { transform: rotateY(-180deg); }
.account.flipped .face-back { transform: rotateY(0deg); }
.account.swing { animation: swingShingleSideways calc(2.5s * var(--t)) linear infinite; }
.account.swing:hover, .account.swing:focus-within { animation-play-state: paused; }
@keyframes swingShingleSideways { 0% { transform: rotateZ(-5deg); } 50% { transform: rotateZ(5deg); } 100% { transform: rotateZ(-5deg); } }
.signin-short { display: none; }

/* "Sign in to unlock" arrow: fades in when the locked lock is tapped while signed out */
.topbar-right { display: flex; align-items: center; gap: 10px; }
.connect-arrow { width: clamp(118px, 26vw, 230px); height: auto; opacity: 0; pointer-events: none; transition: opacity calc(.4s * var(--t)) ease-in-out; }
.connect-arrow.show { opacity: 1; }
body.signed-in .connect-arrow { display: none; }

/* Panel / drop zone */
.panel.visible { transform: translateY(0); opacity: 1; }
.panel { position: relative; z-index: 1; transform: translateY(-10vh); opacity: 0; transition: transform calc(.5s * var(--t)) ease, opacity calc(.5s * var(--t)) ease;
  margin: 18px auto 0; max-width: 620px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; backdrop-filter: blur(8px); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel h2 { margin: 0; font-size: 1.3rem; }
.panel-help { color: var(--muted); margin: 6px 0 14px; }
.drop { border: 2px dashed rgba(246,197,24,.45); border-radius: 14px; padding: 26px 16px; text-align: center; transition: background .2s, border-color .2s; }
.drop.over { background: rgba(246,197,24,.08); border-color: var(--gold-2); }
.drop-label { margin: 0; font-weight: 600; font-size: 1.1rem; }
.drop-or { margin: 4px 0 10px; color: var(--muted); }
.progress-wrap { margin-top: 14px; }
.progress-label { margin: 0 0 6px; }
progress { width: 100%; height: 12px; accent-color: var(--gold); }
.result { margin-top: 14px; text-align: center; }
.result-text { font-weight: 600; margin: 0 0 12px; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Info sections */
.warning, .how { margin: 22px auto 0; max-width: 680px; padding: 16px 18px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(6px); }
.warning { border-color: rgba(255, 170, 60, .5); }
.warning h2, .how h2 { margin: 0 0 6px; font-size: 1.1rem; }
.warning h2 { color: #ffbe5c; }
.warning p { margin: 0; }
.how ol { margin: 0; padding-left: 1.3em; }
.how li { margin: 4px 0; }
.small { color: var(--muted); font-size: .9rem; margin: 10px 0 0; }

.footer { width: 100%; max-width: 920px; margin: 30px auto 0; padding: 14px clamp(14px, 4vw, 28px) 34px; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); }
.footer p { margin: 8px 0 0; }
.foot-brand { display: flex; align-items: center; gap: 14px; margin: 14px 0 6px; flex-wrap: wrap; }
.foot-logo-link { display: inline-flex; flex: none; border-radius: 10px; }
/* The DiceCo logo is blue + dark gray, so it sits on a light backing to read on the dark page (same as Intuitive Explorer's dark mode). */
.foot-logo { display: block; height: 48px; width: auto; background: #fff; border-radius: 10px; padding: 5px 7px; box-sizing: content-box; }
.foot-brand strong { color: var(--ink); }
.foot-brand .heart { color: var(--gold); }
.footer .muted { color: var(--muted); opacity: .85; }
.footer .small { font-size: .8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


@media (max-width: 520px) {
  .topbar { padding: 10px 12px; }
  .brand-name { font-size: 1.15rem; }
  .brand-by { font-size: .68rem; }
  .signin-long { display: none; }
  .signin-short { display: inline; }
  .who { display: none; }
  #signed-in-actions { flex-direction: column; width: 100%; }
  #signed-in-actions .btn, #signin-main { width: min(100%, 340px); }
}

/* Reduced motion: same choreography, shortened to a quarter of the time; no endless swinging, no video. */
@media (prefers-reduced-motion: reduce) {
  :root { --t: .25; }
  .account.swing { animation: none; }
  .lock.busy .lock-body { animation: none; filter: drop-shadow(0 0 16px rgba(246,197,24,.45)); }
  .bg-video { display: none; }
}
