@import url("fonts/fonts.css");

:root {
  --ink: #22304d;
  --ink-soft: #4a5a78;
  --paper: #fbf7ef;
  --accent: #b9835a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #cfe4f3 url("art/sky.webp") center / cover;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  color: var(--ink);
  font-family: "Cormorant Garamond", "Amiri", serif;
}
body::before { /* blurred backdrop for wide screens */
  content: ""; position: fixed; inset: 0;
  background: inherit; filter: blur(24px) saturate(1.1); transform: scale(1.1);
}
html[lang="ar"] body { font-family: "Amiri", serif; }

/* ---------- stage: phone-shaped, full screen on phones ---------- */
.stage {
  position: fixed; top: 0; bottom: 0; left: 50%;
  width: min(100vw, 62dvh);
  height: 100dvh;
  transform: translateX(-50%);
  overflow: hidden;
  container-type: size;
  background: linear-gradient(#bcdcf2 55%, #c4dca6 55%);
  box-shadow: 0 0 60px rgba(30, 50, 80, .25);
}
@media (max-width: 620px) { .stage { box-shadow: none; } }

.layer { position: absolute; inset: 0; pointer-events: none; }
.sky { background: url("art/sky.webp") center top / cover; }
.sun { position: absolute; width: 26cqw; left: -6cqw; top: -1cqh; animation: spin 60s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.cloud { position: absolute; will-change: transform; }

/* world layers are 1.5x as wide as they are tall and pan sideways */
.world { position: absolute; top: 0; left: 0; height: 100%; aspect-ratio: 3 / 2; will-change: transform; }
.world > img.art { position: absolute; inset: 0; width: 100%; height: 100%; }
.kids {
  position: absolute; left: 72.3%; top: 41.3%; width: 25%;
  filter: drop-shadow(0 1.2cqh 1.2cqh rgba(40, 60, 40, .25));
  transform-origin: 50% 100%;
}
.dove { position: absolute; width: 22cqw; top: 26cqh; left: -30cqw; will-change: transform; }
.dove.d2 { width: 17cqw; top: 31cqh; }

/* soft paper grain over everything */
.grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .22; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .5 0 0 0 0 .42 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- text in the sky ---------- */
.copy {
  position: absolute; left: 0; right: 0; top: calc(6cqh + env(safe-area-inset-top));
  height: 34cqh; display: grid; place-items: center; text-align: center;
  padding: 0 7cqw; pointer-events: none;
}
.line { grid-area: 1 / 1; opacity: 0; text-shadow: 0 0 2cqw rgba(255, 255, 255, .7); }
.script { font-family: "Pinyon Script", cursive; font-weight: 400; line-height: 1.15; }
html[lang="ar"] .script { font-family: "Aref Ruqaa", serif; line-height: 1.5; }
.big { font-size: 14cqw; }
.mid { font-size: 9.5cqw; }
.small { font-size: 5.4cqw; letter-spacing: .02em; }
.caps { font-family: "Cormorant Garamond", serif; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; font-size: 4.2cqw; }
html[lang="ar"] .caps { font-family: "Amiri", serif; font-weight: 700; text-transform: none; letter-spacing: 0; font-size: 5.6cqw; }
html[lang="ar"] .big { font-size: 15cqw; }
html[lang="ar"] .mid { font-size: 8.6cqw; }
.amp { font-size: .6em; display: block; line-height: .9; }
.stack > * { display: block; }
.final .names { font-size: 11.5cqw; }
html[lang="ar"] .final .names { font-size: 12.5cqw; }
.final .sub { margin: .3cqh 0 1.6cqh; }
.final .when { line-height: 1.6; }
.rule { display: block; width: 26cqw; height: 1px; margin: 1.2cqh auto; background: linear-gradient(90deg, transparent, var(--ink-soft), transparent); }

/* ---------- bottom details panel ---------- */
.panel {
  position: absolute; left: 3cqw; right: 3cqw; bottom: calc(2.2cqh + env(safe-area-inset-bottom));
  padding: 1.8cqh 3.5cqw 1.6cqh;
  background: rgba(251, 247, 239, .86);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-radius: 5cqw; border: 1px solid rgba(120, 100, 70, .18);
  box-shadow: 0 1cqh 4cqh rgba(40, 50, 40, .18);
  opacity: 0; transform: translateY(120%);
}
.countdown { display: flex; justify-content: center; gap: 2.6cqw; direction: ltr; }
html[lang="ar"] .countdown { direction: rtl; }
.countdown div { min-width: 14cqw; text-align: center; }
.countdown b { display: block; font-size: 6.6cqw; font-weight: 600; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
.countdown span { font-size: 3.1cqw; color: var(--ink-soft); }
html[lang="ar"] .countdown span { font-size: 3.5cqw; }
.countdown.today { font-size: 5cqw; font-weight: 700; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.2cqw; margin-top: 1.5cqh; }
.btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5cqh;
  min-height: 44px; padding: 1.1cqh 1cqw; border-radius: 3.4cqw;
  background: #fff; border: 1px solid rgba(34, 48, 77, .16);
  color: var(--ink); text-decoration: none; font: inherit; font-size: 3.6cqw; font-weight: 600; cursor: pointer;
  transition: transform .15s;
}
html[lang="ar"] .btn { font-size: 3.9cqw; font-weight: 700; }
.btn:active { transform: scale(.96); }
.btn svg { width: 6.6cqw; height: 6.6cqw; }

/* ---------- top controls ---------- */
.controls {
  position: absolute; top: calc(1.6cqh + env(safe-area-inset-top)); right: 3cqw;
  display: flex; align-items: center; gap: 2cqw; opacity: 0; z-index: 5; direction: ltr;
}
.icon-btn {
  width: 10cqw; height: 10cqw; min-width: 38px; min-height: 38px; border-radius: 50%;
  display: grid; place-items: center; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .7); color: var(--ink);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.icon-btn svg { width: 50%; height: 50%; }
.lang {
  font: 600 3.8cqw/1 "Cormorant Garamond", "Amiri", serif; color: var(--ink); text-decoration: none;
  background: rgba(255, 255, 255, .7); padding: 2.4cqw 3.4cqw; border-radius: 99px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

/* ---------- cover (tap to open) ---------- */
.cover {
  position: absolute; inset: 0; z-index: 10; display: grid; place-items: center;
  background: radial-gradient(120% 80% at 50% 40%, rgba(251, 247, 239, .55), rgba(190, 220, 240, .6)), url("art/sky.webp") center / cover;
  cursor: pointer;
}
.card {
  width: 78cqw; padding: 7cqh 6cqw 5cqh; text-align: center;
  background: var(--paper); border-radius: 2cqw;
  box-shadow: 0 2cqh 6cqh rgba(40, 60, 90, .25);
  position: relative;
}
.card::before { /* thin double frame like stationery */
  content: ""; position: absolute; inset: 2.4cqw; border: 1px solid rgba(34, 48, 77, .25); border-radius: 1cqw; pointer-events: none;
}
.card .invited { font-size: 4.6cqw; color: var(--ink-soft); letter-spacing: .08em; }
html[lang="ar"] .card .invited { font-size: 5.4cqw; letter-spacing: 0; }
.card .names { font-size: 12cqw; margin: 2cqh 0 3cqh; }
.seal {
  width: 22cqw; height: 22cqw; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #9fb8d6, #5d7ea6 60%, #46668e);
  box-shadow: inset 0 -.6cqw 1.4cqw rgba(0, 0, 0, .25), 0 .8cqh 1.6cqh rgba(40, 60, 90, .3);
  color: #f3f6fb; font-family: "Pinyon Script", cursive; font-size: 8cqw;
  animation: pulse 2.2s ease-in-out infinite;
}
html[lang="ar"] .seal { font-family: "Aref Ruqaa", serif; font-size: 7cqw; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.tap { margin-top: 3cqh; font-size: 4.4cqw; color: var(--ink-soft); }
html[lang="ar"] .tap { font-size: 5cqw; }
.tap::after { content: " ♡"; }

@media (prefers-reduced-motion: reduce) {
  .sun, .seal { animation: none; }
}

/* short / wide-ish phones: tighten the final text so it clears the arch */
@container (min-aspect-ratio: 10 / 18) {
  .copy { top: calc(4.5cqh + env(safe-area-inset-top)); }
  .final .names { font-size: 10cqw; }
  html[lang="ar"] .final .names { font-size: 11cqw; }
  .final .sub { margin: 0 0 .6cqh; }
  .rule { display: none; }
  .final .sub { margin-bottom: 1cqh; }
  .panel { padding: 1.2cqh 3cqw 1.2cqh; }
  .countdown b { font-size: 5.8cqw; }
  .actions { margin-top: 1cqh; }
  .btn { padding: .7cqh 1cqw; gap: .2cqh; }
  .btn svg { width: 5.4cqw; height: 5.4cqw; }
  .final .when { line-height: 1.35; font-size: 3.8cqw; }
  html[lang="ar"] .final .when { font-size: 5cqw; }
}

/* meadow continues below the art when the scene is lifted */
.world.near::after { content: ""; position: absolute; left: 0; right: 0; top: 99.5%; height: 30%; background: #bed7a0; }
