:root {
  --bg: #ffffff;
  --bg-soft: #faf7f4;
  --ink: #15171c;
  --ink-soft: #6b6e76;
  --ink-faint: #9a9da6;
  --line: #e9e4de;
  --coral: #e15a34;
  --coral-dark: #c2491f;
  --coral-soft: #fbe9e0;
  --moss: #2f5d4f;
  --moss-soft: #e5eeea;
  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 18, 15, 0.05);
  --shadow-md: 0 16px 32px -16px rgba(20, 18, 15, 0.22);
  --font-serif: "Fraunces", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-serif); margin: 0; line-height: 1.18; font-weight: 600; letter-spacing: -0.01em; }
em { font-style: italic; color: var(--coral); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
img, video { display: block; max-width: 100%; }

.icon { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.icon--solid { fill: currentColor; stroke: none; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--coral-dark);
  margin: 0 0 12px;
}

/* ---------- navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.navbar__brand { display: flex; align-items: center; gap: 10px; }
.navbar__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--coral);
  color: #fff;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
}
.navbar__title { font-family: var(--font-serif); font-weight: 600; font-size: 1.08rem; }
.navbar__links { display: none; align-items: center; gap: 26px; font-weight: 500; color: var(--ink-soft); font-size: 0.92rem; }
.navbar__links a:not(.btn):hover { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 600;
  padding: 13px 24px;
  font-size: 0.94rem;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn--primary { background: var(--coral); color: #fff; }
.btn--primary:hover { background: var(--coral-dark); transform: translateY(-1px); }
.btn--primary:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.btn--ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn--ghost:hover { border-color: var(--ink-faint); }
.btn--sm { padding: 9px 18px; font-size: 0.85rem; }
.btn--lg { padding: 16px 28px; font-size: 1rem; }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(21, 23, 28, 0.06);
  color: var(--ink);
  flex-shrink: 0;
}
.icon-btn:hover { background: rgba(21, 23, 28, 0.1); }
.icon-btn--light { background: rgba(255, 255, 255, 0.14); color: #fff; }
.icon-btn--light:hover { background: rgba(255, 255, 255, 0.22); }
.icon-btn.is-disabled { opacity: 0.3; pointer-events: none; }

/* ---------- hero (banner suave) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 60px 20px 48px;
  background: linear-gradient(165deg, #fffaf6 0%, #fbeee6 60%, #ffffff 100%);
  border-radius: 0 0 32px 32px;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero__blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.45; }
.hero__blob--a { width: 300px; height: 300px; background: var(--coral-soft); top: -90px; right: 6%; }
.hero__blob--b { width: 240px; height: 240px; background: var(--moss-soft); bottom: -110px; left: 4%; }
.hero__content { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; text-align: left; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.1rem); }
.hero__subtitle { margin-top: 18px; color: var(--ink-soft); font-size: 1.08rem; max-width: 540px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero__stats { display: flex; gap: 30px; margin-top: 38px; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600; }
.stat span { color: var(--ink-faint); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.07em; }

/* ---------- stories ---------- */
.stories { padding: 6px 0 36px; }
.stories__scroller {
  display: flex;
  gap: 18px;
  padding: 4px 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.stories__scroller::-webkit-scrollbar { display: none; }

.story {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  width: 76px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.story.is-visible { opacity: 1; transform: translateY(0); }

.story__ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 2.5px;
  display: grid;
  place-items: center;
}
.story__ring--unseen { background: linear-gradient(135deg, var(--coral), var(--moss)); }
.story__ring--seen { background: var(--line); }
.story__ring--dashed { background: none; border: 1.5px dashed var(--ink-faint); }
.story__ring--more { background: var(--bg-soft); border: 1.5px solid var(--line); }

.story__avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  border: 2.5px solid #fff;
}
.story__avatar img, .story__avatar video { width: 100%; height: 100%; object-fit: cover; }
.story__initials { font-family: var(--font-serif); font-weight: 600; color: var(--ink); font-size: 1.05rem; }
.story__avatar--add { background: var(--bg-soft); color: var(--ink-faint); }
.story__avatar--more { background: #fff; color: var(--ink); font-family: var(--font-serif); font-weight: 700; font-size: 0.95rem; }
.story__label { font-size: 0.74rem; color: var(--ink-soft); max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- how it works ---------- */
.how {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 20px 64px;
  max-width: 980px;
  margin: 0 auto;
}
.how__step {
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 26px 22px;
  flex: 1;
}
.how__icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #fff;
  color: var(--coral);
  margin-bottom: 14px;
}
.how__step h3 { font-size: 1.1rem; margin-bottom: 6px; }
.how__step p { color: var(--ink-soft); font-size: 0.92rem; }

/* ---------- section heading shared ---------- */
.section__heading h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
.section__subtitle { color: var(--ink-soft); margin-top: 10px; max-width: 460px; }

/* ---------- upload ---------- */
.upload { padding: 20px 20px 70px; max-width: 760px; margin: 0 auto; width: 100%; }
.upload-card {
  margin-top: 28px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.field-row { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.field label span { font-weight: 400; color: var(--ink-faint); }
.field input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--ink);
  font-size: 0.95rem;
  font-family: inherit;
}
.field input:focus { outline: 2px solid var(--coral); outline-offset: 1px; }
.field input::placeholder { color: var(--ink-faint); }

.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--coral); }
.dropzone.dragover { border-color: var(--coral); background: var(--coral-soft); }
.dropzone__icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--coral-soft); color: var(--coral); margin-bottom: 12px; }
.dropzone__content p { font-size: 1rem; }
.dropzone__hint { display: block; margin-top: 6px; color: var(--ink-faint); font-size: 0.8rem; }

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
}
.preview-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--ink);
}
.preview-item img, .preview-item video { width: 100%; height: 100%; object-fit: cover; }
.preview-item__badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 6px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}
.preview-item__badge .icon { width: 0.8em; height: 0.8em; }
.preview-item__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
}
.preview-item__remove .icon { width: 0.75em; height: 0.75em; }

/* ---------- gallery ---------- */
.gallery { padding: 20px 20px 90px; max-width: 1180px; margin: 0 auto; }
.gallery__header { display: flex; flex-direction: column; gap: 18px; margin-bottom: 26px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter {
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
}
.filter.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.gallery-grid { column-count: 2; column-gap: 12px; }
.memory-card {
  break-inside: avoid;
  margin-bottom: 12px;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
}
.memory-card.is-visible { opacity: 1; transform: translateY(0); }
.memory-card:hover { box-shadow: var(--shadow-md); }
.memory-card__media { width: 100%; display: block; transition: transform 0.4s ease; background: var(--bg-soft); }
.memory-card:hover .memory-card__media { transform: scale(1.045); }
.memory-card__media--h-sm { aspect-ratio: 4 / 5; object-fit: cover; }
.memory-card__media--h-md { aspect-ratio: 3 / 4; object-fit: cover; }
.memory-card__media--h-lg { aspect-ratio: 2 / 3; object-fit: cover; }

.memory-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(21, 23, 28, 0.45);
  color: #fff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(3px);
  animation: playPulse 2.6s ease-in-out infinite;
}
@keyframes playPulse { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.08); } }

.card-download {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
}
.card-download .icon { width: 0.9em; height: 0.9em; }

.memory-card__overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 30px 12px 10px;
  background: linear-gradient(to top, rgba(10, 10, 10, 0.72), transparent);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.memory-card__author { font-size: 0.82rem; font-weight: 700; color: #fff; }
.memory-card__time { font-size: 0.72rem; color: rgba(255, 255, 255, 0.75); }

.gallery__more { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 8px; }
.gallery__count { font-size: 0.8rem; color: var(--ink-faint); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-state h3 { margin-bottom: 6px; color: var(--ink); }

/* ---------- footer ---------- */
.footer {
  padding: 50px 20px 120px;
  text-align: center;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.footer__brand { display: flex; align-items: center; gap: 10px; }
.footer__about { max-width: 460px; font-size: 0.9rem; }
.footer__credit { font-size: 0.78rem; color: var(--ink-faint); }

/* ---------- bottom nav (mobile) ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  color: var(--ink-faint);
  font-weight: 600;
}
.bottom-nav__item .icon { width: 1.3em; height: 1.3em; }
.bottom-nav__item.active { color: var(--coral); }
.bottom-nav__item--cta {
  background: var(--coral);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-top: -26px;
  box-shadow: var(--shadow-md);
}
.bottom-nav__item--cta .icon { width: 1.4em; height: 1.4em; }

/* ---------- lightbox: tela cheia a sério ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  touch-action: pan-y;
  overscroll-behavior: contain;
}
.lightbox__stage { width: 100%; height: 100%; display: grid; place-items: center; }
.lightbox__stage img, .lightbox__stage video { width: 100%; height: 100%; object-fit: contain; }
.lightbox__bar { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; z-index: 2; display: flex; gap: 8px; }
.lightbox__nav { position: absolute; top: 50%; translate: 0 -50%; z-index: 2; }
.lightbox__nav--prev { left: 14px; }
.lightbox__nav--next { right: 14px; }
.lightbox__meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 70px 24px calc(22px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  text-align: center;
  pointer-events: none;
}
.lightbox__meta strong { display: block; font-size: 1rem; font-family: var(--font-serif); }
.lightbox__meta span { color: rgba(255, 255, 255, 0.6); font-size: 0.85rem; }
.lightbox__meta p { margin-top: 8px; color: rgba(255, 255, 255, 0.9); font-size: 0.95rem; }

@media (max-width: 640px) {
  .lightbox__nav { display: none; }
}

/* ---------- story viewer ---------- */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: #0b0c0e;
  color: #fff;
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
  overscroll-behavior: contain;
}
.story-viewer__progress { display: flex; gap: 5px; padding: 14px 14px 0; }
.story-viewer__bar { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.25); position: relative; overflow: hidden; }
.story-viewer__bar::after { content: ""; position: absolute; inset: 0; width: 0%; background: #fff; }
.story-viewer__bar.is-complete::after { width: 100%; }
.story-viewer__bar.is-active::after { animation: storyFill 5s linear forwards; }
@keyframes storyFill { from { width: 0%; } to { width: 100%; } }

.story-viewer__header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.story-viewer__avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex-shrink: 0; }
.story-viewer__avatar img, .story-viewer__avatar video { width: 100%; height: 100%; object-fit: cover; }
.story-viewer__avatar .story__initials { color: var(--ink); font-size: 0.85rem; }
.story-viewer__who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.story-viewer__who strong { font-size: 0.9rem; font-family: var(--font-serif); }
.story-viewer__who span { font-size: 0.74rem; color: rgba(255, 255, 255, 0.55); }

.story-viewer__stage { flex: 1; display: grid; place-items: center; position: relative; padding: 0 14px; min-height: 0; }
.story-viewer__stage img, .story-viewer__stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-md); }

.story-viewer__zone { position: absolute; top: 60px; bottom: 90px; width: 35%; }
.story-viewer__zone--prev { left: 0; }
.story-viewer__zone--next { right: 0; }

.story-viewer__caption { padding: 16px 24px calc(28px + env(safe-area-inset-bottom)); text-align: center; color: rgba(255, 255, 255, 0.85); font-size: 0.95rem; }

/* ---------- toast ---------- */
.toast-stack {
  position: fixed;
  bottom: 90px;
  left: 50%;
  translate: -50% 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 100%;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.25s ease, toast-out 0.25s ease 2.6s forwards;
}
@keyframes toast-in { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes toast-out { to { opacity: 0; translate: 0 -8px; } }

/* ---------- floating upload tray (non-blocking uploads) ---------- */
.upload-tray {
  position: fixed;
  bottom: 86px;
  right: 16px;
  left: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.upload-tray__item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  border-radius: 999px;
  padding: 10px 16px 10px 10px;
  font-size: 0.82rem;
  font-weight: 500;
  animation: tray-in 0.3s ease;
  max-width: 320px;
}
@keyframes tray-in { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
.upload-tray__ring {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--coral) calc(var(--p) * 1%), var(--line) 0);
  transition: background 0.2s linear;
}
.upload-tray__ring::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: #fff; }
.upload-tray__check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--moss-soft);
  color: var(--moss);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.upload-tray__check .icon { width: 0.85em; height: 0.85em; }

/* ---------- responsive ---------- */
@media (min-width: 640px) {
  .field-row { flex-direction: row; }
  .field { flex: 1; }
  .gallery-grid { column-gap: 16px; }
  .how { flex-direction: row; }
}

@media (min-width: 900px) {
  .navbar { padding: 18px 48px; }
  .navbar__links { display: flex; }
  .hero { padding: 96px 48px 64px; border-radius: 0 0 44px 44px; }
  .hero__content { max-width: 880px; }
  .stories__scroller { padding: 4px 48px; }
  .upload, .gallery { padding-left: 48px; padding-right: 48px; }
  .gallery-grid { column-count: 3; }
  .bottom-nav { display: none; }
  .footer { padding-bottom: 60px; }
  .toast-stack, .upload-tray { bottom: 28px; }
  .upload-tray { right: 28px; left: auto; }
}

@media (min-width: 1200px) {
  .gallery-grid { column-count: 4; }
}

@media (prefers-reduced-motion: reduce) {
  .story, .memory-card, .memory-card__play, .story-viewer__bar.is-active::after {
    animation: none !important;
    transition: none !important;
  }
}
