/* =========================================================
   Farmon — a royal decree scroll sealed in crimson wax on lapis
   velvet; the seal cracks, the scroll unrolls into gold light and
   becomes a Herat miniature garden under a gold-leaf sky.
   Built on shared/base.css; this sheet is the look: a manuscript
   page in lapis ink, vermilion rubrics, malachite and gold.
   ========================================================= */

:root {
  --bg: #f4ead2;
  --ink: #1d2447;
  --ink-soft: #6a5c45;
  --accent: #b23a20;
  --accent-deep: #1b2f6e;
  --accent-soft: #ebdcbc;
  --gold: #b0802a;
  --gold-soft: #e2c47e;
  --malachite: #2c6a4e;
  --vermilion: #b23a20;
  --line: rgba(27, 47, 110, 0.14);
  --line-strong: rgba(27, 47, 110, 0.3);
  --surface: #fbf4e3;
  --on-accent: #fbefd0;
  --shadow: 40 30 20;
  --glow: rgba(255, 246, 220, 0.9);
  --intro-bg: #060a18;

  --display: "Brygada 1918", "Alegreya", Georgia, serif;
  --body: "Alegreya", Georgia, serif;
  --label: "Alegreya SC", "Alegreya", Georgia, serif;

  --open-default: url("/styles/farmon/media/open-poster.jpg");
  --amb-poster: url("/styles/farmon/media/amb-poster.jpg");
  --close-poster: url("/styles/farmon/media/close-poster.jpg");
  --dissolve: 2s;
  --pulse: rgba(255, 226, 160, 0.95);
  --pulse-glow: rgba(255, 190, 90, 0.55);
  --music-fg: #1b2f6e;

  /* the page of a manuscript: faint warm mottling on the vellum */
  --vellum:
    radial-gradient(ellipse 60% 40% at 15% 10%, rgba(176, 128, 42, 0.07), transparent 70%),
    radial-gradient(ellipse 50% 35% at 90% 60%, rgba(176, 128, 42, 0.06), transparent 70%),
    radial-gradient(ellipse 70% 30% at 40% 95%, rgba(106, 92, 69, 0.06), transparent 70%);
}

body {
  font-size: 19px;
  background-color: var(--bg);
  background-image: var(--vellum);
}

.label {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: var(--vermilion);
}

/* ---------- Opening ---------- */

.intro__kicker {
  font-size: 14px;
  letter-spacing: 0.24em;
  text-transform: lowercase;
  color: #e9cd8c;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}

.intro__to {
  font-size: clamp(32px, 9vw, 42px);
  color: #fbf1d8;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85), 0 0 4px rgba(0, 0, 0, 0.5);
}

.intro__hint {
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: #f3dfae;
  background: rgba(8, 13, 34, 0.82);
  border-color: rgba(226, 196, 126, 0.6);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.8);
}

.intro__tap {
  border-color: #e2c47e;
}

.intro__tap::after {
  background: #c8352a;
}

/* ---------- The jadval: ruled gold and lapis lines framing a miniature ---------- */

.jadval {
  position: absolute;
  inset: max(10px, env(safe-area-inset-top)) 10px 10px;
  pointer-events: none;
  border: 2px solid #c99a3c;
  box-shadow:
    inset 0 0 0 3px rgba(251, 239, 208, 0.75),
    inset 0 0 0 4px #1b2f6e,
    inset 0 0 0 6px rgba(201, 154, 60, 0.9),
    0 0 0 1px rgba(27, 47, 110, 0.45);
  opacity: 0;
  transition: opacity 2.4s var(--ease-soft) 1s;
}

.hero .jadval {
  bottom: 18%;
  border-bottom: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}

.hero.is-in .jadval {
  opacity: 1;
}

.jadval--night {
  top: 16%;
  border-top: 0;
  -webkit-mask-image: linear-gradient(to top, #000 70%, transparent);
  mask-image: linear-gradient(to top, #000 70%, transparent);
  opacity: 1;
}

/* ---------- Hero ---------- */

.hero__veil {
  background:
    radial-gradient(ellipse 80% 22% at 50% 23%, rgba(255, 244, 214, 0.32), rgba(255, 244, 214, 0) 75%),
    linear-gradient(to bottom, rgba(244, 234, 210, 0) 82%, rgba(244, 234, 210, 0.85) 95%, var(--bg) 100%);
}

.hero__text {
  top: max(9%, calc(env(safe-area-inset-top) + 62px));
  padding: 0 28px;
}

.hero__kicker {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 0 0 6px;
  font-family: var(--label);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  color: #8f2615;
  text-shadow: 0 0 10px rgba(255, 240, 200, 0.6);
}

/* a small lapis rosette with a gold heart, as in an illuminated margin */
.rosette {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle, #f2d58a 0 24%, #1b2f6e 26% 62%, transparent 64%),
    conic-gradient(from 22.5deg, #1b2f6e 0 12.5%, transparent 0 25%, #1b2f6e 0 37.5%, transparent 0 50%, #1b2f6e 0 62.5%, transparent 0 75%, #1b2f6e 0 87.5%, transparent 0);
}

.names {
  margin: 0;
  font-weight: 400;
  line-height: 1;
}

.name {
  display: block;
  white-space: nowrap;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(56px, 17vw, 80px);
  line-height: 1.04;
  color: #15265e;
  text-shadow: 0 1px 0 rgba(255, 238, 190, 0.7), 0 0 22px rgba(255, 240, 205, 0.55);
}

.names__amp {
  display: block;
  margin: 2px 0 4px;
  font-family: var(--body);
  font-style: italic;
  font-size: 26px;
  line-height: 1;
  color: #8f2615;
  text-shadow: 0 0 10px rgba(255, 240, 200, 0.7);
}

.hero__date {
  position: absolute;
  left: 50%;
  bottom: max(98px, calc(env(safe-area-inset-bottom) + 86px));
  translate: -50% 0;
  margin: 0;
  padding: 10px 30px;
  white-space: nowrap;
  font-family: var(--label);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: #f6e2a8;
  /* a cartouche: pointed ends, like a manuscript title panel */
  background: linear-gradient(180deg, #23408f, #15265e);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
  filter: drop-shadow(0 10px 14px rgba(20, 20, 40, 0.45));
}

.hero__date::before {
  content: "";
  position: absolute;
  inset: 3px;
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%);
  box-shadow: inset 0 0 0 1px rgba(242, 213, 138, 0.8);
  border: 1px solid rgba(242, 213, 138, 0.8);
  pointer-events: none;
}

.hero.is-in .hero__kicker {
  animation: rise 1.8s var(--ease) 0.5s both;
}

/* the names are written in, like ink drawn across the gold */
.hero.is-in .names__one {
  animation: ink 2.4s var(--ease) 0.9s both;
}

.hero.is-in .names__amp {
  animation: rise 1.6s var(--ease) 1.9s both;
}

.hero.is-in .names__two {
  animation: ink 2.4s var(--ease) 2.3s both;
}

.hero.is-in .hero__date {
  animation: rise 1.8s var(--ease) 3.2s both;
}

.hero {
  --cue-d: 4.2s;
}

@keyframes ink {
  from {
    opacity: 0;
    clip-path: inset(-20% 100% -20% -5%);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    clip-path: inset(-20% -5% -20% -5%);
    filter: blur(0);
  }
}

.cue {
  font-family: var(--label);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: lowercase;
}

/* ---------- Gold-leaf flecks drifting down the page ---------- */

.leaf {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 3s var(--ease-soft);
}

body.is-open .leaf {
  opacity: 1;
}

.leaf i {
  position: absolute;
  top: -24px;
  left: var(--x);
  width: var(--s);
  height: calc(var(--s) * 0.8);
  background: linear-gradient(135deg, #fbe7a4 0%, #d6a840 45%, #a8781f 70%, #f3d37a 100%);
  clip-path: polygon(8% 30%, 38% 4%, 62% 16%, 96% 8%, 84% 46%, 100% 80%, 58% 96%, 28% 84%, 2% 96%, 14% 60%);
  opacity: 0.85;
  filter: drop-shadow(0 1px 1px rgba(90, 60, 10, 0.35));
  animation: drift var(--d) linear var(--delay) infinite;
}

.leaf i:nth-child(1) { --x: 12%; --s: 9px; --d: 26s; --delay: 1s; --sway: 40px; }
.leaf i:nth-child(2) { --x: 34%; --s: 6px; --d: 31s; --delay: 9s; --sway: -30px; }
.leaf i:nth-child(3) { --x: 58%; --s: 11px; --d: 28s; --delay: 4s; --sway: 36px; }
.leaf i:nth-child(4) { --x: 80%; --s: 7px; --d: 34s; --delay: 15s; --sway: -44px; }
.leaf i:nth-child(5) { --x: 92%; --s: 8px; --d: 29s; --delay: 21s; --sway: -24px; }
.leaf i:nth-child(6) { --x: 46%; --s: 5px; --d: 37s; --delay: 26s; --sway: 30px; }
.leaf i:nth-child(7) { --x: 24%; --s: 7px; --d: 33s; --delay: 18s; --sway: -36px; }

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) rotateY(0deg);
  }
  25% {
    transform: translate3d(var(--sway), 27vh, 0) rotate(90deg) rotateY(160deg);
  }
  50% {
    transform: translate3d(0, 54vh, 0) rotate(180deg) rotateY(320deg);
  }
  75% {
    transform: translate3d(calc(var(--sway) * -0.6), 81vh, 0) rotate(270deg) rotateY(480deg);
  }
  100% {
    transform: translate3d(0, calc(100vh + 48px), 0) rotate(360deg) rotateY(640deg);
  }
}

/* ---------- Sections ---------- */

.title {
  font-family: var(--display);
  font-size: clamp(42px, 12.5vw, 54px);
  font-weight: 400;
  color: var(--accent-deep);
}

.head .divider,
.divider {
  width: min(78%, 300px);
}

/* a ruled margin band: gold, lapis, gold, the lines a scribe draws */
.rule {
  height: 16px;
  margin: 10px 18px;
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  background:
    linear-gradient(var(--accent-deep), var(--accent-deep)) center / 100% 4px no-repeat,
    linear-gradient(var(--vermilion), var(--vermilion)) center / 100% 8px no-repeat;
  box-shadow: inset 0 3px 0 var(--bg), inset 0 -3px 0 var(--bg);
  opacity: 0.85;
}

.emblem {
  width: 116px;
  margin: 0 auto 18px;
  filter: drop-shadow(0 8px 12px rgb(var(--shadow) / 0.25));
}

.emblem.is-in {
  animation: turn 120s linear infinite;
}

@keyframes turn {
  to {
    rotate: 360deg;
  }
}

.corner {
  width: 46%;
  max-width: 220px;
  opacity: 0.95;
}

.invite {
  padding-top: 100px;
}

.invite__greet {
  font-family: var(--display);
  font-size: clamp(32px, 9.4vw, 40px);
  color: var(--accent-deep);
}

.invite .divider {
  margin: 0 auto 28px;
}

.parents__names {
  font-family: var(--display);
  font-size: 23px;
  color: var(--accent-deep);
}

.invite__quote {
  font-style: italic;
  font-family: var(--body);
  font-size: 23px;
  color: var(--vermilion);
}

/* ---------- Date ---------- */

.bigdate {
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  justify-items: stretch;
  margin-bottom: 4px;
}

.bigdate__side {
  font-family: var(--label);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--ink-soft);
}

/* the day sits in a shamsa: a gold sun with a lapis heart */
.bigdate__day {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  font-family: var(--display);
  font-size: 70px;
  line-height: 1;
  color: #f8e6b0;
}

.bigdate__day::before,
.bigdate__day::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: polygon(50% 0%, 56.8% 15.9%, 69.1% 3.8%, 69.6% 21%, 85.4% 14.6%, 79% 30.4%, 96.2% 30.9%, 84.1% 43.2%, 100% 50%, 84.1% 56.8%, 96.2% 69.1%, 79% 69.6%, 85.4% 85.4%, 69.6% 79%, 69.1% 96.2%, 56.8% 84.1%, 50% 100%, 43.2% 84.1%, 30.9% 96.2%, 30.4% 79%, 14.6% 85.4%, 21% 69.6%, 3.8% 69.1%, 15.9% 56.8%, 0% 50%, 15.9% 43.2%, 3.8% 30.9%, 21% 30.4%, 14.6% 14.6%, 30.4% 21%, 30.9% 3.8%, 43.2% 15.9%);
  background: linear-gradient(135deg, #f3d47e, #b0802a 60%, #e6c06a);
}

.bigdate__day::after {
  inset: 18px;
  clip-path: circle(50%);
  background: radial-gradient(circle at 40% 35%, #2a4aa0, #15265e 70%);
  box-shadow: inset 0 0 0 2px #f2d58a;
}

.bigdate__day > span {
  position: relative;
  z-index: 1;
  margin-top: -4px;
}

.bigdate__meta {
  margin: 6px 0 30px;
  font-style: italic;
  font-size: 21px;
}

.cal {
  border-radius: 2px;
  background: var(--surface);
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--accent-deep);
}

.cal__wd {
  font-family: var(--label);
  color: var(--vermilion);
}

/* the day: a vermilion rosette */
.cal__d.is-day {
  color: #fff3d6;
}

.cal__d.is-day::before {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, #c4452a 0 55%, #8f2615 100%);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--gold);
}

.cd__row {
  gap: 8px;
}

.cd__cell {
  padding: 12px 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface);
  box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 4px rgba(176, 128, 42, 0.45);
}

.cd__cell:first-child {
  border-left: 1px solid var(--line-strong);
}

.cd__num {
  font-family: var(--display);
  color: var(--accent-deep);
}

.cd__unit {
  font-family: var(--label);
  text-transform: lowercase;
  color: var(--vermilion);
}

.cd__past {
  color: var(--accent-deep);
}

/* ---------- Buttons ---------- */

.btn {
  border-radius: 4px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 17px;
}

.btn--solid {
  background: linear-gradient(180deg, #24418f, var(--accent-deep));
  color: #fbefd0;
  box-shadow: inset 0 0 0 1px rgba(242, 213, 138, 0.7), inset 0 0 0 3px #1b2f6e, inset 0 0 0 4px rgba(242, 213, 138, 0.45),
    0 12px 24px -14px rgb(var(--shadow) / 0.9);
}

.copy {
  border-radius: 4px;
}

/* ---------- Program ---------- */

.tl__time {
  font-family: var(--display);
  color: var(--accent-deep);
  font-size: 22px;
}

.tl__ico {
  background: radial-gradient(circle at 40% 35%, #2a4aa0, #15265e 75%);
  border: 2px solid var(--gold-soft);
  color: #f6dc9c;
}

.tl::before {
  background: repeating-linear-gradient(var(--gold) 0 3px, transparent 3px 7px, var(--vermilion) 7px 9px, transparent 9px 13px);
  opacity: 0.6;
}

.tl__title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
}

.tl__note {
  font-style: italic;
}

.detail {
  border-radius: 2px;
}

.detail__ico {
  background: var(--malachite);
  color: #f6dc9c;
}

.detail__title {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 400;
}

/* ---------- Venue ---------- */

.venue__art {
  width: min(86%, 360px);
}

.venue__name {
  font-family: var(--display);
  font-weight: 400;
  font-size: 32px;
  color: var(--accent-deep);
}

.mapcard {
  border-radius: 2px;
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--accent-deep), 0 18px 30px -20px rgb(var(--shadow) / 0.6);
}

.map {
  border-radius: 0;
}

/* ---------- Toʻyona: lapis lacquer cards with a gold rosette ---------- */

.ccard {
  border-radius: 12px;
  color: #fbeccb;
  background:
    radial-gradient(circle at 100% 100%, rgba(242, 213, 138, 0.22) 0 22%, transparent 23%),
    linear-gradient(135deg, #24418f, #101d4a);
  border: 1px solid rgba(242, 213, 138, 0.65);
  box-shadow: inset 0 0 0 4px rgba(16, 29, 74, 0.6), inset 0 0 0 5px rgba(242, 213, 138, 0.35), 0 18px 30px -18px rgb(var(--shadow) / 0.8);
}

.ccard--humo {
  background:
    radial-gradient(circle at 100% 100%, rgba(242, 213, 138, 0.22) 0 22%, transparent 23%),
    linear-gradient(135deg, #b8432a, #6e1a10);
}

.ccard--visa {
  background:
    radial-gradient(circle at 100% 100%, rgba(242, 213, 138, 0.22) 0 22%, transparent 23%),
    linear-gradient(135deg, #2f7656, #123a29);
}

.ccard__chip {
  background: linear-gradient(135deg, #f6dc9c, #b88a2e);
}

/* ---------- Answer ---------- */

.reply {
  border-radius: 2px;
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px rgba(176, 128, 42, 0.5);
}

.choice span {
  border-radius: 4px;
}

.stepper {
  border-radius: 4px;
}

.sent__art {
  width: 120px;
}

/* the couple's seal is pressed onto the answer */
.reply.is-sent .sent__art {
  animation: press-seal 1.1s var(--ease) both;
}

@keyframes press-seal {
  0% {
    opacity: 0;
    transform: scale(1.6) rotate(-8deg);
  }
  60% {
    opacity: 1;
    transform: scale(0.94) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.sent__title {
  font-family: var(--display);
  color: var(--accent-deep);
}

/* ---------- Closing ---------- */

.closing__veil {
  background:
    linear-gradient(to bottom, var(--bg) 0%, rgba(244, 234, 210, 0.55) 7%, rgba(244, 234, 210, 0) 18%),
    radial-gradient(ellipse 90% 18% at 50% 26%, rgba(8, 18, 50, 0.45), transparent 76%),
    linear-gradient(to top, var(--bg) 0%, rgba(244, 234, 210, 0) 12%);
}

.closing__text {
  top: 20%;
}

.closing__wait {
  font-family: var(--display);
  font-size: clamp(44px, 13vw, 60px);
  font-weight: 400;
  color: #f6dc9c;
  text-shadow: 0 2px 16px rgba(5, 12, 40, 0.9), 0 0 3px rgba(5, 12, 40, 0.6);
}

.closing__names {
  font-family: var(--body);
  font-style: italic;
  font-size: 24px;
  color: #fbefd0;
  text-shadow: 0 1px 10px rgba(5, 12, 40, 0.9);
}

.closing__amp {
  color: #f2c46a;
}

.footer__art {
  width: 84px;
}

.footer__sign {
  font-style: italic;
}

/* ---------- Small and wide screens ---------- */

@media (max-height: 700px) and (max-aspect-ratio: 3/4) {
  .hero__text {
    top: max(7%, calc(env(safe-area-inset-top) + 58px));
  }

  .name {
    font-size: clamp(46px, 14vw, 62px);
  }

  .names__amp {
    font-size: 22px;
  }
}

@media (min-aspect-ratio: 3/4) {
  .name {
    font-size: min(80px, 8vh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .leaf {
    display: none;
  }

  .emblem.is-in {
    animation: none;
  }
}
