:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #5b6472;
  --line: #d9dee8;
  --paper: #f7f3ec;
  --panel: #ffffff;
  --brand: #0f766e;
  --brand-dark: #0b524d;
  --accent: #b45309;
  --shadow: 0 18px 45px rgba(17, 24, 39, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(135deg, #f7f3ec 0%, #f1f7f4 52%, #eef2f8 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("/static/logo.png");
  background-position: right 6vw bottom 5vh;
  background-repeat: no-repeat;
  background-size: min(520px, 55vw);
  opacity: 0.08;
  pointer-events: none;
}

a {
  color: inherit;
}

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

.hero,
.gallery-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: stretch;
  padding: 32px 0;
}

.hero h1,
.gallery-head h1,
.upload-panel h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.25rem, 7vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.lead {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.create-form,
.event-card,
.qr-card,
.upload-panel {
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.create-form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

button,
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: #fff;
  background: var(--brand);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: var(--brand-dark);
}

.button.secondary {
  color: var(--ink);
  background: #edf3ef;
}

.events-grid,
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.event-card {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.event-card h2 {
  margin: 0;
  font-size: 1.35rem;
}

.event-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.event-card img,
.qr-card img {
  width: min(220px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border: 8px solid #fff;
  border-radius: 8px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-end;
  align-items: center;
  padding: 8px 0 18px;
  color: var(--brand-dark);
  font-weight: 800;
}

.download-link {
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
}

.qr-card {
  display: grid;
  gap: 14px;
  align-content: center;
  padding: 20px;
}

.photo-tile {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.1);
}

.album-page .photo-grid {
  position: relative;
  min-height: 260px;
  isolation: isolate;
}

.album-page .photo-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("/static/logo.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: min(460px, 70vw);
  opacity: 0.07;
  pointer-events: none;
}

.photo-tile img,
.photo-tile video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #111827;
}

.photo-tile span {
  display: block;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.upload-screen {
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(280px, 680px);
  gap: 22px;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  place-items: center;
  padding: 18px;
}

.upload-panel {
  width: min(520px, 100%);
  padding: 26px;
}

.recent-panel {
  width: min(680px, 100%);
}

.recent-panel h2 {
  margin: 0 0 14px;
  font-size: 1.4rem;
}

.drop-zone {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.drop-zone label {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  border: 2px dashed #a7b7ad;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
}

.upload-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 2.4rem;
  line-height: 1;
}

.drop-zone small {
  color: var(--muted);
  font-weight: 600;
}

.status {
  min-height: 28px;
  margin-top: 14px;
  color: var(--brand-dark);
  font-weight: 800;
}

.gallery-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--brand-dark);
  font-weight: 800;
}

.login-screen {
  grid-template-columns: minmax(280px, 520px);
}

.login-panel .create-form {
  margin-top: 24px;
  border: 0;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.login-error {
  margin: 14px 0 0;
  color: #b91c1c;
  font-weight: 800;
}

.photo-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.empty {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding-top: 18px;
  }

  .hero,
  .gallery-head {
    grid-template-columns: 1fr;
    padding: 18px 0;
  }

  .upload-screen {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero h1,
  .gallery-head h1,
  .upload-panel h1 {
    font-size: clamp(2rem, 13vw, 3.5rem);
  }

  .actions {
    grid-template-columns: 1fr;
  }
}
