/* impromike.com · shared styles for every page in site/
   Direction: bubbles and squiggle. Teal and tangerine lead, cream is the air between.
   Motion rule: only transform (incl. translate / rotate / scale) and opacity ever animate. */

:root {
  /* brand palette, in order of priority */
  --teal: #09687d; /* Stormy Teal */
  --tangerine: #ff9959; /* Tangerine Dream */
  --brick: #ba2d0b; /* Brick Ember */
  --ink: #0d1321; /* Ink Black */
  --mahogany: #431a0a; /* Rich Mahogany */
  --cream: #fbf6ef;

  /* theme: light */
  --paper: #fbf6ef;
  --surface: #ffffff;
  --text: #0d1321;
  --muted: #4a5161;
  --line: rgba(13, 19, 33, 0.14);
  --accent: #09687d; /* accent for text on paper */
  --u-color: #09687d;
  --third-bg: #0d1321; /* the third bubble colour next to teal and tangerine */
  --third-fg: #fbf6ef;
  --chip-bg: #ffe1cb;
  --chip-fg: #431a0a;
  --device: #0d1321;
  --focus: #0d1321;
  --shadow-s: 0 1px 2px rgba(13, 19, 33, 0.08), 0 10px 28px -12px rgba(13, 19, 33, 0.22);
  --shadow-l: 0 2px 4px rgba(13, 19, 33, 0.06), 0 44px 80px -36px rgba(13, 19, 33, 0.42);

  /* type */
  --font-display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --step--1: clamp(0.9rem, 0.87rem + 0.12vw, 0.97rem);
  --step-0: clamp(1.04rem, 1rem + 0.2vw, 1.16rem);
  --step-1: clamp(1.18rem, 1.08rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
  --step-4: clamp(2.6rem, 1.6rem + 5vw, 5.4rem);
  --step-5: clamp(3.4rem, 1.5rem + 8.4vw, 8rem);

  /* space */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --section: clamp(5.5rem, 12vw, 11rem);
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --inset: clamp(0.5rem, 1vw, 0.875rem);
  --wrap: clamp(75rem, 72vw, 90rem);
  --r-block: clamp(1.75rem, 4vw, 3.5rem);
  --r-card: 1.75rem;

  /* motion */
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-soft: cubic-bezier(0.3, 1.25, 0.5, 1);

  color-scheme: light dark;
}

/* real damped springs where linear() exists (about 12% and 3% overshoot) */
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(
      0, 0.057, 0.195, 0.374, 0.561, 0.733, 0.877, 0.987, 1.063, 1.107, 1.125, 1.124, 1.11, 1.089,
      1.065, 1.042, 1.023, 1.007, 0.996, 0.988, 0.985, 0.984, 0.985, 0.988, 0.991, 0.993, 0.996,
      0.998, 1, 1.001, 1.002, 1.002, 1.002, 1.002, 1.001, 1.001, 1
    );
    --spring-soft: linear(
      0, 0.063, 0.207, 0.379, 0.547, 0.693, 0.81, 0.898, 0.958, 0.997, 1.019, 1.029, 1.032, 1.029,
      1.024, 1.019, 1.014, 1.009, 1.006, 1.003, 1.001, 1, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 1
    );
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1321;
    --surface: #1a2338;
    --text: #fbf6ef;
    --muted: #b4bac7;
    --line: rgba(251, 246, 239, 0.16);
    --accent: #ff9959;
    --u-color: #fbf6ef;
    --third-bg: #fbf6ef;
    --third-fg: #0d1321;
    --chip-bg: #3a2a25;
    --chip-fg: #ffc9a6;
    --device: #05080f;
    --focus: #fbf6ef;
    --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px -12px rgba(0, 0, 0, 0.7);
    --shadow-l: 0 2px 4px rgba(0, 0, 0, 0.3), 0 44px 80px -36px rgba(0, 0, 0, 0.9);
  }
}

/* ---------- base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth; /* only affects the two in-page anchor links */
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 var(--step-0) / 1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

p {
  margin: 0;
  text-wrap: pretty;
}

ul,
ol,
dl,
dd,
figure {
  margin: 0;
  padding: 0;
}

::selection {
  background: var(--tangerine);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-5);
  line-height: 0.94;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--step-4);
  letter-spacing: -0.028em;
}

h3 {
  font-size: var(--step-2);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-top: var(--section);
}

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

.lead {
  font-size: var(--step-1);
  line-height: 1.45;
  max-width: 33ch;
}

/* emphasised words in running text (*like this*): italic, a bit bolder, never split */
.lead .name,
em.hl {
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- colour blocks ---------- */

.block {
  position: relative;
  isolation: isolate;
  margin-inline: var(--inset);
  border-radius: var(--r-block);
  overflow: hidden;
  overflow: clip;
}

.on-teal {
  background: var(--teal);
  color: var(--cream);
  --focus: var(--cream);
  --u-color: var(--cream);
  --wave: var(--tangerine);
  --tone: #0b7b93; /* tone-on-tone line */
}

.on-tang {
  background: var(--tangerine);
  color: var(--ink);
  --focus: var(--ink);
  --u-color: var(--ink);
  --wave: var(--teal);
  --tone: #ffb07d;
}

/* the three bubble colours */
.is-teal {
  --bub-bg: var(--teal);
  --bub-fg: var(--cream);
}

.is-tang {
  --bub-bg: var(--tangerine);
  --bub-fg: var(--ink);
}

.is-third {
  --bub-bg: var(--third-bg);
  --bub-fg: var(--third-fg);
}

/* ---------- sticker word ---------- */

.sticker {
  display: inline-block;
  padding: 0.02em 0.26em 0.1em;
  border-radius: 0.42em;
  background: var(--tangerine);
  color: var(--ink);
  rotate: -3deg;
  transform-origin: 40% 60%;
  transition:
    rotate 0.8s var(--spring),
    scale 0.8s var(--spring);
}

.sticker.is-teal {
  background: var(--teal);
  color: var(--cream);
}

@media (hover: hover) {
  .sticker:hover {
    rotate: 2deg;
    scale: 1.04;
  }
}

/* typewriter sticker (site.js): the pill grows and shrinks with the letters */
.typer {
  white-space: nowrap;
}

.typer-caret {
  display: none;
  width: 0.075em;
  height: 0.74em;
  margin-left: 0.06em;
  border-radius: 0.04em;
  background: currentColor;
  vertical-align: -0.02em;
}

.js .typer-caret {
  display: inline-block;
}

/* the caret blinks only while a word rests; while typing it stays solid */
.typer.is-idle .typer-caret {
  animation: caret-blink 1.1s steps(1) infinite;
}

@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .typer-caret {
    display: none;
  }
}

/* ---------- buttons and links ---------- */

.btn {
  --btn-bg: var(--teal);
  --btn-fg: var(--cream);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  min-height: 3.5rem;
  padding: 0.5rem 0.5rem 0.5rem 1.5rem;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  transition:
    scale 0.6s var(--spring),
    translate 0.8s var(--spring);
}

.btn-tang {
  --btn-bg: var(--tangerine);
  --btn-fg: var(--ink);
}

.btn-ghost {
  padding-inline: 1.5rem;
  background: transparent;
  color: inherit;
  box-shadow: inset 0 0 0 2px currentColor;
}

.btn-dot {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  border-radius: 50%;
  background: var(--btn-fg);
  color: var(--btn-bg);
  transition: transform 0.6s var(--spring);
}

.icon {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:active {
  scale: 0.95;
}

@media (hover: hover) {
  .btn:hover {
    scale: 1.045;
  }
  .btn:hover .btn-dot {
    transform: rotate(-45deg) scale(1.08);
  }
  .btn:active {
    scale: 0.97;
  }
}

/* follows the pointer while hovered, springs back when left (see site.js) */
.is-magnet {
  transition:
    scale 0.6s var(--spring),
    translate 0.2s ease-out;
}

.link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  min-height: 2.75rem;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.45rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}

.link .icon {
  transition: transform 0.5s var(--spring);
}

@media (hover: hover) {
  .link:hover::after {
    transform: none;
  }
  .link:hover .icon {
    transform: translateX(0.25em);
  }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.chips li {
  padding: 0.34em 0.95em;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-fg);
  font-size: var(--step--1);
  font-weight: 600;
}

/* ---------- squiggles that draw themselves ----------
   A transform-only wipe: the clip box slides in from the left while its content slides the
   opposite way, so the line stays put and appears to be drawn. site.js scrubs [data-scrub] ones. */

.wipe,
.wipe-in {
  display: block;
}

.wipe {
  overflow: hidden;
}

.js .draw .wipe {
  transform: translate3d(-101%, 0, 0);
}

.js .draw .wipe-in {
  transform: translate3d(101%, 0, 0);
}

.js .draw.in .wipe,
.js .draw.in .wipe-in {
  transform: none;
  transition: transform var(--draw-time, 1.1s) cubic-bezier(0.5, 0, 0.2, 1) var(--draw-delay, 0.25s);
}

.squiggle {
  fill: none;
  stroke: var(--wave, var(--tangerine));
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* wavy underline under one word of a heading, injected by site.js into .u */
.u {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  color: var(--u-color, inherit); /* teal word on a tangerine wave: the two lead colours together */
}

.u .wipe {
  position: absolute;
  left: -1%;
  right: -1%;
  bottom: -0.2em;
  height: 0.24em;
  pointer-events: none;
}

.u .squiggle {
  width: 100%;
  height: 0.24em;
  stroke-width: 0.085em;
}

html:not(.js) .u {
  text-decoration: underline wavy var(--wave, var(--tangerine)) 0.07em;
  text-underline-offset: 0.12em;
}

/* ---------- header: two floating pills ----------
   Scrolling down, the nav pill slides away and the brand pill lets go of the round photo, which
   stays on screen the whole time: it docks towards the edge of the page, into the free margin
   beside the content where there is one. Scrolling up brings everything back (site.js). */

.skip {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-weight: 700;
  transform: translateY(-300%);
}

.skip:focus {
  transform: none;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding: calc(var(--inset) + 0.75rem) var(--gutter) 0;
  pointer-events: none;
}

.site-header > * {
  pointer-events: auto;
}

.brand,
.site-nav {
  display: flex;
  align-items: center;
  height: 3.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  color: var(--text);
}

.site-nav {
  background: var(--surface);
  box-shadow: var(--shadow-s);
  transition: transform 0.75s var(--spring-soft); /* coming back: a soft landing */
}

.site-header.is-hidden:not(:focus-within) .site-nav {
  transform: translate3d(0, -220%, 0);
  transition: transform 0.45s cubic-bezier(0.5, 0, 0.8, 0.3); /* leaving: quick and out of the way */
}

.brand {
  position: relative;
  isolation: isolate;
  gap: 0.65rem;
  padding-right: 1.15rem;
  font: 700 1.02rem/1 var(--font-display);
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: transform 0.75s var(--spring-soft);
}

/* the pill behind the brand is its own layer, so it can let go of the photo */
.brand::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--surface);
  box-shadow: var(--shadow-s);
  transform-origin: 1.625rem 50%;
  transition:
    opacity 0.35s ease,
    transform 0.6s var(--spring-soft);
}

.brand-name {
  transition:
    opacity 0.3s ease,
    transform 0.6s var(--spring-soft);
}

/* a coin: his face on one side, the M on the other */
.coin {
  position: relative;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  box-shadow: 0 0 0 0.25rem var(--surface); /* same ring as the pill, so it survives without it */
  perspective: 18rem;
  transition: scale 0.6s var(--spring);
}

.coin::after {
  content: "";
  position: absolute;
  inset: -0.25rem;
  z-index: -1;
  border-radius: 50%;
  box-shadow: var(--shadow-s);
  opacity: 0;
  transition: opacity 0.35s ease;
}

@media (min-width: 641px) {
  .site-header.is-hidden:not(:focus-within) .brand {
    pointer-events: none; /* only the photo stays clickable, not the empty space the name left */
    /* just left of the content column where the page has a free margin, otherwise 1rem from
       the edge of the page (the inner max() is the free space left of the column) */
    transform: translate3d(
      max(1rem - max(var(--gutter), (100vw - var(--wrap)) / 2), -4.5rem),
      0,
      0
    );
  }
  .site-header.is-hidden:not(:focus-within) .coin {
    pointer-events: auto;
  }
  .site-header.is-hidden:not(:focus-within) .brand::before {
    opacity: 0;
    transform: scaleX(0.45);
  }
  .site-header.is-hidden:not(:focus-within) .brand-name {
    opacity: 0;
    transform: translate3d(-0.9rem, 0, 0);
  }
  .site-header.is-hidden:not(:focus-within) .coin::after {
    opacity: 1;
  }
}

.coin-in {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateY(calc((var(--side, 0) + var(--peek, 0)) * 180deg));
  transition: transform 1s var(--spring-soft);
}

.coin-side {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.coin-face {
  object-fit: cover;
}

.coin-logo {
  display: grid;
  place-items: center;
  background: var(--teal);
  color: var(--cream);
  transform: rotateY(180deg);
}

.coin-logo svg {
  width: 60%;
  height: 60%;
}

/* homepage: the big portrait is on screen, so the coin shows the M until the portrait scrolls away */
[data-page="home"] .site-header:not(.is-docked) .coin-in {
  --side: 1;
}

@media (hover: hover) {
  .brand:hover .coin-in {
    --peek: 1;
  }
  .brand:hover .coin {
    scale: 1.08;
  }
}

.site-nav {
  gap: 0.125rem;
}

.site-nav a {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  height: 2.75rem;
  padding-inline: clamp(0.62rem, 1.5vw, 1.1rem);
  border-radius: 999px;
  font-size: clamp(0.92rem, 0.88rem + 0.2vw, 1rem);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--chip-bg);
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity 0.25s ease,
    transform 0.5s var(--spring);
}

.site-nav a[aria-current="page"] {
  color: var(--cream);
}

.site-nav a[aria-current="page"]::before {
  background: var(--teal);
  opacity: 1;
  transform: none;
}

.site-nav .nav-cta {
  margin-left: 0.25rem;
  padding-inline: clamp(0.8rem, 1.8vw, 1.25rem);
  color: var(--ink);
  font-weight: 700;
}

.site-nav .nav-cta::before {
  background: var(--tangerine);
  opacity: 1;
  transform: none;
}

@media (hover: hover) {
  .site-nav a:not([aria-current="page"]):hover::before {
    opacity: 1;
    transform: none;
  }
  .site-nav .nav-cta:hover::before {
    transform: scale(1.07);
  }
}

@media (max-width: 640px) {
  .brand {
    padding-right: 0.25rem;
    transform-origin: 0 0;
  }
  .brand-name {
    display: none;
  }
  /* a slightly larger tap area than the visible circle, so it can shrink below */
  .brand::after {
    content: "";
    position: absolute;
    inset: -0.45rem;
    border-radius: 50%;
  }
  /* phones: the photo tucks into the corner, a bit smaller, to stay out of the way of the text */
  .site-header.is-hidden:not(:focus-within) .brand {
    transform: translate3d(-0.375rem, -0.5rem, 0) scale(0.82);
  }
}

/* ---------- hero (first screen of every page): a colour field with rounded corners ---------- */

.hero {
  display: grid;
  align-items: center;
  min-height: min(calc(100svh - 2 * var(--inset)), 62rem);
  margin-top: var(--inset);
}

.hero-in {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  padding-block: clamp(6.5rem, 11vw, 9rem) clamp(3.5rem, 7vw, 6rem);
}

.hero-text {
  display: grid;
  justify-items: start;
  gap: var(--s-5);
  container-type: inline-size; /* the typewriter word below sizes itself to this column */
}

/* the longest word ("Programátor", about 6em wide) always fits the column */
.hero h1 .typer {
  font-size: min(1em, 15.6cqi);
}

.hero-line {
  display: block;
}

.hero h1 .sticker {
  margin-top: 0.12em;
}

.hero .lead {
  margin-top: var(--s-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-3);
}

/* things arrive one after another on load */
.hero-line,
.hero .lead,
.hero .actions {
  animation: rise 1s var(--spring-soft) both;
}

.hero h1 .sticker {
  animation: pop 0.9s var(--spring) 0.18s both;
}

.hero .lead {
  animation-delay: 0.28s;
}

.hero .actions {
  animation-delay: 0.4s;
}

.bub {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  animation: pop 0.9s var(--spring) both;
}

/* the long line behind everything, drawn once on load */
.hero-squiggle {
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  bottom: 0;
  --draw-delay: 0.5s;
  --draw-time: 1.8s;
  pointer-events: none;
}

.hero-squiggle svg {
  width: 100%;
  min-width: 46rem;
  height: auto;
  stroke: var(--tone);
  stroke-width: clamp(8px, 1.1vw, 16px);
}

@media (max-width: 760px) {
  .hero-in {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-5);
    padding-block: 5.75rem 2.75rem;
  }
}

/* ---------- the round photo (shared partial: me) ---------- */

.me {
  display: block;
  flex: none;
  width: var(--me, 10rem);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--teal);
  box-shadow:
    0 0 0 calc(var(--me, 10rem) * 0.05) var(--cream),
    0 calc(var(--me, 10rem) * 0.16) calc(var(--me, 10rem) * 0.3) calc(var(--me, 10rem) * -0.12) rgba(13, 19, 33, 0.5);
  transition:
    rotate 0.9s var(--spring),
    scale 0.9s var(--spring);
}

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

@media (hover: hover) {
  .me:hover {
    rotate: 5deg;
    scale: 1.05;
  }
}

/* ---------- closing call to action: a colour block with his photo popping out on top ---------- */

.cta {
  --me: clamp(7.5rem, 13vw, 10.5rem);
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
  gap: var(--s-5);
  margin: calc(var(--section) + 2.5rem) var(--inset) 0;
  padding: 0 var(--gutter) clamp(3.5rem, 8vw, 6.5rem);
  border-radius: var(--r-block);
  text-align: center;
}

.cta-deco {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

.cta-deco i {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
}

.cta-deco i:nth-child(1) {
  width: clamp(12rem, 30vw, 26rem);
  left: clamp(-9rem, -8vw, -4rem);
  bottom: clamp(-11rem, -10vw, -5rem);
}

.cta-deco i:nth-child(2) {
  width: clamp(4rem, 9vw, 8rem);
  right: 7%;
  top: 14%;
}

@media (max-width: 640px) {
  .cta-deco i:nth-child(1) {
    width: 9.5rem;
    left: -4.75rem;
    bottom: -5.25rem;
  }
  .cta-deco i:nth-child(2) {
    width: 3.25rem;
    right: -1rem;
    top: 2.25rem;
  }
}

.cta.on-tang .cta-deco i {
  background: var(--teal);
}

.cta.on-teal .cta-deco i {
  background: var(--tangerine);
}

.cta-me {
  margin-top: calc(var(--me) * -0.5);
  margin-bottom: var(--s-2);
}

/* the question and the invitation each get their own line (a <br> in the markup),
   so the size steps down just enough on phones for the question to fit */
.cta h2 {
  font-size: min(var(--step-4), 10.2vw);
}

.cta p {
  max-width: 34ch;
  margin-top: var(--s-3);
  font-size: var(--step-1);
  line-height: 1.45;
}

.cta .btn {
  margin-top: var(--s-3);
}

/* ---------- footer ---------- */

.site-footer {
  padding: clamp(3rem, 7vw, 5rem) 0 2.5rem;
  color: var(--muted);
  font-size: var(--step--1);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  font-weight: 600;
  text-decoration: none;
}

.footer-mark {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--accent);
  transition:
    rotate 0.8s var(--spring),
    scale 0.8s var(--spring);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  margin-inline: -0.75rem;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

@media (hover: hover) {
  .footer-brand:hover .footer-mark {
    rotate: -12deg;
    scale: 1.15;
  }
  .footer-nav a:hover {
    color: var(--text);
    text-decoration: underline wavy var(--tangerine) 2px;
    text-underline-offset: 0.3em;
  }
}

/* ---------- reveal on scroll ---------- */

.js .reveal {
  opacity: 0;
  transform: translate3d(0, 2.25rem, 0);
}

.js .reveal.pop {
  transform: scale(0.7);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.5s ease calc(var(--i, 0) * 90ms),
    transform 1s var(--spring-soft) calc(var(--i, 0) * 90ms);
}

.js .reveal.pop.in {
  transition-timing-function: ease, var(--spring);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translate3d(0, 0.45em, 0);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(-14deg);
  }
}

/* ---------- no motion wanted ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .reveal,
  .js .draw .wipe,
  .js .draw .wipe-in {
    opacity: 1;
    transform: none;
  }
  /* the nav still gets out of the way, with a plain fade instead of a slide; the photo stays */
  .site-header .site-nav,
  .site-header .brand::before,
  .site-header .brand-name,
  .site-header .coin::after {
    transition: opacity 0.2s linear !important;
  }
  .site-header.is-hidden:not(:focus-within) .site-nav {
    opacity: 0;
    transform: none;
    pointer-events: none;
  }
  .site-header.is-hidden:not(:focus-within) .brand,
  .site-header.is-hidden:not(:focus-within) .brand::before,
  .site-header.is-hidden:not(:focus-within) .brand-name {
    transform: none;
  }
}

/* ---------- the header photo when the nav is tucked away ----------
   Only very wide screens have a free margin beside the content where the photo can wait.
   Everywhere else it would sit on top of the text, so it leaves together with the nav
   (both come back as soon as you scroll up). */
@media (max-width: 1399px) {
  .site-header.is-hidden:not(:focus-within) .brand {
    transform: translate3d(0, -220%, 0);
    transition: transform 0.45s cubic-bezier(0.5, 0, 0.8, 0.3);
    pointer-events: none;
  }
  .site-header.is-hidden:not(:focus-within) .brand .coin {
    pointer-events: none;
  }
  .site-header.is-hidden:not(:focus-within) .brand::before,
  .site-header.is-hidden:not(:focus-within) .brand-name {
    opacity: 1;
    transform: none;
  }
  .site-header.is-hidden:not(:focus-within) .coin::after {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* no sliding: the whole header simply fades out and back */
  .site-header .brand {
    transition: opacity 0.2s linear !important;
  }
  .site-header.is-hidden:not(:focus-within) .brand {
    opacity: 0;
    transform: none;
    pointer-events: none;
  }
  .site-header.is-hidden:not(:focus-within) .brand .coin {
    pointer-events: none;
  }
}
