/* Shared */

.patterned {
  position: relative;
  isolation: isolate;
  background-color: var(--color-sand);
}

.patterned::before,
.patterned::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../svg/pattern-tile.svg") center top / 160px 231px;
  pointer-events: none;
}

.patterned::before {
  opacity: 0.075;
}

/* The gold shimmer: a brighter copy of the pattern, revealed in a soft circle around the pointer. */
.patterned::after {
  opacity: 0;
  filter: brightness(1.15) saturate(1.6);
  -webkit-mask-image: radial-gradient(circle 280px at var(--mx, 50%) var(--my, 50%), #000, rgb(0 0 0 / 0.5) 40%, transparent 72%);
  mask-image: radial-gradient(circle 280px at var(--mx, 50%) var(--my, 50%), #000, rgb(0 0 0 / 0.5) 40%, transparent 72%);
  transition: opacity 0.6s ease;
}

.patterned.is-shimmering::after {
  opacity: 0.55;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 48px;
  border-radius: 20px;
  font: 500 1.25rem / 1.2 var(--font-body);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s ease, transform 0.25s ease;
}

.cta--wine {
  --pulse: rgb(98 0 14 / 0.4);
  background: var(--color-wine-deep);
}

.cta--gold {
  --pulse: rgb(201 136 37 / 0.5);
  background: var(--color-gold);
}

.cta__arrow {
  width: 24px;
  height: 24px;
  flex: none;
  transition: transform 0.25s ease;
}

/* Only where a pointer can really hover: a tap on a phone leaves :hover stuck on the button. */
@media (hover: hover) {
  .cta:hover {
    animation: none;
  }

  .cta--wine:hover {
    background: var(--color-burgundy);
  }

  .cta--gold:hover {
    background: #b57819;
  }

  .cta:hover .cta__arrow {
    transform: translateY(3px);
  }
}

/* A ring that swells and fades, then rests, so it draws the eye without nagging. */
@keyframes cta-pulse {
  0% {
    box-shadow: 0 0 0 0 var(--pulse);
  }

  45%,
  100% {
    box-shadow: 0 0 0 14px transparent;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .cta {
    animation: cta-pulse 3s ease-out infinite;
  }

  .cta:focus-visible {
    animation: none;
  }
}

/* Intro */

/* Sticky so the hero slides up over it instead of pushing it away. */
.intro {
  position: sticky;
  top: 0;
  height: 100svh;
  background: var(--color-intro);
  overflow: hidden;
}

.no-intro .intro,
.intro.is-done {
  display: none;
}

/* On phones the landscape video is shown whole rather than zoomed to fill the height: only the sky at its
   sides is cropped, and its top and bottom fade into the matching paper colour so no edge shows. */
.intro__video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  max-width: none;
  aspect-ratio: 16 / 9;
  translate: -50% -50%;
  -webkit-mask-image: linear-gradient(transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(transparent, #000 15%, #000 85%, transparent);
}

@media (min-width: 768px) {
  .intro__video {
    position: static;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    translate: none;
    object-fit: cover;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.intro__brand {
  --u: 3.6px;

  position: absolute;
  top: 24px;
  right: 20px;
  display: grid;
  width: max-content;
  transition: opacity 1.2s ease, translate 1.2s var(--ease-out);
}

.intro__brand .lockup {
  width: calc(var(--u) * 41.2);
}

/* The logo and "Presents:" appear together, once the logo can paint, instead of the text arriving first. */
.js .intro__brand:not(.is-ready) {
  opacity: 0;
}

.intro__brand.is-out {
  opacity: 0;
  translate: 0 -12px;
}

.intro__presents {
  margin: 6px 0 0;
  font-family: var(--font-lato);
  font-size: 0.875rem;
  text-align: center;
  color: #000;
}

.intro__skip {
  position: absolute;
  right: 24px;
  bottom: 24px;
  padding: 10px 18px;
  border: 1px solid var(--color-ink);
  border-radius: 20px;
  background: var(--color-cream);
  color: var(--color-ink);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}

.intro__skip:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 768px) {
  .intro__brand {
    --u: 6px;

    top: 65px;
    right: 84px;
  }

  .intro__presents {
    margin-top: 10px;
    font-size: 1.125rem;
  }
}

/* Lockup */

.lockup {
  width: 247px;
  height: auto;
}

/* Hero */

.hero {
  overflow: clip;
  padding-top: 100px;
}

/* Once the building's bottom reaches the screen's, it holds still and the next section slides up over it. */
@media (prefers-reduced-motion: no-preference) {
  .js .hero.is-pinned {
    position: sticky;
    top: min(0px, calc(100svh - var(--hero-h)));
  }
}

.hero__details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-inline: 30px;
  text-align: center;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px;
  margin-bottom: 16px;
}

.hero__lede {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0.5px;
  color: #000;
}

.hero__image {
  position: relative;
  margin-top: 60px;
  aspect-ratio: 1440 / 967;
}

.hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The photo's top fades into the section, so the sky meets the background without an edge. */
.hero__image::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 20.7%;
  background: linear-gradient(var(--color-sand), rgb(229 224 214 / 0));
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .js .hero__image {
    opacity: 0.3;
    transform: translateY(120px);
    transition: opacity var(--duration-hero-reveal) ease, transform var(--duration-hero-reveal) var(--ease-out);
  }

  .js .hero__image.is-revealed {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding-top: 120px;
  }

  .hero__details {
    gap: 40px;
    padding-inline: 0;
  }

  .hero__copy {
    gap: 8px;
    margin-bottom: 0;
  }

  .hero__lede {
    font-size: 1.5rem;
    line-height: normal;
    letter-spacing: 0;
    color: var(--color-text);
  }
}

/* More than a residence */

.residence {
  padding: 80px 32px;
  text-align: center;
}

.residence__text {
  max-width: 440px;
  margin-inline: auto;
}

.residence__title {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.2;
  color: var(--color-wine-deep);
}

.residence__body p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0.5px;
}

.residence__body p + p {
  margin-top: 1.4em;
}

.residence__note {
  margin: 24px 0 0;
  font-size: 0.875rem;
}

.perks {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.perk {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 270px;
  padding-block: 0 12px;
}

.perk + .perk {
  margin-top: 16px;
  padding-top: 32px;
  background: linear-gradient(to right, #fff, #594a11 50%, #fff) top center / 125px 1px no-repeat;
}

.perk__icon {
  width: 24px;
  height: 24px;
  margin: 8px 0 12px;
}

.perk__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-wine);
}

.perk__text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-ink);
}

@media (min-width: 768px) {
  .perks {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 12px 0;
    margin-top: 94px;
  }

  .perk {
    padding-inline: 6px;
  }

  .perk + .perk {
    margin-top: 0;
    padding-top: 0;
    background: linear-gradient(#fff, #594a11 50%, #fff) left center / 1px 125px no-repeat;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .perks {
    max-width: 600px;
    margin-inline: auto;
    gap: 40px 0;
  }

  .perk:nth-child(odd) {
    background: none;
  }
}

@media (min-width: 1024px) {
  .residence {
    padding: 120px 40px 100px;
  }

  .residence__text {
    max-width: none;
  }

  .residence__title {
    margin-bottom: 20px;
    font-size: 3rem;
  }

  .residence__body {
    max-width: 600px;
    margin-inline: auto;
  }

  .residence__body p {
    font-size: 1.25rem;
    line-height: normal;
    letter-spacing: 0;
    color: var(--color-text);
  }

  .residence__body p + p {
    margin-top: 1.2em;
  }

  .residence__note {
    font-size: 1rem;
    color: var(--color-text);
  }

  .perks {
    flex-wrap: nowrap;
  }

  .perk {
    flex: 0 1 270px;
    padding: 0 0 12px;
  }

  .perk + .perk {
    margin-left: 24px;
    padding-left: 24px;
  }

  .perk__icon {
    width: 32px;
    height: 32px;
    margin: 14px 0 34px;
  }

  .perk__title {
    font-family: var(--font-display-decorative);
    white-space: nowrap;
  }

  .perk__text {
    font-size: 1.125rem;
  }
}

/* Gallery */

.gallery {
  /* Read by gallery.js: card size, how far and how small the neighbours sit, their tilt in degrees. */
  --card-w: 360px;
  --card-r: 8px;
  --side-scale: 0.75;
  --side-x: 305px;
  --side-step: 250px;
  --tilt: 27;
  --depth: 900;

  position: relative;
  isolation: isolate;
  padding: 80px 0;
  border-radius: 24px;
  background: var(--color-gallery) url("../images/gallery-baroque.webp") center top / 450px 450px;
  overflow: clip;
  text-align: center;
}

.gallery__header {
  position: relative;
  padding-inline: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

.gallery__eyebrow {
  margin: 0 0 -1.2em;
  font-size: 1.125rem;
  text-transform: uppercase;
  color: var(--color-gold);
}

.gallery__title {
  margin: 0;
  font-size: min(21.9vw, 260px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-cream);
}

.gallery__track {
  position: relative;
  z-index: 1;
  height: calc(var(--card-w) / 1.5);
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  touch-action: pan-y;
}

/* Without JS the images sit in a row the visitor can swipe through. */
html:not(.js) .gallery__track {
  display: flex;
  gap: 8px;
  height: auto;
  padding-inline: 35px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

html:not(.js) .gallery__slide {
  flex: none;
  width: var(--card-w);
  aspect-ratio: 3 / 2;
  border-radius: var(--card-r);
  overflow: hidden;
  scroll-snap-align: center;
}

.js .gallery__slide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--card-w);
  aspect-ratio: 3 / 2;
  border-radius: var(--card-r);
  overflow: hidden;
  opacity: 0;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

.js .gallery:not(.is-ready) .gallery__slide:first-child {
  opacity: 1;
}

.gallery__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery__controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-top: 40px;
}

.gallery__progress {
  position: relative;
  width: min(390px, 100% - 40px);
  height: 8px;
  border-radius: 8px;
  background: #141414;
  overflow: hidden;
}

/* gallery.js slides it one width per image, so it travels the bar once per round of the gallery. */
.gallery__progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(100% / var(--total, 7));
  border-radius: 8px;
  background: var(--color-gold);
}

.gallery__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: min(390px, 100% - 40px);
}


.gallery__arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--color-gold);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.gallery__arrow svg {
  width: 24px;
  height: 24px;
}

.gallery__arrow--next {
  border-color: #fff;
  background: #fff;
  color: var(--color-ink);
}

@media (hover: hover) {
  .gallery__arrow--prev:hover {
    background: rgb(201 136 37 / 0.25);
  }

  .gallery__arrow--next:hover {
    border-color: var(--color-cream);
    background: var(--color-cream);
  }
}

.gallery__arrow:focus-visible {
  outline-color: var(--color-gold);
}

html:not(.js) .gallery__progress,
html:not(.js) .gallery__nav {
  display: none;
}

@media (min-width: 768px) {
  .gallery {
    --card-w: 520px;
    --card-r: 12px;
    --side-scale: 0.72;
    --side-x: 445px;
    --side-step: 360px;
    --depth: 1100;
  }
}

@media (min-width: 1024px) {
  .gallery {
    padding: 100px 0 120px;
    border-radius: 40px;
  }

  .gallery__eyebrow {
    font-size: 1.5rem;
  }

  .gallery__title {
    font-size: min(18.06vw, 260px);
  }

  .gallery__track {
    margin-top: min(-7vw, -40px);
  }

  .gallery__controls {
    margin-top: 60px;
  }

  .gallery__progress,
  .gallery__nav {
    width: 600px;
  }


  .gallery__arrow {
    width: 60px;
    height: 60px;
  }

  .gallery__arrow svg {
    width: 32px;
    height: 32px;
  }
}

@media (min-width: 1280px) {
  .gallery {
    --card-w: 640px;
    --card-r: 16px;
    --side-scale: 0.72;
    --side-x: 550px;
    --side-step: 470px;
    --depth: 1300;
  }
}

/* Enquiry form */

.register {
  display: grid;
  gap: 40px;
  padding: 80px 20px;
  background: var(--color-sand) url("../images/form-sketch.webp") center / cover no-repeat;
}

.register__intro {
  max-width: 519px;
  padding-inline: 4px;
  color: var(--color-text);
}

.register__title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: normal;
}

.register__intro p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0.5px;
}

.register__panel {
  border: 1px solid rgb(0 0 0 / 0.12);
  background: var(--color-cream);
  color: var(--color-ink);
}

.register__form,
.register__success {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 40px 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__label {
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  height: 44px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid var(--color-rule);
  border-radius: 0;
  background: transparent;
  font: 1rem var(--font-body);
  color: var(--color-ink);
}

.field select {
  appearance: none;
  padding-right: 28px;
  background: url("../svg/select-arrow.svg") right 9px center / 10px 6px no-repeat;
}

.field--message {
  padding-top: 16px;
}

.field textarea {
  height: 84px;
  padding-block: 8px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--color-burgundy);
  box-shadow: 0 1px 0 var(--color-burgundy);
}

.field [aria-invalid="true"] {
  border-bottom-color: var(--color-wine);
}

.field__error {
  font: 0.75rem / 1.4 var(--font-body);
  color: var(--color-wine);
}

.field__error:empty {
  display: none;
}

.field--trap {
  position: absolute;
  left: -9999px;
}

.register__consents {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 12px;
}

.consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  column-gap: 12px;
  font: 500 0.75rem / 1.4 var(--font-body);
  letter-spacing: 0.052em;
  color: var(--color-muted);
}

.consent input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-burgundy);
}

.consent a {
  font-weight: 700;
  color: inherit;
}

.consent .field__error {
  grid-column: 2;
  margin-top: 4px;
}

.register__submit {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 20px;
}

.register__submit button {
  width: 100%;
  padding: 12px 40px;
  border: 0;
  border-radius: 20px;
  background: var(--color-burgundy);
  font: 600 1.125rem / 1.4 var(--font-body);
  letter-spacing: 0.035em;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.register__submit button:hover {
  opacity: 0.9;
}

.register__submit button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.register__submit button:focus-visible {
  outline-color: var(--color-burgundy);
  outline-offset: 3px;
}

.register__submit p {
  margin: 0;
  font: 0.75rem / 1.4 var(--font-body);
  letter-spacing: 0.052em;
  color: var(--color-muted);
}

.register__status {
  margin: 0;
  font: 0.875rem / 1.4 var(--font-body);
  color: var(--color-wine);
}

.register__status:empty {
  display: none;
}

.register__success {
  justify-content: center;
  min-height: 400px;
  outline: none;
}

.register__success h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  color: var(--color-burgundy);
}

.register__success p {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.4;
}

@media (min-width: 1024px) {
  .register {
    grid-template-columns: minmax(0, 519px) 522px;
    justify-content: center;
    align-items: start;
    column-gap: 111px;
    padding: 124px 40px 136px;
  }

  .register__title {
    margin-bottom: 24px;
    font-size: 2.75rem;
  }

  .register__intro p {
    font-size: 1.25rem;
  }

  .register__form,
  .register__success {
    padding: 40px 60px;
  }

  .register__success {
    min-height: 836px;
  }

  .register__submit {
    flex-direction: row;
    align-items: center;
    padding-top: 20px;
  }

  .register__submit button {
    width: auto;
  }

  .register__submit p {
    flex: 1;
    font-size: 0.875rem;
  }
}

/* Footer */

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 80px 20px 40px;
  background: var(--color-cream);
  color: var(--color-ink);
  text-align: center;
}

.footer__wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.875rem, 11vw, 5.5rem);
  line-height: 1.05;
  color: var(--color-wine-deep);
}

.footer__address {
  margin: 4px 0 0;
  font-size: 0.625rem;
  color: var(--color-burgundy);
}

.footer__partners {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  font-size: 0.875rem;
}

.footer__partners img:first-child {
  width: 154px;
}

.footer__contacts {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__contacts li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer__contacts a,
.footer__legal a {
  color: var(--color-ink);
  text-decoration: none;
  text-underline-offset: 4px;
}

.footer__contacts a:hover,
.footer__contacts a:focus-visible,
.footer__legal a:hover,
.footer__legal a:focus-visible {
  text-decoration: underline;
}

.footer__legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1160px;
  font-size: 0.75rem;
}

.footer__legal p {
  margin: 0;
}

.footer__legal a {
  font-weight: 600;
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .footer {
    gap: 60px;
    padding: 100px 40px 80px;
  }

  .footer__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer__wordmark {
    margin-bottom: -16px;
    font-size: min(6.1vw, 5.5rem);
    line-height: normal;
    white-space: nowrap;
  }

  .footer__address {
    font-size: 0.875rem;
  }

  .footer__partners {
    flex-direction: row;
    gap: 60px;
  }

  .footer__contacts {
    flex-direction: row;
    gap: 0;
    font-size: 1rem;
  }

  .footer__contacts li + li {
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid var(--color-rule);
  }

  .footer__legal {
    font-size: 1rem;
  }

  .footer__legal a {
    font-size: 1.125rem;
  }
}

@media (min-width: 1024px) {
  .footer {
    padding-inline: 140px;
  }
}

/* Privacy policy */

.policy {
  min-height: 100vh;
  padding: 60px 24px 100px;
}

.policy__header {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 60px;
}

.policy__logo {
  color: inherit;
  text-decoration: none;
}

.policy__close {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--color-ink);
}

.policy__close svg {
  width: 100%;
  height: 100%;
}

.policy__content {
  max-width: 1200px;
  margin: 40px auto 0;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0.5px;
  color: var(--color-ink);
}

.policy__presents {
  margin: 0 0 24px;
  font-size: 1.125rem;
  text-align: center;
}

.policy__title {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  color: var(--color-wine-deep);
}

.policy__updated {
  margin: 0 0 40px;
  text-align: center;
  color: var(--color-muted);
}

.policy__content h2 {
  margin: 1.4em 0 0;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--color-wine-deep);
}

.policy__content p,
.policy__content ul,
.policy__content address {
  margin: 1.4em 0 0;
}

.policy__content ul {
  padding-left: 1.5em;
}

.policy__content address {
  font-style: normal;
}

.policy__content a {
  color: var(--color-wine-deep);
  text-underline-offset: 3px;
}

@media (min-width: 768px) {
  .policy {
    padding: 160px 120px;
  }

  .policy__header {
    padding-top: 0;
  }

  .policy__close {
    top: 47px;
    width: 80px;
    height: 80px;
  }

  .policy__content {
    margin-top: 80px;
    font-size: 1.125rem;
  }

  .policy__presents {
    margin-bottom: 40px;
    font-size: 1.5rem;
  }

  .policy__title {
    font-size: 3.25rem;
  }

  .policy__content h2 {
    font-size: 1.5rem;
  }
}

/* Cookie banner */

.cookies {
  position: fixed;
  inset: auto 15px 15px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-height: calc(100svh - 30px);
  padding: 40px 20px;
  overflow-y: auto;
  background: var(--color-cream);
  box-shadow: 0 6px 10px 4px rgb(0 0 0 / 0.15), 0 2px 3px rgb(0 0 0 / 0.3);
  color: var(--color-ink);
  opacity: 0;
  translate: 0 24px;
  transition: opacity 0.5s ease, translate 0.5s var(--ease-out);
}

.cookies.is-shown {
  opacity: 1;
  translate: none;
}

.cookies__close {
  position: absolute;
  top: 24px;
  right: 24px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-ink);
  cursor: pointer;
}

.cookies__close svg {
  width: 28px;
  height: 28px;
}

.cookies__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 40px;
  line-height: 1.4;
  letter-spacing: 0.5px;
}

.cookies__title {
  margin: 0;
  font-weight: 600;
  font-size: 1.25rem;
  text-transform: uppercase;
}

.cookies__text p {
  margin: 0;
}

.cookies__prefs {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: -20px;
}

.cookies__pref {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.cookies__pref-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
}

.cookies__pref strong {
  font-size: 1.125rem;
}

.cookies__required {
  color: #d11442;
}

.cookies__switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  margin: 0;
  border: 1px solid var(--color-burgundy);
  border-radius: 999px;
  background: transparent;
  appearance: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.cookies__switch::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-burgundy);
  transition: translate 0.2s ease, background-color 0.2s ease;
}

.cookies__switch:checked {
  background: var(--color-burgundy);
}

.cookies__switch:checked::before {
  background: #fff;
  translate: 16px 0;
}

.cookies__switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cookies__switch:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.cookies__actions {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cookies__button {
  padding: 18px 40px;
  border: 0;
  border-radius: 20px;
  background: var(--color-burgundy);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

.cookies__link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-burgundy);
  cursor: pointer;
  text-underline-offset: 4px;
}

@media (hover: hover) {
  .cookies__button:hover {
    background: var(--color-wine-deep);
  }

  .cookies__link:hover {
    text-decoration: underline;
  }
}

.cookies__button:focus-visible,
.cookies__link:focus-visible,
.cookies__close:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .cookies {
    transition: none;
  }
}

@media (min-width: 768px) {
  .cookies {
    inset: auto 50% 24px auto;
    width: min(918px, 100% - 48px);
    padding: 40px 80px;
    translate: 50% 24px;
  }

  .cookies.is-shown {
    translate: 50% 0;
  }

  .cookies:not(.is-expanded) .cookies__close {
    display: none;
  }

  .cookies:not(.is-expanded) .cookies__text {
    padding-right: 0;
  }

  .cookies__actions {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 24px;
  }

  .cookies.is-expanded .cookies__actions {
    justify-content: flex-start;
  }
}
