:root {
  --ink: #17181f;
  --muted: #626777;
  --paper: #fffaf3;
  --panel: #ffffff;
  --red: #d71920;
  --green: #007a3d;
  --black: #111111;
  --gold: #f2b84b;
  --blue: #165d9c;
  --line: rgba(23, 24, 31, 0.12);
  --shadow: 0 18px 60px rgba(17, 17, 17, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(215, 25, 32, 0.08), transparent 28%),
    linear-gradient(225deg, rgba(0, 122, 61, 0.09), transparent 34%),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
a {
  font: inherit;
}

a {
  color: inherit;
}

.site-header {
  color: #fff;
  background:
    radial-gradient(circle at 18% 18%, rgba(242, 184, 75, 0.35), transparent 24%),
    linear-gradient(110deg, rgba(17, 17, 17, 0.9), rgba(22, 93, 156, 0.7)),
    linear-gradient(135deg, var(--red), var(--green));
  min-height: 520px;
  position: relative;
  overflow: hidden;
}

.site-header::after,
.auth-body::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 360px;
  height: 360px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 49%, rgba(255, 255, 255, 0.16) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(255, 255, 255, 0.16) 50%, transparent 51%);
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  max-width: 1180px;
  padding: 22px;
  position: relative;
  z-index: 1;
}

.site-name {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  padding: 10px 14px;
  text-decoration: none;
}

.top-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.hero {
  margin: 0 auto;
  max-width: 1180px;
  padding: 70px 22px 110px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.2rem, 7vw, 5.9rem);
  line-height: 0.96;
  margin: 12px 0 22px;
  max-width: 950px;
}

.hero p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 650px;
}

.hero-kicker,
.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.scoreline {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.scoreline span,
.scoreline strong {
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 12px 18px;
}

main {
  margin: -54px auto 80px;
  max-width: 1180px;
  padding: 0 22px;
  position: relative;
  z-index: 2;
}

.highlights,
.toolbar,
.upload-section,
.gallery-section {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  padding: 24px;
}

.highlights {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: 0.85fr 1.15fr;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1.05;
  margin: 0;
}

.stats-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, 1fr);
}

.stats-grid article {
  background: #f8f4ed;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.stats-grid strong {
  display: block;
  font-size: 2rem;
}

.stats-grid span,
.muted,
.card-body p {
  color: var(--muted);
}

.toolbar,
.section-heading {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab,
.ghost-btn,
.icon-btn,
.download-all,
.download-btn,
.upload-form button,
.auth-form button {
  align-items: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.tab,
.ghost-btn,
.icon-btn {
  background: #f1ece3;
  color: var(--ink);
}

.tab.active,
.download-all,
.download-btn,
.upload-form button,
.auth-form button {
  background: var(--ink);
  color: #fff;
}

.download-btn {
  border-radius: 6px;
  margin: 0 14px 14px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
}

.card-actions .download-btn {
  margin: 0;
}

.preview-action {
  background: #f1ece3;
  color: var(--ink);
}

.download-all {
  background: var(--gold);
  color: var(--ink);
}

button:hover,
.download-all:hover,
.download-btn:hover {
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.16);
  transform: translateY(-1px);
}

.search-box {
  align-items: center;
  background: #f8f4ed;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  gap: 10px;
  min-width: min(100%, 330px);
  padding: 8px 14px;
}

.search-box span {
  color: var(--muted);
  font-weight: 800;
}

.search-box input,
.auth-form input {
  background: transparent;
  border: 0;
  color: var(--ink);
  min-width: 0;
  outline: 0;
  width: 100%;
}

.upload-section {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr auto;
}

.upload-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.upload-form input::file-selector-button {
  background: #f1ece3;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  margin-right: 12px;
  padding: 10px 14px;
}

progress {
  grid-column: 1 / -1;
  width: 100%;
}

.form-message {
  color: var(--muted);
  grid-column: 1 / -1;
  margin: 0;
}

.gallery-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  margin-top: 22px;
}

.media-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(17, 17, 17, 0.08);
  overflow: hidden;
  position: relative;
}

.preview-btn {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, rgba(215, 25, 32, 0.2), rgba(0, 122, 61, 0.2)), #e9e2d8;
  border: 0;
  cursor: zoom-in;
  display: block;
  padding: 0;
  width: 100%;
}

.preview-btn img,
.preview-btn video {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.video .preview-btn {
  cursor: default;
}

.media-badge {
  background: rgba(17, 17, 17, 0.82);
  border-radius: 999px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  left: 12px;
  padding: 6px 9px;
  position: absolute;
  text-transform: uppercase;
  top: 12px;
}

.card-body {
  padding: 14px;
}

.card-body h3 {
  font-size: 0.98rem;
  line-height: 1.3;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.card-body p {
  font-size: 0.87rem;
  line-height: 1.45;
  margin: 0;
}

.empty-state {
  background: #f8f4ed;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  margin-top: 22px;
  padding: 40px 20px;
  text-align: center;
}

.lightbox {
  background: rgba(17, 17, 17, 0.92);
  border: 0;
  border-radius: 8px;
  color: #fff;
  max-height: 92vh;
  max-width: 92vw;
  padding: 18px;
}

.lightbox #lightboxContent {
  display: grid;
  justify-items: center;
  min-width: min(88vw, 980px);
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.lightbox-stage {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(70px, 11vw) minmax(0, 1fr) minmax(70px, 11vw);
  justify-items: center;
  width: 100%;
}

.lightbox img,
.lightbox video {
  display: block;
  grid-column: 2;
  max-height: 74vh;
  max-width: 100%;
  object-fit: contain;
}

.lightbox-nav {
  align-items: center;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  display: flex;
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  min-height: min(74vh, 420px);
  min-width: 0;
  padding: 0;
  text-indent: -0.08em;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
  width: 100%;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  transform: scale(1.02);
}

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

.lightbox-prev {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.02));
  border-radius: 8px 0 0 8px;
  grid-column: 1;
}

.lightbox-next {
  background: linear-gradient(270deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.02));
  border-radius: 0 8px 8px 0;
  grid-column: 3;
  text-indent: 0.08em;
}

.lightbox-title {
  overflow-wrap: anywhere;
}

.close-btn {
  background: #fff;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  margin-bottom: 12px;
  padding: 9px 13px;
}

.auth-body {
  align-items: center;
  background:
    linear-gradient(120deg, rgba(17, 17, 17, 0.66), rgba(22, 93, 156, 0.44)),
    linear-gradient(135deg, var(--red), var(--green));
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.auth-shell {
  margin: 0 auto;
  max-width: 560px;
  padding: 22px;
  width: 100%;
}

.auth-panel {
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(26px, 6vw, 52px);
}

.brand-mark {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}

.brand-mark span {
  background: var(--ink);
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
  padding: 10px 14px;
}

.brand-mark i {
  background: var(--gold);
  border-radius: 50%;
  height: 18px;
  width: 18px;
}

.auth-panel h1 {
  font-size: clamp(2.2rem, 9vw, 4.7rem);
  line-height: 0.95;
  margin: 0 0 18px;
}

.auth-copy {
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.auth-form input {
  background: #f8f4ed;
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 48px;
  padding: 0 16px;
}

@media (max-width: 780px) {
  .topbar,
  .toolbar,
  .section-heading,
  .upload-section,
  .highlights {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .topbar,
  .toolbar,
  .section-heading {
    flex-direction: column;
  }

  .top-actions,
  .upload-form {
    justify-content: flex-start;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .auth-form {
    flex-direction: column;
  }

  .lightbox {
    max-width: 96vw;
    padding: 14px;
  }

  .lightbox #lightboxContent {
    min-width: 0;
    width: 100%;
  }

  .lightbox-stage {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
  }

  .lightbox-nav {
    font-size: 3.5rem;
    min-height: min(62vh, 360px);
  }
}
