/* Darrel & Lemlie wedding site. Shared by every page: fonts, colours, the wallpaper page and the pinned Back button. */

@font-face { font-family: "Bellefair"; src: url("../fonts/Bellefair-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fonts/Montserrat-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pinyon Script"; src: url("../fonts/PinyonScript-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/Cormorant-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --burgundy: #560d1a;
  --burgundy-ink: #631523;
  --olive-deep: #33371a;
  --pearl: #f7f2ea;
  --ink: #3b3226;
  --silver-foil: linear-gradient(115deg, #8b9096 0%, #f4f5f6 28%, #a4a8ae 46%, #e9ebed 64%, #8f949a 82%, #dfe2e4 100%);
  --display: "Bellefair", "Times New Roman", serif;
  --serif: "Cormorant", Georgia, serif;
  --script: "Pinyon Script", cursive;
  --label: "Montserrat", "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* --u is one design pixel. Every size on the site is a number times --u.
     Phones show the approved 390px design scaled to their own width, so text wraps exactly as approved on every phone.
     From 760px up the desktop design is used at its true size. */
  --u: 1px;
  --wall: 440;
}
@supports (width: min(1px, 2px)) {
  :root { --u: calc(min(100vw, 520px) / 390); }
}
@media (min-width: 760px) {
  :root { --u: 1px; --wall: 815; }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: #efe2d1; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: var(--serif); font-weight: 500; color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; font-weight: 400; }
img { display: block; }

/* the damask wallpaper, toned down very slightly so it sits behind the stationery */
.page {
  position: relative; overflow: hidden; min-height: 100vh;
  background-color: #efe2d1;
  background-image: linear-gradient(rgba(88, 62, 40, .027), rgba(88, 62, 40, .027)), url("../img/wallpaper.jpg");
  background-image: linear-gradient(rgba(88, 62, 40, .027), rgba(88, 62, 40, .027)), image-set(url("../img/wallpaper.webp") type("image/webp"), url("../img/wallpaper.jpg") type("image/jpeg"));
  background-position: 0 0, center top;
  background-size: 100% 100%, calc(var(--wall) * var(--u)) auto;
  background-repeat: no-repeat, repeat;
}

/* the one way back: a button pinned to the bottom of the screen on every inner page. It is never animated.
   48 design pixels tall: on a 360px-wide phone that is 44px, the smallest size that is still comfortable to tap. */
.stick {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; display: flex; justify-content: center; pointer-events: none;
  padding: calc(30 * var(--u)) calc(16 * var(--u)) calc(16 * var(--u));
  padding-bottom: calc(16 * var(--u) + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(240, 228, 212, 0) 0%, rgba(240, 228, 212, .95) 46%);
}
.pill {
  pointer-events: auto; position: relative; display: flex; align-items: center; justify-content: center; gap: calc(11 * var(--u));
  width: 100%; max-width: calc(300 * var(--u)); height: calc(48 * var(--u)); border-radius: calc(24 * var(--u));
  font-family: var(--display); font-size: calc(14.5 * var(--u)); text-transform: uppercase; letter-spacing: .16em; white-space: nowrap;
  text-decoration: none; color: var(--pearl); background: linear-gradient(180deg, #671422 0%, #490a15 100%);
  box-shadow: 0 0 0 1.5px rgba(206, 210, 214, .95), 0 2px 3px rgba(40, 10, 14, .45), 0 9px 20px rgba(40, 10, 14, .34);
  -webkit-tap-highlight-color: transparent; transition: transform .15s ease, filter .15s ease;
}
.pill::after {
  content: ""; position: absolute; top: calc(4 * var(--u)); right: calc(4 * var(--u)); bottom: calc(4 * var(--u)); left: calc(4 * var(--u));
  border-radius: calc(20 * var(--u)); border: 1px solid rgba(214, 218, 222, .42);
}
.pill svg { flex: none; width: calc(21 * var(--u)); height: calc(9.6 * var(--u)); margin-top: -1px; transition: transform .2s ease; }
.pill:active { transform: scale(.975); filter: brightness(.9); }
.pill:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (hover: hover) {
  .pill:hover { filter: brightness(1.14); }
  .pill:hover svg { transform: translateX(-3px); }
}
@media (min-width: 760px) {
  .stick { background: radial-gradient(34% 100% at 50% 100%, rgba(240, 228, 212, .95) 0%, rgba(240, 228, 212, .8) 45%, rgba(240, 228, 212, 0) 100%); }
}

/* background music button: the same round control in the same corner on every page. Hidden until the music script is ready,
   and on the main page while the sealed envelope is up (the seal is the only thing to tap there). The note is crossed out when
   the music is off. */
.music {
  position: fixed; z-index: 250; top: calc(12 * var(--u) + env(safe-area-inset-top, 0px)); right: calc(12 * var(--u));
  width: max(44px, calc(42 * var(--u))); height: max(44px, calc(42 * var(--u))); padding: 0; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; visibility: hidden; cursor: pointer;
  color: var(--pearl); background: linear-gradient(180deg, #671422 0%, #490a15 100%);
  box-shadow: 0 0 0 1.5px rgba(206, 210, 214, .95), 0 2px 3px rgba(40, 10, 14, .45), 0 6px 14px rgba(40, 10, 14, .3);
  -webkit-tap-highlight-color: transparent; -webkit-appearance: none; appearance: none; transition: transform .15s ease, filter .15s ease;
}
.music.ready { visibility: visible; }
html.gate .music { visibility: hidden; }
.music svg { width: 48%; height: 48%; overflow: visible; }
.music .slash { display: none; }
.music:not(.on) .slash { display: inline; }
.music:active { transform: scale(.94); }
.music:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (hover: hover) { .music:hover { filter: brightness(1.14); } }
@media (min-width: 760px) { .music { top: 20px; right: 20px; width: 46px; height: 46px; } }
.music.waiting { animation: music-pulse 1.8s ease-in-out infinite; }
@keyframes music-pulse { 0%, 100% { box-shadow: 0 0 0 1.5px rgba(206, 210, 214, .95), 0 2px 3px rgba(40, 10, 14, .45), 0 6px 14px rgba(40, 10, 14, .3); }
  50% { box-shadow: 0 0 0 1.5px rgba(206, 210, 214, .95), 0 0 0 9px rgba(103, 20, 34, .18), 0 6px 14px rgba(40, 10, 14, .3); } }
@media (prefers-reduced-motion: reduce) { .music.waiting { animation: none; } }

/* an inner page opened over the invitation (main page only, see index.js): it fills the screen, inside the phone's safe area */
.sheet { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 190; background: #efe2d1;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s; }
html.viewing .sheet { opacity: 1; visibility: visible; transition: opacity .3s ease; }
.sheet iframe { display: block; width: 100%; height: 100%; border: 0; background: #efe2d1; }
html.viewing, html.viewing body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .sheet, html.viewing .sheet { transition: none; } }
