/* olivia.nicholasirons.ca — the poster
   The whole page is drawn on a 390×844 "poster" and scaled to fit any phone (see fitFrame in script.js). */

:root {
  --cobalt: #2340D9;
  --pop: #FF8FB3;
  --navy: #0F1B66;
  --paper: #F4EFE6;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --glide: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0; height: 100%;
  background: var(--cobalt);
  transition: background .5s ease;
  overscroll-behavior: none;
}
body { display: flex; align-items: center; justify-content: center; overflow: hidden; }
body.pink { background: var(--pop); }
body.dark { background: #111; }

#frame {
  width: 390px; height: 844px; flex: none;
  position: relative; overflow: hidden;
  background: var(--cobalt); color: #fff;
  font-family: 'Bricolage Grotesque', 'Arial Narrow', Impact, sans-serif;
  transform-origin: center center;
  transition: background .5s ease, color .5s ease;
  user-select: none; -webkit-user-select: none;
}
#frame.pink { background: var(--pop); color: var(--navy); }

.screen { position: absolute; inset: 0; padding: 26px 22px 24px; display: flex; flex-direction: column; }
.spacer { flex: 1; min-height: 12px; }
button { font-family: inherit; cursor: pointer; }
.btn:active { transform: scale(.97); }

/* ---------- the ask ---------- */
.toprow {
  display: flex; justify-content: space-between;
  font-size: 12px; font-weight: 600; letter-spacing: .16em; font-variation-settings: 'wdth' 100;
}
#headline {
  margin: 18px 0 0; font-weight: 800; font-size: 92px; line-height: .86; letter-spacing: -.02em;
  text-transform: uppercase; font-variation-settings: 'wdth' 75, 'opsz' 96;
}
.line { display: block; overflow: hidden; transition: transform .55s var(--spring); }
.word { display: inline-block; }
.pop { color: var(--pop); }
#headline.rise .word { animation: rise .7s var(--glide) both; }
@keyframes rise { from { opacity: 0; transform: translateY(60%); } to { opacity: 1; transform: none; } }

.answer-row { display: flex; align-items: flex-end; gap: 10px; }
.btn.yes {
  flex: 1 1 0; min-width: 0; height: 100px; border: 0; border-radius: 28px;
  background: var(--pop); color: var(--navy);
  font-weight: 800; font-size: 50px; letter-spacing: -.02em; font-variation-settings: 'wdth' 75;
  transition: flex-grow .45s var(--glide), height .45s var(--glide), font-size .45s var(--glide);
}
.btn.no {
  flex: 1 1 0; min-width: 78px; height: 100px; padding: 0 8px;
  border: 3px solid #fff; border-radius: 32px; background: transparent; color: #fff;
  font-weight: 800; font-size: 52px; line-height: .9; text-transform: uppercase;
  overflow: hidden; overflow-wrap: anywhere; font-variation-settings: 'wdth' 75;
  transition: all .4s ease;
}
.btn.no.free {
  position: absolute; z-index: 6; flex: none; min-width: 0; background: var(--cobalt);
  box-shadow: 0 10px 22px -10px rgba(0,0,0,.45);
  transition: left .45s var(--spring), top .45s var(--spring), width .3s ease, height .3s ease, font-size .3s ease;
}

.peek {
  position: absolute; right: -16px; top: 47%; width: 132px; height: 132px; z-index: 5;
  border-radius: 50%; overflow: hidden; border: 4px solid #fff;
  box-shadow: 0 14px 28px -10px rgba(0,0,0,.5);
  animation: peek 2.4s cubic-bezier(.3, .8, .3, 1) both;
}
.peek img { position: absolute; left: -47px; top: -59px; width: 300px; height: 300px; max-width: none; }
@keyframes peek {
  0% { transform: translateX(170px) rotate(24deg); }
  16% { transform: translateX(0) rotate(-8deg); }
  24% { transform: translateX(6px) rotate(-5deg); }
  72% { transform: translateX(0) rotate(-8deg); }
  100% { transform: translateX(170px) rotate(24deg); }
}

/* ---------- the peel ---------- */
.sheet { position: absolute; inset: 0; z-index: 20; touch-action: none; --d: 56px; }
.paper {
  position: absolute; inset: 0; padding: 26px 22px 30px; display: flex; flex-direction: column; color: #1C1C1C;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(40,30,20,.07) 1px, transparent 1.2px); background-size: 5px 5px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--d)), calc(100% - var(--d)) 100%, 0 100%);
  transition: clip-path .7s cubic-bezier(.3, .7, .2, 1);
}
.paper .small { font-size: 12px; font-weight: 600; letter-spacing: .16em; font-variation-settings: 'wdth' 100; }
.paper .big {
  margin-top: 10px; font-weight: 800; font-size: 124px; line-height: .82; letter-spacing: -.03em;
  text-transform: uppercase; color: var(--cobalt); font-variation-settings: 'wdth' 75, 'opsz' 96;
}
.paper .hint { align-self: flex-end; margin-right: 92px; font-size: 15px; font-weight: 700; letter-spacing: .1em; font-variation-settings: 'wdth' 100; }
.flap-wrap { position: absolute; inset: 0; pointer-events: none; filter: drop-shadow(-8px -8px 12px rgba(0,0,0,.28)); }
.flap {
  position: absolute; inset: 0;
  background: linear-gradient(to top left, #D8D0C2 0%, #FFFFFF 45%, #EFE9DE 100%);
  clip-path: polygon(calc(100% - var(--d)) 100%, 100% calc(100% - var(--d)), calc(100% - var(--d)) calc(100% - var(--d)));
  transition: clip-path .7s cubic-bezier(.3, .7, .2, 1);
}
.sheet.dragging .paper, .sheet.dragging .flap { transition: none; }
.corner { position: absolute; right: 0; bottom: 0; width: 110px; height: 110px; border: 0; padding: 0; background: transparent; cursor: grab; }
.sheet:not(.touched) .corner { animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-6px, -6px); } }

/* ---------- booking ---------- */
#book { gap: 20px; color: var(--navy); }
.when { margin: 0; font-weight: 800; font-size: 104px; line-height: .82; letter-spacing: -.03em; font-variation-settings: 'wdth' 75, 'opsz' 96; animation: popin .6s cubic-bezier(.2, .9, .3, 1.2) both; }
.venue { display: flex; flex-direction: column; gap: 2px; }
.venue-name { font-size: 20px; font-weight: 700; }
.venue-addr { font-size: 14px; font-weight: 500; }
.map { position: relative; height: 150px; flex: none; border-radius: 20px; overflow: hidden; border: 2px solid var(--navy); background: #fff; }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
.days { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -22px; padding: 0 22px; }
.days::-webkit-scrollbar { display: none; }
.times { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.chip {
  min-height: 64px; border-radius: 18px; border: 2px solid var(--navy);
  background: transparent; color: var(--navy);
  font-weight: 800; font-size: 22px; font-variation-settings: 'wdth' 80;
  transition: background .2s, color .2s;
}
.days .chip { flex: none; padding: 0 18px; border-radius: 20px; }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; }
.btn.lock {
  min-height: 76px; border: 0; border-radius: 28px; background: var(--navy); color: #fff;
  font-weight: 800; font-size: 30px; letter-spacing: -.01em; font-variation-settings: 'wdth' 75;
}
.btn.lock[disabled] { opacity: .7; }

/* ---------- it's a date ---------- */
#sent { gap: 18px; }
.date-title {
  margin: 40px 0 0; font-weight: 800; font-size: 118px; line-height: .82; letter-spacing: -.03em;
  text-transform: uppercase; font-variation-settings: 'wdth' 75, 'opsz' 96;
  animation: popin .6s cubic-bezier(.2, .9, .3, 1.2) both;
}
.tline { display: block; white-space: nowrap; }
.ch { display: inline-block; transition: transform .9s var(--spring); }
.tumbling .ch { transition: transform .55s var(--glide); }
.details { display: flex; flex-direction: column; gap: 4px; }
.when-label { font-size: 30px; font-weight: 800; font-variation-settings: 'wdth' 80; }
.where { font-size: 15px; font-weight: 500; }
.actions { display: flex; flex-direction: column; gap: 10px; width: 264px; }
.btn.cal, .btn.shake {
  min-height: 56px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 800; font-size: 17px; letter-spacing: .04em; text-decoration: none; white-space: nowrap;
}
.btn.cal { border: 0; background: var(--pop); color: var(--navy); }
.btn.shake { border: 3px solid #fff; background: transparent; color: #fff; }
.sticker { position: absolute; right: 22px; bottom: 110px; width: 150px; height: 150px; }
.spin { animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes popin { 0% { opacity: 0; transform: scale(.6) rotate(-4deg); } 70% { opacity: 1; transform: scale(1.06) rotate(1deg); } 100% { transform: none; } }

/* ---------- the dog ---------- */
.dog { position: absolute; inset: 0; z-index: 30; background: #111; color: #fff; font-family: 'Bricolage Grotesque', 'Arial Narrow', sans-serif; overflow: hidden; }
.dog-photo { position: absolute; inset: 0; transform: translateY(100%); transition: transform .75s cubic-bezier(.2, .9, .25, 1); }
.dog.shown .dog-photo { transform: none; }
.dog-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: 37% 42%; transition: transform 2.4s cubic-bezier(.25, .6, .3, 1); }
.dog-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 38%, rgba(0,0,0,.55) 62%, rgba(0,0,0,.86) 100%); }
.dog-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 24px 34px; display: flex; flex-direction: column; gap: 16px; }
.dog-caption { margin: 0; font-weight: 800; font-size: 44px; line-height: 1; letter-spacing: -.02em; opacity: 0; transform: translateY(14px); transition: opacity .5s ease .35s, transform .5s ease .35s; }
.dog.shown .dog-caption { opacity: 1; transform: none; }
.dog-ask { display: flex; flex-direction: column; gap: 12px; opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity .45s ease, transform .45s ease; }
.dog.asking .dog-ask { opacity: 1; transform: none; pointer-events: auto; }
.dog-sub { font-size: 17px; font-weight: 500; color: #E8E8E8; }
.dog-buttons { display: flex; gap: 10px; }
.dog-btn { flex: 1; min-height: 54px; border-radius: 999px; font-family: inherit; font-size: 16px; }
.dog-yes { border: 0; background: var(--pop); color: var(--navy); font-weight: 700; }
.dog-no { border: 1.5px solid rgba(255,255,255,.7); background: rgba(0,0,0,.25); color: #fff; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .line, .btn.no.free, .ch, .dog-photo img { transition: none !important; }
}
