:root {
  color-scheme: light;
  --color-signal-blue: #0077ff;
  --color-paper: #ffffff;
  --color-ink: #000000;
  --color-hairline: #e5e7eb;
  --color-smoke: #b8b8b8;
  --color-graphite: #525252;
  --color-ash: #737373;
  --color-crimson: #ef4444;
  --color-ok: #16803c;
  --shadow-subtle: rgba(0, 0, 0, 0.25) 0 0 1px 0;
  --font-intervariable: InterVariable, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--color-paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-intervariable);
  font-feature-settings: "ss01" on, "cv11" on;
  letter-spacing: -0.025em;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  letter-spacing: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.top-pill {
  position: sticky;
  top: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: calc(100% - 32px);
  min-height: 44px;
  margin: 16px auto 0;
  padding: 4px;
  background: var(--color-paper);
  border-radius: 9999px;
  box-shadow: var(--shadow-subtle);
}

.top-pill a,
.top-pill button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: transparent;
  color: var(--color-graphite);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: none;
  cursor: pointer;
}

.top-pill .brand {
  gap: 8px;
  color: var(--color-ink);
  font-weight: 700;
}

.brand-mark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--color-signal-blue);
}

.top-pill button {
  background: var(--color-signal-blue);
  color: var(--color-paper);
  box-shadow: var(--shadow-subtle);
}

.shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 96px;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  width: min(420px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0;
}

.login-card {
  width: 100%;
  padding: 34px 28px;
  background: var(--color-paper);
  border: 1px solid var(--color-hairline);
  border-radius: 16px;
  box-shadow: var(--shadow-subtle);
  text-align: center;
}

.login-card h1 {
  max-width: 340px;
  margin-inline: auto;
  margin-bottom: 12px;
  font-size: clamp(34px, 8vw, 48px);
}

.pin-form {
  display: grid;
  gap: 14px;
  width: min(260px, 100%);
  margin: 28px auto 0;
}

.pin-form .field {
  text-align: left;
}

.pin-form input {
  min-height: 48px;
  text-align: center;
  font-size: 22px;
  letter-spacing: 0.18em;
}

.pin-form button {
  width: 100%;
  min-height: 52px;
}

.login-error {
  margin: 0;
  color: var(--color-crimson);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.hero {
  display: grid;
  place-items: center;
  min-height: 410px;
  padding: 96px 0 64px;
  text-align: center;
}

.hero > div {
  width: min(820px, 100%);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--color-ash);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  color: var(--color-ink);
  font-size: clamp(42px, 7vw, 62px);
  font-weight: 400;
  line-height: 1.16;
}

h2 {
  margin-bottom: 0;
  color: var(--color-ink);
  font-size: 62px;
  font-weight: 400;
  line-height: 1.16;
}

.lead {
  max-width: 540px;
  margin: 0 auto;
  color: var(--color-graphite);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.lead a {
  color: var(--color-signal-blue);
  font-weight: 600;
}

.panel {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--color-paper);
  border: 1px solid var(--color-hairline);
  border-radius: 16px;
  box-shadow: var(--shadow-subtle);
}

#accessPanel {
  display: none;
}

.uploader {
  margin-bottom: 128px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--color-ink);
  font-size: 14px;
  font-weight: 500;
}

.field input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--color-hairline);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--color-paper);
  color: var(--color-ink);
  font-size: 14px;
  font-weight: 400;
}

.field input:focus {
  border-color: var(--color-ink);
  outline: none;
}

.hint {
  margin: 8px 0 0;
  color: var(--color-ash);
  font-size: 12px;
  line-height: 1.5;
}

code {
  padding: 2px 4px;
  background: transparent;
  border: 1px solid var(--color-hairline);
  border-radius: 8px;
  color: var(--color-graphite);
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 238px;
  padding: 32px;
  border: 1px dashed var(--color-hairline);
  border-radius: 16px;
  background: var(--color-paper);
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms ease;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--color-smoke);
}

.dropzone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-hairline);
  border-radius: 16px;
  color: var(--color-signal-blue);
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

.drop-title {
  color: var(--color-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.drop-subtitle,
.file-meta,
.file-status,
.media-meta span {
  color: var(--color-ash);
  font-size: 12px;
  line-height: 1.5;
}

.upload-note {
  margin: 12px 0 0;
  padding: 12px;
  background: var(--color-paper);
  border: 1px solid var(--color-hairline);
  border-radius: 8px;
  color: var(--color-graphite);
}

.actions,
.gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.actions {
  margin-top: 12px;
  justify-content: center;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  background: var(--color-signal-blue);
  color: var(--color-paper);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
}

button[hidden] {
  display: none !important;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

#uploadButton:disabled {
  background: transparent;
  border: 1px solid var(--color-hairline);
  color: var(--color-graphite);
  box-shadow: none;
  opacity: 1;
}

button.secondary,
.disk-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  background: var(--color-paper);
  border: 1px solid var(--color-hairline);
  color: var(--color-graphite);
}

.disk-link {
  background: var(--color-signal-blue);
  border-color: var(--color-signal-blue);
  color: var(--color-paper);
  box-shadow: var(--shadow-subtle);
}

.queue {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 119, 255, 0.5) transparent;
}

.queue::-webkit-scrollbar {
  width: 8px;
}

.queue::-webkit-scrollbar-thumb {
  background: rgba(0, 119, 255, 0.5);
  border-radius: 999px;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 240px) minmax(112px, max-content);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--color-hairline);
  border-radius: 16px;
  background: var(--color-paper);
}

.queue-item strong,
.media-meta strong {
  display: block;
  color: var(--color-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.43;
  overflow-wrap: anywhere;
}

.queue-item progress {
  width: 100%;
  height: 8px;
  accent-color: var(--color-signal-blue);
}

.queue-item.done .file-status {
  color: var(--color-ok);
  font-weight: 600;
}

.queue-item.failed .file-status {
  color: var(--color-crimson);
  font-weight: 600;
}

.gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 32px;
  padding-top: 96px;
  border-top: 1px solid var(--color-hairline);
}

.gallery-head h2 {
  margin: 0;
}

.gallery-copy {
  display: grid;
  gap: 10px;
}

.filters {
  display: flex;
  gap: 18px;
}

.filter {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-ash);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: none;
  cursor: pointer;
}

.filter.active {
  color: var(--color-signal-blue);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 24px;
}

.gallery-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.page-button {
  min-width: 46px;
  background: var(--color-paper);
  border: 1px solid var(--color-hairline);
  color: var(--color-graphite);
  box-shadow: none;
}

.page-button.active {
  background: var(--color-signal-blue);
  border-color: var(--color-signal-blue);
  color: var(--color-paper);
}

.page-dots {
  color: var(--color-ash);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  padding: 0 4px;
}

.scroll-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 54px;
  height: 54px;
  min-height: 54px;
  padding: 0;
  border-radius: 999px;
  background: var(--color-signal-blue);
  color: var(--color-paper);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.media-card {
  overflow: hidden;
  background: var(--color-paper);
  border: 1px solid var(--color-hairline);
  border-radius: 16px;
  box-shadow: var(--shadow-subtle);
}

.media-card a {
  display: block;
  aspect-ratio: 1 / 1;
  margin: 13px;
  overflow: hidden;
  background: #fafafa;
  border: 1px solid var(--color-hairline);
  border-radius: 16px;
}

.media-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.video-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 16px;
  background: var(--color-ink);
  color: var(--color-paper);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

.video-thumb span {
  display: block;
}

.preview-missing {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 16px;
  background: #fafafa;
  color: var(--color-graphite);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

.preview-missing span {
  display: block;
}

.media-meta {
  padding: 0 16px 16px;
}

.empty {
  margin: 0;
  padding: 16px;
  color: var(--color-graphite);
  background: var(--color-paper);
  border: 1px solid var(--color-hairline);
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.43;
}

.error {
  color: var(--color-crimson);
}

.top-pill {
  display: none !important;
}

.eyebrow {
  color: var(--color-ink);
  font-size: 18px;
  font-weight: 400;
  text-transform: none;
}

.dropzone {
  background: rgba(0, 119, 255, 0.15) !important;
  border-color: rgba(0, 119, 255, 0.35) !important;
}

.dropzone:hover,
.dropzone.dragging {
  background: rgba(0, 119, 255, 0.15) !important;
  border-color: var(--color-signal-blue) !important;
}

.upload-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  margin-top: 16px !important;
  padding: 14px 18px !important;
  border: 2px solid #c22f45 !important;
  background: #fff8f0 !important;
  color: #c22f45 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  text-align: center;
}

.upload-note::before {
  content: "!";
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #c22f45;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 32px;
  background: rgba(0, 0, 0, 0.82);
}

.lightbox.open {
  display: grid;
}

.lightbox img,
.lightbox video {
  max-width: min(1120px, 96vw);
  max-height: 88vh;
  display: block;
  object-fit: contain;
  border-radius: 16px;
  background: var(--color-paper);
  box-shadow: rgba(0, 0, 0, 0.25) 0 25px 50px -12px;
}

.lightbox video {
  width: min(1120px, 96vw);
  background: #000000;
}

.lightbox img[hidden],
.lightbox video[hidden] {
  display: none;
}

.video-fallback {
  width: min(620px, 92vw);
  padding: 28px;
  border-radius: 16px;
  background: var(--color-paper);
  color: var(--color-ink);
  text-align: center;
  box-shadow: rgba(0, 0, 0, 0.25) 0 25px 50px -12px;
}

.video-fallback[hidden] {
  display: none;
}

.video-fallback strong,
.video-fallback span {
  display: block;
}

.video-fallback strong {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.25;
}

.video-fallback span {
  color: var(--color-graphite);
  font-size: 14px;
  line-height: 1.5;
}

.video-fallback a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 18px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--color-signal-blue);
  color: var(--color-paper);
  font-size: 15px;
  font-weight: 600;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  border-radius: 999px;
  background: var(--color-paper);
  color: var(--color-ink);
  font-size: 28px;
  line-height: 1;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  width: 56px;
  height: 64px;
  min-height: 64px;
  padding: 0;
  border-radius: 999px;
  background: var(--color-paper);
  color: var(--color-ink);
  font-size: 38px;
  line-height: 1;
  transform: translateY(-50%);
}

.lightbox-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.lightbox-prev {
  left: 18px;
}

.lightbox-next {
  right: 18px;
}

.lightbox-count {
  position: fixed;
  left: 50%;
  bottom: 18px;
  min-width: 64px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--color-paper);
  color: var(--color-graphite);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: var(--shadow-subtle);
}

.lightbox-download {
  position: fixed;
  left: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--color-signal-blue);
  color: var(--color-paper);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: var(--shadow-subtle);
}

@media (max-width: 720px) {
  .top-pill {
    width: calc(100% - 24px);
    justify-content: space-between;
    overflow-x: auto;
  }

  .shell {
    width: min(100% - 24px, 1200px);
    padding-bottom: 64px;
  }

  .hero {
    min-height: 360px;
    padding: 72px 0 48px;
  }

  h1,
  h2 {
    font-size: 42px;
  }

  .uploader {
    margin-bottom: 96px;
  }

  .dropzone {
    min-height: 220px;
    padding: 24px;
  }

  .queue-item {
    grid-template-columns: 1fr;
  }

  .actions button {
    flex: 1;
  }

  .gallery-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    padding-top: 64px;
  }

  .disk-link {
    width: 100%;
  }

  .filters {
    flex-wrap: wrap;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .media-card a {
    margin: 8px;
  }

  .lightbox {
    padding: 18px;
  }

  .lightbox img {
    max-width: 100%;
    max-height: 78vh;
  }

  .lightbox-nav {
    top: auto;
    bottom: 18px;
    width: 44px;
    height: 44px;
    min-height: 44px;
    font-size: 32px;
    transform: none;
  }

  .lightbox-prev {
    left: 18px;
  }

  .lightbox-next {
    right: 18px;
  }

  .lightbox-download {
    left: 50%;
    bottom: 72px;
    transform: translateX(-50%);
  }

  .scroll-top {
    right: 14px;
    bottom: 14px;
    width: 48px;
    height: 48px;
    min-height: 48px;
    font-size: 22px;
  }
}
