:root {
  color-scheme: dark;
  --bg: #0c0e13;
  --raise: #171a22;
  --raise-2: #212633;
  --line: rgba(246, 242, 234, 0.1);
  --text: #f6f2ea;
  --muted: #b1aaa0;
  --faint: #7d776f;
  --accent: #ff6b3d;
  --ink: #2a1008;
  --mint: #9cf0cc;
  --danger: #ffb4a8;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --font: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(900px 480px at 100% -10%, rgba(255, 107, 61, 0.18), transparent 55%),
    radial-gradient(720px 420px at -10% 0%, rgba(110, 90, 255, 0.16), transparent 50%),
    var(--bg);
}

h1, h2, p { margin: 0; }

h1 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

h2 { font-size: 1.15rem; letter-spacing: -0.03em; }

a { color: var(--accent); }

img, video { max-width: 100%; }

.topbar, .page {
  width: min(1080px, calc(100% - 32px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: calc(18px + env(safe-area-inset-top)) 0 8px;
}

.page { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }

.brand {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.06em;
  font-size: 1.4rem;
  text-decoration: none;
}

.nav { display: flex; gap: 4px; }

.nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
}

.nav-link.is-on {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.account span {
  color: var(--muted);
  font-size: 0.92rem;
}

.kid-pill {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--raise);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
}

.page-head, .section-head, .actions, .copy-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.page-head { margin: 18px 0 20px; }

.section-head { margin: 28px 0 12px; }

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lede, .fine, .album-meta { color: var(--muted); }

.fine { font-size: 0.88rem; }

.card {
  background: color-mix(in srgb, var(--raise) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.narrow { max-width: 520px; }

.auth {
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 32px 16px;
}

.auth .card { width: min(440px, 100%); }

.fields, .stack { display: grid; gap: 14px; }

label, .fields { margin-top: 0; }

form.fields { margin-top: 16px; }

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

input:not([type="checkbox"]):not([type="submit"]):not([type="button"]),
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--raise-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  margin-right: 12px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 8px;
  margin: 0;
}

legend { color: var(--muted); padding: 0 6px; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.button, .button-tiny {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  line-height: 1;
}

.button {
  background: var(--accent);
  color: var(--ink);
  border: 0;
  padding: 12px 16px;
}

.button-quiet {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.button-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(255, 180, 168, 0.35);
}

.button-tiny {
  background: rgba(12, 14, 19, 0.78);
  color: white;
  border: 0;
  padding: 6px 8px;
  font-size: 0.75rem;
}

form.button_to { margin: 0; }

form.fields .button, .join-card .button, .editor-cancel { width: 100%; }

.editor-cancel { margin-top: 10px; }

.join-card { width: min(560px, 100%); margin-inline: auto; }

.banner {
  background: rgba(156, 240, 204, 0.12);
  color: var(--mint);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.banner-alert {
  background: rgba(255, 107, 61, 0.14);
  color: #ffd0c4;
}

.albums, .people, .roll {
  display: grid;
  gap: 14px;
}

.albums, .people { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.album, .person-card, .tile-open { color: inherit; text-decoration: none; }

.album { display: grid; gap: 8px; }

.album-cover, .tile-open, .file-fallback, .tile-mark {
  display: grid;
  place-items: center;
}

.album-cover {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: hsl(var(--hue) 42% 24%);
  color: hsl(var(--hue) 90% 78%);
  font-size: 2rem;
  font-weight: 700;
  transition: transform 160ms ease;
}

.album:hover .album-cover { transform: translateY(-3px); }

.album-cover img, .tile-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-name, .person-card strong { display: block; font-weight: 600; }

.person-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--raise);
}

.avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: hsl(var(--hue) 45% 28%);
  color: hsl(var(--hue) 90% 80%);
  font-weight: 700;
}

.roll { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }

.tile { position: relative; }

.tile-open {
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: var(--raise);
  border: 1px solid var(--line);
}

.tile-mark { font-weight: 700; letter-spacing: 0.04em; }

.tile-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 8px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile form.button_to { position: absolute; top: 8px; right: 8px; z-index: 2; }

.play {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.play::before {
  content: "";
  border-style: solid;
  border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent white;
  margin-left: 3px;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
}

.chips a {
  flex: none;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
}

.chips a.is-on {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.stage { margin: 0 0 16px; }

.stage img, .stage video, .pdf, .file-fallback {
  width: 100%;
  background: #07080c;
  border-radius: 18px;
}

.stage img, .stage video { max-height: 78dvh; object-fit: contain; }

.pdf { min-height: 70dvh; border: 0; }

.file-fallback {
  min-height: 240px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 700;
}

.actions { margin-top: 8px; }

.hint, .invite { margin: 8px 0 16px; }

.hint {
  border: 1px solid var(--line);
  background: rgba(255, 107, 61, 0.08);
  border-radius: 16px;
  padding: 12px 14px;
}

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }

.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.is-revoked { opacity: 0.55; }

.danger-zone { margin-top: 36px; }

.steps { color: var(--muted); display: grid; gap: 6px; margin: 16px 0 0; padding-left: 1.2rem; }

.copy-row input { flex: 1; }

.direct-upload {
  display: inline-block;
  position: relative;
  margin-top: 8px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.direct-upload__progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(255, 107, 61, 0.35);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .account { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .album-cover { transition: none; }
  .album:hover .album-cover { transform: none; }
}
