/* GatherPics — self-contained. No shared stylesheet, no external assets. */

:root {
  --ink: #12100c;
  --paper: #ffffff;
  --sand: #faf7f0;
  --line: #12100c;
  /* Sampled from the app icon: pink -> coral -> orange, with purple opposite. */
  --pink: #fe4a85;
  --coral: #fd745b;
  --orange: #fe9834;
  --purple: #b14ece;
  --brand: linear-gradient(115deg, var(--purple) 0%, var(--pink) 42%, var(--orange) 100%);
  --accent: var(--pink);
  --accent-soft: #fff0f5;
  --muted: #6f6a60;
  --ok: #1b8a3a;
  --warn-bg: #fff3e2;
  --bad-bg: #fdecec;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --wrap: 1060px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* The `hidden` attribute is only display:none in the browser's own stylesheet,
   so any author rule setting a display value beats it. Several components here
   do exactly that, which would leave overlays painted over the page with their
   close buttons apparently inert. Make hidden authoritative once, up front. */
[hidden] {
  display: none !important;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

a {
  color: inherit;
}

.muted {
  color: var(--muted);
}

/* --- buttons --- */

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 650;
  font-size: 15px;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 8px;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--ink);
}

.btn-primary:hover {
  filter: saturate(1.15);
}

.btn-link {
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
  color: var(--ink);
}

/* --- site chrome --- */

.gp-header {
  border-bottom: 2px solid var(--line);
  padding: 18px 0;
}

.gp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.gp-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.gp-logo-mark {
  width: 30px;
  height: 30px;
  flex: none;
}

.gp-footer {
  border-top: 2px solid var(--line);
  background: var(--sand);
  padding: 32px 0;
  margin-top: 56px;
  font-size: 14px;
}

.gp-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.gp-footer nav {
  display: flex;
  gap: 18px;
}

.hero {
  padding: 72px 0 48px;
  background:
    radial-gradient(circle at 88% 6%, rgba(254, 152, 52, 0.34), transparent 46%),
    radial-gradient(circle at 6% 32%, rgba(177, 78, 206, 0.22), transparent 44%),
    var(--paper);
}

.hero-inner {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 6.5vw, 56px);
}

.hero-sub {
  margin: 0;
  font-size: 18px;
  max-width: 62ch;
}

/* --- app shell --- */

.gp-app {
  padding: 36px 0 48px;
}

.panel {
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 20px;
  margin-bottom: 20px;
}

.caution {
  border: 2px solid var(--line);
  border-left-width: 8px;
  border-radius: 8px;
  background: var(--warn-bg);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-weight: 600;
}

.caution-ok {
  background: #e8f6ec;
}

.gp-signin h2,
.gp-create h2,
.gp-newlink h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.gp-signin p {
  margin: 0 0 16px;
  max-width: 62ch;
}

.gp-hostbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
}

/* --- create form --- */

.gp-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 16px 0 20px;
}

.gp-form-wide {
  grid-column: 1 / -1;
}

.gp-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  min-width: 0;
}

.gp-form label em {
  font-style: normal;
  font-weight: 400;
}

.gp-form input,
.gp-form select {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  min-width: 0;
}

.gp-form input:focus,
.gp-form select:focus {
  outline: 3px solid var(--pink);
  outline-offset: 1px;
}

/* --- guest link --- */

.gp-newlink {
  background: var(--accent-soft);
}

.gp-linkrow {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.gp-linkrow input {
  flex: 1 1 260px;
  min-width: 0;
  font: inherit;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

/* --- event list --- */

.gp-section-title {
  margin: 32px 0 16px;
  font-size: 22px;
}

.gp-events {
  display: grid;
  gap: 16px;
}

.gp-event-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gp-event-head h3 {
  margin: 0;
  font-size: 19px;
}

.gp-badge {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--brand);
  color: #fff;
}

.gp-event-closed .gp-badge,
.gp-event-expired .gp-badge {
  background: var(--sand);
  color: var(--muted);
}

.gp-event-stats {
  margin: 8px 0 14px;
}

.gp-event-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.gp-danger {
  color: #a11;
}

/* --- how it works --- */

.gp-how {
  background: var(--sand);
  border-top: 2px solid var(--line);
  padding: 48px 0;
}

.gp-how h2 {
  margin: 0 0 20px;
  font-size: 27px;
}

.gp-steps {
  margin: 0 0 24px;
  padding-left: 22px;
  max-width: 70ch;
}

.gp-steps li {
  margin-bottom: 10px;
}

.gp-privacy-note {
  max-width: 70ch;
}

/* ---------------- guest page ---------------- */

.gp-guest-body {
  /* Room for the fixed bottom toolbar, plus the phone's home indicator. */
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}

.gp-guest-head {
  border-bottom: 2px solid var(--line);
  background: var(--brand);
  color: #fff;
  padding: 26px 0 22px;
}

.gp-guest-head h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 44px);
}

.gp-guest-head .muted {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
}

.gp-guest-message {
  margin: 12px 0 0;
  font-size: 17px;
  font-weight: 600;
  max-width: 60ch;
}

.gp-guest .wrap {
  padding-top: 20px;
}

/* --- drop zone --- */

.gp-drop {
  border: 3px dashed var(--line);
  border-radius: 14px;
  padding: 32px 20px;
  text-align: center;
  margin-bottom: 20px;
  transition: background 0.15s ease;
}

.gp-dragging .gp-drop {
  background: var(--accent-soft);
}

.gp-drop-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 600;
}

.gp-drop .muted {
  margin: 0 0 16px;
}

.gp-drop-hint {
  margin: 12px 0 0;
  font-size: 14px;
}

@media (hover: none) {
  /* Dragging isn't a thing on a phone, and this is a phone-first page. */
  .gp-drop-hint {
    display: none;
  }
}

/* --- upload progress --- */

/* Deliberately small. One line for the whole batch, not a card per file --
   the photos appearing in the grid are the real feedback. */
.gp-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
}

.gp-progress-label {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.gp-progress-track {
  flex: 1;
  min-width: 0;
  height: 6px;
  border-radius: 999px;
  background: var(--sand);
  border: 1px solid var(--line);
  overflow: hidden;
}

.gp-progress-fill {
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width 0.2s ease;
}

.gp-upload-errors:empty {
  display: none;
}

.gp-upload-error {
  margin: 0 0 6px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--bad-bg);
  font-size: 13px;
}

/* --- gallery --- */

.gp-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 32px;
}

@media (max-width: 520px) {
  .gp-gallery {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 5px;
  }
}

.gp-tile {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--sand);
  border: 2px solid var(--line);
  cursor: pointer;
}

.gp-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gp-tile-noimg img {
  display: none;
}

.gp-tile-noimg::after {
  content: "…";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 28px;
  color: var(--muted);
}

.gp-tile-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 30px;
  color: var(--paper);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.gp-tile-mine {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  border: 1.5px solid var(--line);
}

.gp-gallery-empty {
  text-align: center;
  padding: 32px 0 48px;
}

/* --- bottom toolbar --- */

.gp-toolbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-top: 2px solid var(--line);
}

.gp-tool {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.gp-tool-icon {
  font-size: 19px;
  line-height: 1;
}

.gp-tool-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.gp-tool[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--pink);
}

.gp-tool-locked {
  opacity: 0.55;
}

.gp-lock {
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translateX(20px);
  font-size: 10px;
}

.gp-tool-add {
  background: var(--ink);
  color: var(--paper);
}

.gp-tool-add .gp-tool-icon {
  font-size: 22px;
}

/* --- locked-feature sheet --- */

.gp-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  background: rgba(0, 0, 0, 0.45);
  padding: 16px;
}

.gp-sheet-inner {
  width: 100%;
  max-width: 440px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
}

.gp-sheet-inner h2 {
  margin: 0 0 8px;
  font-size: 21px;
}

.gp-sheet-inner p {
  margin: 0 0 18px;
}

/* --- lightbox --- */

.gp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.9);
  padding: 24px;
}

.gp-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.gp-lightbox-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--paper);
  background: rgba(0, 0, 0, 0.5);
  color: var(--paper);
  font-size: 18px;
  cursor: pointer;
}

/* --- live refresh --- */

.gp-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
}

.gp-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7dffa8;
  box-shadow: 0 0 0 0 rgba(125, 255, 168, 0.6);
  animation: gp-pulse 2.4s ease-out infinite;
}

@keyframes gp-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(125, 255, 168, 0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(125, 255, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(125, 255, 168, 0); }
}

.gp-tile-new {
  animation: gp-tile-in 0.35s ease-out;
}

@keyframes gp-tile-in {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .gp-live-dot,
  .gp-tile-new {
    animation: none;
  }
}

.gp-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 35;
  max-width: calc(100vw - 32px);
  padding: 11px 20px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

/* --- legal pages --- */

.gp-legal {
  padding: 40px 0 20px;
}

.gp-legal-body {
  max-width: 68ch;
}

.gp-legal-body h2 {
  margin: 32px 0 8px;
  font-size: 20px;
}

.gp-legal h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 5vw, 40px);
}

.gp-updated {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}

/* Guest-page credit. Attendees arrive here straight from a text message and
   never see the marketing page, so this is the only place the album says who
   made it. Kept small and out of the way of the photos. */
.gp-credit {
  margin: 8px 0 28px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.gp-credit a {
  color: var(--muted);
}

/* Checkbox row in the new-event form: box beside the label, not stacked
   above it like the text inputs. */
.gp-check {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

.gp-check input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  flex: none;
  accent-color: var(--pink);
}

.gp-check em {
  font-style: normal;
  font-weight: 400;
}

/* Host call-to-action on the guest page. A guest who has just added a photo
   has experienced the entire product without signing up for anything -- that
   is the moment they might want one of their own, so this sits under the
   gallery rather than interrupting it. */
.gp-cta {
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--accent-soft);
  padding: 24px;
  margin: 8px 0 24px;
  text-align: center;
}

.gp-cta-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
}

.gp-cta-body {
  margin: 0 auto 18px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 15px;
}

/* Once they have uploaded, the invitation has earned a bit more presence. */
.gp-cta-warm {
  background: var(--brand);
  border-color: var(--line);
}

.gp-cta-warm .gp-cta-body {
  color: rgba(255, 255, 255, 0.94);
}

.gp-cta-warm .gp-cta-title {
  color: #fff;
}

.gp-cta-warm .btn-primary {
  background: var(--paper);
  color: var(--ink);
}

/* Full-resolution callout. The one thing GatherPics does that a group chat
   cannot, so it gets to look like a claim rather than body copy. */
.gp-callout {
  border-left: 6px solid var(--pink);
  background: var(--paper);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  margin: 0 0 24px;
  max-width: 70ch;
}

.gp-fullsize {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--pink);
}

/* Way home from a guest album. The guest page has no site chrome on purpose
   -- an attendee is here for the photos -- but the same person is often a
   host too, and had no route back to their own albums. */
.gp-guest-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  opacity: 0.9;
}

.gp-guest-brand:hover {
  opacity: 1;
}

.gp-guest-brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

/* A signed-in host gets straight to their events, so the app section shouldn't
   carry hero-sized padding when the hero above it is gone. */
.gp-app {
  padding-top: 32px;
}

@media (max-width: 620px) {
  .hero {
    padding: 40px 0 28px;
  }
  .gp-app {
    padding-top: 20px;
  }
  .panel {
    padding: 16px;
  }
  /* The signed-in bar wrapped "Sign out" onto two lines on a narrow phone. */
  .gp-hostbar {
    padding: 12px 16px;
    font-size: 14px;
  }
  .gp-hostbar .btn-link {
    white-space: nowrap;
  }
}

/* Explains why "When taken" can look identical to "Just added": a photo with
   no EXIF capture time has nothing to sort by. Silent fallback made the button
   look broken. */
.gp-sortnote {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-left: 4px solid var(--pink);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: var(--muted);
}
