/*
 * Base styles and shared components. Values come from tokens.css only.
 * htmx runs with includeIndicatorStyles=false (it would inject an inline
 * <style>), so the indicator rules live here.
 */
@font-face {
  font-family: Damion;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Damion-Regular.23349716d944.woff2") format("woff2");
}

@font-face {
  font-family: Chromatophore;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Chromatophore-Regular.4bf4abb44817.woff2") format("woff2");
}

@font-face {
  font-family: Chromatophore;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/Chromatophore-Medium.541a69340ece.woff2") format("woff2");
}

@font-face {
  font-family: Chromatophore;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/Chromatophore-Bold.0f036bfb9a38.woff2") format("woff2");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-surface) var(--gradient-base) fixed;
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
}

main {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
}

:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
}

main:focus,
h1:focus {
  outline: none;
}

[x-cloak] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-2);
  transform: translateY(-200%);
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  transform: none;
}

/* Requests in flight */
.htmx-indicator {
  opacity: 0;
  visibility: hidden;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--duration-fast) ease-in;
}

[aria-busy="true"] {
  cursor: progress;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: var(--border-width) solid var(--color-primary);
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font: inherit;
  font-weight: var(--font-weight-regular);
  cursor: pointer;
}

.button:hover {
  background: var(--color-primary-hover);
}

.button:disabled {
  opacity: var(--opacity-disabled);
  cursor: not-allowed;
}

/* Forms: Django 5.2 renders errors as ul.errorlist#<field-id>_error */
label {
  display: block;
  margin-bottom: var(--space-1);
  font-weight: var(--font-weight-bold);
}

input,
select,
textarea {
  width: 100%;
  padding: var(--space-2);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--color-text);
  background: var(--color-field);
}

[aria-invalid="true"] {
  border-color: var(--color-danger);
}

.helptext {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.errorlist {
  margin: var(--space-1) 0;
  padding: 0;
  list-style: none;
  color: var(--color-danger);
  font-weight: var(--font-weight-bold);
}

/* Messages: the label text carries the meaning, colour only reinforces it */
.message {
  margin: 0 0 var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-left: var(--focus-ring-width) solid var(--color-info);
  background: var(--color-info-surface);
  color: var(--color-text);
}

.message__label {
  font-weight: var(--font-weight-bold);
}

.message--success {
  border-left-color: var(--color-success);
  background: var(--color-success-surface);
}

.message--warning {
  border-left-color: var(--color-warning);
  background: var(--color-warning-surface);
}

.message--error {
  border-left-color: var(--color-danger);
  background: var(--color-danger-surface);
}

/* Site header and page sections. */
.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
}

.site-header nav {
  display: flex;
  gap: var(--space-4);
}

.site-header__brand {
  display: inline-flex;
}

.site-header nav a {
  color: var(--color-text-muted);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--color-text);
}

a {
  color: var(--color-link);
}

h1,
h2,
h3,
strong {
  font-weight: var(--font-weight-bold);
}

h1,
h2 {
  line-height: var(--line-height-tight);
}

.button {
  justify-content: center;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--duration-fast) ease-in;
}

.button--large {
  padding: var(--space-3) var(--space-8);
  font-size: var(--font-size-lg);
}

.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--color-accent);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-eyebrow);
  text-transform: uppercase;
}

.badge {
  display: inline-block;
  margin: 0 0 var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: var(--border-width) solid var(--color-accent);
  border-radius: var(--radius-pill);
  color: var(--color-accent);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.preview-banner {
  margin: 0 0 var(--space-6);
  padding: var(--space-3) var(--space-4);
  border-left: var(--focus-ring-width) solid var(--color-voltage);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

/* Onboarding */
.intro {
  margin: calc(var(--space-6) * -1) calc(var(--space-4) * -1) 0;
  container-type: inline-size;
  text-align: center;
}

.intro__body {
  max-width: var(--reading-max-width);
  margin: var(--space-8) auto 0;
  padding: 0 var(--space-4);
}

/* Wide screens: the intro text lines up with the step texts below it. */
@media (width >= 45rem) {
  .intro__body {
    max-width: var(--content-max-width);
  }

  .journey__steps {
    gap: 0;
  }

  .journey__text {
    padding: 0 var(--space-3);
  }

  .journey__step--1 .journey__text {
    padding-left: 0;
  }

  .journey__step--3 .journey__text {
    padding-right: 0;
  }
}

.intro__lead,
.calendar__lead {
  color: var(--color-text-muted);
  font-size: var(--font-size-lg);
}

.intro__cta {
  margin: var(--space-8) 0;
}

.calendar {
  text-align: center;
}

.calendar__title {
  max-width: 44rem;
  margin: 0 auto var(--space-4);
}

.calendar__title img {
  display: block;
  width: 100%;
  height: auto;
}

/* The page behind a door */
.surprise {
  max-width: var(--surprise-max-width);
  margin: 0 auto;
  text-align: center;
}

.surprise__day {
  margin: 0;
  color: var(--color-accent);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
}

.surprise__emoji {
  margin: var(--space-2) 0;
  font-size: var(--font-size-emoji);
}

.surprise h1 {
  font-size: var(--font-size-display);
}

.surprise__body {
  color: var(--color-text-muted);
  font-size: var(--font-size-lg);
}

.surprise__back {
  margin-top: var(--space-8);
}

/* Draw sign-up */
.draw {
  max-width: var(--form-max-width);
  margin: var(--space-8) auto 0;
  padding: var(--space-8);
  border: var(--border-width) solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-surface-card);
  text-align: left;
}

.draw h2 {
  margin-top: 0;
}

.field {
  margin-bottom: var(--space-4);
}

.field--check {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: flex-start;
}

.field--check input {
  width: auto;
  margin-top: var(--space-1);
}

.field--check label {
  flex: 1;
  font-weight: var(--font-weight-regular);
}

.field--check .errorlist {
  flex-basis: 100%;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.helptext {
  color: var(--color-text-muted);
}

/* Calendar: a Christmas tree of light bulbs (marketing Figma file) */
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.bulb-lit__stop1 {
  stop-color: var(--color-bulb-lit-1);
}

.bulb-lit__stop2 {
  stop-color: var(--color-bulb-lit-2);
}

.bulb-lit__stop3 {
  stop-color: var(--color-bulb-lit-3);
}

.bulb-off__stop1 {
  stop-color: var(--color-bulb-off-1);
}

.bulb-off__stop2 {
  stop-color: var(--color-bulb-off-2);
}

.tree {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: var(--space-8) auto 0;
  padding: var(--space-4) 0 var(--space-8);
}

.tree__top {
  margin-bottom: var(--space-2);
}

.tree__row {
  display: flex;
  justify-content: center;
  margin: var(--bulb-row-gap) 0 0;
  padding: 0;
  list-style: none;
}

.tree__item {
  margin: 0 var(--bulb-gap);
}

.bulb {
  position: relative;
  display: block;
  width: var(--bulb-width);
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text);
  font: inherit;
  text-decoration: none;
}

button.bulb,
button.constantine {
  cursor: pointer;
}

/* A closed bulb, or Constantine before 24 December, shakes when touched. */
.is-shaking .bulb__art,
.is-shaking img {
  animation: bulb-shake var(--duration-shake) ease-in-out;
}

@keyframes bulb-shake {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }

  20% {
    transform: translateX(-3px) rotate(-6deg);
  }

  40% {
    transform: translateX(3px) rotate(6deg);
  }

  60% {
    transform: translateX(-2px) rotate(-4deg);
  }

  80% {
    transform: translateX(2px) rotate(3deg);
  }
}

.bulb__art {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  transform-origin: 50% 100%;
}

.bulb__glass--off {
  fill: url("#bulb-off");
}

.bulb__glass--lit {
  fill: url("#bulb-lit");
}

.bulb__filament {
  fill: none;
  stroke-width: 7px;
  stroke-linecap: round;
}

.bulb__filament--off {
  stroke: var(--color-bulb-off-1);
}

.bulb__filament--lit {
  stroke: var(--color-bulb-lit-3);
}

.bulb__lit {
  opacity: 0;
}

.bulb__base {
  fill: var(--color-cable);
}

.bulb__stripe--light {
  fill: var(--color-bulb-stripe-light);
}

.bulb__stripe--dark {
  fill: var(--color-bulb-stripe-dark);
}

.bulb__label {
  fill: var(--color-cable);
}

.bulb__number {
  fill: var(--color-ice);
  font-family: var(--font-family-base);
  font-size: 110px;
  font-weight: var(--font-weight-regular);
}

/* A past day: the bulb stays lit. */
.bulb--open .bulb__lit {
  opacity: 1;
}

.bulb--open .bulb__art {
  filter: drop-shadow(0 0 var(--glow-radius) var(--color-glow));
}

/* Staff preview of a future day: the bulb stays off, but it is a link. */
.bulb--open .bulb__art,
.bulb--preview .bulb__art {
  transition: transform var(--duration-fast) ease-out;
}

.bulb--open:hover .bulb__art,
.bulb--open:focus-visible .bulb__art,
.bulb--preview:hover .bulb__art,
.bulb--preview:focus-visible .bulb__art {
  transform: translateY(var(--lift)) scale(1.05);
}

/* Today: the bulb jingles, flickers on, and then keeps twinkling. */
.bulb--today .bulb__art {
  animation:
    bulb-jingle var(--duration-jingle) ease-in-out both,
    bulb-glow-on var(--duration-switch-on) ease-out var(--duration-jingle) both,
    bulb-twinkle var(--duration-twinkle) ease-in-out var(--delay-twinkle) infinite;
}

.bulb--today .bulb__lit {
  animation: bulb-switch-on var(--duration-switch-on) steps(1, end) var(--duration-jingle) both;
}

@keyframes bulb-jingle {
  0%,
  100% {
    transform: rotate(0deg);
  }

  15% {
    transform: rotate(var(--ring-angle));
  }

  35% {
    transform: rotate(calc(var(--ring-angle) * -1));
  }

  55% {
    transform: rotate(calc(var(--ring-angle) * 0.6));
  }

  75% {
    transform: rotate(calc(var(--ring-angle) * -0.3));
  }
}

@keyframes bulb-switch-on {
  0% {
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  30% {
    opacity: 0.2;
  }

  45% {
    opacity: 1;
  }

  55% {
    opacity: 0.4;
  }

  70%,
  100% {
    opacity: 1;
  }
}

@keyframes bulb-glow-on {
  from {
    filter: drop-shadow(0 0 0 var(--color-glow));
  }

  to {
    filter: drop-shadow(0 0 var(--glow-radius-strong) var(--color-glow));
  }
}

@keyframes bulb-twinkle {
  0%,
  100% {
    filter: drop-shadow(0 0 var(--glow-radius-strong) var(--color-glow));
  }

  50% {
    filter: drop-shadow(0 0 var(--glow-radius) var(--color-glow)) brightness(1.15);
  }
}

/* Constantine is door 24: always pink; from 24 December he dances. */
.constantine {
  position: relative;
  display: block;
  width: var(--constantine-width);
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--color-text);
  text-decoration: none;
}

.constantine img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 var(--glow-radius) var(--color-glow-soft));
}

.constantine--open img {
  filter: drop-shadow(0 0 var(--glow-radius-strong) var(--color-glow));
  transform-origin: 50% 100%;
  animation: constantine-dance var(--duration-dance) ease-in-out infinite;
}

.constantine__day {
  position: absolute;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--space-12);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-cable);
  color: var(--color-ice);
  font-size: var(--font-size-xl);
}

@keyframes constantine-dance {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(var(--dance-jump)) rotate(calc(var(--sway-angle) * -4));
  }

  50% {
    transform: translateY(0) rotate(0deg);
  }

  75% {
    transform: translateY(var(--dance-jump)) rotate(calc(var(--sway-angle) * 4));
  }
}

.sparkle {
  position: absolute;
  width: clamp(1rem, 3.5vw, 2.25rem);
  height: auto;
  pointer-events: none;
  animation: sparkle-twinkle var(--duration-twinkle) ease-in-out infinite;
}

.sparkle--1 {
  top: 30%;
  left: 22%;
}

.sparkle--2 {
  top: 44%;
  right: 20%;
  animation-delay: -0.8s;
}

.sparkle--3 {
  top: 58%;
  left: 14%;
  animation-delay: -1.6s;
}

.sparkle--4 {
  top: 18%;
  right: 30%;
  animation-delay: -0.4s;
}

.sparkle--5 {
  top: 72%;
  right: 8%;
  animation-delay: -1.2s;
}

.sparkle--6 {
  top: 86%;
  left: 30%;
  animation-delay: -2s;
}

@keyframes sparkle-twinkle {
  0%,
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }

  50% {
    opacity: 0.35;
    transform: scale(0.6) rotate(20deg);
  }
}

/* "Felices fiestas" band */
.festive-band {
  overflow: hidden;
  background: var(--color-band-6);
}

.festive-band__track {
  display: flex;
  width: max-content;
  animation: band-scroll var(--duration-band) linear infinite;
}

.festive-band--reverse .festive-band__track {
  animation-direction: reverse;
}

.festive-band__item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--band-height);
  aspect-ratio: 610 / 88;
}

.festive-band__lettering {
  display: block;
  width: 96%;
  height: auto;
}

.festive-band__item--1 {
  background: var(--color-band-1);
}

.festive-band__item--2 {
  background: var(--color-band-2);
}

.festive-band__item--3 {
  background: var(--color-band-3);
}

.festive-band__item--4 {
  background: var(--color-band-4);
}

.festive-band__item--5 {
  background: var(--color-band-5);
}

.festive-band__item--6 {
  background: var(--color-band-6);
}

@keyframes band-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* Onboarding banner: the Figma frame "banner", with falling snow */
.banner {
  position: relative;
  overflow: hidden;
  container-type: inline-size;
  background: var(--color-night);
}

.banner__piece {
  position: absolute;
  height: auto;
}

.banner__piece--swing {
  transform-origin: 50% 0%;
  animation: ornament-swing var(--duration-sway) ease-in-out infinite alternate;
}

.banner__piece--ornament-bolt-cyan {
  animation-delay: -2s;
}

.banner__piece--ornament-star {
  animation-delay: -4s;
}

.banner__title {
  position: absolute;
  margin: 0;
  text-align: left;
}

.banner__lead-in {
  display: block;
  color: var(--color-light-white);
  font-weight: var(--font-weight-medium);
  line-height: 1.1;
  white-space: nowrap;
}

.banner__script {
  display: block;
  height: auto;
}

.banner__snow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.snowflake {
  position: absolute;
  top: -10%;
  width: 3.4%;
  height: auto;
  animation:
    snow-fall var(--duration-snow) linear infinite,
    snow-drift var(--duration-drift) ease-in-out infinite alternate;
}

@keyframes snow-fall {
  from {
    top: -10%;
  }

  to {
    top: 105%;
  }
}

@keyframes snow-drift {
  from {
    transform: translateX(calc(var(--snow-drift) * -1)) rotate(0deg);
  }

  to {
    transform: translateX(var(--snow-drift)) rotate(90deg);
  }
}

@keyframes ornament-swing {
  from {
    transform: rotate(calc(var(--sway-angle) * -4));
  }

  to {
    transform: rotate(calc(var(--sway-angle) * 4));
  }
}

/* Onboarding steps: a garland. The cable takes its shape while it grows, and each
   ornament enters on the cable when the cable reaches it. */
.journey {
  /* .intro is the size container; the journey is at most --content-max-width wide. */
  --cable-width: calc(min(100cqw, var(--content-max-width)) - var(--space-8));
  --cable-height: calc(var(--cable-width) * 80 / 900);

  position: relative;
  max-width: var(--content-max-width);
  margin: var(--space-8) auto 0;
  padding: 0 var(--space-4);
}

.journey__cable {
  position: absolute;
  overflow: visible;
  pointer-events: none;
}

.journey__cable path {
  fill: none;
  stroke: var(--color-cable);
  stroke-width: 5px;
  stroke-linecap: round;
  stroke-dasharray: 1 1;
  animation:
    cable-draw var(--duration-cable) linear both,
    var(--cable-shape) var(--duration-cable) ease-out both;
}

.journey__cable--wide {
  --cable-shape: cable-shape-wide;

  top: 0;
  left: var(--space-4);
  width: var(--cable-width);
  height: auto;
}

.journey__cable--tall {
  --cable-shape: cable-shape-tall;

  display: none;
}

.journey__steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Room above the texts for the cable and the ornaments that hang from it. */
.journey__steps {
  padding-top: calc(var(--cable-width) * 238 / 900);
}

.journey__step--1 .journey__text {
  animation-delay: var(--arrive-step-1);
}

.journey__step--2 .journey__text {
  animation-delay: var(--arrive-step-2);
}

.journey__step--3 .journey__text {
  animation-delay: var(--arrive-step-3);
}

.journey__text {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-lg);
  animation: step-text-appear var(--duration-appear) ease-out both;
}

.journey__text strong {
  display: block;
  color: var(--color-text);
}

/* Step 2 reads as one sentence: "Toca la bombilla del día para abrirla". */
.journey__step--2 .journey__text strong {
  display: inline;
}

.journey__number {
  display: block;
  color: var(--color-accent);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

@keyframes cable-draw {
  from {
    stroke-dashoffset: 1;
  }

  to {
    stroke-dashoffset: 0;
  }
}

/* The cable starts with the opposite wave, overshoots, and settles in its final shape. */
@keyframes cable-shape-wide {
  0% {
    d: path("M0 30 C50 30 100 10 150 10 C200 10 400 60 450 60 C500 60 700 10 750 10 C800 10 850 30 900 30");
  }

  55% {
    d: path("M0 30 C50 30 100 70 150 70 C200 70 400 0 450 0 C500 0 700 70 750 70 C800 70 850 30 900 30");
  }

  100% {
    d: path("M0 30 C50 30 100 60 150 60 C200 60 400 10 450 10 C500 10 700 60 750 60 C800 60 850 30 900 30");
  }
}

@keyframes cable-shape-tall {
  0% {
    d: path("M40 0 C40 40 60 50 60 80 C60 130 20 190 20 240 C20 290 60 350 60 400 C60 430 40 450 40 480");
  }

  55% {
    d: path("M40 0 C40 40 12 50 12 80 C12 130 68 190 68 240 C68 290 12 350 12 400 C12 430 40 450 40 480");
  }

  100% {
    d: path("M40 0 C40 40 20 50 20 80 C20 130 60 190 60 240 C60 290 20 350 20 400 C20 430 40 450 40 480");
  }
}

@keyframes step-text-appear {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Small screens: the garland hangs down the left side, one ornament per step. */
@media (width < 45rem) {
  .journey__cable--wide {
    display: none;
  }

  .journey__cable--tall {
    top: 0;
    left: var(--space-4);
    display: block;
    width: var(--journey-icon-column);
    height: calc(var(--journey-step-height) * 3);
  }

  .journey__steps {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 0;
  }

  .journey__step {
    display: grid;
    grid-template-columns: var(--journey-icon-column) 1fr;
    gap: var(--space-4);
    height: var(--journey-step-height);
    text-align: left;
  }

  .journey__text {
    grid-column: 2;
    align-self: center;
  }
}

/* Motion off: everything shows in its final state, nothing moves. */
@media (prefers-reduced-motion: reduce) {
  .bulb__art,
  .bulb__lit,
  .constantine img,
  .sparkle,
  .festive-band__track,
  .banner__piece,
  .snowflake,
  .journey__cable path,
  .journey__text {
    animation: none !important;
  }

  .bulb--today .bulb__art {
    filter: drop-shadow(0 0 var(--glow-radius-strong) var(--color-glow));
  }
}

.snowflake--1 {
  left: 1.5%;
  animation-duration: 9s, 4.5s;
  animation-delay: 0s, 0.0s;
}

.snowflake--2 {
  left: 4%;
  animation-duration: 12s, 6.0s;
  animation-delay: -3s, -1.5s;
}

.snowflake--3 {
  left: 49%;
  animation-duration: 10s, 5.0s;
  animation-delay: -6s, -3.0s;
}

.snowflake--4 {
  left: 54%;
  animation-duration: 14s, 7.0s;
  animation-delay: -1s, -0.5s;
}

.snowflake--5 {
  left: 59%;
  animation-duration: 11s, 5.5s;
  animation-delay: -8s, -4.0s;
}

.snowflake--6 {
  left: 64%;
  animation-duration: 13s, 6.5s;
  animation-delay: -4s, -2.0s;
}

.snowflake--7 {
  left: 69%;
  animation-duration: 9s, 4.5s;
  animation-delay: -2s, -1.0s;
}

.snowflake--8 {
  left: 74%;
  animation-duration: 15s, 7.5s;
  animation-delay: -9s, -4.5s;
}

.snowflake--9 {
  left: 79%;
  animation-duration: 12s, 6.0s;
  animation-delay: -5s, -2.5s;
}

.snowflake--a {
  left: 84%;
  animation-duration: 10s, 5.0s;
  animation-delay: -7s, -3.5s;
}

.snowflake--b {
  left: 89%;
  animation-duration: 13s, 6.5s;
  animation-delay: -11s, -5.5s;
}

.snowflake--c {
  left: 95%;
  animation-duration: 11s, 5.5s;
  animation-delay: -2.5s, -1.2s;
}

@media (width < 40rem) {
  .snowflake--1 {
    left: 4%;
  }

  .snowflake--2 {
    left: 12%;
  }

  .snowflake--3 {
    left: 20%;
  }

  .snowflake--4 {
    left: 28%;
  }

  .snowflake--5 {
    left: 36%;
  }

  .snowflake--6 {
    left: 44%;
  }

  .snowflake--7 {
    left: 52%;
  }

  .snowflake--8 {
    left: 60%;
  }

  .snowflake--9 {
    left: 68%;
  }

  .snowflake--a {
    left: 76%;
  }

  .snowflake--b {
    left: 84%;
  }

  .snowflake--c {
    left: 92%;
  }
}

/* Small screens: the tree keeps its shape. The bulbs touch, and the number tag is bigger. */
@media (width < 40rem) {
  .tree {
    --bulb-width: calc((100vw - var(--space-8)) / 8 - 2px);
    --bulb-gap: 1px;
    --bulb-row-gap: var(--space-1);
    --constantine-width: 5.5rem;

    margin-top: var(--space-4);
  }

  .bulb__tag {
    transform: scale(1.45);
    transform-box: fill-box;
    transform-origin: 50% 40%;
  }

  .constantine__day {
    min-width: var(--space-8);
    padding: 0 var(--space-2);
    font-size: var(--font-size-base);
  }
}

/* "Banner día": the first thing on the page of each day (marketing Figma file). */
.day-banner {
  width: 100%;
  height: clamp(6.25rem, calc((100vw - var(--space-8)) * 214 / 1214), 12.7rem);
  margin: 0 0 var(--space-8);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-day-banner);
}

.day-banner__art {
  display: block;
  width: 100%;
  height: 100%;
}

.day-banner__extension {
  fill: none;
  stroke: var(--color-day-banner-cable);
  stroke-linecap: round;
}

.day-banner__extension--left {
  stroke-width: 10.8px;
}

.day-banner__extension--right {
  stroke-width: 12px;
}

.day-banner__title {
  fill: var(--color-day-banner-cable);
  font-family: Damion, cursive;
  font-size: 96.54px;
}

/* The lights twinkle slowly: a white shine fades in over the glass and the light
   gets brighter, then it goes back to its colour. The glass never turns see-through,
   and the cable on top never changes. */
.day-banner__shine {
  opacity: 0;
  animation: day-light-shine var(--duration-day-twinkle) ease-in-out infinite;
}

.day-banner__bulb {
  animation: day-light-glow var(--duration-day-twinkle) ease-in-out infinite;
}

.day-banner__bulb--2,
.day-banner__bulb--2 .day-banner__shine {
  animation-delay: calc(var(--duration-day-twinkle) / -10 * 1);
}

.day-banner__bulb--3,
.day-banner__bulb--3 .day-banner__shine {
  animation-delay: calc(var(--duration-day-twinkle) / -10 * 2);
}

.day-banner__bulb--4,
.day-banner__bulb--4 .day-banner__shine {
  animation-delay: calc(var(--duration-day-twinkle) / -10 * 3);
}

.day-banner__bulb--5,
.day-banner__bulb--5 .day-banner__shine {
  animation-delay: calc(var(--duration-day-twinkle) / -10 * 4);
}

.day-banner__bulb--6,
.day-banner__bulb--6 .day-banner__shine {
  animation-delay: calc(var(--duration-day-twinkle) / -10 * 5);
}

.day-banner__bulb--7,
.day-banner__bulb--7 .day-banner__shine {
  animation-delay: calc(var(--duration-day-twinkle) / -10 * 6);
}

.day-banner__bulb--8,
.day-banner__bulb--8 .day-banner__shine {
  animation-delay: calc(var(--duration-day-twinkle) / -10 * 7);
}

.day-banner__bulb--9,
.day-banner__bulb--9 .day-banner__shine {
  animation-delay: calc(var(--duration-day-twinkle) / -10 * 8);
}

.day-banner__bulb--10,
.day-banner__bulb--10 .day-banner__shine {
  animation-delay: calc(var(--duration-day-twinkle) / -10 * 9);
}

@keyframes day-light-shine {
  0%,
  30%,
  70%,
  100% {
    opacity: 0;
  }

  50% {
    opacity: 0.7;
  }
}

@keyframes day-light-glow {
  0%,
  30%,
  70%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.35);
  }
}


@media (prefers-reduced-motion: reduce) {
  .day-banner__shine,
  .day-banner__bulb {
    animation: none;
  }
}

/* The dialog for a bulb that has not switched on yet. */
.bulb-dialog {
  max-width: min(24rem, calc(100vw - var(--space-8)));
  padding: var(--space-6);
  border: var(--border-width) solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-surface-card);
  box-shadow: var(--shadow-card);
  color: var(--color-text);
  text-align: center;
}

.bulb-dialog::backdrop {
  background: var(--color-backdrop);
}

.bulb-dialog__mascot {
  width: var(--mascot-size);
  height: auto;
}

.bulb-dialog__title {
  margin: var(--space-2) 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

.bulb-dialog__text {
  margin: 0 0 var(--space-6);
  color: var(--color-text-muted);
}

.bulb-dialog[open] {
  animation: dialog-pop var(--duration-appear) cubic-bezier(0.3, 1.4, 0.6, 1);
}

@keyframes dialog-pop {
  from {
    opacity: 0;
    transform: scale(0.85);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Header band of the dynamic of the day: under the day banner, full width of the page. */
.kind-band {
  margin: calc(var(--space-8) * -1 + var(--space-4)) calc(var(--space-4) * -1) var(--space-8);
}

.kind-band__item--1 {
  background: var(--color-band-1);
}

.kind-band__item--2 {
  background: var(--color-band-2);
}

.kind-band__item--3 {
  background: var(--color-band-3);
}

.kind-band__item--4 {
  background: var(--color-band-6);
}

.kind-band__item--5 {
  background: var(--color-band-4);
}

.kind-band__item--6 {
  background: var(--color-band-5);
}

/* Every header word is an SVG 80 units tall with capitals from 0 to 70 (as in Figma),
   so any new word fits: the segment grows with the word. */
.kind-band__item {
  gap: calc(var(--band-height) * 0.12);
  align-items: flex-start;
  aspect-ratio: auto;
  padding: calc(var(--band-height) * 0.11) calc(var(--band-height) * 0.17) 0;
}

.kind-band .festive-band__lettering {
  width: auto;
  height: 88%;
}

.draw form .button {
  display: flex;
  width: fit-content;
  margin: var(--space-6) auto 0;
  padding: var(--space-3) var(--space-8);
}

/* Onboarding: a calendar reminder and a WhatsApp invitation, in the style of the
   Octopus Energy España product pages: a cyan title, flat dark cards with art on
   a glowing background, and pink buttons. */
.keep-in-touch {
  max-width: var(--content-max-width);
  margin: var(--space-12) auto 0;
  padding: 0 var(--space-4) var(--space-12);
}

.keep-in-touch__title {
  margin: 0;
  color: var(--color-voltage);
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: var(--font-weight-regular);
}

.keep-in-touch__lead {
  margin: var(--space-3) 0 var(--space-8);
  color: var(--color-text);
  font-size: var(--font-size-lg);
}

.keep-in-touch__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: var(--space-4);
}

.offer-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-hemocyanin);
  text-align: left;
}

.offer-card__art {
  display: grid;
  place-items: center;
  height: 11rem;
  background: var(--gradient-glow);
}

.offer-card__art img {
  width: auto;
  max-width: 80%;
  height: 9rem;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px var(--color-shadow));
}

.offer-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
}

.offer-card__title {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-regular);
}

.offer-card__highlight {
  margin: 0;
  color: var(--color-voltage);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-regular);
}

.offer-card__text,
.offer-card__row {
  margin: 0;
  color: var(--color-text-muted);
}

.offer-card__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.offer-card__row label {
  margin: 0;
  font-weight: var(--font-weight-regular);
}

.reminder__time {
  width: auto;
  padding: var(--space-1) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-siphon);
  font-size: var(--font-size-lg);
  color-scheme: dark;
}

.offer-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-3);
}

/* Pink buttons with dark text, as on the Octopus Energy product pages. */
.button--pink {
  border-color: var(--color-accent);
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: var(--color-siphon); /* 6.8:1 on soho lights */
  font-weight: var(--font-weight-regular);
}

.button--pink:hover {
  border-color: var(--color-akoya);
  background: var(--color-akoya);
}

.whatsapp-icon {
  width: 1.4em;
  height: 1.4em;
  flex: none;
}

/* "Tu código" in the header, once the calendar knows the person. */
.site-header__code {
  margin: 0;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--color-surface-card);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.site-header__code strong {
  color: var(--color-voltage);
  letter-spacing: 0.04em;
}

/* Start a calendar, or open it on another device. */
.account {
  max-width: var(--form-max-width);
  margin: 0 auto;
  text-align: center;
}

.account__title {
  margin-bottom: var(--space-2);
  color: var(--color-voltage);
  font-size: var(--font-size-display);
  font-weight: var(--font-weight-regular);
}

.account__lead {
  color: var(--color-text-muted);
  font-size: var(--font-size-lg);
}

.account__form {
  margin-top: var(--space-6);
}

.account__form .button {
  display: flex;
  width: fit-content;
  margin: var(--space-6) auto 0;
}

.account__switch,
.draw__account {
  margin-top: var(--space-4);
  text-align: center;
}

.calendar__account {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  align-items: center;
  justify-content: center;
  margin: var(--space-6) 0 0;
}

/* The day is over: a notice instead of the entry box. */
.draw-closed {
  max-width: var(--form-max-width);
  margin: var(--space-8) auto 0;
  text-align: center;
}

.draw-closed__title {
  margin-bottom: var(--space-2);
  color: var(--color-akoya);
  font-size: var(--font-size-2xl);
}

.draw-closed__title--personal {
  font-size: var(--font-size-xl);
}

.draw-closed__account {
  margin-top: var(--space-6);
  text-align: left;
}

.draw-closed__account .button {
  display: flex;
  width: fit-content;
  margin: var(--space-6) auto 0;
}

.draw__done {
  color: var(--color-voltage);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
}

/* Quiz: one block for each question. */
.quiz__question {
  margin: 0 0 var(--space-6);
  padding: var(--space-4);
  border: var(--border-width) solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}

.quiz__question legend {
  padding: 0 var(--space-2);
  font-weight: var(--font-weight-semibold);
}

.quiz__question .field--check {
  margin-bottom: var(--space-2);
}

/* The result of the person: a card with an Ink border. */
.result-card {
  margin: 0 auto var(--space-6);
  padding: var(--space-6);
  border: var(--border-width-strong) solid var(--color-ink);
  border-radius: var(--radius-lg);
  background: var(--color-hemocyanin);
  text-align: center;
}

.result-card > * + * {
  margin-top: var(--space-3);
}

.result-card p {
  margin-bottom: 0;
}

.result-card__title {
  margin: 0;
  color: var(--color-voltage);
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-tight);
}

.result-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

.result-card__actions form {
  margin: 0;
}

.result-card__code {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.result-card .draw-closed__account {
  margin-top: var(--space-4);
}

/* The photo of the product: on the right on desktop, on top on mobile. */
.surprise__intro {
  display: grid;
  gap: var(--space-6);
  align-items: center;
  margin: var(--space-6) 0;
}

.surprise__intro .prize-showcase {
  order: -1;
}

@media (min-width: 48rem) {
  .surprise__intro {
    grid-template-columns: 3fr 2fr;
    text-align: left;
  }

  .surprise__intro .prize-showcase {
    order: 0;
  }
}

.prize-showcase {
  margin: 0 auto;
  max-width: 24rem;
}

.prize-showcase__photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* Results of a draw: the public codes, never personal data. */
.results {
  margin-top: var(--space-8);
  padding: var(--space-6);
  border: var(--border-width) solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-surface-card);
}

.results h2 {
  margin-top: 0;
  font-size: var(--font-size-xl);
}

.results__codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: var(--space-2);
  margin: 0 0 var(--space-6);
  padding: 0;
  list-style: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.results__codes li {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted);
  overflow-wrap: anywhere;
}

.prize-code {
  margin: var(--space-2) auto var(--space-4);
  padding: var(--space-3) var(--space-4);
  width: fit-content;
  border: var(--border-width-strong) dashed var(--color-voltage);
  border-radius: var(--radius-md);
  color: var(--color-voltage);
  font-size: var(--font-size-2xl);
  letter-spacing: var(--letter-spacing-eyebrow);
  overflow-wrap: anywhere;
}

.claim-deadline {
  color: var(--color-akoya);
  font-weight: var(--font-weight-medium);
}

/* Welcome: the participation code appears letter by letter. */
.welcome {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: var(--color-backdrop);
  animation: welcome-fade var(--duration-appear) ease-out both;
}

.welcome__card {
  position: relative;
  width: min(30rem, 100%);
  padding: var(--space-8) var(--space-6);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--gradient-glow);
  text-align: center;
  animation: dialog-pop var(--duration-appear) cubic-bezier(0.3, 1.4, 0.6, 1) both;
}

.welcome__mascot {
  width: 10rem;
  height: auto;
}

.welcome__title {
  margin: var(--space-3) 0 var(--space-2);
  font-size: var(--font-size-xl);
}

.welcome__lead,
.welcome__text {
  margin: 0;
  color: var(--color-text);
}

.welcome__code {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.08em;
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-siphon);
  color: var(--color-voltage);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.06em;
}

.welcome__letter {
  display: inline-block;
  animation: letter-drop var(--duration-appear) cubic-bezier(0.3, 1.6, 0.6, 1) both;
}

.welcome__letter:nth-child(1) {
  animation-delay: calc(var(--duration-appear) + 0 * 90ms);
}

.welcome__letter:nth-child(2) {
  animation-delay: calc(var(--duration-appear) + 1 * 90ms);
}

.welcome__letter:nth-child(3) {
  animation-delay: calc(var(--duration-appear) + 2 * 90ms);
}

.welcome__letter:nth-child(4) {
  animation-delay: calc(var(--duration-appear) + 3 * 90ms);
}

.welcome__letter:nth-child(5) {
  animation-delay: calc(var(--duration-appear) + 4 * 90ms);
}

.welcome__letter:nth-child(6) {
  animation-delay: calc(var(--duration-appear) + 5 * 90ms);
}

.welcome__letter:nth-child(7) {
  animation-delay: calc(var(--duration-appear) + 6 * 90ms);
}

.welcome__letter:nth-child(8) {
  animation-delay: calc(var(--duration-appear) + 7 * 90ms);
}

.welcome__letter:nth-child(9) {
  animation-delay: calc(var(--duration-appear) + 8 * 90ms);
}

.welcome__letter:nth-child(10) {
  animation-delay: calc(var(--duration-appear) + 9 * 90ms);
}

.welcome__letter:nth-child(11) {
  animation-delay: calc(var(--duration-appear) + 10 * 90ms);
}

.welcome__letter:nth-child(12) {
  animation-delay: calc(var(--duration-appear) + 11 * 90ms);
}

.welcome__letter:nth-child(13) {
  animation-delay: calc(var(--duration-appear) + 12 * 90ms);
}

.welcome__letter:nth-child(14) {
  animation-delay: calc(var(--duration-appear) + 13 * 90ms);
}

.welcome__letter:nth-child(15) {
  animation-delay: calc(var(--duration-appear) + 14 * 90ms);
}

.welcome__letter:nth-child(16) {
  animation-delay: calc(var(--duration-appear) + 15 * 90ms);
}

.welcome .button {
  margin-top: var(--space-6);
}

@keyframes welcome-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes letter-drop {
  from {
    opacity: 0;
    transform: translateY(-0.8em) rotate(-12deg) scale(0.6);
  }

  to {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome,
  .welcome__card,
  .welcome__letter {
    animation: none;
  }
}

/* The sparkles stay behind the text and the button of the welcome card. */
.welcome__card > :not(.sparkle) {
  position: relative;
  z-index: 1;
}
