/* Feathers on the page: the first page of a down pillow maker, with dozens of drawn feathers lying on it. */
:root {
  --paper: #f1eadf;         /* the page */
  --paper-warm: #f8f2e8;    /* the soft light on it */
  --ink: #3a3236;           /* the words */
  --muted: #7b6f70;         /* the smaller words */
  --accent: #b6787a;        /* the button and the brand mark */
  --accent-ink: #fff8f2;    /* the words on the button */
  --feather-1: #fbf6ec;     /* ivory down */
  --feather-2: #efd4cc;     /* blush */
  --feather-3: #d9e2d3;     /* sage */
  --feather-4: #d5dde6;     /* dove blue */
  --feather-5: #e1d6e8;     /* lavender */
  --quill: #a8968a;         /* the shaft of every feather */
  --shadow: #5b4a44;        /* the feather shadows on the page */
  --air: #b9a59c;           /* the lines of the breath */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

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

.stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 440px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 70% 35%, var(--paper-warm), transparent 72%),
    radial-gradient(ellipse 50% 40% at 10% 100%, color-mix(in srgb, var(--feather-2) 45%, transparent), transparent 70%),
    var(--paper);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

/* ---------------------------------------------------------------- the top bar */
.bar {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(16px, 3vw, 30px) clamp(16px, 4vw, 52px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark {
  width: 30px;
  height: 30px;
  color: var(--accent);
  transform-origin: 20% 85%;
  transition: transform 0.7s cubic-bezier(0.34, 1.9, 0.45, 1);
}

.brand__name {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 500;
  font-variation-settings: 'SOFT' 100, 'opsz' 30;
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  gap: clamp(14px, 3vw, 34px);
}

.nav__link {
  position: relative;
  display: inline-block;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 520;
  text-decoration: none;
}

/* the word floats up a little, tilted like a feather caught by air, and settles back with a spring */
.nav__link span {
  display: inline-block;
  transition: transform 0.7s cubic-bezier(0.34, 1.9, 0.45, 1), color 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .brand:hover .brand__mark {
    transform: rotate(-12deg) translateY(-2px);
  }

  .nav__link:hover span {
    transform: translateY(-4px) rotate(-4deg);
    color: var(--ink);
  }
}

/* ---------------------------------------------------------------- the copy */
.copy {
  position: absolute;
  z-index: 1;
  left: clamp(16px, 4vw, 52px);
  bottom: clamp(56px, 9vh, 96px);
  max-width: min(560px, calc(100% - 32px));
}

.copy__kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 640;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copy__title {
  margin: 0 0 18px;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: clamp(2.3rem, 5.6vw, 4.6rem);
  font-weight: 380;
  font-variation-settings: 'SOFT' 100, 'WONK' 0, 'opsz' 96;
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.copy__title .word {
  display: inline-block;
  transform-origin: 50% 90%;
  will-change: transform;
}

.copy__line {
  margin: 0 0 24px;
  max-width: 44ch;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
  line-height: 1.5;
}

.copy__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin: 0;
}

.copy__note {
  color: var(--muted);
  font-size: 0.86rem;
}

/* the elastic pill: the words widen on the width axis, the background swells with a bounce */
.pill {
  position: relative;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  color: var(--accent-ink);
  font-weight: 640;
  font-size: 0.98rem;
  font-stretch: 100%;
  text-decoration: none;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.pill::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--accent);
  transition: inset 0.6s cubic-bezier(0.34, 1.9, 0.45, 1), transform 0.16s ease-out;
}

.pill__text {
  display: block;
  text-align: center;
  transition: font-stretch 0.6s cubic-bezier(0.34, 1.9, 0.45, 1);
}

/* the widest version of the words keeps its place, invisible, so nothing around moves */
.pill__text::before {
  content: attr(data-text);
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-stretch: 125%;
}

@media (hover: hover) and (pointer: fine) {
  .pill:hover::before {
    inset: -2px -7px;
  }

  .pill:hover .pill__text {
    font-stretch: 125%;
  }
}

.pill:active::before {
  transform: scale(1.03, 0.88);
}

/* ---------------------------------------------------------------- the feathers */
.shadows,
.feathers,
.puffs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shadows {
  z-index: 0;
}

.feathers {
  z-index: 2;
}

.puffs {
  z-index: 2;
}

.feather,
.feather-shadow {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

.feather svg,
.feather-shadow svg {
  display: block;
  overflow: visible;
}

.feather-shadow {
  filter: brightness(0) blur(1.5px);
  opacity: 0;
}

.puff {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
}

.puff path {
  fill: none;
  stroke: var(--air);
  stroke-width: 1.4;
  stroke-linecap: round;
}

/* ---------------------------------------------------------------- the rest */
.blow {
  position: absolute;
  z-index: 5;
  right: 16px;
  bottom: 16px;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
}

.blow:focus-visible {
  width: auto;
  height: auto;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  opacity: 1;
}

.blow:focus-visible::after {
  content: 'Blow';
}

.hint {
  position: absolute;
  z-index: 3;
  right: clamp(16px, 4vw, 52px);
  bottom: clamp(18px, 3vh, 28px);
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------------------------------------------------------------- phone */
@media (max-width: 640px) {
  .nav {
    gap: 14px;
  }

  .nav__link:nth-child(3) {
    display: none;
  }

  .copy {
    bottom: 64px;
  }

  .copy__line {
    margin-bottom: 18px;
  }

  .hint {
    left: 16px;
    right: auto;
  }
}
