@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Noto+Kufi+Arabic:wght@400;500;600;700&display=swap');

:root {
  --paper: #f4ebdc;
  --paper-light: #fbf7ee;
  --paper-deep: #e8d9c4;
  --ink: #3c3030;
  --ink-soft: #6b5a53;
  --wine: #8c5a52;
  --wine-deep: #68433f;
  --sage: #7c8a70;
  --line: rgba(110, 76, 61, .25);
  --sans: 'Noto Kufi Arabic', sans-serif;
  --display: 'Amiri', serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: #d8c5ae; font-family: var(--sans); overflow-x: hidden; }
button { font: inherit; }
[hidden] { display: none !important; }

body::before { content: ''; position: fixed; inset: 0; z-index: -2; background: linear-gradient(125deg, #dbc8b2 0%, #cdb69e 52%, #e1d0b9 100%); }
body::after { content: ''; position: fixed; inset: 0; z-index: -1; opacity: .18; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paper)' opacity='.35'/%3E%3C/svg%3E"); mix-blend-mode: multiply; }

.page-shell { width: min(1160px, calc(100% - 42px)); margin: 0 auto; }
.topbar { height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); animation: fadeDown .8s ease both; }
.wordmark { color: var(--wine-deep); text-decoration: none; display: inline-flex; gap: 10px; align-items: center; font: 700 1.35rem var(--display); }
.wordmark-mark { color: var(--wine); font-size: 1.7rem; line-height: 1; }
.topbar-note { color: var(--wine); font-size: .62rem; letter-spacing: .08em; }
.live-dot { display: none; }

.hero { min-height: 530px; display: grid; grid-template-columns: .94fr 1.06fr; gap: 7%; align-items: center; padding: 70px 7% 62px; }
.hero-copy { order: 2; padding-top: 8px; }
.eyebrow { margin: 0 0 19px; color: var(--wine); font-size: .64rem; font-weight: 600; letter-spacing: .08em; display: flex; gap: 10px; align-items: center; }
.eyebrow > span { display: inline-block; width: 27px; height: 1px; background: var(--wine); opacity: .75; }
.eyebrow.centered { justify-content: center; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 560px; margin-bottom: 20px; color: var(--ink); font: 400 clamp(4rem, 8vw, 7.4rem)/.79 var(--display); letter-spacing: -.06em; animation: fadeUp .8s .12s ease both; }
h1 em, h2 em { color: var(--wine); font-style: normal; }
.hero-lede { width: min(350px, 100%); color: var(--ink-soft); font-size: .75rem; line-height: 2.1; animation: fadeUp .8s .22s ease both; }
.hero-signature { display: flex; align-items: center; gap: 10px; color: var(--wine); font: 400 1.15rem var(--display); margin-top: 27px; animation: fadeUp .8s .32s ease both; }
.signature-line { display: block; width: 42px; height: 1px; background: var(--wine); opacity: .55; }
.signature-line-short { width: 16px; }

.hero-art { order: 1; min-height: 340px; position: relative; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: rgba(251,247,238,.34); box-shadow: inset 0 0 0 10px rgba(251,247,238,.2); animation: fadeIn 1.1s .2s ease both; }
.hero-art::before { content: ''; position: absolute; inset: 19px; border: 1px solid rgba(110, 76, 61, .22); pointer-events: none; }
.hero-art::after { content: '❧'; position: absolute; top: 21px; right: 29px; color: var(--sage); font: 400 2.5rem var(--display); transform: rotate(-10deg); opacity: .65; }
.moon { width: 164px; height: 164px; border-radius: 50%; position: relative; z-index: 2; background: var(--paper-light); border: 1px solid rgba(140,90,82,.38); box-shadow: 0 12px 35px rgba(93,61,47,.14); }
.moon::before { content: 'ي & إ'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--wine); font: 400 3rem var(--display); padding-bottom: 5px; }
.moon::after { content: ''; position: absolute; inset: 12px; border: 1px solid rgba(140,90,82,.32); border-radius: 50%; }
.moon-glow { width: 226px; height: 226px; position: absolute; border: 1px solid rgba(124,138,112,.5); border-radius: 50%; transform: rotate(27deg); }
.star { color: var(--wine); position: absolute; z-index: 3; font-family: var(--display); }
.star-a { top: 22%; right: 18%; font-size: 1.1rem; }
.star-b { bottom: 22%; left: 21%; font-size: .82rem; }
.star-c { top: 18%; left: 22%; color: var(--sage); font-size: 1.7rem; }
.petal { position: absolute; z-index: 1; width: 46px; height: 21px; border: 1px solid var(--sage); border-radius: 100% 0 100% 0; opacity: .7; }
.petal-a { right: 15%; bottom: 23%; transform: rotate(28deg); }
.petal-b { right: 24%; bottom: 15%; transform: rotate(-35deg) scale(.7); }
.petal-c { left: 15%; top: 31%; transform: rotate(114deg) scale(.55); }
.petal-d { left: 22%; top: 22%; transform: rotate(202deg) scale(.35); }
.stem { height: 110px; width: 1px; position: absolute; background: linear-gradient(var(--sage), transparent); transform: rotate(31deg); right: 21%; bottom: 15%; opacity: .7; }
.stem-b { height: 72px; right: auto; left: 22%; bottom: auto; top: 27%; transform: rotate(-28deg); }
.art-caption { position: absolute; bottom: 22px; left: 34px; right: 34px; display: flex; align-items: center; gap: 9px; color: var(--wine); font-size: .55rem; letter-spacing: .1em; }
.art-caption i { height: 1px; flex: 1; background: var(--line); }

.unlock-card { position: relative; overflow: hidden; margin: 0 7% 88px; border: 1px solid rgba(140,90,82,.45); background: var(--paper-light); min-height: 425px; display: flex; align-items: center; justify-content: center; text-align: center; box-shadow: 0 20px 60px rgba(75,50,39,.15); }
.unlock-card::before { content: '❧'; position: absolute; color: rgba(124,138,112,.15); font: 400 17rem/1 var(--display); right: -20px; top: -80px; transform: rotate(24deg); }
.unlock-card::after { content: ''; position: absolute; inset: 14px; border: 1px solid rgba(140,90,82,.15); pointer-events: none; }
.unlock-inner { position: relative; z-index: 2; width: min(650px, 100%); padding: 44px 28px 34px; }
.lock-badge { height: 64px; width: 64px; border-radius: 50%; background: var(--wine); color: var(--paper-light); display: grid; place-items: center; margin: 0 auto 21px; font: 400 2.25rem var(--display); box-shadow: 0 7px 16px rgba(140,90,82,.23); }
.lock-badge span { transform: rotate(180deg); }
.unlock-card h2 { margin-bottom: 11px; color: var(--ink); font: 400 clamp(2.7rem, 5vw, 4.6rem)/.94 var(--display); letter-spacing: -.04em; }
.unlock-hint { margin-bottom: 29px; color: var(--ink-soft); font-size: .7rem; }
.answer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.answer-btn { cursor: pointer; border: 1px solid rgba(140,90,82,.33); background: rgba(244,235,220,.45); color: var(--ink); padding: 15px 10px; display: flex; align-items: center; justify-content: center; gap: 11px; transition: border-color .25s, background .25s, transform .25s, color .25s; }
.answer-btn:hover, .answer-btn:focus-visible { border-color: var(--wine); background: rgba(140,90,82,.09); color: var(--wine-deep); transform: translateY(-2px); outline: none; }
.answer-btn.correct { border-color: var(--sage); background: rgba(124,138,112,.16); color: var(--wine-deep); }
.answer-btn.wrong { animation: shake .38s ease; border-color: rgba(140,90,82,.75); color: var(--wine); }
.answer-index { color: var(--wine); font-size: .64rem; }
.answer-feedback { min-height: 21px; margin: 17px 0 20px; color: var(--sage); font-size: .69rem; }
.answer-feedback.error { color: var(--wine); }
.progress-row { display: flex; align-items: center; gap: 12px; color: rgba(60,48,48,.48); font-size: .57rem; }
.progress-track { height: 2px; flex: 1; background: rgba(110,76,61,.18); overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 20%; background: var(--wine); transition: width .8s ease; }
.progress-count { color: var(--wine); direction: ltr; }

.invitation { position: relative; width: min(900px, calc(100% - 14%)); margin: -7px auto 83px; padding: 68px 7% 52px; color: var(--ink); background: var(--paper-light); border: 1px solid rgba(140,90,82,.4); box-shadow: 0 28px 80px rgba(75,50,39,.21); text-align: center; animation: reveal .9s cubic-bezier(.2,.8,.2,1) both; overflow: hidden; }
.invitation::before, .invitation::after { content: '❧'; position: absolute; color: rgba(124,138,112,.28); font: 400 6rem var(--display); }
.invitation::before { top: 8px; left: 24px; transform: rotate(180deg); }
.invitation::after { bottom: 2px; right: 24px; }
.invitation .eyebrow { color: var(--wine); }
.invitation .eyebrow > span { background: var(--wine); }
.invitation-ribbon { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); color: var(--wine); font-size: .57rem; letter-spacing: .08em; display: flex; gap: 10px; align-items: center; }
.invitation-ribbon span { font-size: .8rem; }
.invitation-intro { margin-bottom: 3px; color: var(--wine); font-size: .72rem; }
.invitation-header h2 { margin-bottom: 14px; color: var(--ink); font: 400 clamp(3.3rem, 6vw, 6rem)/.94 var(--display); letter-spacing: -.05em; }
.invitation-verse { margin: 0 auto; max-width: 545px; color: var(--ink-soft); font: 400 1.05rem/2 var(--display); }
.couple-block { display: flex; justify-content: center; align-items: center; gap: 17px; margin: 30px 0 25px; }
.couple-name { color: var(--wine-deep); font: 400 clamp(2.8rem, 5vw, 4.7rem)/1 var(--display); }
.couple-amp { color: var(--sage); font: 400 2.1rem var(--display); }
.invitation-divider { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--wine); }
.invitation-divider i { display: block; width: min(190px, 30%); height: 1px; background: var(--line); }
.invitation-divider span { font-size: .75rem; }
.details-grid { margin: 35px 0 33px; display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-item { padding: 24px 20px 22px; }
.detail-item + .detail-item { border-right: 1px solid var(--line); }
.detail-icon { color: var(--wine); font-size: 1.55rem; display: block; margin-bottom: 6px; }
.detail-label { margin-bottom: 7px; color: var(--wine); font-size: .64rem; font-weight: 600; letter-spacing: .08em; }
.detail-value { margin-bottom: 5px; color: var(--ink); font: 400 1.25rem var(--display); }
.detail-subvalue { margin: 0; color: var(--ink-soft); font-size: .63rem; }
.attendance-note { display: flex; justify-content: center; align-items: center; gap: 18px; color: var(--wine-deep); }
.note-ornament { font-size: 1.3rem; color: var(--sage); }
.attendance-note strong { display: block; margin-bottom: 6px; font: 400 1.45rem var(--display); }
.attendance-note p { margin: 0; color: var(--ink-soft); font-size: .65rem; }
.reset-btn { margin-top: 28px; padding: 8px 15px; border: 0; background: transparent; color: rgba(60,48,48,.42); cursor: pointer; font-size: .59rem; text-decoration: underline; text-underline-offset: 4px; }
.reset-btn:hover { color: var(--wine); }
.footer { padding: 0 7% 31px; display: flex; justify-content: center; align-items: center; gap: 12px; color: rgba(60,48,48,.56); font-size: .56rem; letter-spacing: .04em; }
.footer span:nth-child(2) { color: var(--wine); }

@keyframes fadeDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes reveal { from { opacity: 0; transform: translateY(38px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 28px, 600px); }
  .topbar { height: 70px; }
  .topbar-note { font-size: .54rem; }
  .hero { display: flex; flex-direction: column; align-items: stretch; gap: 28px; min-height: auto; padding: 57px 3% 41px; }
  .hero-copy { order: 1; padding-top: 0; }
  h1 { font-size: clamp(3.8rem, 15vw, 5.9rem); }
  .hero-lede { font-size: .7rem; }
  .hero-art { order: 2; min-height: 290px; }
  .moon { width: 134px; height: 134px; }
  .moon::before { font-size: 2.5rem; }
  .unlock-card { margin: 0 0 68px; min-height: 430px; }
  .unlock-inner { padding-inline: 21px; }
  .answer-grid { grid-template-columns: 1fr; gap: 8px; }
  .answer-btn { padding: 13px 10px; }
  .progress-label { display: none; }
  .invitation { width: 100%; padding: 61px 6% 42px; margin-bottom: 66px; }
  .invitation-verse { font-size: .88rem; }
  .couple-block { gap: 10px; }
  .couple-name { font-size: clamp(2.65rem, 13vw, 4rem); }
  .couple-amp { font-size: 1.6rem; }
  .details-grid { grid-template-columns: 1fr; }
  .detail-item + .detail-item { border-right: 0; border-top: 1px solid var(--line); }
  .attendance-note { gap: 8px; }
  .note-ornament { font-size: .95rem; }
  .attendance-note strong { font-size: 1.2rem; }
  .attendance-note p { font-size: .58rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
