:root {
  --ink: #e8eef4;
  --ink-dim: #9aadb8;
  --paper: #0b1218;
  --paper-2: #121c26;
  --mist: rgba(232, 238, 244, 0.08);
  --line: rgba(232, 238, 244, 0.14);
  --ember: #e4a35c;
  --ember-deep: #c47d2e;
  --river: #3d7ea6;
  --ok: #6fbf8a;
  --danger: #e07a6a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --radius: 18px;
  --max: 1100px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(61, 126, 166, 0.28), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(228, 163, 92, 0.18), transparent 50%),
    linear-gradient(165deg, #0b1218 0%, #101a24 45%, #0d151c 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  z-index: 0;
}

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

img,
video {
  max-width: 100%;
  display: block;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

/* —— Hub hero —— */
.hero {
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding: 4rem 0 3rem;
  animation: rise 0.9s ease both;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  max-width: 14ch;
}

.brand span {
  color: var(--ember);
}

.tagline {
  margin: 0;
  max-width: 28ch;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  color: var(--ink-dim);
  line-height: 1.45;
}

.hero-rule {
  width: 4.5rem;
  height: 3px;
  margin: 1.75rem 0 2.5rem;
  border: 0;
  background: linear-gradient(90deg, var(--ember), transparent);
  animation: draw 1.1s 0.2s ease both;
}

.section-label {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 1rem;
}

.trip-list {
  display: grid;
  gap: 1rem;
  padding-bottom: 4rem;
}

.trip-link {
  display: grid;
  gap: 0.35rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(18, 28, 38, 0.9), rgba(11, 18, 24, 0.65));
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  animation: rise 0.8s ease both;
}

.trip-link:nth-child(1) { animation-delay: 0.08s; }
.trip-link:nth-child(2) { animation-delay: 0.16s; }
.trip-link:nth-child(3) { animation-delay: 0.24s; }

.trip-link:hover,
.trip-link:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(228, 163, 92, 0.55);
  outline: none;
}

.trip-link h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  letter-spacing: -0.02em;
}

.trip-meta {
  color: var(--ember);
  font-weight: 600;
  font-size: 0.95rem;
}

.trip-blurb {
  margin: 0.15rem 0 0;
  color: var(--ink-dim);
  font-size: 0.98rem;
}

.trip-count {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: var(--ink-dim);
}

/* —— Trip page —— */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0 0.5rem;
}

.back {
  color: var(--ink-dim);
  font-size: 0.95rem;
}

.back:hover {
  color: var(--ink);
}

.admin-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-dim);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.admin-btn.is-on {
  color: var(--ember);
  border-color: rgba(228, 163, 92, 0.5);
}

.trip-hero {
  padding: 1.5rem 0 1.75rem;
  animation: rise 0.7s ease both;
}

.trip-hero h1 {
  margin: 0.2rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  letter-spacing: -0.03em;
  line-height: 1;
}

.trip-hero .dates {
  color: var(--ember);
  font-weight: 600;
  margin: 0;
}

.trip-hero .blurb {
  margin: 0.75rem 0 0;
  color: var(--ink-dim);
  max-width: 36ch;
}

.who-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
}

.who-label {
  color: var(--ink-dim);
  font-size: 0.9rem;
  font-weight: 600;
}

.album-bar {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1rem;
}

.album-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(18, 28, 38, 0.75);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  line-height: 1.2;
}

.chip.ghost {
  background: transparent;
  color: var(--ink-dim);
}

.chip.accent {
  border-color: rgba(228, 163, 92, 0.55);
  color: var(--ember);
}

.chip.is-on {
  background: rgba(228, 163, 92, 0.18);
  border-color: rgba(228, 163, 92, 0.7);
  color: var(--ember);
  font-weight: 700;
}

.chip.drop-target,
.chip.can-file {
  outline: 2px solid var(--ember);
  background: rgba(228, 163, 92, 0.22);
}

.chip.can-file::after {
  content: " ←";
  font-weight: 700;
}

.chip-x {
  margin-left: 0.35rem;
  opacity: 0.7;
  font-weight: 800;
}

.select-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, rgba(5, 8, 12, 0.92) 28%);
  pointer-events: none;
}

.select-dock[hidden] {
  display: none !important;
}

.select-dock-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(228, 163, 92, 0.45);
  background: rgba(18, 28, 38, 0.96);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.select-dock-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 10rem;
}

.select-dock-copy strong {
  font-size: 1rem;
}

.select-dock-copy span {
  color: var(--ink-dim);
  font-size: 0.85rem;
}

.select-dock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.select-dock .chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

body.is-selecting {
  padding-bottom: 6.5rem;
}

body.is-selecting .upload-panel {
  opacity: 0.45;
  pointer-events: none;
}

.move-list {
  display: grid;
  gap: 0.45rem;
  margin: 0.25rem 0 0.5rem;
  max-height: 50vh;
  overflow: auto;
}

.move-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  cursor: pointer;
}

.move-option:has(input:checked) {
  border-color: rgba(228, 163, 92, 0.7);
  background: rgba(228, 163, 92, 0.1);
}

.move-option input {
  margin-top: 0.2rem;
  accent-color: var(--ember);
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
}

.move-option-text {
  display: grid;
  gap: 0.15rem;
}

.move-option-text strong {
  font-size: 1rem;
}

.move-option-text small {
  color: var(--ink-dim);
  font-size: 0.82rem;
}

.upload-panel {
  margin: 0.5rem 0 2rem;
  padding: 1.4rem;
  border: 1px dashed rgba(228, 163, 92, 0.45);
  border-radius: var(--radius);
  background: rgba(18, 28, 38, 0.55);
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
  animation: rise 0.8s 0.1s ease both;
}

.upload-panel.is-drag {
  border-color: var(--ember);
  background: rgba(228, 163, 92, 0.08);
}

.upload-panel h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.upload-panel p {
  margin: 0 0 1rem;
  color: var(--ink-dim);
  font-size: 0.95rem;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.7rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ember), var(--ember-deep));
  color: #1a1208;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(228, 163, 92, 0.25);
}

.file-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.file-btn input {
  display: none;
}

.progress {
  margin-top: 1rem;
  display: none;
  text-align: left;
}

.progress.is-on {
  display: block;
}

.progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--mist);
  overflow: hidden;
}

.progress-bar-lg {
  height: 12px;
}

.progress-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--river), var(--ember));
  transition: width 0.2s ease;
}

.progress-bar > span.is-pulse {
  width: 35% !important;
  animation: bar-pulse 1.1s ease-in-out infinite;
}

.progress-text {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  color: var(--ink-dim);
}

.upload-panel strong {
  color: var(--ember);
  font-weight: 700;
}

.upload-panel.is-uploading {
  border-style: solid;
  border-color: var(--ember);
  background: rgba(228, 163, 92, 0.1);
}

.upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(5, 8, 12, 0.92);
  backdrop-filter: blur(8px);
}

.upload-overlay[hidden] {
  display: none !important;
}

.upload-overlay-card {
  width: min(100%, 420px);
  padding: 1.75rem 1.4rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid rgba(228, 163, 92, 0.45);
  background: linear-gradient(160deg, #162231, #0d151c);
  box-shadow: var(--shadow);
  text-align: center;
}

.upload-overlay-card h2 {
  margin: 0.85rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.upload-overlay-keep {
  margin: 0 0 1.25rem;
  color: var(--ember);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.35;
}

.upload-overlay-sub {
  margin: 0.85rem 0 0;
  color: var(--ink-dim);
  font-size: 0.9rem;
}

.upload-spinner {
  width: 2.6rem;
  height: 2.6rem;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(232, 238, 244, 0.15);
  border-top-color: var(--ember);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes bar-pulse {
  0%, 100% { transform: translateX(-40%); opacity: 0.7; }
  50% { transform: translateX(120%); opacity: 1; }
}

.status {
  margin: 0.85rem 0 0;
  min-height: 1.25rem;
  font-size: 0.92rem;
}

.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }

.gallery-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
}

.gallery-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.gallery-head span {
  color: var(--ink-dim);
  font-size: 0.9rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  padding-bottom: 4rem;
}

@media (min-width: 700px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
  }
}

.tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-2);
  cursor: pointer;
  animation: rise 0.55s ease both;
  padding: 0;
  margin: 0;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  pointer-events: none;
}

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

.tile.is-hidden {
  opacity: 0.45;
  outline: 2px dashed rgba(224, 122, 106, 0.7);
}

.tile .badge {
  position: absolute;
  left: 0.45rem;
  bottom: 0.45rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tile .curate {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  background: rgba(11, 18, 24, 0.8);
  color: var(--ink);
}

.tile .heart-btn {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 2;
  border: 0;
  border-radius: 999px;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  background: rgba(11, 18, 24, 0.55);
  color: rgba(232, 238, 244, 0.7);
  backdrop-filter: blur(4px);
}

.tile .heart-btn.is-on {
  color: #ff6b81;
  background: rgba(11, 18, 24, 0.72);
}

.tile.is-selected {
  outline: 2px solid var(--ember);
}

.tile .sel-check {
  position: absolute;
  right: 0.45rem;
  top: 0.45rem;
  z-index: 2;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 2px solid rgba(232, 238, 244, 0.95);
  background: rgba(11, 18, 24, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.tile .sel-check.is-on {
  background: var(--ember);
  border-color: var(--ember);
}

.tile .sel-check.is-on::after {
  content: "";
  position: absolute;
  inset: 0.28rem;
  border-radius: 999px;
  background: #1a1208;
}

.lightbox-heart {
  position: absolute;
  top: -0.5rem;
  left: -0.5rem;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: rgba(11, 18, 24, 0.85);
  color: rgba(232, 238, 244, 0.55);
  font: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 1;
}

.lightbox-heart.is-on {
  color: #e86b7a;
}

.empty {
  grid-column: 1 / -1;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(5, 8, 12, 0.88);
  backdrop-filter: blur(6px);
}

.lightbox.is-on {
  display: grid;
}

.lightbox-inner {
  width: min(100%, 960px);
  max-height: min(88vh, 900px);
  position: relative;
}

.lightbox-inner img,
.lightbox-inner video {
  width: 100%;
  max-height: min(88vh, 900px);
  object-fit: contain;
  border-radius: 12px;
  background: #000;
}

.lightbox-close {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--ember);
  color: #1a1208;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

/* modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(5, 8, 12, 0.75);
}

.modal.is-on {
  display: grid;
}

.modal-card {
  width: min(100%, 360px);
  padding: 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.modal-card h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
}

.modal-card p {
  margin: 0 0 1rem;
  color: var(--ink-dim);
  font-size: 0.92rem;
}

.modal-card input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  letter-spacing: 0.2em;
  text-align: center;
  font-size: 1.2rem;
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

.modal-actions button {
  flex: 1;
  min-height: 2.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.modal-actions .primary {
  border: 0;
  background: linear-gradient(135deg, var(--ember), var(--ember-deep));
  color: #1a1208;
  font-weight: 700;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes draw {
  from { width: 0; opacity: 0; }
  to { width: 4.5rem; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
