/* The background of the string lights that light up in waves: the holiday page of Thimble & Pine, a made-up cafe and
   gift shop. The canvas draws the night, the wire, the glass bulbs and their halos; over it the grain and the hero
   with the serif headline, which catches the warm light (--lit, written by the script). */
:root {
  --night: #070a15;         /* the midnight blue, almost black */
  --night-top: #111a33;     /* the blue of the sky behind the wire */
  --ivory: #f4e9d6;         /* the words */
  --muted: #a39c92;         /* the small words */
  --amber: #ffb65c;         /* the warm light of the bulbs */
  --accent: #ef5a44;        /* the only accent: the cranberry bulbs and the ampersand */
  --wire: #1d2a24;          /* the green black of the wire */
  --lit: 0;                 /* how much the string is lit, 0 to 1 (written by the script) */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.7, 0.5, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--night);
}

body {
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  color: var(--ivory);
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  height: 100vh;
  height: 100lvh;
  max-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% 0%, var(--night-top) 0%, rgba(17, 26, 51, 0) 70%),
    radial-gradient(90% 60% at 50% 110%, #0b1020 0%, rgba(11, 16, 32, 0) 70%),
    var(--night);
  touch-action: pan-y;
}

.sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------------------------------------------------------------- the hero */
.hero {
  position: absolute;
  left: 0;
  right: 0;
  top: 41%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 6vw;
  pointer-events: none;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7em;
  margin: 0 0 min(2.2vh, 18px);
  font-size: clamp(10px, min(1.15vw, 1.9vh), 13px);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-stretch: 112%;
  color: var(--muted);
  white-space: nowrap;
}

.eyebrow em {
  font-style: normal;
  color: var(--accent);
}

.eyebrow__mark {
  width: 1.35em;
  height: 1.35em;
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.eyebrow__rule {
  width: 1.6em;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.title {
  margin: 0;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-weight: 380;
  font-size: clamp(34px, min(10.4vw, 12.6vh), 150px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  font-variation-settings: 'opsz' 144, 'SOFT' 60;
  color: color-mix(in srgb, var(--ivory) calc(70% + var(--lit) * 30%), #8a8478);
  text-shadow:
    0 0 calc(var(--lit) * 0.35em) rgba(255, 182, 92, calc(var(--lit) * 0.22)),
    0 -0.02em calc(var(--lit) * 0.9em) rgba(255, 160, 70, calc(var(--lit) * 0.12));
}

.title__line {
  display: block;
}

.title__line--it {
  font-style: italic;
  font-weight: 330;
  color: color-mix(in srgb, #ffd9a0 calc(40% + var(--lit) * 60%), #8a8478);
}

.line {
  max-width: 32em;
  margin: min(2.6vh, 22px) 0 min(3.4vh, 28px);
  font-size: clamp(11px, min(1.25vw, 2.1vh), 16px);
  line-height: 1.55;
  font-stretch: 104%;
  color: var(--muted);
}

/* ---------------------------------------------------------------- the elastic pill */
.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.95em 1.5em 0.95em 1.6em;
  font-size: clamp(11px, min(1.15vw, 2vh), 15px);
  font-weight: 560;
  font-stretch: 100%;
  color: #1a1208;
  text-decoration: none;
  pointer-events: auto;
  transition: font-stretch 0.5s var(--ease-spring), transform 0.18s var(--ease-out);
}

.pill__bg {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe2b3, #ffc274);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(140, 70, 10, 0.25),
    0 0 0 1px rgba(255, 190, 110, 0.35),
    0 6px 18px -6px rgba(255, 150, 50, calc(0.25 + var(--lit) * 0.35)),
    0 18px 40px -18px rgba(255, 140, 40, calc(var(--lit) * 0.5));
  transition: transform 0.55s var(--ease-spring);
}

.pill__text,
.pill__arrow {
  position: relative;
}

.pill__arrow {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.45s var(--ease-spring);
}

.pill:active {
  transform: scale(0.97);
}

@media (hover: hover) {
  .pill:hover {
    font-stretch: 118%;
  }

  .pill:hover .pill__bg {
    transform: scale(1.05, 1.1);
  }

  .pill:hover .pill__arrow {
    transform: translateX(3px);
  }
}

/* ---------------------------------------------------------------- the pointer of the walk on its own */
.cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: #f4e9d6;
  stroke: #070a15;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  opacity: 0;
  z-index: 10;
}

@media (prefers-reduced-motion: reduce) {
  .pill,
  .pill__bg,
  .pill__arrow {
    transition: none;
  }
}
