/* ══ Islamic Sage Modern — sage · ivory · deep moss · breathing lattice ══
   Prefix: sg- · Fonts: Spectral · IBM Plex Sans · Amiri */

:root {
  --sg-ivory: #FAF9F4;
  --sg-sage: #9CAF88;
  --sg-sage-ink: #6B7F58;
  --sg-sage-l: #DFE7D8;
  --sg-sage-l2: #EFF3EA;
  --sg-moss: #3E4A3D;
  --sg-moss-l: #5F7351;
  --sg-mut: #7D8676;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: "IBM Plex Sans", system-ui, sans-serif; background: var(--sg-moss); color: var(--sg-moss); -webkit-font-smoothing: antialiased; }
body:not(.is-open) { overflow: hidden; }

.sg-page {
  max-width: 480px; margin: 0 auto; background: var(--sg-ivory);
  box-shadow: 0 0 70px rgba(62,74,61,.3); position: relative; overflow-x: clip;
}
.sg-page::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle at 50% 22%, rgba(156,175,136,.14), transparent 55%);
  animation: sg-breathe 9s ease-in-out infinite;
}
@keyframes sg-breathe { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sg-page::before { animation: none; } }
.sg-page > * { position: relative; z-index: 1; }

/* ── cover: star bloom ── */
.sg-cover {
  position: fixed; inset: 0; z-index: 100; max-width: 480px; margin: 0 auto;
  background: var(--sg-sage-l); display: flex; align-items: center; justify-content: center;
  transition: visibility 0s 1.05s;
}
.sg-cover-lattice { position: absolute; inset: 0; opacity: .5; }
.sg-cover-lattice svg { width: 100%; height: 100%; }
.sg-bloom {
  position: absolute; width: 560px; height: 560px; left: 50%; top: 50%;
  transform: translate(-50%,-50%) rotate(0deg) scale(.62);
  color: var(--sg-sage); opacity: .95;
  transition: transform 1s cubic-bezier(.6,0,.3,1), opacity .7s ease;
}
.sg-bloom svg { width: 100%; height: 100%; fill: currentColor; }
body.is-open .sg-cover { visibility: hidden; pointer-events: none; }
body.is-open .sg-bloom { transform: translate(-50%,-50%) rotate(45deg) scale(1.35); opacity: 0; }
.sg-cover-inner { position: relative; text-align: center; padding: 30px; transition: opacity .4s ease; }
body.is-open .sg-cover-inner { opacity: 0; }
.sg-basmala { font-family: "Amiri", serif; font-size: 24px; color: var(--sg-moss-l); line-height: 1.9; }
.sg-basmala-sm { font-size: 18px; }
.sg-cover-kicker { font-size: 10.5px; letter-spacing: .32em; text-transform: uppercase; color: var(--sg-mut); margin: 14px 0 6px; }
.sg-cover-names { font-family: "Spectral", Georgia, serif; font-weight: 300; font-size: 44px; line-height: 1.12; }
.sg-cover-names span { display: block; font-size: 17px; font-style: italic; color: var(--sg-sage); margin: 4px 0; }
.sg-cover-date { font-size: 13px; letter-spacing: .12em; color: var(--sg-mut); margin-top: 6px; }
.sg-cover-guest { margin: 24px 0 20px; font-size: 12.5px; color: var(--sg-mut); }
.sg-guest-name { font-family: "Spectral", serif; font-size: 20px; color: var(--sg-moss); margin-top: 4px; }
.sg-open-btn {
  font-family: "IBM Plex Sans", sans-serif; font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  background: var(--sg-moss); color: var(--sg-ivory); border: none; padding: 14px 36px; cursor: pointer; border-radius: 999px;
  transition: background .25s ease, transform .2s ease;
}
.sg-open-btn:hover { background: var(--sg-moss-l); transform: translateY(-2px); }

/* ── hero: panel on panel ── */
.sg-hero { padding: 46px 20px 52px; background: var(--sg-sage-l); }
.sg-hero-panel {
  background: var(--sg-ivory); border-radius: 22px; padding: 36px 26px 32px; text-align: center;
  box-shadow: 0 22px 44px -22px rgba(62,74,61,.35), 0 1px 0 rgba(62,74,61,.04);
}
.sg-hero-intro { font-size: 12.5px; line-height: 1.75; color: var(--sg-mut); max-width: 34ch; margin: 14px auto 0; }
.sg-hero-names { font-family: "Spectral", serif; font-weight: 300; font-size: 46px; line-height: 1.1; margin: 16px 0 6px; }
.sg-hero-names em { font-style: italic; color: var(--sg-sage); }
.sg-hero-date { font-size: 13px; letter-spacing: .12em; color: var(--sg-mut); }
.sg-cd { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; max-width: 328px; margin: 26px auto 0; }
.sg-cd-cell { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.sg-cd-star { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--sg-sage-l); }
.sg-cd-cell b { position: relative; font-family: "Spectral", serif; font-weight: 400; font-size: 21px; font-variant-numeric: tabular-nums; color: var(--sg-moss); }
.sg-cd-cell span { position: absolute; bottom: 11%; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--sg-mut); }

/* ── quote ── */
.sg-quote { padding: 46px 30px; text-align: center; }
.sg-quote-ar { font-family: "Amiri", serif; font-size: 22px; line-height: 2.1; color: var(--sg-moss-l); }
.sg-quote-id { font-family: "Spectral", serif; font-style: italic; font-size: 13.5px; line-height: 1.8; color: var(--sg-mut); max-width: 36ch; margin: 16px auto 0; }
.sg-quote-src { margin-top: 12px; font-size: 10.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--sg-sage-ink); }

/* ── sections ── */
.sg-sec { padding: 46px 24px; }
.sg-sec-head { text-align: center; margin-bottom: 30px; }
.sg-head-star { width: 30px; height: 30px; fill: var(--sg-sage); margin-bottom: 4px; }
.sg-sec-title { font-family: "Spectral", serif; font-weight: 300; font-size: 26px; letter-spacing: .01em; }

/* ── couple ── */
.sg-couple { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sg-person {
  background: var(--sg-sage-l2); border-radius: 18px; text-align: center; padding: 24px 14px 20px;
}
.sg-medal { position: relative; width: 92px; height: 92px; margin: 0 auto 14px; display: grid; place-items: center; }
.sg-medal-star { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--sg-sage); }
.sg-medal b { position: relative; font-family: "Spectral", serif; font-weight: 400; font-size: 30px; color: var(--sg-ivory); }
.sg-person-name { font-family: "Spectral", serif; font-weight: 400; font-size: 18px; line-height: 1.3; }
.sg-person-parents { margin-top: 8px; font-size: 11px; line-height: 1.6; color: var(--sg-mut); }
.sg-person-ig { margin-top: 6px; font-size: 11px; color: var(--sg-sage-ink); }

/* ── events ── */
.sg-events { background: var(--sg-sage-l); }
.sg-event {
  background: var(--sg-ivory); border-radius: 18px; padding: 24px 22px 20px; text-align: center;
  box-shadow: 0 14px 30px -20px rgba(62,74,61,.3); margin-bottom: 12px;
}
.sg-event-title { font-family: "Spectral", serif; font-weight: 400; font-size: 21px; }
.sg-event-time { font-size: 12.5px; font-weight: 600; color: var(--sg-moss-l); margin-top: 4px; letter-spacing: .06em; }
.sg-event-venue { font-size: 14px; font-weight: 600; margin-top: 10px; }
.sg-event-addr { font-size: 12px; line-height: 1.55; color: var(--sg-mut); margin-top: 2px; }
.sg-cal { margin-top: 12px; display: flex; justify-content: center; gap: 12px; }
.sg-cal a {
  font-size: 11.5px; font-weight: 600; color: var(--sg-moss); text-decoration: none;
  border: 1px solid var(--sg-sage); border-radius: 999px; padding: 6px 13px; transition: background .2s ease, color .2s ease;
}
.sg-cal a:hover { background: var(--sg-sage); color: var(--sg-ivory); }
.sg-map-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.sg-map-tab {
  appearance: none; border: none; background: var(--sg-ivory); cursor: pointer; border-radius: 999px;
  padding: 10px 0; font-family: "IBM Plex Sans", sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--sg-mut);
}
.sg-map-tab.is-active { background: var(--sg-moss); color: var(--sg-ivory); }
.sg-map { display: block; width: 100%; height: 215px; border: none; border-radius: 18px; }

/* ── story ── */
.sg-story { list-style: none; display: grid; gap: 0; }
.sg-story-item { position: relative; padding: 0 0 26px 30px; }
.sg-story-item:last-child { padding-bottom: 0; }
.sg-story-item::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 13px; height: 13px;
  background: var(--sg-sage); clip-path: polygon(50% 0, 63% 30%, 100% 30%, 72% 55%, 82% 92%, 50% 70%, 18% 92%, 28% 55%, 0 30%, 37% 30%);
}
.sg-story-item::after { content: ""; position: absolute; left: 6px; top: 18px; bottom: -4px; width: 1.5px; background: var(--sg-sage-l); }
.sg-story-item:last-child::after { display: none; }
.sg-story-year { font-family: "Spectral", serif; font-size: 14px; color: var(--sg-moss-l); letter-spacing: .1em; }
.sg-story-title { font-family: "Spectral", serif; font-weight: 400; font-size: 18.5px; margin: 3px 0 5px; }
.sg-story-text { font-size: 13px; line-height: 1.7; color: var(--sg-mut); }

/* ── gallery ── */
.sg-gal-sec { background: var(--sg-sage-l); }
.sg-gal { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sg-g-item { border-radius: 16px; overflow: hidden; cursor: zoom-in; box-shadow: 0 12px 26px -18px rgba(62,74,61,.4); transition: transform .25s ease;  aspect-ratio: 4/3; overflow: hidden; }
.sg-g-item:hover { transform: translateY(-3px); }
.sg-g-item svg { display: block; width: 100%; height: auto; }
.sg-g-item img { display: block; width: 100%; height: 100%; aspect-ratio: 4/3; object-fit: cover; }
.sg-g-item { color: #5F7351; }

/* ── forms ── */
.sg-form { display: grid; gap: 15px; }
.sg-field { display: grid; gap: 6px; border: none; }
.sg-field span, .sg-field legend { font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--sg-moss-l); }
.sg-field input, .sg-field select, .sg-field textarea {
  font-family: "IBM Plex Sans", sans-serif; font-size: 14px; color: var(--sg-moss);
  background: var(--sg-sage-l2); border: 1.5px solid transparent; border-radius: 12px; padding: 12px 14px; outline: none; width: 100%;
}
.sg-field input:focus, .sg-field select:focus, .sg-field textarea:focus { border-color: var(--sg-sage); background: var(--sg-ivory); }
.sg-radios { display: block; }
.sg-radios label { display: flex; gap: 9px; align-items: center; font-size: 13.5px; padding: 4px 0; text-transform: none; letter-spacing: 0; color: var(--sg-mut); }
.sg-radios input { accent-color: var(--sg-moss-l); width: 16px; height: 16px; }
.sg-submit {
  justify-self: center; appearance: none; cursor: pointer; border-radius: 999px;
  background: var(--sg-moss); color: var(--sg-ivory); border: none;
  font-family: "IBM Plex Sans", sans-serif; font-size: 12px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; padding: 13px 34px; transition: background .25s ease, transform .2s ease;
}
.sg-submit:hover { background: var(--sg-moss-l); transform: translateY(-2px); }
.sg-thanks { text-align: center; font-family: "Spectral", serif; font-style: italic; font-size: 17px; color: var(--sg-moss-l); padding: 22px 8px; }

/* ── wishes ── */
.sg-wish-form { margin-bottom: 26px; }
.sg-wishes { display: grid; gap: 10px; margin-bottom: 16px; }
[data-wishes-list] .wish { background: var(--sg-sage-l2); border-radius: 14px; padding: 14px 17px 12px; }
[data-wishes-list] .wish h4 { font-family: "Spectral", serif; font-weight: 500; font-size: 15.5px; }
[data-wishes-list] .wish p { font-size: 13px; line-height: 1.65; color: var(--sg-mut); margin-top: 3px; }
[data-wishes-list] .wish time { display: block; font-size: 10.5px; color: var(--sg-sage-ink); margin-top: 5px; }
.sg-more {
  display: block; margin: 0 auto; appearance: none; background: none; cursor: pointer; border-radius: 999px;
  border: 1px solid var(--sg-sage); color: var(--sg-moss-l); font-family: "IBM Plex Sans", sans-serif;
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; padding: 9px 20px;
}

/* ── amplop ── */
.sg-amplop { background: var(--sg-sage-l); }
.sg-amplop-note { text-align: center; font-size: 13px; line-height: 1.7; color: var(--sg-mut); max-width: 36ch; margin: 0 auto 20px; }
.sg-envs { display: grid; gap: 12px; }
.sg-env { background: var(--sg-ivory); border-radius: 16px; text-align: center; padding: 20px 18px 17px; box-shadow: 0 12px 26px -20px rgba(62,74,61,.35); }
.sg-env-name { font-size: 10.5px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--sg-moss-l); }
.sg-env-num { font-family: "Spectral", serif; font-size: 23px; letter-spacing: .05em; margin-top: 7px; }
.sg-env-holder { font-size: 12px; color: var(--sg-mut); margin-top: 3px; }
.sg-copy {
  margin-top: 12px; appearance: none; cursor: pointer; border-radius: 999px;
  background: var(--sg-sage-l); color: var(--sg-moss); border: 1px solid var(--sg-sage);
  font-family: "IBM Plex Sans", sans-serif; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: 7px 15px;
}

/* ── closing ── */
.sg-closing { background: var(--sg-moss); color: var(--sg-sage-l); text-align: center; padding: 52px 28px 38px; }
.sg-closing-text { font-size: 13px; line-height: 1.75; color: #C3CDB9; max-width: 34ch; margin: 0 auto 20px; }
.sg-closing-names { font-family: "Spectral", serif; font-weight: 300; font-size: 36px; color: var(--sg-ivory); }
.sg-closing-du { margin-top: 16px; font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--sg-sage); }

/* ── music ── */
.sg-music {
  position: fixed; right: 18px; bottom: 22px; z-index: 90; width: 46px; height: 46px; border-radius: 50%;
  background: var(--sg-moss); color: var(--sg-sage-l); border: 1px solid rgba(156,175,136,.5);
  cursor: pointer; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(62,74,61,.35);
}
.sg-music svg { width: 20px; height: 20px; }
.sg-music.is-playing { animation: sg-breathe 3.2s ease-in-out infinite; }

/* ── reveal (behavior-critical) ── */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .85s ease, transform .85s ease; }
[data-reveal].revealed { opacity: 1; transform: none; }

.lb-overlay { font-family: "IBM Plex Sans", sans-serif; }
.map-open { color: var(--sg-moss-l); }