:root {
  --bone: #f3eee6;
  --bone-2: #ebe4d9;
  --ink: #1c1815;
  --ink-2: #3a312c;
  --fog: #8a857d;
  --fog-2: #b5b0a8;
  --amber: #a8703a;
  --amber-2: #c98a4a;
  --line: rgba(28, 24, 21, 0.12);
  --danger: #a04040;
}

*,
*::before,
*::after {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  padding: 0
}

html {
  -webkit-text-size-adjust: 100%
}

body {
  font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bone);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.locked {
  overflow: hidden
}

img {
  display: block;
  max-width: 100%;
  height: auto
}

button {
  font-family: inherit
}

/* ---- Top bar ---- */
.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.bar.scrolled {
  background: rgba(243, 238, 230, 0.85);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}

.bar__mark {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-style: italic;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variation-settings: "SOFT" 60, "opsz" 36;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0);
  transition: text-shadow 0.3s ease, color 0.3s ease;
  text-decoration: none;
}

.bar.over-hero .bar__mark,
.bar.over-hero .bar__share {
  color: #f5efe6
}

.bar.over-hero .bar__mark {
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4)
}

.bar__share {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 1px solid currentColor;
  color: var(--ink);
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  display: inline-block;
}

.bar__share:hover {
  background: var(--ink);
  color: var(--bone);
  border-color: var(--ink)
}

.bar.over-hero .bar__share {
  border-color: rgba(245, 239, 230, 0.7)
}

.bar.over-hero .bar__share:hover {
  background: #f5efe6;
  color: var(--ink);
  border-color: #f5efe6
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 20px 48px;
  color: #f5efe6;
  overflow: hidden;
  isolation: isolate;
}

.hero__picture {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: block;
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(20, 16, 12, 0.45) 0%, rgba(20, 16, 12, 0) 18%),
    linear-gradient(180deg, rgba(20, 16, 12, 0) 45%, rgba(20, 16, 12, 0.55) 80%, rgba(20, 16, 12, 0.85) 100%);
}

.hero__name {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(76px, 24vw, 168px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin: 0 0 8px;
  font-variation-settings: "SOFT" 100, "opsz" 144;
}

.hero__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0;
}

.hero__play {
  -webkit-appearance: none;
  appearance: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(243, 238, 230, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(245, 239, 230, 0.3);
  color: #f5efe6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
  flex-shrink: 0;
}

.hero__play:hover {
  background: rgba(243, 238, 230, 0.22);
}

.hero__play:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.hero__dates {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.18em;
  opacity: 0.85;
}

.hero__dates span {
  margin: 0 10px;
  opacity: 0.55
}

/* ---- Wall ---- */
.wall {
  padding: 24px 20px 64px
}

.wall__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

.wall__head h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-style: italic;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0;
  font-variation-settings: "SOFT" 80;
}

.wall__count {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fog);
}

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

.tile {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bone-2);
  aspect-ratio: 1/1.15;
  cursor: pointer;
}

.tile img,
.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.tile:hover img,
.tile:hover video {
  transform: scale(1.04)
}

.tile__caption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  right: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #f5efe6;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.tile__caption b {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  display: block;
  font-size: 9.5px;
  opacity: 0.85;
  margin-bottom: 2px;
}

.tile.video::after {
  content: "▶";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 2px;
  pointer-events: none;
}

.tile__delete {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(20, 16, 12, 0.7);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

body.is-admin .tile__delete {
  display: flex
}

.tile__delete:hover {
  background: var(--danger)
}

/* ---- Text note tile ---- */
.tile.note {
  background: var(--ink);
  padding: 20px 16px 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile__note-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.tile__note-text {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(18px, 3.5vw, 26px);
  line-height: 1.35;
  color: var(--bone);
  letter-spacing: -0.01em;
  margin: 0;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  font-variation-settings: "SOFT" 60;
}

.tile__note-who {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 239, 230, 0.35);
}

/* ---- Empty / loading ---- */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--fog);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.empty__line {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  text-transform: none;
}

/* ---- Footer ---- */
footer {
  padding: 32px 20px 40px;
  text-align: center;
  border-top: 1px solid var(--line);
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--fog);
  text-transform: uppercase;
}

footer p {
  margin: 6px 0
}

/* ---- Modal (shared by upload + password) ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(20, 16, 12, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
  animation: fade 0.25s ease
}

@keyframes fade {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

.modal__panel {
  width: 100%;
  max-width: 520px;
  background: var(--bone);
  border-radius: 14px 14px 0 0;
  padding: 28px 22px 32px;
  max-height: 92svh;
  overflow-y: auto;
  animation: slideup 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideup {
  from {
    transform: translateY(20px)
  }

  to {
    transform: translateY(0)
  }
}

.modal__handle {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: var(--fog-2);
  margin: 0 auto 18px;
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.modal__head h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-style: italic;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  font-variation-settings: "SOFT" 80;
}

.modal__head p {
  font-size: 13px;
  color: var(--fog);
  margin: 0;
  line-height: 1.5;
}

.modal__close {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bone-2);
  border: none;
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.field {
  margin-bottom: 14px
}

.field label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fog);
  margin-bottom: 6px;
}

.field input[type=text],
.field input[type=password],
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--ink);
  border-radius: 3px;
  outline: none;
  transition: border-color 0.2s ease;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--ink)
}

.field textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5
}

.drop {
  border: 1.5px dashed var(--fog-2);
  border-radius: 4px;
  padding: 28px 18px;
  text-align: center;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drop:hover {
  border-color: var(--ink)
}

.drop.has-file {
  border-style: solid;
  border-color: var(--ink);
  background: var(--bone-2)
}

.drop__icon {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 36px;
  color: var(--amber);
  line-height: 1;
  margin-bottom: 8px;
}

.drop__main {
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 4px;
  word-break: break-all
}

.drop__sub {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--fog);
  text-transform: uppercase;
}

.submit {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  width: 100%;
  padding: 16px;
  background: var(--ink);
  color: var(--bone);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 6px;
}

.submit:hover {
  background: var(--amber)
}

.submit:disabled {
  opacity: 0.5;
  cursor: not-allowed
}

/* progress bar inside the submit area */
.progress {
  height: 4px;
  background: var(--bone-2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 12px;
  display: none;
}

.progress.active {
  display: block
}

.progress__bar {
  height: 100%;
  background: var(--amber);
  width: 0%;
  transition: width 0.2s ease
}

/* ---- Slideshow overlay ---- */
.slideshow {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0a0807;
  display: none;
  align-items: center;
  justify-content: center;
}

.slideshow.active {
  display: flex
}

.slideshow__media {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.slideshow__media.show {
  opacity: 1
}

.slideshow__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0 20px;
}

.slideshow__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  z-index: 2;
}

.slideshow__progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.slideshow__progress span {
  display: block;
  height: 100%;
  background: var(--amber-2);
  width: 0%;
  transition: width 0.05s linear;
}

/* ---- Slideshow note (text-only memory) ---- */
.slideshow__note {
  max-width: 640px;
  padding: 40px 32px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(26px, 5vw, 52px);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--bone);
  text-align: center;
  font-variation-settings: "SOFT" 80;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.slideshow__note.show {
  opacity: 1;
}

/* ---- Cheese tax gate ---- */
.cheese-gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 16, 12, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.6s ease;
}

.cheese-gate.out {
  opacity: 0;
  pointer-events: none;
}

.cheese-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 24px 40px;
  max-width: 340px;
  animation: slideup 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cheese-bubble {
  background: var(--bone);
  color: var(--ink);
  border-radius: 20px;
  padding: 14px 22px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(18px, 5vw, 23px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 80;
  position: relative;
  max-width: 280px;
  transition: opacity 0.25s ease;
}

.cheese-bubble::after {
  content: "";
  position: absolute;
  bottom: -13px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 13px solid var(--bone);
}

.cheese-sticker {
  width: clamp(200px, 62vw, 300px);
  height: auto;
  margin-top: -4px;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.5));
  transition: opacity 0.3s ease;
}

.cheese-btn {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: var(--amber);
  color: var(--bone);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 16px 32px;
  border-radius: 999px;
  cursor: pointer;
  margin-top: 20px;
  transition: background 0.2s ease, transform 0.15s ease;
}

.cheese-btn:hover {
  background: var(--amber-2);
  transform: scale(1.05);
}

.cheese-btn:active {
  transform: scale(0.96);
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--bone);
  padding: 14px 22px;
  border-radius: 999px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0)
}

.toast.error {
  background: var(--danger)
}

/* ---- Admin page additions ---- */
.admin-bar {
  background: var(--ink);
  color: var(--bone);
  padding: 80px 20px 28px;
}

.admin-bar h1 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-style: italic;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--bone);
  font-variation-settings: "SOFT" 80;
}

.admin-bar p {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 239, 230, 0.55);
  margin: 0 0 22px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px
}

.admin-btn {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(245, 239, 230, 0.3);
  background: transparent;
  color: var(--bone);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 11px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-btn:hover {
  background: var(--bone);
  color: var(--ink);
  border-color: var(--bone)
}

.admin-btn.is-on {
  background: var(--amber);
  border-color: var(--amber)
}

.admin-btn.is-on:hover {
  background: var(--amber-2);
  border-color: var(--amber-2);
  color: var(--bone)
}

.admin-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed
}

@media(min-width:720px) {
  .grid {
    grid-template-columns: repeat(3, 1fr)
  }

  .hero__img {
    object-position: 72% 40%;
  }

  .wall {
    padding: 32px 40px 80px
  }

  .modal {
    align-items: center
  }

  .modal__panel {
    border-radius: 14px;
    max-height: 80vh
  }

  .modal__handle {
    display: none
  }

  .admin-bar {
    padding: 96px 40px 32px
  }
}