:root {
  --paper: #fbfbf7;
  --paper2: #f2f0e8;

  --ink: #2a2a2a;
  --inkSoft: rgba(42, 42, 42, .70);
  --muted: rgba(42, 42, 42, .55);

  --sage: #9fb3a1;
  --sage2: #7f9a86;

  --line: rgba(127, 154, 134, .22);
  --line2: rgba(42, 42, 42, .10);

  --radius: 26px;

  --script: "Great Vibes", cursive;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Montserrat", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  background:
    radial-gradient(900px 520px at 20% 0%, rgba(159, 179, 161, .10), transparent 70%),
    radial-gradient(900px 520px at 92% 16%, rgba(159, 179, 161, .08), transparent 68%),
    linear-gradient(180deg, var(--paper), var(--paper2));
}

/* gentle paper grain, barely there */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .045;
  background-image:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .014), rgba(0, 0, 0, .014) 1px, transparent 1px, transparent 6px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .010), rgba(0, 0, 0, .010) 1px, transparent 1px, transparent 8px);
  mix-blend-mode: multiply;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) clamp(14px, 2.2vw, 18px) clamp(28px, 4vw, 52px);
}

/* “printed sheet” – invite-like */
.invite {
  position: relative;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(127, 154, 134, .14);
  border-radius: var(--radius);
  padding: clamp(18px, 2.6vw, 30px);
  overflow: hidden;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .04);
}

/* double-line stationery margin (NOT a boxy frame) */
.invite::before {
  content: "";
  position: absolute;
  inset: clamp(14px, 2vw, 20px);
  border: 1px solid rgba(127, 154, 134, .14);
  border-radius: calc(var(--radius) - 8px);
  pointer-events: none;
}

.invite::after {
  content: "";
  position: absolute;
  inset: clamp(22px, 2.8vw, 30px);
  border: 1px solid rgba(42, 42, 42, .08);
  border-radius: calc(var(--radius) - 14px);
  pointer-events: none;
  opacity: .55;
}

/* foliage container */
.foliage-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

/* shared foliage */
.foliage {
  position: absolute;
  background: url("assets/floral/leaf-line.png") no-repeat;
  background-size: contain;
  opacity: 0.45;
  /* NOTICEABLE */
}

/* top-left foliage */
.foliage.left {
  top: -60px;
  left: -105px;
  width: 420px;
  height: 420px;
  background-position: left top;
  transform: scaleX(-1) rotate(0deg);
}

/* content must sit above foliage */
.header,
.section,
.panel {
  position: relative;
  z-index: 5;
}

.foliage-br {
  position: absolute;
  bottom: -80px;
  right: -40px;
  width: 420px;
  height: 420px;
  background: url("assets/floral/leaf-br.png") no-repeat;
  background-size: contain;
  opacity: 0.16;
  /* subtle but visible */
  z-index: 1;
  /* below line foliage, above paper */
  transform: scaleX(-1) rotate(-6deg);
  pointer-events: none;
}



/* keep content above “print lines” */
.header,
.section,
.panel {
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  text-align: center;
  padding: clamp(10px, 1.4vw, 14px) clamp(10px, 1.4vw, 14px) 6px;
}

.monogram {
  width: clamp(56px, 7vw, 72px);
  height: clamp(56px, 7vw, 72px);
  border-radius: 999px;
  border: 1px solid rgba(127, 154, 134, .22);
  background: rgba(255, 255, 255, .82);
  margin: 0 auto 10px;

  display: grid;
  place-items: center;

  color: var(--sage2);
  font-family: var(--serif);
  letter-spacing: .18em;
  font-weight: 600;
}

.monogram .plus {
  font-family: var(--sans);
  letter-spacing: .12em;
  font-size: 12px;
  color: rgba(42, 42, 42, .32);
  font-weight: 500;
}

.names {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(40px, 6.6vw, 58px);
  line-height: 1.06;
  color: rgba(42, 42, 42, .86);
}

.smallcaps {
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: rgba(127, 154, 134, .68);
  /* sage-forward */
}

.subline {
  margin: 12px auto 0;
  max-width: 640px;
  font-size: clamp(16px, 2.2vw, 18px);
  line-height: 1.9;
  color: rgba(42, 42, 42, .66);
}

/* invite-style hairline divider */
.rule {
  height: 1px;
  width: clamp(220px, 40vw, 320px);
  margin: 18px auto 0;
  background: rgba(127, 154, 134, .28);
}

/* sections */
.section {
  margin-top: 18px;
  padding: 10px 10px 0;
}

.sectionTitle {
  margin: 0 0 6px;
  font-size: clamp(22px, 3.2vw, 26px);
  font-weight: 600;
  letter-spacing: .01em;
  text-align: center;
}

.hint {
  margin: 0 auto;
  text-align: center;
  max-width: 640px;
  font-size: clamp(15px, 2.1vw, 16px);
  line-height: 1.75;
  color: rgba(42, 42, 42, .60);
}

/* layout */
.twoCol {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 12px;
}

@media (min-width: 900px) {
  .twoCol {
    grid-template-columns: 1fr 1fr;
  }
}

/* panels – quieter, more “paper inset” */
.panel {
  background: rgba(255, 255, 255, .70);
  border: 1px solid rgba(42, 42, 42, .08);
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .03);
}

.panelTitle {
  margin: 2px 0 8px;
  font-size: clamp(24px, 3vw, 30px);
  font-family: var(--serif);
  font-weight: 600;
  text-align: left;
  color: rgba(42, 42, 42, .84);
}

.panelTop {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.label {
  display: block;
  margin: 14px 0 8px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(127, 154, 134, .70);
}

.field {
  width: 100%;
  border: 1px solid rgba(42, 42, 42, .10);
  border-radius: 14px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, .86);
  outline: none;
  font-size: 16px;
  font-family: var(--serif);
  color: rgba(42, 42, 42, .86);
}

.field:focus {
  border-color: rgba(127, 154, 134, .45);
  box-shadow: 0 0 0 6px rgba(159, 179, 161, .10);
}

textarea.field {
  resize: vertical;
}

/* password gate row */
.gateRow {
  display: flex;
  gap: 12px;
  margin: 14px auto 0;
  max-width: 520px;
}

@media (max-width: 520px) {
  .gateRow {
    flex-direction: column;
  }
}

.btn {
  border: 1px solid rgba(127, 154, 134, .32);
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  background: rgba(127, 154, 134, .90);
  color: #fff;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  font-weight: 500;
}

.btn.wide {
  width: min(260px, 100%);
  display: block;
  margin: 16px auto 0;
}

.btn:hover {
  filter: brightness(1.02);
}

.btn:active {
  transform: translateY(1px);
}

.link {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(42, 42, 42, .52);
  padding: 8px 10px;
}

.link:hover {
  color: rgba(42, 42, 42, .78);
}

/* custom file picker */
.fileWrap {
  position: relative;
}

.fileInput {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.fileUi {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px dashed rgba(127, 154, 134, .30);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, .72);
}

.fileBtn {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(42, 42, 42, .10);
  background: rgba(255, 255, 255, .86);
  color: rgba(42, 42, 42, .66);
  white-space: nowrap;
}

.fileNames {
  font-size: 14px;
  color: rgba(42, 42, 42, .56);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
  min-height: 30px;
}

@media (min-width: 720px) {
  .gallery {
    grid-template-columns: repeat(4, 1fr);
  }
}


.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: grid;
  place-items: center;
  z-index: 9999;
}

.loadMore {
  margin: 32px auto 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 10px 28px;
  border-radius: 999px;
  border: 1px solid rgba(26, 26, 26, .18);
  background: rgba(255, 255, 255, .6);

  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;

  opacity: .65;
  cursor: pointer;
  transition: opacity .2s ease, transform .2s ease;
}

.loadMore::after {
  content: "›";
  font-size: 18px;
  line-height: 1;
  margin-top: -1px;
}

.loadMore:hover {
  opacity: 1;
  transform: translateY(-1px);
}


.lightbox.hidden {
  display: none;
}

.lbInner {
  width: min(92vw, 860px);
  max-height: 88vh;
  background: rgba(255, 255, 255, .92);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

#lbImg {
  width: 100%;
  height: auto;
  max-height: 68vh;
  object-fit: contain;
  display: block;
  border-radius: 16px;
}

.lbMeta {
  padding: 12px 6px 4px;
  color: #2b2b2b;
}

.lbName {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .65;
}

.lbMsg {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.45;
  opacity: .9;
}

.lbClose {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, .9);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.lbNav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, .9);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.lbPrev {
  left: 18px;
}

.lbNext {
  right: 18px;
}


/* messages + closing */
.msg {
  margin: 12px 0 0;
  text-align: center;
  font-family: var(--serif);
  font-size: 14px;
  color: rgba(42, 42, 42, .66);
  min-height: 18px;
}

.footnote {
  margin-top: 10px;
}

.closing {
  margin: 18px 0 2px;
  text-align: center;
  font-size: 16px;
  color: rgba(42, 42, 42, .60);
}

.script {
  font-family: var(--script);
  font-size: 28px;
  color: rgba(42, 42, 42, .78);
}

/* utilities */
.hidden {
  display: none !important;
}

/* --- Gallery grid (keeps all items same size) --- */
#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 22px;
  align-items: start;
}

/* --- Polaroid card --- */
.thumb {
  background: #ffffffe6;;
  border-radius: 18px;
  padding: 12px 12px 16px;
  /* extra bottom = polaroid feel */
  box-shadow:
    0 8px 20px rgba(0, 0, 0, .08),
    inset 0 0 0 1px rgba(26, 26, 26, .08);
  transition: transform .18s ease, box-shadow .18s ease;
  cursor: pointer;
}

/* subtle lift on hover */
.thumb:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, .12),
    inset 0 0 0 1px rgba(26, 26, 26, .1);
}

/* --- Image area (forces uniform size) --- */
.thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  /* 👈 square thumbnails */
  object-fit: cover;
  /* crop nicely */
  border-radius: 12px;
  display: block;
  background: #f3f3f3;
}

/* --- Caption area --- */
.thumbMeta {
  margin-top: 10px;
  text-align: center;
}

/* name = handwritten label vibe */
.thumbName {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .65;
}

/* message = little note */
.thumbMsg {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
  opacity: .85;
}

.album {
  position: relative;
  perspective: 1400px;
}

/* the "page" that flips */
.albumPage {
  transform-origin: left center;
  transition: transform .7s ease, opacity .4s ease;
}

/* flip out animation */
.albumPage.turning {
  transform: rotateY(-110deg);
  opacity: 0;
}

/* nice subtle page-turn button (inside the panel) */
/* Arrow buttons (next / back) */
.turnPage{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  width: 42px;
  height: 42px;
  border-radius: 999px;

  border: 1px solid rgba(127,154,134,.25);
  background: rgba(255,255,255,.85);
  box-shadow: 0 8px 20px rgba(0,0,0,.12);

  display: grid;
  place-items: center;

  cursor: pointer;
  opacity: .8;
  transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;

  font-size: 0; /* hide any text */
  z-index: 10;
}

/* RIGHT arrow */
#turnPage{
  right: -18px;
}
#turnPage::before{
  content: "›";
  font-size: 28px;
  line-height: 1;
  color: rgba(42,42,42,.7);
}

/* LEFT arrow */
#prevPage{
  left: -18px;
}
#prevPage::before{
  content: "‹";
  font-size: 28px;
  line-height: 1;
  color: rgba(42,42,42,.7);
}

/* hover */
.turnPage:hover{
  opacity: 1;
  box-shadow: 0 12px 26px rgba(0,0,0,.16);
}
#turnPage:hover{
  transform: translateY(-50%) translateX(2px);
}
#prevPage:hover{
  transform: translateY(-50%) translateX(-2px);
}

/* disabled state */
.turnPage:disabled{
  opacity: .25;
  cursor: default;
  box-shadow: none;
}
#turnPage:disabled:hover,
#prevPage:disabled:hover{
  transform: translateY(-50%);
}

/* mobile – tuck arrows in */
@media (max-width: 720px){
  #turnPage{ right: -10px; }
  #prevPage{ left: -10px; }
}


/* =========================
   MOBILE POLISH (phones)
   ========================= */
@media (max-width: 720px) {

  /* Page padding + keep it centered */
  .page {
    padding: 16px 12px 28px;
  }

  /* Invite sheet: a bit tighter but still “paper” */
  .invite {
    padding: 18px 14px 18px;
    border-radius: 22px;
  }

  /* Inner margin line: bring in slightly */
  .invite::after {
    inset: 12px;
    border-radius: 16px;
  }

  /* Header typography scales down nicely */
  .names {
    font-size: 40px;
    /* was clamp – lock for phones */
    line-height: 1.05;
  }

  .subline {
    font-size: 15px;
    line-height: 1.7;
    max-width: 34ch;
  }

  .rule {
    width: 200px;
    margin-top: 14px;
  }

  /* Stack the 2 panels */
  .twoCol {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 14px;
  }

  /* Panels: less padding so they don’t feel chunky */
  .panel {
    padding: 16px 14px;
    border-radius: 18px;
  }

  .panelTitle {
    font-size: 24px;
    margin-bottom: 6px;
  }

  /* Labels & fields: better readability + tap targets */
  .label {
    font-size: 10px;
    letter-spacing: .22em;
    margin: 12px 0 6px;
  }

  .field {
    font-size: 16px;
    /* prevents iOS zoom */
    padding: 12px 12px;
    border-radius: 14px;
  }

  textarea.field {
    min-height: 110px;
  }

  /* File picker: stack nicely */
  .fileUi {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .fileBtn {
    width: 100%;
    text-align: center;
  }

  .fileNames {
    white-space: normal;
    overflow: visible;
  }

  /* Buttons: easier to press */
  .btn {
    width: 100%;
    padding: 14px 16px;
    font-size: 11px;
  }

  .btn.wide {
    width: 100%;
    margin-top: 14px;
  }

  /* Gallery thumbs: bigger on phones */
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .thumb {
    border-radius: 12px;
  }

  /* Footer spacing */
  .closing {
    margin-top: 14px;
    font-size: 15px;
  }

  /* =========================
   MOBILE FOLIAGE (your exact classes)
   ========================= */
  @media (max-width: 720px) {

    /* Create a clean stacking context */
    .invite {
      position: relative;
      isolation: isolate;
    }

    /* Decoration layer */
    .foliage-wrap {
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 1;
      /* below text/panels */
    }

    /* Make sure content is above */
    .header,
    .section,
    .panel {
      position: relative;
      z-index: 5;
    }

    /* Shared foliage behaviour on mobile */
    .foliage {
      opacity: 0.16;
      /* visible but light */
      filter: blur(0.15px);
      /* soft print feel */
    }

    /* TOP-LEFT (hero) -peeking in like the invite */
    .foliage.left {
      width: 260px;
      height: 260px;
      top: -70px;
      left: -70px;
      transform: scaleX(-1) rotate(10deg);
      opacity: 0.35;
      /* slightly stronger than base */
    }

    /* TOP-RIGHT -remove on mobile to avoid “frame/template” vibe */
    .foliage.right {
      display: none;
    }

    /* BOTTOM-RIGHT (soft filled leaf) -balance only */
    .foliage-br {
      position: absolute;
      width: 300px;
      height: 300px;
      right: -160px;
      bottom: -75px;
      opacity: 0.25;
      transform: rotate(-6deg);
      filter: blur(0.15px);
    }

    /* iOS: prevent zoom on focus */
    .field {
      font-size: 16px;
    }
  }

  /* Extra small phones */
  @media (max-width: 380px) {
    .foliage.left {
      width: 230px;
      height: 230px;
      top: -85px;
      left: -110px;
      opacity: 0.40;
    }

    .foliage-br {
      width: 260px;
      height: 260px;
      right: -110px;
      bottom: -130px;
      opacity: 0.10;
    }
  }

  /* Extra-small phones */
  @media (max-width: 380px) {
    .names {
      font-size: 36px;
    }

    .panelTitle {
      font-size: 22px;
    }

    .gallery {
      grid-template-columns: repeat(2, 1fr);
    }
  }
}

.previews{
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (min-width: 720px){
  .previews{
    grid-template-columns: repeat(4, 1fr);
  }
}

.preview{
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(127,154,134,.22);
  background: rgba(255,255,255,.7);
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
}

.preview img{
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.previewRemove{
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(42,42,42,.18);
  background: rgba(255,255,255,.9);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  opacity: .95;
}

.previewRemove:hover{
  transform: translateY(-1px);
}

/* Force 2 photos per row on phones */
@media (max-width: 720px){
  .gallery{
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px; /* slightly tighter for phones */
  }
}
