/* The home page: the other half of Kirke's night. In the app you wait in the room; here she's out on the
   rooftops. The room, the beads and Match Night itself stay in the app, so nobody sees them here first.
   One night from top to bottom; paper objects (notes, Polaroids) are the only light things on it.
   Loaded after site.css, on the two home pages only: the legal pages don't use any of this. */

html:has(body.home) { background: #131230; }
.home {
  --wall: #1f1d45;
  --deep: #131230;
  --dusk-2: #38347a;
  --lamp: #ffb547;
  --paper: #f2eadb;
  --paper-shade: #ddd2bd;
  --ink-night: #0f0e1a;
  --moon: #e8e6f4;
  --haze: #a4a1c9;
  --out: cubic-bezier(0.22, 1, 0.36, 1);
  --settle: cubic-bezier(0.3, 1.22, 0.5, 1);
  color: var(--moon);
  background: linear-gradient(180deg, var(--wall) 0, var(--wall) 62rem, var(--deep) 100%);
}
/* the film grain the app lays over everything */
.home::after { content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0.06; background: url("/assets/grain.svg"); }
.home [hidden] { display: none !important; }
.home :focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; }
.home .mast, .home .hero, .home .footer { background: none; }
.home .skip:focus { color: var(--ink-night); }
.home .mast { position: absolute; z-index: 7; left: 0; right: 0; top: 0; }
.home .mast-inner { border-bottom: 0; }
.home .language { border-color: rgba(232, 230, 244, 0.45); }
.home .defs { position: absolute; }

/* ---------- Hero: the rooftops at dusk, and Kirke on a windowsill ---------- */
.home .hero { position: relative; display: grid; align-items: center; min-height: clamp(36rem, 86vh, 54rem); overflow: clip; }
.rooftops { position: absolute; inset: 0; overflow: clip; container-type: size; }
/* The painting covers the scene whatever its shape, and everything on it is placed in the painting's own
   percentages, so Kirke stays on her sill. */
.stage { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: linear-gradient(180deg, #5a58a6 0%, #7d7bc4 55%, #4a4686 100%); }
.rooftops-art { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 70% 70%; user-select: none; -webkit-user-drag: none; }
@supports (width: 1cqw) {
  .stage {
    --w: max(100cqw, 100cqh * 2.0491); /* the painting is 1795 x 876 */
    width: var(--w); height: calc(var(--w) / 2.0491);
    left: calc((100cqw - var(--w)) * var(--fx, 0.7)); top: calc((100cqh - var(--w) / 2.0491) * 0.72);
  }
}
/* the left of the painting carries the words, and its foot runs into the page */
.rooftops::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(27, 25, 62, 0.84) 0, rgba(27, 25, 62, 0.58) 30%, rgba(27, 25, 62, 0) 58%), linear-gradient(180deg, rgba(31, 29, 69, 0.5) 0, rgba(31, 29, 69, 0) 17%, rgba(31, 29, 69, 0) 76%, var(--wall) 100%);
}
.stars i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff4dc; box-shadow: 0 0 4px 1px rgba(255, 236, 190, 0.5); animation: twinkle 3.4s ease-in-out infinite; }
.stars i:nth-child(1) { left: 39.5%; top: 9%; }
.stars i:nth-child(2) { left: 46%; top: 21%; animation-duration: 4.6s; animation-delay: -1.2s; }
.stars i:nth-child(3) { left: 54.5%; top: 6.5%; animation-duration: 2.9s; animation-delay: -2s; }
.stars i:nth-child(4) { left: 58%; top: 31%; width: 2px; height: 2px; animation-delay: -0.6s; }
.stars i:nth-child(5) { left: 43%; top: 40%; width: 2px; height: 2px; animation-duration: 5.2s; animation-delay: -3.1s; }
.stars i:nth-child(6) { left: 50.5%; top: 52%; width: 2px; height: 2px; animation-duration: 3.8s; animation-delay: -1.7s; }
.stars i:nth-child(7) { left: 61%; top: 15%; animation-duration: 4.1s; animation-delay: -2.6s; }
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* Kirke fades in once she's drawn; without scripts a still picture of her sits there instead (a noscript) */
.rooftops-still { position: absolute; z-index: 2; left: 62%; top: 43.6%; width: 11.4%; height: auto; max-width: none; }
.kitty { position: absolute; z-index: 2; pointer-events: none; }
.kitty--roof { left: 56.2%; top: 38%; width: 23%; aspect-ratio: 1; opacity: 0; transition: opacity 0.45s var(--out); }
.rooftops.is-live .kitty--roof { opacity: 1; }
.kitty-hit { position: absolute; z-index: 3; left: 62%; top: 44.5%; width: 12.5%; height: 33%; padding: 0; border: 0; border-radius: 45%; background: none; cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.kitty-hit:focus-visible { outline-offset: -4px; }

.hero-copy { position: relative; z-index: 2; max-width: min(33rem, 48vw); padding-block: 7rem 4.5rem; }
.home .eyebrow { display: block; margin-bottom: 1rem; color: var(--moon); font-size: 1rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.home .eyebrow::before { content: none; }
.home .hero h1 { color: var(--paper); }
.home .hero h1 span:last-child { color: var(--lamp); }
.home .intro { color: var(--moon); }
.home .button { border-radius: 2rem; padding-inline: 1.35rem; }
.home .button-play { background: var(--lamp); color: var(--ink-night); box-shadow: none; transition: transform 0.15s var(--out), background 0.2s; }
.home .button-play:hover { background: #ffc670; }
.home .button-play:active { transform: scale(0.97); }
.home .play-mark i { background: var(--ink-night); }
.home .store-later { color: var(--moon); }
.when { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 1.1rem; margin-top: 2.2rem; color: var(--moon); font-size: 1rem; line-height: 1.4; }
.night-label { color: var(--paper); font: 400 1.35rem/1.1 var(--display); letter-spacing: -0.03em; }
.clocks { display: inline-flex; flex-wrap: wrap; gap: 0 1.1rem; }
.clocks span { white-space: nowrap; }
.clocks b { margin-left: 0.18rem; }

/* Kirke's paper note */
.paper-note { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.75rem 0.9rem 0.75rem 0.75rem; border-radius: 3px; background: var(--paper); color: var(--ink-night); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); font-size: 0.94rem; line-height: 1.4; text-align: left; }
.paw-mark { flex: none; width: 1.1rem; height: 1.1rem; margin-top: 1px; fill: var(--ink-night); opacity: 0.75; }

/* ---------- The Polaroid, developing (the app's stages) ---------- */
.polaroid { display: block; position: relative; width: var(--pw); padding: calc(var(--pw) * 0.07) calc(var(--pw) * 0.07) calc(var(--pw) * 0.25); border-radius: 3px; background: var(--paper); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45), inset 0 -1px 0 var(--paper-shade); }
.photo { display: block; position: relative; aspect-ratio: 1; overflow: hidden; background: #a39b8d; }
.photo img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 12%; background: #514d76; transition: filter 2.6s var(--out), opacity 2.6s var(--out); }
.photo::after {
  content: ""; position: absolute; inset: 0; transition: opacity 2.6s var(--out);
  background: radial-gradient(120% 90% at 28% 18%, rgba(255, 250, 238, 0.24), transparent 55%), linear-gradient(160deg, #b7ae9e 0%, #9f9688 55%, #8c8476 100%);
}
.exposure:has(input[value="start"]:checked) .photo img { opacity: 0.38; filter: blur(12px) grayscale(1) contrast(0.6) brightness(1.3); }
.exposure:has(input[value="start"]:checked) .photo::after { opacity: 0.7; }
.exposure:has(input[value="half"]:checked) .photo img { opacity: 0.7; filter: blur(7px) grayscale(0.6) sepia(0.35) contrast(0.82) brightness(1.15); }
.exposure:has(input[value="half"]:checked) .photo::after { opacity: 0.38; }
.exposure:has(input[value="full"]:checked) .photo img { opacity: 1; filter: none; }
.exposure:has(input[value="full"]:checked) .photo::after { opacity: 0; }

/* ---------- How Match Night works: three things from a night, each in its own lamplight ---------- */
/* the lamplight is wider than its plate: cut it at the screen's edge here, since a clip on the body only
   reaches the browser window, and a phone would scroll sideways into it */
.home .how { padding-block: clamp(3rem, 6vw, 5rem) clamp(4rem, 7vw, 6rem); overflow-x: clip; }
.home .how h2 { color: var(--paper); margin-bottom: clamp(1rem, 2vw, 1.5rem); }
.home .story h3 { color: var(--paper); }
.home .story p { color: var(--haze); }
.home .plate { height: clamp(14rem, 20vw, 16.5rem); overflow: visible; border-radius: 0; background: none; }
.home .plate::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: 150%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(255, 181, 71, 0.15) 0%, rgba(255, 159, 46, 0.05) 38%, transparent 66%); }
.kirke-note { width: min(84%, 17.5rem); padding: 1.05rem 1.15rem 0.9rem 0.95rem; transform: rotate(-3.5deg); font-size: 1.06rem; transition: transform 0.5s var(--settle); }
.note-plate:hover .kirke-note { transform: rotate(-1.5deg) translateY(-3px); }
.kirke-note q { display: block; quotes: none; }
.kirke-note b { display: block; margin-top: 0.45rem; text-align: right; font: 400 1.15rem/1 var(--display); }
.home .exposure { flex-direction: column; justify-content: center; gap: 1rem; padding: 0; background: none; }
.develop { display: flex; align-items: center; justify-content: center; gap: 1.1rem; width: 100%; }
.talk { display: flex; flex-direction: column; gap: 0.4rem; width: 7.2rem; }
.talk i { height: 1.5rem; border-radius: 1rem; }
.talk .them { align-self: flex-start; background: var(--dusk-2); border-bottom-left-radius: 5px; transform-origin: 0 100%; }
.talk .me { align-self: flex-end; background: var(--lamp); border-bottom-right-radius: 5px; transform-origin: 100% 100%; }
.talk .w1 { width: 46%; }
.talk .w2 { width: 64%; }
.talk .w3 { width: 84%; }
.talk.is-playing i { opacity: 0; transform: translateY(10px) scale(0.88); }
.talk.is-playing i.is-in { opacity: 1; transform: none; transition: opacity 0.3s var(--out), transform 0.36s var(--out); }
.sample-print { --pw: 8.6rem; transform: rotate(4deg); }
.home .exposures { background: rgba(232, 230, 244, 0.1); }
.home .exposures span { color: var(--moon); }
.home .exposures input:checked + span { background: var(--paper); color: var(--ink-night); }
.home .exposures input:focus-visible + span { outline: 2px solid var(--lamp); }
.home .envelope { box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4); }
.home .envelope span { color: #302639; transition: transform 0.6s var(--out); }
.bye-plate:hover .envelope span { transform: rotate(1deg) translateY(-22%); }
.home .footer { border-top: 1px solid rgba(232, 230, 244, 0.12); }
.home .foot-brand p, .home .foot-contact span { color: var(--haze); }

/* ---------- Sizes ---------- */
@media (max-width: 55rem) {
  .develop { gap: 0.7rem; }
  .talk { width: 5.6rem; }
  .sample-print { --pw: 7.4rem; }
}
@media (max-width: 47rem) {
  /* a phone: the rooftops first, then the words on the night below them */
  .home .hero { display: block; min-height: 0; }
  .rooftops { position: relative; inset: auto; height: 25rem; --fx: 0.7; }
  .rooftops::before { background: linear-gradient(180deg, rgba(31, 29, 69, 0.55) 0, rgba(31, 29, 69, 0) 20%, rgba(31, 29, 69, 0) 72%, var(--wall) 100%); }
  .hero-copy { max-width: none; margin-top: -1.2rem; padding-block: 0 3rem; }
  .when { margin-top: 1.6rem; }
  .home .story article { display: block; }
  .home .story .plate { height: auto; min-height: 13rem; padding-block: 1.6rem; }
  .home .story h3 { margin-top: 0.4rem; }
  .develop { gap: 1.1rem; }
  .talk { width: 7.2rem; }
  .sample-print { --pw: 8.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .stars i { animation: none; opacity: 0.8; }
  .kitty--roof { transition: none; }
  .photo img, .photo::after, .talk i, .kirke-note, .home .envelope span { transition-duration: 0.01s !important; }
}
