/* =====================================================================
   Montevelli Studio — the cookie preferences pop-up
   ===================================================================== */
/* Cookie preferences: R3 V7's pop-up, carried over as it is (its own colours, corners and motion, kept inside .cookie).
   The photo fills the pop-up; the title sits in its empty top-left corner, the sentence on a blue panel (the colour of
   the fur), the buttons at the bottom. The Close button's golden fill sweeps across with a new scatter of chocolate
   chips each time (cookie.js). Used by index.html, privacy.html and 404.html. */
.cookie { --ck-cream: #FBF1EE; --ck-fur: #1F3A68; --ck-cookie: #CC8E43; --ck-chip: #511F08; --ck-ink: #0B0B0A; --ck-ivory: #F5F2EB; --ck-card: #F1F2F3; --ck-line: rgba(11, 11, 10, 0.14);
  --f-smooth: cubic-bezier(.5, 0, .3, 1); --f-cubic: cubic-bezier(.22, .31, 0, 1);
  margin: auto; width: min(720px, calc(100% - 32px)); aspect-ratio: 1200 / 839; min-height: 420px; padding: 0; border: 0; border-radius: 26px; overflow: hidden; color: var(--ck-ink); color-scheme: light;
  font: 400 1rem/1.5 "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #F9E6E3 url("../img/cookie-bg.jpg") 30% 0 / cover no-repeat; box-shadow: 0 50px 120px -40px rgba(0, 0, 0, .7); }
.cookie::backdrop { background: rgba(11, 11, 10, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.cookie form { position: absolute; inset: 0; display: flex; flex-direction: column; padding: clamp(18px, 3.2vw, 28px); }
.ck-title { align-self: flex-start; max-width: 56%; height: clamp(2.7rem, 6.2vw, 4rem); display: flex; align-items: center; padding: 0 18px; font-family: "Space Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif; font-weight: 500; font-size: clamp(2rem, 5.2vw, 2.9rem); line-height: 1; letter-spacing: -.045em; white-space: nowrap; }
.ck-text { align-self: flex-start; max-width: calc(46% - 6px); margin-top: 10px; padding: 14px 18px; border-radius: 14px; background: var(--ck-fur); color: var(--ck-ivory); font-size: clamp(14px, 1.6vw, 16px); line-height: 1.5; box-shadow: 0 10px 30px -18px rgba(10, 20, 50, .6); }
.ck-actions { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ck-link { display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; border-radius: 12px; background: var(--ck-cream); color: var(--ck-ink); font-size: 14px; font-weight: 500; text-decoration: none; box-shadow: 0 10px 30px -18px rgba(80, 30, 20, .5); }
/* the hover underline: grows in from the left, leaves to the right */
.cookie .u { background: linear-gradient(currentColor, currentColor) no-repeat 100% 100% / 0 1px; transition: background-size .45s var(--f-smooth); padding-bottom: 1px; }
.cookie .u:hover, .cookie a:hover > .u, .cookie a:focus-visible > .u { background-size: 100% 1px; background-position-x: 0; transition: background-size .45s var(--f-cubic); }
.cookie :focus-visible { outline: 2px solid var(--ck-ink); outline-offset: 3px; border-radius: 12px; }
.btn-sweep { position: relative; display: inline-grid; place-items: center; min-height: 54px; padding: 0 28px; border-radius: 12px; background: var(--ck-card); color: var(--ck-ink); box-shadow: inset 0 0 0 1px var(--ck-line); font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; isolation: isolate; cursor: pointer; }
.sweep-base { position: relative; }
.sweep-fill { position: absolute; inset: 0; display: grid; place-items: center; background: var(--ck-ink); color: var(--ck-ivory); clip-path: inset(0 100% 0 0); transition: clip-path .55s var(--f-smooth); }
.btn-sweep:hover .sweep-fill, .btn-sweep:focus-visible .sweep-fill { clip-path: inset(0 0 0 0); transition: clip-path .6s var(--f-cubic); }
.cookie .ck-close { min-height: 48px; border-radius: 12px; background: var(--ck-ink); color: var(--ck-ivory); box-shadow: none; }
.cookie .ck-close .sweep-fill { background: var(--ck-cookie); color: #2B1206; }
/* Chocolate chips: they live inside the golden fill, so they only show where the sweep has passed */
.ck-chip { position: absolute; pointer-events: none; background: var(--ck-chip); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 220, 190, .12); }
.cookie[open] { animation: ck-pop .4s var(--f-cubic); }
/* Phones: the whole picture sits at the top (title in its empty corner); the sentence and buttons follow on the wall colour */
@media (max-width: 560px) {
  .cookie { aspect-ratio: auto; min-height: 0; container-type: inline-size; background-size: 100% auto; background-position: 0 0; }
  .cookie form { position: relative; inset: auto; display: grid; grid-template-rows: calc(69.9cqw - 18px) auto auto; padding: 14px 14px 16px; }
  .ck-title { align-self: start; max-width: 64%; height: auto; padding: 6px 10px 8px; font-size: 1.45rem; }
  .ck-text { max-width: none; margin-top: 14px; margin-right: 6px; }
  .ck-actions { margin-top: 14px; }
}
@keyframes ck-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
  .cookie .u, .sweep-fill, .btn-sweep:hover .sweep-fill, .btn-sweep:focus-visible .sweep-fill { transition: none; }
  .cookie[open] { animation: none; }
}
