/* Demo app. Apple-style: light canvas, white cards, system font, quiet depth. */
:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --hairline: rgba(0, 0, 0, 0.08);
  --chip: #f2f2f7;
  --nav: rgba(251, 251, 253, 0.78);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 28px rgba(0, 0, 0, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --accent: #0a84ff;
  color-scheme: light dark;
}
/* Per-app accent (kept in CSS so the strict Content-Security-Policy needs no inline styles). */
body.app-checkin { --accent: #0a84ff; }
body.app-records { --accent: #bf5af2; }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000; --card: #1c1c1e; --fg: #f5f5f7; --muted: #a1a1a6;
    --hairline: rgba(255, 255, 255, 0.1); --chip: #2c2c2e; --nav: rgba(22, 22, 23, 0.78);
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); -webkit-font-smoothing: antialiased; letter-spacing: -0.012em; }
a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 10px; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 5; background: var(--nav); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--hairline); padding-top: env(safe-area-inset-top); }
.nav__inner { max-width: 980px; margin: 0 auto; height: 56px; padding: 0 22px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.nav__brand { grid-column: 2; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.nav__home { grid-column: 1; display: inline-flex; align-items: center; gap: 2px; font-size: 17px; }
.nav__home svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nav__user { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 12px; }
.nav__signout { font-size: 15px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: #fff; background: linear-gradient(160deg, #5e5ce6, #0a84ff); }

/* App icon */
.app-icon { display: inline-grid; place-items: center; border-radius: 22%; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent)); box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.25); }
.app-icon svg { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; width: 58%; height: 58%; }
.app-icon--sm { width: 28px; height: 28px; }
.app-icon--lg { width: 96px; height: 96px; box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 35%, transparent); }
.app-icon--muted { filter: grayscale(1); opacity: 0.6; box-shadow: none; }

/* Layout */
.main { max-width: 980px; margin: 0 auto; padding: 44px 22px 80px; }
.stack { display: grid; gap: 22px; max-width: 640px; margin: 0 auto; animation: rise 0.6s var(--ease) both; }
.page-head h1 { font-size: clamp(34px, 5vw, 48px); line-height: 1.08; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.025em; }
.muted { color: var(--muted); font-size: 17px; line-height: 1.47; margin: 0; }
.center { min-height: 62vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; max-width: 460px; margin: 0 auto; animation: rise 0.6s var(--ease) both; }
.center h1 { font-size: 34px; margin: 14px 0 0; letter-spacing: -0.02em; }
.fineprint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Cards */
.card { background: var(--card); border-radius: 22px; padding: 26px; box-shadow: var(--shadow); }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.card__title { font-size: 21px; font-weight: 600; margin: 0; letter-spacing: -0.015em; }
.card--info .card__title { margin-bottom: 8px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 0; }
.pill { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); white-space: nowrap; }

.facts { margin: 0; display: grid; }
.facts > div { display: grid; grid-template-columns: 140px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--hairline); }
.facts > div:first-child { border-top: 0; }
.facts dt { color: var(--muted); font-size: 15px; }
.facts dd { margin: 0; font-size: 15px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--chip); font-weight: 500; }
.chip--on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }

/* Hello (Check-in) */
.hello {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: 32px; padding: 64px 32px 48px; text-align: center; color: #fff;
  background: #0b0b14;
  box-shadow: 0 30px 80px rgba(36, 24, 96, 0.35);
}
.hello__aurora { position: absolute; inset: -30%; z-index: -1; filter: blur(60px) saturate(140%); }
.hello__aurora span { position: absolute; width: 60%; height: 60%; border-radius: 50%; opacity: 0.85; mix-blend-mode: screen; animation: drift 18s ease-in-out infinite alternate; }
.hello__aurora span:nth-child(1) { background: #5e5ce6; left: 0; top: 5%; }
.hello__aurora span:nth-child(2) { background: #0a84ff; right: 0; top: 0; animation-duration: 22s; animation-delay: -6s; }
.hello__aurora span:nth-child(3) { background: #ff375f; left: 25%; bottom: 0; animation-duration: 26s; animation-delay: -12s; opacity: 0.6; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12%, 8%) scale(1.15); }
  100% { transform: translate(-10%, -6%) scale(0.95); }
}
.hello::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 80% at 50% 0%, transparent 40%, rgba(5, 5, 12, 0.55)); }
.hello__inner { position: relative; display: grid; justify-items: center; gap: 14px; }
.hello__when { margin: 0; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; letter-spacing: 0.02em; color: rgba(255, 255, 255, 0.72); font-variant-numeric: tabular-nums; }
.hello__dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.hello__title { margin: 6px 0 0; font-size: clamp(44px, 9vw, 76px); line-height: 1.02; letter-spacing: -0.045em; font-weight: 700; }
.hello__name {
  background: linear-gradient(100deg, #fff 0%, #c7c2ff 30%, #7fd4ff 55%, #ffb3c7 80%, #fff 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }
.hello__sub { margin: 0; max-width: 30em; font-size: 18px; line-height: 1.5; color: rgba(255, 255, 255, 0.8); }
.hello__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.hello__chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: #fff;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.hello__live { width: 8px; height: 8px; border-radius: 50%; background: #30d158; box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.6); animation: live 2s ease-out infinite; }
@keyframes live { to { box-shadow: 0 0 0 10px rgba(48, 209, 88, 0); } }
@media (prefers-reduced-motion: reduce) {
  .hello__aurora span, .hello__name, .hello__live { animation: none; }
}

/* Records */
.records { list-style: none; margin: 6px 0 0; padding: 0; }
.records li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--hairline); font-size: 15px; }
.records li:first-child { border-top: 0; }
.records__k { color: var(--muted); }
.records__v { font-weight: 500; text-align: right; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 13px 22px; border-radius: 980px; font-size: 17px; font-weight: 500; border: 0; cursor: pointer; font-family: inherit; transition: transform 0.15s var(--ease), opacity 0.15s; }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--secondary { background: var(--chip); color: var(--fg); }
.btn--plain { background: none; color: var(--accent); }
.btn--wide { min-width: 240px; margin-top: 10px; }

/* Sign-in options (landing page) */
.signin { display: grid; gap: 10px; width: min(100%, 320px); margin-top: 14px; }
.btn--signin { justify-content: flex-start; gap: 12px; padding: 12px 18px; background: var(--card); color: var(--fg); box-shadow: inset 0 0 0 1px var(--hairline), var(--shadow); }
.btn--signin svg { width: 20px; height: 20px; flex: none; }
.signin__stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn--signin span { flex: 1; text-align: center; margin-right: 32px; }
.note { display: inline-block; margin: 10px 0 0; font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; word-break: break-all; }

/* Idle warning */
.idle { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, 0.32); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); animation: fade 0.3s both; }
.idle__card { width: min(100%, 380px); background: var(--card); border-radius: 24px; padding: 30px 26px 18px; text-align: center; display: grid; gap: 10px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25); animation: rise 0.4s var(--ease) both; }
.idle__card h2 { margin: 0; font-size: 22px; }
.idle__card p { margin: 0 0 8px; color: var(--muted); line-height: 1.45; }
@keyframes fade { from { opacity: 0; } }

@media (max-width: 560px) {
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .main { padding-top: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
