/* Noor Courtyard — a Nikah under the lanterns */
:root {
  --deep: #06231F;
  --emerald: #0B3B33;
  --emerald-2: #115246;
  --gold: #D6B160;
  --gold-light: #F1DDA6;
  --ivory: #F7F1E3;
  --rose: #D49A93;
  --text: #EFE8D6;
  --muted: #A9BDB4;
  --arabic: "Amiri", "Traditional Arabic", serif;
  --display: "Marcellus", "Times New Roman", serif;
  --serif: "Spectral", Georgia, serif;
  --script: "Alex Brush", cursive;
  --ease: cubic-bezier(.22, .8, .2, 1);
  /* an eight-point star (two overlapping squares) */
  --star8: polygon(50% 0%, 61% 25%, 85% 15%, 75% 39%, 100% 50%, 75% 61%, 85% 85%, 61% 75%, 50% 100%, 39% 75%, 15% 85%, 25% 61%, 0% 50%, 25% 39%, 15% 15%, 39% 25%);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--deep);
  color: var(--text);
  font-family: var(--serif);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.65;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; height: 100svh; }
img, video, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  background: var(--ivory); color: var(--deep); padding: 8px 14px; border-radius: 6px;
}
.skip-link:focus { top: 16px; }

/* a quiet gold star lattice behind the page */
main {
  position: relative;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23D6B160' stroke-opacity='.09' stroke-width='1'%3E%3Crect x='22' y='22' width='36' height='36'/%3E%3Crect x='22' y='22' width='36' height='36' transform='rotate(45 40 40)'/%3E%3Cpath d='M0 40h14M66 40h14M40 0v14M40 66v14'/%3E%3C/g%3E%3C/svg%3E");
}

.eyebrow {
  font-family: var(--display);
  font-size: .74rem; letter-spacing: .26em; text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 .8rem;
}
.display {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2rem, 8.5vw, 3rem);
  line-height: 1.12;
  margin: 0 0 1.4rem;
  color: var(--ivory);
}
.display em { font-family: var(--script); font-style: normal; font-size: 1.15em; color: var(--gold-light); }
.bismillah { font-family: var(--arabic); font-size: clamp(1.6rem, 7vw, 2.2rem); line-height: 1.6; color: var(--gold-light); margin: 0; }

/* ================= Intro ================= */
.intro {
  position: fixed; inset: 0; z-index: 50;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, var(--emerald-2), var(--deep) 75%);
  transition: opacity 1.2s ease, visibility 1.2s;
}
.intro.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }

/* The film is cut out by a star that grows to fill the screen */
@property --r { syntax: "<length>"; inherits: false; initial-value: 0px; }
.portal {
  position: absolute; inset: 0;
  --r: 0px;
  /* eight-point star centred on the pattern; --r is its outer radius */
  clip-path: polygon(
    calc(50% + 0 * var(--r)) calc(40% - 1 * var(--r)),
    calc(50% + .237 * var(--r)) calc(40% - .573 * var(--r)),
    calc(50% + .707 * var(--r)) calc(40% - .707 * var(--r)),
    calc(50% + .573 * var(--r)) calc(40% - .237 * var(--r)),
    calc(50% + 1 * var(--r)) calc(40% - 0 * var(--r)),
    calc(50% + .573 * var(--r)) calc(40% + .237 * var(--r)),
    calc(50% + .707 * var(--r)) calc(40% + .707 * var(--r)),
    calc(50% + .237 * var(--r)) calc(40% + .573 * var(--r)),
    calc(50% + 0 * var(--r)) calc(40% + 1 * var(--r)),
    calc(50% - .237 * var(--r)) calc(40% + .573 * var(--r)),
    calc(50% - .707 * var(--r)) calc(40% + .707 * var(--r)),
    calc(50% - .573 * var(--r)) calc(40% + .237 * var(--r)),
    calc(50% - 1 * var(--r)) calc(40% - 0 * var(--r)),
    calc(50% - .573 * var(--r)) calc(40% - .237 * var(--r)),
    calc(50% - .707 * var(--r)) calc(40% - .707 * var(--r)),
    calc(50% - .237 * var(--r)) calc(40% - .573 * var(--r))
  );
  transition: --r 2.8s cubic-bezier(.65, 0, .25, 1);
}
.portal__film { width: 100%; height: 100%; object-fit: cover; }
.is-opening .portal { --r: 260vmax; }

.girih {
  position: absolute; left: 50%; top: 40%;
  width: min(92vw, 520px); height: min(92vw, 520px);
  transform: translate(-50%, -50%);
  overflow: visible;
  transition: transform 2.6s cubic-bezier(.65, 0, .25, 1), opacity 1.6s ease .6s;
}
.girih path, .girih circle, .girih polygon {
  fill: none; stroke: var(--gold); stroke-width: 1.2; stroke-linejoin: round;
  stroke-dasharray: var(--len, 1200); stroke-dashoffset: var(--len, 1200);
  animation: draw 3.2s var(--ease) forwards;
  animation-delay: var(--delay, 0s);
}
.girih .fill { fill: rgba(214,177,96,.08); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.girih__spin { transform-origin: 0 0; animation: spin 90s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.is-opening .girih { transform: translate(-50%, -50%) scale(4) rotate(22.5deg); opacity: 0; }

.intro__text {
  position: absolute; left: 16px; right: 16px; bottom: max(6vh, 40px);
  text-align: center;
  transition: opacity .6s;
}
.is-opening .intro__text { opacity: 0; pointer-events: none; }
.intro__text .bismillah { animation: up 1.2s var(--ease) .6s both; }
.intro__eyebrow { font-family: var(--display); letter-spacing: .3em; text-transform: uppercase; font-size: .72rem; color: var(--gold); margin: .6rem 0 0; animation: up 1s var(--ease) .9s both; }
.intro__names { font-family: var(--script); font-size: clamp(2.8rem, 12vw, 3.8rem); line-height: 1.2; margin: 0 0 1.1rem; color: var(--ivory); animation: up 1s var(--ease) 1.1s both; }
.intro__names span { color: var(--gold); }
@keyframes up { from { opacity: 0; transform: translateY(14px); } }
.tap {
  border: 1px solid var(--gold); border-radius: 999px;
  padding: .85rem 1.8rem;
  background: rgba(6,35,31,.6);
  color: var(--gold-light);
  font-family: var(--display); font-size: .78rem; letter-spacing: .24em; text-transform: uppercase;
  animation: up 1s var(--ease) 1.3s both;
}
.tap:hover, .tap:focus-visible { background: var(--emerald-2); outline: none; box-shadow: 0 0 0 3px rgba(214,177,96,.3); }

/* ================= Controls ================= */
.controls {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; gap: 10px; align-items: center;
}
.controls[hidden], .ctl[hidden] { display: none; }
.ctl {
  border: 1px solid rgba(214,177,96,.6); border-radius: 999px;
  background: rgba(6,35,31,.75); color: var(--gold-light);
  padding: .5rem 1rem;
  font-family: var(--display); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase;
  backdrop-filter: blur(6px);
}
.ctl--round { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; }
.ctl svg { width: 20px; height: 20px; fill: currentColor; }
.ctl .ico-off { display: none; }
.ctl[aria-pressed="false"] .ico-on { display: none; }
.ctl[aria-pressed="false"] .ico-off { display: block; }

/* ================= Hero ================= */
.hero { position: relative; min-height: 100svh; overflow: hidden; display: flex; justify-content: center; text-align: center; }
.hero__bg { position: absolute; inset: 0; background: url("media/courtyard-end.webp") center bottom / cover; }
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,35,31,.75) 0%, rgba(6,35,31,.45) 40%, rgba(6,35,31,.05) 62%, rgba(6,35,31,.6) 100%);
}
.hero__text { position: relative; z-index: 2; padding: max(8svh, 52px) 16px 0; max-width: 560px; }
.bismillah--hero { font-size: clamp(1.8rem, 8vw, 2.4rem); text-shadow: 0 0 18px rgba(214,177,96,.45); }
.hero .eyebrow { font-size: .62rem; letter-spacing: .18em; color: var(--gold-light); opacity: .85; }
.hero__names {
  font-family: var(--script); font-weight: 400;
  font-size: clamp(3.6rem, 17vw, 5.8rem);
  line-height: 1.05;
  margin: 0 0 .8rem;
  display: flex; flex-direction: column; align-items: center;
  color: var(--ivory);
  text-shadow: 0 2px 24px rgba(6,35,31,.8);
}
.hero__names em { font-family: var(--display); font-style: normal; font-size: .4em; color: var(--gold); margin: .15em 0; }
.hero__date {
  display: inline-block; margin: 0;
  font-family: var(--display); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold-light);
  padding: .55rem 1.1rem;
  border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold);
  background: rgba(6,35,31,.45);
}

.fade { opacity: 0; }
.is-open .fade { animation: fade-up 1.2s var(--ease) var(--d, 0s) both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ================= Ayah ================= */
.ayah { padding: 4.5rem 16px; }
.ayah__frame {
  position: relative;
  max-width: 32rem; margin: 0 auto;
  padding: 3rem 1.4rem 2.2rem;
  text-align: center;
  border: 1px solid rgba(214,177,96,.5);
  border-radius: 200px 200px 8px 8px;
  background: linear-gradient(180deg, rgba(17,82,70,.55), rgba(6,35,31,.4));
  box-shadow: inset 0 0 0 6px var(--deep), inset 0 0 0 7px rgba(214,177,96,.25);
}
.star { display: block; width: 34px; height: 34px; margin: 0 auto 1rem; background: var(--gold); clip-path: var(--star8); }
.ayah__ar { font-family: var(--arabic); font-size: clamp(1.4rem, 6vw, 1.8rem); line-height: 2.1; color: var(--gold-light); margin: 0 0 1.2rem; }
.ayah__en { font-style: italic; color: var(--text); margin: 0 0 .8rem; }
.ayah__ref { font-family: var(--display); font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); margin: 0; }

/* ================= Invitation ================= */
.invite { padding: 3rem 16px 4.5rem; text-align: center; }
.invite__inner { max-width: 32rem; margin: 0 auto; }
.invite__hosts { font-family: var(--display); font-size: 1.15rem; letter-spacing: .04em; color: var(--ivory); margin: 0; }
.invite__copy { font-style: italic; color: var(--muted); margin: .3rem auto; max-width: 22em; }
.invite__name { font-family: var(--script); font-weight: 400; font-size: clamp(2.8rem, 12vw, 3.6rem); line-height: 1.15; color: var(--gold-light); margin: .6rem 0 0; }
.invite__with { font-family: var(--display); font-size: .74rem; letter-spacing: .4em; text-transform: uppercase; color: var(--gold); margin: .2rem 0; }

/* ================= Arch + countdown ================= */
.arch { padding: 4.5rem 16px; display: grid; gap: 2.2rem; justify-items: center; text-align: center; background: linear-gradient(180deg, transparent, rgba(11,59,51,.7) 20%, rgba(11,59,51,.7) 80%, transparent); }
.arch__frame {
  width: min(76vw, 320px); aspect-ratio: 9 / 15;
  /* a Mughal multifoil arch */
  border-radius: 50% 50% 6px 6px / 28% 28% 6px 6px;
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 8px var(--deep), 0 0 0 9px rgba(214,177,96,.4), 0 0 60px rgba(214,177,96,.25);
  background: #000;
}
.arch__film { width: 100%; height: 100%; object-fit: cover; }
.arch__text { max-width: 30rem; }
.arch__text p:not(.eyebrow) { color: var(--muted); }

.stars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; max-width: 30rem; }
.cstar {
  aspect-ratio: 1;
  display: grid; place-content: center; text-align: center;
  clip-path: var(--star8);
  background: var(--gold);
  position: relative;
}
.cstar::before { content: ""; position: absolute; inset: 3px; clip-path: var(--star8); background: radial-gradient(circle, var(--emerald-2) 30%, var(--emerald) 70%); }
.cstar b, .cstar small { position: relative; }
.cstar b { font-family: var(--display); font-weight: 400; font-size: clamp(1.2rem, 6vw, 1.7rem); line-height: 1; color: var(--gold-light); }
.cstar small { font-family: var(--display); font-size: .5rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }

/* ================= Events ================= */
.events { padding: 4.5rem 16px; text-align: center; }
.events__list { list-style: none; margin: 0 auto; padding: 0; max-width: 34rem; display: grid; gap: 1.4rem; text-align: left; }
.event {
  position: relative;
  padding: 1.5rem 1.4rem 1.3rem 1.4rem;
  border: 1px solid rgba(214,177,96,.35);
  border-radius: 120px 120px 8px 8px / 40px 40px 8px 8px;
  background: rgba(11,59,51,.55);
}
.event__badge { position: absolute; top: -14px; left: 50%; width: 28px; height: 28px; margin-left: -14px; background: var(--gold); clip-path: var(--star8); }
.event__time { font-family: var(--display); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin: .4rem 0 0; text-align: center; }
.event__name { font-family: var(--script); font-weight: 400; font-size: 2.6rem; line-height: 1.1; margin: .1rem 0 .4rem; color: var(--ivory); text-align: center; }
.event__place { font-weight: 400; margin: 0; }
.event__note { color: var(--muted); margin: .3rem 0 0; font-size: 1rem; }
.event__dress { font-style: italic; color: var(--gold-light); margin: .4rem 0 0; font-size: .98rem; }
.event__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.events__note { max-width: 30rem; margin: 1.8rem auto 0; font-style: italic; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: .55rem 1.2rem;
  border: 1px solid var(--gold); border-radius: 999px;
  background: transparent; color: var(--gold-light);
  font-family: var(--display); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  text-decoration: none;
  transition: background .25s, color .25s;
}
.btn:hover, .btn:focus-visible { background: rgba(214,177,96,.15); outline: none; }
.btn--solid { background: var(--gold); color: var(--deep); }
.btn--solid:hover, .btn--solid:focus-visible { background: var(--gold-light); }

/* ================= RSVP ================= */
.rsvp { padding: 4.5rem 16px; text-align: center; }
.rsvp__form { max-width: 28rem; margin: 0 auto; display: grid; gap: 1.1rem; text-align: left; }
.field { display: grid; gap: .35rem; }
.field > span, .choice legend { font-family: var(--display); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.field small { text-transform: none; letter-spacing: 0; font-family: var(--serif); color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit; font-weight: 400; font-size: 1.02rem;
  padding: .7rem .9rem;
  border-radius: 10px;
  border: 1px solid rgba(214,177,96,.35);
  background: rgba(11,59,51,.6);
  color: var(--text);
}
.field select option { background: var(--emerald); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.choice { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; }
.choice legend { margin-bottom: .4rem; }
.choice--multi { grid-template-columns: repeat(3, 1fr); }
.choice--multi legend { grid-column: 1 / -1; }
.choice label {
  display: flex; align-items: center; gap: .6rem;
  min-height: 44px; padding: .6rem .8rem;
  border: 1px solid rgba(214,177,96,.3); border-radius: 10px;
  cursor: pointer;
}
.choice input { accent-color: var(--gold); width: 18px; height: 18px; margin: 0; flex: none; }
.choice label:has(input:checked) { border-color: var(--gold); background: rgba(214,177,96,.1); }
.rsvp__actions { display: grid; gap: .6rem; margin-top: .3rem; }

/* ================= Footer ================= */
.foot { text-align: center; padding: 1rem 16px calc(5.5rem + env(safe-area-inset-bottom)); }
.foot__lanterns {
  width: 220px; margin: 0 auto;
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
  mask-image: linear-gradient(180deg, #000 60%, transparent);
}
.foot__ar { font-family: var(--arabic); font-size: 1.5rem; line-height: 1.9; color: var(--gold-light); margin: 0 auto .4rem; max-width: 26rem; }
.foot__en { font-style: italic; color: var(--muted); max-width: 26rem; margin: 0 auto 1.2rem; }
.foot__names { font-family: var(--script); font-size: 2.4rem; color: var(--gold-light); margin: 0 0 1.4rem; }

/* ================= Reveal + toast ================= */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 70;
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  padding: .7rem 1.1rem;
  background: var(--ivory); color: var(--deep);
  border-radius: 10px;
  font-size: .98rem; font-weight: 400;
  opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 820px) {
  .arch { grid-template-columns: auto minmax(0, 30rem); align-items: center; justify-content: center; column-gap: 4rem; text-align: left; }
  .stars { grid-column: 1 / -1; justify-self: center; }
  .hero__bg { background-size: auto 100%; background-repeat: no-repeat; background-color: var(--deep); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fade, .reveal { opacity: 1; transform: none; }
  .girih path, .girih circle, .girih polygon { stroke-dashoffset: 0; }
}
