:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #ececec;
  --accent: #7fa9c7;
  --accent-soft: #e9f1f7;
  --accent-ink: #ffffff;
  --error: #b3261e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 56px 24px 96px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* --- hero --- */

.hero { text-align: center; }

.hero-label {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: slashed-zero;
  font-size: 0.72rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
  padding-left: 0.45em;          /* compensate for last letter's spacing */
}

.hero h1 {
  font-family: "Parisienne", "Cormorant Garamond", cursive;
  font-weight: 400;
  font-style: normal;
  font-size: clamp(3rem, 12vw, 4.6rem);
  line-height: 1.1;
  letter-spacing: 0;
  margin: 0;
  color: var(--ink);
}
.hero h1 .amp {
  padding: 0 0.06em;
  color: var(--accent);
}

.date {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: slashed-zero;
  font-size: 0.95rem;
  letter-spacing: 0.3em;
  color: var(--ink);
  margin: 22px 0 0;
  padding-left: 0.3em;
}

/* --- typography --- */

h2 {
  margin: 0 0 16px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: slashed-zero;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

p { margin: 0; }
.muted { color: var(--muted); font-size: 0.9rem; }
.error { color: var(--error); font-size: 0.9rem; }

/* --- buttons --- */

button, .file-label {
  display: inline-block;
  font: inherit;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.primary:hover { background: #6c97b6; }
.ghost {
  background: transparent;
  color: var(--accent);
  padding: 8px 14px;
  font-size: 0.85rem;
}
.ghost:hover { color: var(--ink); }

/* --- QR block --- */

.qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.qr-block canvas {
  background: #fff;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.share-row {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 360px;
}
.share-row input {
  flex: 1;
  border: none;
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding: 6px 4px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: slashed-zero;
  font-size: 0.78rem;
  color: var(--muted);
  outline: none;
  text-align: center;
}
.share-row input:focus { border-bottom-color: var(--accent); color: var(--ink); }

/* --- upload --- */

.upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.file-label { text-align: center; }
.status {
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.2em;
  text-align: center;
}

.upload-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.upload-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
}
.upload-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
}
.upload-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.upload-size {
  flex-shrink: 0;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: slashed-zero;
}
.upload-progress {
  height: 3px;
  background: var(--accent-soft);
  border-radius: 2px;
  overflow: hidden;
}
.upload-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s linear;
}
.upload-row.done .upload-bar { background: var(--accent); }
.upload-row.failed .upload-bar {
  width: 100% !important;
  background: var(--error);
}
.upload-row.failed .upload-name::after { content: " — zlyhalo"; color: var(--error); }

/* --- gallery --- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 4px;
}
.tile {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--accent-soft);
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}
.tile:hover img { opacity: 0.9; }

video.tile {
  grid-column: 1 / -1;
  aspect-ratio: auto;
  max-width: 100%;
  height: auto;
  max-height: 60vh;
  background: #000;
  object-fit: contain;
}
