/*
 * Every .space site: real space behind iPhone glass. The photos are NASA's. A page sets its photo
 * with <html data-sky="carina|deep">, and everything on it sits in glass over the universe.
 */
:root { color-scheme: dark; --ink: #f5f6fa; --dim: rgba(245, 246, 250, 0.68); --line: rgba(255, 255, 255, 0.24); --sky: url("/shared/bg/carina.jpg"); }
html[data-sky="deep"] { --sky: url("/shared/bg/deep.jpg"); }
* { box-sizing: border-box; }
html { background: #000; }
html, body { margin: 0; min-height: 100%; color: var(--ink); font-family: -apple-system, system-ui, "Segoe UI", sans-serif; -webkit-text-size-adjust: 100%; }

.space { position: fixed; inset: -6%; z-index: -1; background: var(--sky) center / cover no-repeat #000; animation: float 90s ease-in-out infinite alternate; }
.space::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 40%, transparent 30%, rgba(0, 0, 0, 0.5) 100%); }
@keyframes float { from { transform: scale(1) translate3d(-1.5%, -1%, 0); } to { transform: scale(1.12) translate3d(1.5%, 1%, 0); } }

/* iPhone glass: the sky shows through, blurred and brightened, with light caught on the rim. */
.glass {
  position: relative;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.05) 45%, rgba(255, 255, 255, 0.12));
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -1px 0 rgba(255, 255, 255, 0.1), 0 14px 40px rgba(0, 0, 0, 0.42);
}

/* The default for anything on a .space domain: an app on a home screen. */
.apps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 16px; width: min(100%, 460px); margin: 0 auto; padding: 16px; list-style: none; }
@media (min-width: 720px) { .apps { width: min(100%, 720px); grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.app { display: grid; gap: 7px; justify-items: center; width: 100%; padding: 0; color: inherit; background: none; border: 0; font: inherit; cursor: pointer; }
.app-box { display: block; width: 100%; aspect-ratio: 1; padding: 13%; border-radius: 23%; overflow: hidden; transition: transform 0.18s cubic-bezier(0.3, 1.5, 0.6, 1); }
.app:active .app-box, .app:hover .app-box { transform: scale(1.07); }
.app-label { display: block; width: 62%; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.34); }

/* The empty profile card: a default photo and blank lines, waiting for its person. */
.nobody { display: block; width: 100%; aspect-ratio: 1; border-radius: 16%; background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.12)); }
.nobody circle, .nobody path { fill: rgba(255, 255, 255, 0.82); }

.card { width: min(calc(100vw - 48px), 320px); padding: 22px; color: var(--ink); border-radius: 34px; }
.card::backdrop { background: rgba(0, 0, 0, 0.36); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.card[open] { animation: open 0.28s cubic-bezier(0.25, 1.3, 0.5, 1); }
@keyframes open { from { opacity: 0; transform: scale(0.82); } }
.card-lines { display: grid; gap: 10px; margin: 20px 4px 18px; }
.card-lines span { height: 11px; border-radius: 6px; background: rgba(255, 255, 255, 0.3); }
.card-lines span:nth-child(1) { width: 66%; height: 16px; }
.card-lines span:nth-child(2) { width: 88%; }
.card-lines span:nth-child(3) { width: 48%; }
.card-close { display: block; width: 100%; min-height: 46px; color: inherit; font: inherit; font-weight: 600; background: rgba(255, 255, 255, 0.16); border: 1px solid var(--line); border-radius: 23px; cursor: pointer; }

.credit { margin: 28px 0 0; padding: 0 16px max(16px, env(safe-area-inset-bottom)); text-align: center; font-size: 11px; color: var(--dim); }
.credit-pin { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; }

@media (prefers-reduced-motion: reduce) { .space, .card[open] { animation: none; } .app-box { transition: none; } }
