/* base — tokens, atmosphere, page typography, chrome */

:root {
  --pw: 420px;

  /* paper */
  --ivory: #f6efe2;
  --paper: #f1e8d8;
  --paper-2: #eae0cd;
  --paper-3: #e2d7c1;

  /* ink */
  --ink: #33291f;
  --ink-soft: #5c5044;

  /* restrained accents, used sparingly */
  --gold: #a3814f;
  --gold-2: #c8a978;
  --rose: #9d6f6a;
  --mauve: #8a7079;
  --lavender: #8f88a4;
  --sage: #7d8b78;

  /* sacred + night */
  --midnight: #16213a;
  --forest: #1b3229;
  --night: #0e0c0a;
  --cream: #f6f0e5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Karla", system-ui, sans-serif;
  background: radial-gradient(ellipse at 50% 12%, #2a2019 0%, var(--night) 58%),
    var(--night);
  color: var(--cream);
  overflow: hidden;
  overscroll-behavior: none;
}

::selection {
  background: rgba(207, 169, 108, 0.35);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── atmosphere ─────────────────────────────── */
.dust,
.vignette,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.dust {
  z-index: 1;
}

.vignette {
  z-index: 2;
  background: radial-gradient(
    ellipse at 50% 45%,
    transparent 38%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

.grain {
  z-index: 30;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

/* ── page typography ────────────────────────── */
.body {
  font-size: calc(var(--pw) * 0.0415);
  line-height: 1.68;
  font-weight: 300;
}

.body--light {
  color: rgba(244, 236, 222, 0.86);
}

.pg__kicker {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: calc(var(--pw) * 0.052);
  color: var(--gold);
  margin-bottom: calc(var(--pw) * 0.01);
}

.pg__kicker--center {
  text-align: center;
}

.pg__num {
  position: absolute;
  bottom: calc(var(--pw) * 0.035);
  z-index: 2;
  left: 0;
  right: 0;
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-size: calc(var(--pw) * 0.032);
  color: rgba(120, 92, 56, 0.55);
  letter-spacing: 0.2em;
}

.pg--night .pg__num,
.pg--madina .pg__num {
  color: rgba(226, 205, 170, 0.4);
}

.quote {
  font-family: "Cormorant Garamond", serif;
  font-size: calc(var(--pw) * 0.052);
  line-height: 1.5;
  color: var(--ink);
  border-left: 2px solid var(--gold-2);
  padding-left: calc(var(--pw) * 0.045);
  margin: calc(var(--pw) * 0.022) 0;
}

.pg--night .quote,
.pg--madina .quote,
.pg--sacred .quote {
  color: rgba(244, 236, 222, 0.92);
  border-left-color: rgba(200, 169, 120, 0.6);
}

.pg--night .body,
.pg--madina .body,
.pg--sacred .body {
  color: rgba(238, 232, 220, 0.82);
}

.hand {
  font-family: "Caveat", cursive;
  font-size: calc(var(--pw) * 0.066);
  line-height: 1.35;
  color: var(--rose);
}

.hand--lg {
  font-size: calc(var(--pw) * 0.085);
  color: var(--ink);
}

.hand--right {
  text-align: right;
}
.hand--center {
  text-align: center;
}
.hand--light {
  color: var(--gold-2);
}
.hand--tilt {
  transform: rotate(-2.5deg);
}

.reveal {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: calc(var(--pw) * 0.082);
  line-height: 1.3;
  text-align: center;
  color: var(--rose);
  margin: calc(var(--pw) * 0.015) 0;
}

.reveal--light {
  color: var(--gold-2);
}

/* a note squeezed into the margin, after the fact */
.annot {
  align-self: flex-end;
  max-width: 72%;
  font-family: "Caveat", cursive;
  font-size: calc(var(--pw) * 0.052);
  line-height: 1.25;
  text-align: right;
  color: var(--mauve);
  transform: rotate(-1.6deg);
  opacity: 0.85;
}

.pg--night .annot,
.pg--madina .annot,
.pg--sacred .annot {
  color: rgba(200, 169, 120, 0.7);
}

.birthday {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: calc(var(--pw) * 0.105);
  line-height: 1.15;
  text-align: center;
  color: var(--gold);
}

.ar {
  font-family: "Amiri", serif;
  text-align: center;
  line-height: 1.9;
  color: var(--ink);
}

.ar--lg {
  font-size: calc(var(--pw) * 0.088);
  color: var(--gold);
}

.ar--sm {
  font-size: calc(var(--pw) * 0.055);
  margin: calc(var(--pw) * 0.02) 0;
}

.ar__tr {
  text-align: center;
  font-style: italic;
  font-family: "Cormorant Garamond", serif;
  font-size: calc(var(--pw) * 0.048);
  color: var(--ink-soft);
  margin-bottom: calc(var(--pw) * 0.02);
}

.ameen {
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-size: calc(var(--pw) * 0.07);
  color: var(--gold);
  letter-spacing: 0.16em;
}

.list {
  list-style: none;
  display: grid;
  gap: calc(var(--pw) * 0.014);
  margin: calc(var(--pw) * 0.01) 0;
}

.list li {
  font-family: "Caveat", cursive;
  font-size: calc(var(--pw) * 0.058);
  color: var(--ink);
  padding-left: calc(var(--pw) * 0.055);
  position: relative;
}

.list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: calc(var(--pw) * 0.028);
  height: 1px;
  background: var(--gold);
}

.list--check li::before {
  content: "✓";
  top: 0;
  width: auto;
  height: auto;
  background: none;
  color: var(--gold);
  font-family: "Karla", sans-serif;
  font-size: calc(var(--pw) * 0.038);
}

/* ── chrome ─────────────────────────────────── */
.hint {
  font-family: "Caveat", cursive;
  font-size: 1.3rem;
  color: rgba(207, 169, 108, 0.85);
  animation: breathe 3.4s ease-in-out infinite;
  transition: opacity 0.5s ease;
}

.hint.is-hidden {
  opacity: 0;
  pointer-events: none;
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  z-index: 6;
}

.nav[hidden] {
  display: none;
}

.nav__btn {
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(207, 169, 108, 0.4);
  background: rgba(255, 255, 255, 0.03);
  color: var(--gold-2);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.nav__btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.nav__btn:hover:not(:disabled) {
  background: var(--gold);
  color: var(--night);
}

.nav__btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.nav__count {
  font-family: "Cormorant Garamond", serif;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: rgba(207, 169, 108, 0.7);
  min-width: 4.5rem;
  text-align: center;
}

.music {
  position: fixed;
  top: max(0.9rem, env(safe-area-inset-top));
  right: 0.9rem;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(207, 169, 108, 0.35);
  background: rgba(20, 15, 11, 0.55);
  color: rgba(207, 169, 108, 0.85);
  font-family: "Cormorant Garamond", serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: color 0.25s ease, border-color 0.25s ease;
}

.music:hover {
  color: #f0dcb6;
  border-color: rgba(207, 169, 108, 0.7);
}

.music__bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.music__bars i {
  width: 2px;
  height: 30%;
  background: currentColor;
  transition: height 0.3s ease;
}

.music.is-on .music__bars i {
  animation: bars 1s ease-in-out infinite;
}
.music.is-on .music__bars i:nth-child(2) {
  animation-delay: 0.22s;
}
.music.is-on .music__bars i:nth-child(3) {
  animation-delay: 0.44s;
}

@keyframes bars {
  0%,
  100% {
    height: 25%;
  }
  50% {
    height: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hint,
  .music.is-on .music__bars i {
    animation: none;
  }
}
