:root {
  --ink: #2a2420;
  --cream: #f7f1e8;
  --cream-deep: #efe4d4;
  --blush: #e8a4b0;
  --rose: #c45c7a;
  --apricot: #e89b6d;
  --magenta: #b83d6e;
  --muted: #6e5f56;
  --paper: rgba(255, 252, 247, 0.88);
  --radius: 18px;
  --font-display: "Playfair Display", "Times New Roman", serif;
  --font-script: "Great Vibes", cursive;
  --font-body: "Cormorant Garamond", Georgia, serif;
  --shadow: 0 20px 50px rgba(42, 36, 32, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  font-size: 1.125rem;
  line-height: 1.55;
  background-color: var(--cream);
  background-image:
    linear-gradient(180deg, rgba(247, 241, 232, 0.92), rgba(247, 241, 232, 0.96)),
    url("/public/images/invitation-pattern.png");
  background-size: cover, 420px auto;
  background-position: center, center;
  background-attachment: fixed;
}

h1, h2, h3, .brand {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.04em;
}

a { color: inherit; }

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 5;
}

.brand {
  font-size: 1.35rem;
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand .x {
  font-family: var(--font-script);
  text-transform: none;
  letter-spacing: 0;
  color: var(--rose);
  margin: 0 0.15em;
  font-size: 1.4em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  font-size: 1rem;
}

.nav-links a { text-decoration: none; opacity: 0.85; }
.nav-links a:hover { opacity: 1; color: var(--rose); }

.locale-toggle {
  border: 1px solid rgba(42, 36, 32, 0.18);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--rose), var(--magenta));
  color: #fffaf7;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(180, 61, 110, 0.25);
}

.btn-ghost {
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.95rem; }
.btn-lg { padding: 0.95rem 1.75rem; font-size: 1.15rem; min-width: 10.5rem; }

/* Welcome stage — invitation backdrop + 3D couple photo + mid CTAs */
body.landing {
  background-attachment: scroll;
  background-image: none;
  background-color: #f7f1e8;
}

.welcome-stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.25rem 2.5rem;
  perspective: 1600px;
  overflow: hidden;
}

.invite-wash {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(247, 241, 232, 0.78), rgba(247, 241, 232, 0.88)),
    url("/public/images/invitation-pattern.png");
  background-size: cover, cover;
  background-position: center, center;
  opacity: 0.55;
  filter: saturate(1.05);
  pointer-events: none;
  z-index: 0;
}

.stage-inner {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.brand-hero {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.8rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
  line-height: 1;
  color: var(--ink);
  animation: fadeUp 0.8s ease both;
}

.brand-hero .and {
  display: block;
  font-family: var(--font-script);
  font-size: 0.58em;
  letter-spacing: 0;
  text-transform: none;
  color: var(--rose);
  margin: 0.1em 0;
}

.welcome-line {
  font-family: var(--font-script);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  margin: 0.4rem 0 0.2rem;
  color: var(--ink);
  animation: fadeUp 0.9s ease 0.08s both;
}

.hero-meta {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 1.1rem;
  animation: fadeUp 0.9s ease 0.14s both;
}

.photo-3d {
  position: relative;
  width: min(340px, 84vw);
  height: min(425px, 105vw);
  margin: 0.25rem auto 1.75rem;
  transform-style: preserve-3d;
  animation: swing3d 8s ease-in-out infinite;
}

.photo-3d-card {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  overflow: hidden;
  background: #1a1416;
  border: 8px solid #fffaf7;
  transform: rotateY(-18deg) rotateX(8deg);
  box-shadow:
    30px 40px 60px rgba(42, 36, 32, 0.35),
    10px 14px 0 rgba(196, 92, 122, 0.22),
    -6px 0 20px rgba(232, 155, 109, 0.15);
  z-index: 3;
}

.photo-3d-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.photo-3d-rim {
  pointer-events: none;
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.15);
}

.photo-3d-shine {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.08) 32%,
    transparent 52%
  );
}

.tagline-soft {
  margin: 0.85rem 0 0;
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: var(--rose);
}

.photo-3d-glow {
  position: absolute;
  inset: -8% -12% -18%;
  background: radial-gradient(ellipse at 50% 60%, rgba(232, 164, 176, 0.7), transparent 65%);
  filter: blur(22px);
  z-index: 1;
}

.photo-3d-base {
  position: absolute;
  left: 12%;
  right: 8%;
  bottom: -4px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, rgba(196, 92, 122, 0.35), transparent);
  z-index: 2;
  transform: rotateX(80deg) translateZ(-20px);
}

.photo-3d-shadow {
  position: absolute;
  left: 8%;
  right: 2%;
  bottom: -26px;
  height: 36px;
  background: radial-gradient(ellipse at center, rgba(42, 36, 32, 0.4), transparent 72%);
  filter: blur(8px);
  z-index: 0;
}

.cta-center {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 5;
  padding: 1rem 1.1rem;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.82);
  border: 1px solid rgba(196, 92, 122, 0.22);
  box-shadow: 0 18px 40px rgba(42, 36, 32, 0.12);
  backdrop-filter: blur(8px);
  animation: fadeUp 1s ease 0.25s both;
}

.cta-center .btn-lg {
  min-width: 150px;
  font-size: 1.1rem;
}

.cta-center .btn-outline {
  background: #fff;
  border-color: var(--rose);
  color: var(--rose);
}

.cta-center .btn-primary {
  background: linear-gradient(135deg, #f0b0bc, #c45c7a 55%, #b83d6e);
  color: #fffaf7;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(180, 61, 110, 0.35);
}

.limit-pill {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 92, 122, 0.28);
  background: rgba(255, 252, 247, 0.85);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.section {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.25rem;
  text-align: center;
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

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

.invite-card {
  background: var(--paper);
  border: 1px solid rgba(196, 92, 122, 0.18);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  box-shadow: var(--shadow);
  margin-top: 1.5rem;
}

.invite-card .script {
  font-family: var(--font-script);
  font-size: 1.8rem;
  color: var(--rose);
  margin: 0.5rem 0 0;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}

.page.narrow { max-width: 460px; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.form {
  display: grid;
  gap: 1rem;
  background: var(--paper);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid rgba(196, 92, 122, 0.15);
  box-shadow: var(--shadow);
}

.form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

.form input {
  font: inherit;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(42, 36, 32, 0.18);
  background: #fffdfb;
}

.alert {
  background: #fff4f6;
  border: 1px solid rgba(196, 92, 122, 0.3);
  padding: 0.9rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.muted { color: var(--muted); }
.limit-note {
  color: var(--muted);
  font-size: 1rem;
  margin: 0.4rem 0 1rem;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
}

.media-card {
  margin: 0;
  padding: 0;
  border: 0;
  background: #2a2420;
  border-radius: 14px;
  overflow: hidden;
  color: #fffaf7;
  text-align: left;
  position: relative;
  box-shadow: var(--shadow);
}

.media-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.media-card img,
.media-card video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.media-card figcaption {
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.media-card figcaption form { margin: 0; }
.media-card figcaption button {
  font: inherit;
  font-size: 0.75rem;
  border: 1px solid rgba(255,255,255,0.35);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  cursor: pointer;
}

.gallery-empty {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 2.5rem 1.25rem;
  text-align: center;
  border: 1px dashed rgba(196, 92, 122, 0.35);
  box-shadow: var(--shadow);
}

.gallery-page .page-head {
  background: var(--paper);
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(196, 92, 122, 0.15);
}

/* Native phone camera page — no in-app viewfinder frame */
body.native-camera {
  background:
    linear-gradient(180deg, rgba(247, 241, 232, 0.94), rgba(247, 241, 232, 0.97)),
    url("/public/images/invitation-pattern.png");
  background-size: cover, 420px auto;
  color: var(--ink);
}

.native-cam {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 1rem 1.1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.native-cam-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
}

.native-cam-top a {
  text-decoration: none;
  color: var(--rose);
  font-family: var(--font-body);
  letter-spacing: 0;
}

.native-cam-top span:last-child { justify-self: end; }

.native-cam-hero {
  text-align: center;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.4rem 1.1rem;
  border: 1px solid rgba(196, 92, 122, 0.18);
  box-shadow: var(--shadow);
}

.native-cam-hero h1 {
  margin: 0;
  font-size: 1.8rem;
}

.native-cam-hero p { margin: 0.4rem 0 0; color: var(--muted); }

.filter-pick .label {
  margin: 0 0 0.45rem;
  font-weight: 600;
}

.filter-bar {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.filter-btn {
  flex: 0 0 auto;
  border: 1px solid rgba(196, 92, 122, 0.28);
  background: rgba(255, 252, 247, 0.9);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.filter-btn.active {
  background: linear-gradient(135deg, #e8a4b0, #c45c7a);
  border-color: transparent;
  color: #fffaf7;
}

.native-actions {
  display: grid;
  gap: 0.75rem;
}

.capture-btn {
  display: grid;
  gap: 0.15rem;
  justify-items: center;
  text-align: center;
  padding: 1.25rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  border: 1px solid rgba(196, 92, 122, 0.2);
  background: #fffdfb;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}

.capture-btn:active { transform: scale(0.98); }

.capture-btn.photo {
  background: linear-gradient(135deg, #f0b0bc, #c45c7a 60%, #b83d6e);
  color: #fffaf7;
  border: 0;
}

.capture-btn.video {
  background: linear-gradient(135deg, #fff, #f8e6ea);
  color: var(--ink);
}

.capture-btn.upload {
  background: transparent;
  border-style: dashed;
  box-shadow: none;
  padding: 0.9rem;
  color: var(--muted);
}

.capture-btn .icon { font-size: 1.6rem; line-height: 1; }
.capture-btn span { font-weight: 700; font-size: 1.15rem; }
.capture-btn small { font-size: 0.85rem; opacity: 0.85; font-weight: 400; }

.capture-btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.develop-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-content: center;
  gap: 0.85rem;
  background: rgba(42, 36, 32, 0.72);
  color: #fffaf7;
  text-align: center;
}

.film-spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(232, 164, 176, 0.25);
  border-top-color: #ffd5df;
  animation: spin 0.9s linear infinite;
}

.native-error {
  color: var(--magenta);
  text-align: center;
  margin: 0;
}

.native-cam-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  padding-top: 0.5rem;
}

.native-cam-footer a {
  color: var(--rose);
  text-decoration: none;
}

.hidden { display: none !important; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 16, 0.94);
  z-index: 80;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 0.5rem 0.35rem;
  padding: 1rem;
  padding-top: max(1rem, env(safe-area-inset-top));
}

.lightbox-stage {
  grid-column: 2;
  grid-row: 2;
  max-width: min(92vw, 900px);
  width: 100%;
  display: grid;
  place-items: center;
  touch-action: pan-y;
}

.lightbox img,
.lightbox video {
  max-width: 100%;
  max-height: min(78vh, 900px);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.lightbox-close {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: end;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 250, 247, 0.12);
  color: #fffaf7;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-nav {
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 250, 247, 0.14);
  color: #fffaf7;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  grid-row: 2;
}

.lightbox-nav.prev { grid-column: 1; }
.lightbox-nav.next { grid-column: 3; }

.lightbox-meta {
  grid-column: 1 / -1;
  grid-row: 3;
  margin: 0;
  color: rgba(255, 250, 247, 0.75);
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .lightbox {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto auto;
  }
  .lightbox-stage { grid-column: 1; }
  .lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }
  .lightbox-nav.prev { left: 0.35rem; }
  .lightbox-nav.next { right: 0.35rem; }
  .lightbox-meta { grid-row: 4; }
}

.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.site-footer .script {
  font-family: var(--font-script);
  font-size: 1.5rem;
  color: var(--rose);
}

body.native-camera .site-footer,
body.landing .site-footer-default { display: none; }

body.landing .site-nav {
  position: absolute;
  left: 0;
  right: 0;
}

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

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

@keyframes swing3d {
  0%, 100% { transform: translateY(0) rotateY(-18deg); }
  50% { transform: translateY(-14px) rotateY(14deg); }
}

@media (max-width: 640px) {
  .nav-links { gap: 0.45rem; font-size: 0.9rem; }
  .photo-3d {
    width: min(280px, 78vw);
    height: min(350px, 98vw);
  }
  .cta-center {
    border-radius: 22px;
    width: 100%;
  }
  .cta-center .btn { flex: 1 1 130px; }
}

@media (prefers-reduced-motion: reduce) {
  .photo-3d { animation: none; }
  .photo-3d-card { transform: rotateY(-10deg) rotateX(4deg); }
}
