/* Monochrome, editorial look on top of daisyUI's light and dark themes. */
:root {
  font-family: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
}
[data-theme="light"] {
  --color-base-100: oklch(99% 0.003 80);
  --color-base-200: oklch(96.5% 0.005 80);
  --color-base-300: oklch(91% 0.007 80);
  --color-base-content: oklch(20% 0.01 60);
  --color-primary: oklch(62% 0.19 38);
  --color-primary-content: oklch(99% 0 0);
  --color-neutral: oklch(20% 0.01 60);
  --color-neutral-content: oklch(98% 0 0);
  --radius-box: 1.25rem;
  --radius-field: 0.75rem;
}
[data-theme="dark"] {
  --color-base-100: oklch(17% 0.005 60);
  --color-base-200: oklch(21% 0.006 60);
  --color-base-300: oklch(29% 0.008 60);
  --color-base-content: oklch(94% 0.005 80);
  --color-primary: oklch(72% 0.17 45);
  --color-primary-content: oklch(15% 0.01 60);
  --color-neutral: oklch(94% 0.005 80);
  --color-neutral-content: oklch(17% 0.005 60);
  --radius-box: 1.25rem;
  --radius-field: 0.75rem;
}

.nav-link { position: relative; opacity: .75; transition: opacity .2s; }
.nav-link:hover { opacity: 1; }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.nav-link:hover::after { transform: scaleX(1); }

.display { font-size: clamp(2.75rem, 7vw, 6.5rem); line-height: .95; letter-spacing: -0.045em; font-weight: 600; }
.eyebrow { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; opacity: .6; font-weight: 500; }

/* Landing hero: from 1024 px the badges and the picture are the background of the right side, the picture
   fading out behind the copy, whose headline is a little smaller to fit its column. */
@media (min-width: 1024px) {
  /* Tall enough for what's beside the copy: its top offset, the badges (two rows) and the picture (16:9). */
  .hero-section { min-height: calc(6rem + min(60vw, 1200px) * 0.5625); }
  .hero-copy { position: relative; }
  .hero-copy .display { font-size: clamp(2.75rem, 5.2vw, 5.25rem); }
  .hero-art {
    /* Its top lines up with the copy's (the section's pt-24). */
    position: absolute; z-index: -1; right: 0; top: 6rem;
    width: 60vw; max-width: 1200px;
  }
  /* The badges end where the page's content does (max-w-7xl and its padding). */
  .hero-badges { padding-right: max(1.5rem, calc((100vw - 80rem) / 2 + 1.5rem)); }
  .hero-art picture {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28%);
    mask-image: linear-gradient(to right, transparent 0, #000 28%);
  }
}

/* Landing: drop zone and photo cards */
.dropzone { transition: border-color .2s, background-color .2s, transform .2s; }
.dropzone.is-over { border-color: var(--color-primary); background: color-mix(in oklab, var(--color-primary) 6%, transparent); transform: scale(1.005); }
.stage { aspect-ratio: 1 / 1; }
.photo-card { animation: rise .35s ease both; }
/* AI restoration: a button that stands out from the editor's plain ones, and the photo being restored. */
.btn-ai {
  --btn-color: transparent; border: 0; color: #fff; font-weight: 600;
  background: linear-gradient(110deg, #7c3aed 0%, #db2777 55%, #f97316 100%);
  background-size: 160% 100%; background-position: 0% 0;
  box-shadow: 0 6px 18px -6px rgb(219 39 119 / .55);
  transition: background-position .4s ease, transform .15s ease, box-shadow .2s ease;
}
.btn-ai:hover { background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgb(219 39 119 / .65); }
.btn-ai:active { transform: none; }
.btn-ai:disabled { opacity: .5; color: #fff; background: linear-gradient(110deg, #7c3aed, #db2777, #f97316); }
.btn-ai .credits { background: rgb(255 255 255 / .22); border-radius: 999px; padding: 0 .5em; font-size: .75em; line-height: 1.6; }
.btn-ai.is-called { animation: ai-call 1.2s ease 3; }
@keyframes ai-call { 50% { box-shadow: 0 0 0 6px rgb(219 39 119 / .25), 0 10px 24px -8px rgb(219 39 119 / .65); } }
/* The speech bubble on a restored photo: its tail points down at the photo. */
.watermark-note::after {
  content: ""; position: absolute; left: 1.25rem; bottom: -6px; width: 12px; height: 12px;
  background: inherit; transform: rotate(45deg); border-radius: 2px;
}
.photo-card.is-restoring .thumb { filter: blur(10px) saturate(.8); transform: scale(1.03); transition: filter .4s ease; }

/* The crop editor previews a photo to be printed in black and white (Cropper.js draws it in several images). */
#edit-stage.is-grayscale img { filter: grayscale(1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Colour swatches of option values; each sets --swatch-color to the colour it shows. */
.swatch {
  display: inline-block; width: 1rem; height: 1rem; border-radius: 999px; flex: none;
  background: var(--swatch-color);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-base-content) 25%, transparent);
}

#continue:disabled {
  background: color-mix(in oklab, var(--color-neutral-content) 14%, transparent);
  color: color-mix(in oklab, var(--color-neutral-content) 60%, transparent);
  border-color: transparent;
}

/* Contact: animated success check */
.check-anim circle { stroke-dasharray: 166; stroke-dashoffset: 166; animation: stroke .6s cubic-bezier(.65,0,.45,1) forwards; }
.check-anim path { stroke-dasharray: 48; stroke-dashoffset: 48; animation: stroke .35s cubic-bezier(.65,0,.45,1) .6s forwards; }
.check-anim { animation: pop .3s ease-in-out .9s both; }
@keyframes stroke { to { stroke-dashoffset: 0; } }
@keyframes pop { 50% { transform: scale(1.08); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}

/* Attention dialogs (SweetAlert2, see static/js/attention.js): follow the site theme. */
.swal2-popup.attention-popup { background: var(--color-base-100); color: var(--color-base-content); border: 1px solid var(--color-base-300); border-radius: var(--radius-box); font-family: inherit; }
.swal2-popup.attention-popup .swal2-title { color: var(--color-base-content); font-size: 1.375rem; font-weight: 600; letter-spacing: -0.01em; }
.swal2-popup.attention-popup .swal2-html-container { color: color-mix(in oklab, var(--color-base-content) 75%, transparent); font-size: 1rem; }
.swal2-popup.attention-popup .swal2-footer { border-top-color: var(--color-base-300); justify-content: center; }

/* Chat button: above the landing page's order summary while it is shown. */
body:has(#summary:not(.hidden)) .chat-fab { bottom: 6rem; }

/* Crop and rotate dialog (Cropper.js): the editing area keeps a fixed height. */
#edit-stage { height: min(60vh, 520px); }
#edit-stage img { display: block; max-width: 100%; }

/* ------------------------------------------------------------------------------------------------
   Prize carousel (landing.js): a modal with a reel of prizes rolling by, which spins to the prize won.
   ------------------------------------------------------------------------------------------------ */
.prize-overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 1rem;
  background: rgb(20 12 35 / .5); backdrop-filter: blur(6px);
  animation: prize-fade .35s ease both;
}
.prize-overlay:not(.is-open) { display: none; }
.prize-card {
  position: relative; isolation: isolate; overflow: hidden; width: min(100%, 42rem);
  border-radius: 2rem; padding: 2.5rem 1.5rem 2rem; text-align: center;
  background: var(--color-base-100); color: var(--color-base-content);
  box-shadow: 0 40px 90px -25px rgb(124 58 237 / .55), 0 0 0 1px rgb(255 255 255 / .06);
  animation: prize-pop .6s cubic-bezier(.2, 1.4, .4, 1) both;
}
/* An animated gradient ring around the card. */
.prize-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none;
  background: linear-gradient(120deg, #7c3aed, #db2777, #f97316, #facc15, #7c3aed); background-size: 300% 300%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: prize-flow 6s linear infinite;
}
.prize-aura {
  position: absolute; inset: -45%; z-index: -1; opacity: .18; filter: blur(48px);
  background: conic-gradient(from 0deg, #7c3aed, #db2777, #f97316, #facc15, #22c55e, #06b6d4, #7c3aed);
  animation: prize-turn 12s linear infinite;
}
.prize-close { position: absolute; top: .9rem; right: .9rem; }
.prize-eyebrow { font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; opacity: .6; }
.prize-title {
  margin-top: .4rem; font-size: clamp(1.75rem, 4.5vw, 2.5rem); line-height: 1.05; font-weight: 700; letter-spacing: -.03em;
  background: linear-gradient(90deg, #7c3aed, #db2777, #f97316, #7c3aed); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: prize-flow 5s linear infinite;
}
.prize-subtitle { margin-top: .5rem; opacity: .7; }
.prize-window {
  position: relative; margin: 1.75rem -1.5rem; height: 8rem; overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
}
.prize-reel { display: flex; gap: .85rem; padding: 1rem 0; width: max-content; will-change: transform; }
.prize-reel.is-idle { animation: prize-roll 16s linear infinite; }
.prize-tile {
  flex: 0 0 7.5rem; height: 6rem; border-radius: 1.25rem; display: grid; place-items: center;
  color: #fff; font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; text-shadow: 0 2px 10px rgb(0 0 0 / .25);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .4), 0 10px 24px -12px rgb(0 0 0 / .5);
  transition: transform .4s ease, filter .4s ease;
}
.prize-tile:nth-child(5n+1) { background: linear-gradient(135deg, #7c3aed, #c026d3); }
.prize-tile:nth-child(5n+2) { background: linear-gradient(135deg, #db2777, #f97316); }
.prize-tile:nth-child(5n+3) { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.prize-tile:nth-child(5n+4) { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.prize-tile:nth-child(5n+5) { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.prize-reel.is-done .prize-tile:not(.is-won) { filter: grayscale(.6) brightness(.85); transform: scale(.92); }
.prize-tile.is-won {
  transform: scale(1.12); z-index: 1;
  box-shadow: 0 0 0 3px #fff, 0 0 0 7px rgb(250 204 21 / .85), 0 0 50px rgb(250 204 21 / .9);
  animation: prize-win 1s ease-in-out 3;
}
/* The pointer: a glowing triangle above the reel and one below, clear of the prize written on the tile. */
.prize-marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 0; pointer-events: none; }
.prize-marker::before, .prize-marker::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%); border: 11px solid transparent;
  filter: drop-shadow(0 0 6px #facc15) drop-shadow(0 0 12px rgb(249 115 22 / .7));
}
.prize-marker::before { top: -4px; border-top-color: #facc15; }
.prize-marker::after { bottom: -4px; border-bottom-color: #f97316; }
.prize-spin { animation: prize-pulse 1.8s ease-in-out infinite; }
.prize-spin:disabled { animation: none; }
.prize-result { display: none; margin-top: .25rem; }
.prize-result.is-shown { display: block; animation: prize-pop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.prize-won { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.prize-code-text {
  display: inline-block; margin-top: .6rem; padding: .45rem 1rem; border-radius: 999px; border: 2px dashed currentColor;
  font-family: ui-monospace, monospace; font-weight: 700; letter-spacing: .12em; color: #db2777;
}
.prize-note, .prize-min { margin-top: .6rem; font-size: .875rem; opacity: .7; }
.prize-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.prize-confetti i {
  position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; opacity: .9;
  animation: prize-fall var(--fall, 2.2s) cubic-bezier(.25, .6, .4, 1) var(--delay, 0s) forwards;
}

/* The prize star in the summary bar: bouncing and shining, to say a prize is waiting. */
.prize-star { animation: star-bounce 1.1s ease-in-out infinite, star-shine 2.6s linear infinite; }

@keyframes prize-fade { from { opacity: 0; } }
@keyframes prize-pop { from { opacity: 0; transform: translateY(18px) scale(.94); } }
@keyframes prize-turn { to { transform: rotate(1turn); } }
@keyframes prize-flow { to { background-position: 300% 50%; } }
@keyframes prize-roll { to { transform: translateX(-50%); } }
@keyframes prize-win { 50% { transform: scale(1.2) rotate(-2deg); } }
@keyframes prize-pulse { 50% { box-shadow: 0 0 0 10px rgb(219 39 119 / .15), 0 12px 30px -8px rgb(219 39 119 / .7); transform: translateY(-1px); } }
@keyframes prize-fall { to { transform: translate(var(--drift, 0), 34rem) rotate(var(--spin, 540deg)); opacity: 0; } }
@keyframes star-bounce { 0%, 100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-4px) scale(1.15); } 60% { transform: translateY(0) scale(.95); } }
@keyframes star-shine {
  0%, 100% { filter: drop-shadow(0 0 2px #facc15) hue-rotate(0deg); }
  50% { filter: drop-shadow(0 0 8px #f97316) hue-rotate(-25deg); }
}
@media (prefers-reduced-motion: reduce) {
  .prize-overlay, .prize-card, .prize-card::before, .prize-aura, .prize-title, .prize-reel.is-idle, .prize-spin,
  .prize-tile.is-won, .prize-result.is-shown, .prize-star { animation: none !important; }
}
