/* The "Will you be my Valentine?" pages: /valentine (make the link) and /valentine/ask (the page the
   partner opens). Design approved by Heike on 26 Nov 2026. Colours match the magazine (public/blog/blog.css). */
:root {
  color-scheme: light;
  --cream: hsl(48 100% 99%); --navy: hsl(238 61% 20%); --soft: hsl(238 20% 42%); --outline: #1560a0;
  --orange: hsl(24 95% 53%); --orange-dark: hsl(24 100% 40%); --link: hsl(242 47% 45%); --line: hsl(214 32% 91%);
  --tint: hsl(350 100% 97%); --tint-edge: hsl(350 70% 85%);
  --sky-top: hsl(205 85% 84%); --sky-mid: hsl(200 90% 94%);
}
/* Colour picked on /valentine ("c" in the link). Pink is the default. */
body[data-theme="pink"]  { --sky-top: hsl(345 85% 87%); --sky-mid: hsl(350 100% 95%); }
body[data-theme="peach"] { --sky-top: hsl(28 95% 85%);  --sky-mid: hsl(36 100% 94%); }
body[data-theme="lilac"] { --sky-top: hsl(270 70% 88%); --sky-mid: hsl(275 100% 96%); }
body[data-theme="sky"]   { --sky-top: hsl(205 85% 84%); --sky-mid: hsl(200 90% 94%); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; min-height: 100vh; background: var(--cream); color: var(--navy); font: 17px/1.6 "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: clip; }
a { color: var(--link); text-underline-offset: .2em; }
a:hover { color: var(--orange-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, label:focus-within { outline: 3px solid var(--orange); outline-offset: 3px; }
h1, h2 { font-family: "Fredoka One", "Nunito", sans-serif; font-weight: 400; }
[hidden] { display: none !important; }


.sky { position: relative; padding: 20px 16px 40px; text-align: center;
  background:
    radial-gradient(64px 26px at 10% 24%, #fff 98%, transparent), radial-gradient(46px 22px at 14% 19%, #fff 98%, transparent),
    radial-gradient(84px 30px at 90% 16%, #fff 98%, transparent), radial-gradient(52px 24px at 85% 11%, #fff 98%, transparent),
    linear-gradient(180deg, var(--sky-top), var(--sky-mid) 72%, var(--cream)); }
.wrap { width: min(100%, 560px); margin: 0 auto; }
.eyebrow { display: inline-block; background: var(--orange); color: white; padding: 4px 14px; border-radius: 99px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
h1 { font-size: clamp(32px, 9vw, 52px); line-height: 1.15; margin: 14px 0 10px; overflow-wrap: break-word; }
h1.outlined { color: white; -webkit-text-stroke: 3px var(--outline); paint-order: stroke fill; }
.lead { margin: 0 auto; max-width: 42ch; font-weight: 600; }
.wiggle { animation: wiggle 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
.wiggle.late { animation-delay: -1.2s; }
@keyframes wiggle { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }

/* Cards and form */
.card { background: white; border: 1px solid var(--line); border-radius: 24px; padding: 22px 18px; margin: -18px auto 0; position: relative; box-shadow: 0 6px 0 var(--tint-edge); text-align: left; }
.field { display: block; margin: 0 0 16px; }
.field span { display: block; font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.field small { font-weight: 600; color: var(--soft); }
.field input { width: 100%; font: inherit; font-size: 18px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--cream); color: var(--navy); }
.field input:focus { border-color: var(--orange); outline: none; }
.error { color: hsl(350 70% 42%); font-weight: 700; font-size: 14px; margin: -8px 0 12px; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 800; font-size: 15px; margin-bottom: 8px; padding: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 900; font-size: 18px; border: 0; border-radius: 99px; padding: 14px 26px; cursor: pointer; text-decoration: none; min-height: 52px; }
.btn-main { background: var(--orange); color: white; box-shadow: 0 4px 0 var(--orange-dark); }
.btn-main:hover { color: white; background: hsl(24 95% 49%); }
.btn-main:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--orange-dark); }
.btn-soft { background: white; color: var(--navy); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.btn-wide { width: 100%; }
.privacy { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--soft); font-weight: 600; margin: 14px 0 0; }
.privacy img { width: 22px; height: 22px; flex: none; }

.result { margin-top: 20px; padding-top: 18px; border-top: 2px dashed var(--tint-edge); }
.result h2 { font-size: 24px; margin: 0 0 6px; }
.result p { margin: 0 0 12px; }
.linkbox { width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--cream); color: var(--navy); margin-bottom: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.row .btn { flex: 1 1 140px; }
.copied { font-weight: 800; color: hsl(150 55% 32%); font-size: 15px; min-height: 1.6em; margin: 8px 0 0; }

/* The picture in the middle: the hugging bears, or the sender's photo in a heart */
.hero { display: flex; justify-content: center; margin: 8px 0 0; min-height: 150px; }
/* The bears (or the photo) never move and never cry (Heike, 27 Nov 2026). */
.hero .bears { width: 150px; height: 150px; }
.heart-photo { display: block; width: 150px; height: 150px;
  filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(0 4px 0 hsl(345 60% 45% / .5)); }
.heart-photo img { display: block; width: 100%; height: 100%; object-fit: cover;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 92'%3E%3Cpath d='M50 90C20 68 0 50 0 27 0 11 12 0 27 0c10 0 18 6 23 14C55 6 63 0 73 0c15 0 27 11 27 27 0 23-20 41-50 63z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 92'%3E%3Cpath d='M50 90C20 68 0 50 0 27 0 11 12 0 27 0c10 0 18 6 23 14C55 6 63 0 73 0c15 0 27 11 27 27 0 23-20 41-50 63z'/%3E%3C/svg%3E") center / contain no-repeat; }
/* On the yes screen the bears (or photo) stand still, a little bigger (Heike, 27 Nov 2026). */
.hero.still .bears, .hero.still .heart-photo { animation: none; width: 180px; height: 180px; }
.hint { font-size: 14px; color: var(--soft); font-weight: 600; margin: -2px 0 8px; }

/* "Make it yours" on /valentine */
.mine { font-size: 22px; margin: 8px 0 12px; padding-top: 14px; border-top: 2px dashed var(--tint-edge); }
.mine small { font-family: "Nunito", sans-serif; font-size: 14px; color: var(--soft); font-weight: 700; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.swatch { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border: 2px solid var(--line); border-radius: 16px; cursor: pointer; font-weight: 800; font-size: 14px; background: var(--cream); }
.swatch::before { content: ""; width: 34px; height: 34px; border-radius: 50%; background: var(--sw); border: 3px solid white; box-shadow: 0 0 0 2px var(--sw); }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch:has(input:checked), .rain[aria-pressed="true"] { border-color: var(--orange); background: hsl(24 100% 96%); box-shadow: 0 3px 0 var(--orange); }
.rains { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.rain { position: relative; display: flex; justify-content: center; align-items: center; height: 48px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; font: inherit; font-size: 24px; background: var(--cream); padding: 0; }
.mix { font-size: 20px; letter-spacing: 2px; color: var(--navy); }
.more-tile { font-size: 14px; font-weight: 900; color: var(--link); }
.rains-more { margin-top: 8px; padding-top: 8px; border-top: 2px dashed var(--line); }
.own-row { display: flex; gap: 8px; margin-top: 10px; }
.own-row input { flex: 1; min-width: 0; font: inherit; font-size: 17px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; background: var(--cream); color: var(--navy); }
.own-row .btn { min-height: 46px; padding: 10px 18px; font-size: 16px; }
.photo-row { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-row .btn { font-size: 16px; padding: 10px 18px; min-height: 46px; }
.photo-pick { position: relative; }
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.field textarea { width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--cream); color: var(--navy); resize: vertical; }
.field textarea:focus { border-color: var(--orange); outline: none; }

/* Ask screen */
.question { font-size: clamp(34px, 10vw, 58px); }
.answers { position: relative; height: 200px; margin: 18px auto 0; max-width: 520px; }
/* The Yes button grows (--grow) and the No button shrinks (--shrink) with every No try. */
.answers { --grow: 1; --shrink: 1; }
.answers .yes { position: absolute; left: 50%; top: 18px; transform: translateX(calc(-100% - 10px)) scale(var(--grow)); transform-origin: 100% 50%; min-width: 128px; font-size: 22px; transition: transform .4s cubic-bezier(.3,1.6,.5,1); animation: glow 1.6s ease-in-out infinite; z-index: 2; }
.answers .yes:active { transform: translateX(calc(-100% - 10px)) scale(var(--grow)) translateY(2px); }
@keyframes glow { 0%, 100% { box-shadow: 0 4px 0 var(--orange-dark), 0 0 0 0 hsl(24 95% 53% / .45); } 50% { box-shadow: 0 4px 0 var(--orange-dark), 0 0 0 12px hsl(24 95% 53% / 0); } }
.answers .no { position: absolute; left: calc(50% + 10px); top: 18px; min-width: 128px; transform: scale(var(--shrink)); transform-origin: 0 50%; white-space: nowrap; transition: left .35s cubic-bezier(.3,1.4,.6,1), top .35s cubic-bezier(.3,1.4,.6,1), transform .35s; }
/* From the first No on, the Yes button sits in the middle and grows; the No button jumps around it. */
.answers.begging .yes { left: 50%; transform: translateX(-50%) scale(var(--grow)); transform-origin: 50% 50%; transition: transform .4s cubic-bezier(.3,1.6,.5,1), left .4s; }
.answers.begging .yes:active { transform: translateX(-50%) scale(var(--grow)) translateY(2px); }
.answers.begging .no.became-yes { left: 50% !important; top: 130px !important; transform: translateX(-50%); }
.answers .no.dodge { animation: dodge .45s ease-out; }
@keyframes dodge { 0% { rotate: 0deg; } 40% { rotate: -14deg; } 70% { rotate: 10deg; } 100% { rotate: 0deg; } }
.answers .no.became-yes { animation: popin .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes popin { from { scale: .4; opacity: 0; } to { scale: 1; opacity: 1; } }
.answers .no.became-yes { background: var(--orange); color: white; border-color: var(--orange); box-shadow: 0 4px 0 var(--orange-dark); }
.tease { min-height: 1.6em; font-weight: 800; color: var(--soft); margin: 0; }

/* Yes screen */
.party { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
/* Rain: the outer element rises (or falls) at a steady speed; the inner <b> sways smoothly from side to side. */
.party span { position: absolute; bottom: -60px; left: var(--x); line-height: 1; animation: rise var(--d, 9s) linear infinite; animation-delay: var(--delay, 0s); opacity: .95; will-change: transform; }
.party span b, .party i b { display: block; animation: sway var(--sd, 2s) ease-in-out infinite alternate; animation-delay: var(--sdl, 0s); }
.party span b { font-size: var(--s, 30px); font-weight: 400; }
@keyframes rise { from { transform: translateY(0); } to { transform: translateY(-125vh); } }
@keyframes sway { from { transform: translateX(calc(var(--amp, 30px) * -1)) rotate(calc(var(--rot, 15deg) * -1)); } to { transform: translateX(var(--amp, 30px)) rotate(var(--rot, 15deg)); } }
/* Bursts of hearts and confetti, placed by valentine.js */
.spark { position: fixed; z-index: 50; pointer-events: none; font-size: 26px; line-height: 1; }
.spark.bit { width: 10px; height: 16px; border-radius: 3px; font-size: 0; }
.party i { position: absolute; top: -20px; left: var(--x); animation: fall var(--d, 6s) linear infinite; animation-delay: var(--delay, 0s); will-change: transform; }
.party i b { width: 9px; height: 15px; border-radius: 3px; background: var(--c); animation-name: flutter; }
@keyframes flutter { from { transform: translateX(calc(var(--amp, 20px) * -1)) rotate(0deg); } to { transform: translateX(var(--amp, 20px)) rotate(var(--spin, 360deg)); } }
@keyframes fall { from { transform: translateY(0); } to { transform: translateY(115vh); } }
.yes-screen .sky, .yes-screen main { position: relative; z-index: 1; }
.yes-screen { background: linear-gradient(180deg, var(--sky-top), var(--sky-mid) 420px, var(--cream) 720px); }
.yes-screen .sky { background: transparent; }
.pop { animation: pop .6s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.yay { color: white; -webkit-text-stroke: 3px var(--outline); paint-order: stroke fill; font-size: clamp(40px, 12vw, 64px); margin: 10px 0 4px; }
.yay .w { display: inline-block; white-space: nowrap; }
.yay .l { display: inline-block; animation: drop .6s cubic-bezier(.3,1.6,.5,1) both, bob 2s ease-in-out infinite; animation-delay: calc(var(--i) * 70ms + .3s), calc(var(--i) * 120ms + 1.2s); }
@keyframes drop { from { transform: translateY(-80px) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.countdown { display: inline-block; background: white; border-radius: 99px; padding: 6px 16px; font-weight: 800; margin: 0 0 14px; box-shadow: 0 3px 0 var(--tint-edge); }
.note { margin: 4px auto 18px; max-width: 360px; }
.note-open { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; font: inherit; font-weight: 800; font-size: 18px; color: var(--navy); background: white; border: 3px dashed var(--tint-edge); border-radius: 22px; padding: 14px; cursor: pointer; }
.note-open img { width: 72px; height: 72px; animation: wiggle 1.2s ease-in-out infinite; }
.note-open small { font-size: 13px; color: var(--soft); }
.note-card { background: white; border-radius: 18px; padding: 8px 20px 12px; box-shadow: 0 6px 0 var(--tint-edge); font-size: 19px; font-weight: 700; text-align: left; transform-origin: 50% 0; animation: unfold .6s cubic-bezier(.3,1.4,.5,1); background-image: repeating-linear-gradient(transparent 0 31px, hsl(350 70% 92%) 31px 32px); }
.note-card p { margin: 0; line-height: 32px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-card .sign { text-align: right; margin-top: 10px; color: var(--orange-dark); font-family: "Fredoka One", sans-serif; }
@keyframes unfold { from { transform: scaleY(0) rotate(-3deg); opacity: 0; } to { transform: none; opacity: 1; } }
.names { font-family: "Fredoka One", "Nunito", sans-serif; font-size: 26px; margin: 4px 0 14px; color: var(--orange-dark); }
.yes-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; margin: 6px 0 0; }
.yes-actions .btn { width: min(100%, 340px); }

.cta { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; margin: 28px auto 0; padding: 24px 18px; border-radius: 28px; background: var(--tint); border-bottom: 6px solid var(--tint-edge); }
.cta-pets { background: white; border: 4px dashed hsl(24 95% 53% / .3); border-radius: 24px; padding: 8px 12px; transform: rotate(3deg); display: flex; gap: 4px; }
.cta-pets img { width: 64px; height: 64px; transform: rotate(-3deg); }
.cta h2 { font-size: 24px; line-height: 1.25; margin: 6px 0 4px; }
.cta p { margin: 0; }
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.badges img { display: block; height: 44px; width: auto; }
.ideas { margin: 22px 0 0; text-align: center; font-weight: 700; }
.ideas ul { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 4px; }


.skip { position: absolute; left: -9999px; background: white; padding: 1rem; z-index: 60; }
.skip:focus { left: 1rem; top: 1rem; }
.below { position: relative; z-index: 1; padding: 0 16px 40px; }

/* Text below the tool on /valentine, for people who want to know how it works (and for Google). */
.about { width: min(100%, 680px); margin: 44px auto 0; }
.about h2 { font-size: 26px; line-height: 1.25; margin: 30px 0 8px; }
.about h3 { font-size: 18px; font-weight: 900; margin: 20px 0 4px; }
.about p { margin: 0 0 12px; }
.about .cta { margin-top: 36px; }
.about .cta h2 { font-size: 24px; margin: 6px 0 4px; }
.about .cta p { margin: 0; }

.site-foot { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; width: min(100% - 32px, 1400px); margin: 24px auto 0; padding-block: 28px 36px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.site-foot img { height: 32px; width: auto; }
.site-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; }
.site-foot a { color: hsl(238 61% 20% / .7); text-decoration: none; }
.site-foot a:hover { color: var(--orange); }
.site-foot p { margin: 0; color: hsl(238 61% 20% / .7); }
@media (max-width: 767px) { .site-foot { flex-direction: column; text-align: center; } }

@media (min-width: 768px) {
  .sky { padding-top: 34px; }
  .card { padding: 30px 32px; }
  .cta { flex-direction: row; text-align: left; padding: 28px 30px; }
  .badges { justify-content: flex-start; }
  .answers { height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  .wiggle, .party span, .party i, .party b, .pop, .yay .l, .answers .yes, .answers .no, .note-open img, .note-card { animation: none !important; }
  .party { display: none; }
  .answers .no { transition: none; }
}

/* Preview phone on /valentine: a scaled-down /valentine/ask in demo mode */
.phone-preview { margin: 16px auto 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.phone { width: 238px; height: 458px; padding: 8px; border-radius: 36px; background: hsl(238 40% 18%); box-shadow: 0 10px 30px hsl(238 40% 18% / .25); }
.phone .screen { width: 222px; height: 442px; overflow: hidden; border-radius: 28px; background: var(--cream); }
.phone iframe { width: 375px; height: 747px; border: 0; transform: scale(.592); transform-origin: 0 0; pointer-events: none; display: block; }
.phone-preview figcaption { font-size: 14px; font-weight: 800; color: var(--soft); }
/* Inside the preview phone: only the question and the yes screen */
body.demo { overflow: hidden; }
body.demo .sh, body.demo .skip, body.demo .site-foot, body.demo .below, body.demo .cb { display: none !important; }
body.demo .sky { padding-top: 34px; }
/* Inside the preview phone the colored sky fills the whole screen (no white area under the buttons) */
body.demo { background: var(--sky-mid); }
body.demo #screen-ask .sky { min-height: 100vh; }
body.demo .yes-screen { min-height: 100vh; background: linear-gradient(180deg, var(--sky-top), var(--sky-mid)); }
body.demo #screen-ask .sky { background:
    radial-gradient(64px 26px at 10% 24%, #fff 98%, transparent), radial-gradient(46px 22px at 14% 19%, #fff 98%, transparent),
    radial-gradient(84px 30px at 90% 16%, #fff 98%, transparent), radial-gradient(52px 24px at 85% 11%, #fff 98%, transparent),
    linear-gradient(180deg, var(--sky-top), var(--sky-mid)); }
