:root {
  --paper: #efe6d4;
  --paper-shade: #c9b89b;
  --lamp: #ffd9a3;
  --sky: #f1f3f6;
  --accent: #8e3324;
  --ink: #2a221b;
  --ink-soft: #5f5246;
  --line: rgba(42, 34, 27, 0.14);
  --cta: #2a221b;
  --cta-ink: #f6efe2;
  --font: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  --serif: "Fraunces Variable", "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  /* what is left without WebGL: an ivory sheet with a warm side light, fine laid lines and a soft plate mark */
  background:
    repeating-linear-gradient(0deg, rgba(90, 70, 40, 0.035) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(90, 70, 40, 0.04) 0 1px, transparent 1px 28px),
    radial-gradient(120% 90% at 85% 15%, #f8f0de 0%, #efe6d4 45%, #ddd0b8 100%),
    var(--paper);
}

.paper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  display: block;
  opacity: 0;
}

/* a still grain over the paper, so the soft light does not band */
.grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: multiply;
  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.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.37  0 0 0 0 0.27  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.hero {
  width: min(620px, 100% - 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(10px, 2.4vh, 22px);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: rgba(250, 245, 235, 0.62);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px -10px rgba(70, 50, 25, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: clamp(11px, 1.6vh, 13px);
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  max-width: 100%;
}

.pill__text { overflow: hidden; text-overflow: ellipsis; }

.pill__tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fbf3e6;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.title {
  font-family: var(--serif);
  font-size: clamp(30px, min(8.6vw, 9.6vh), 74px);
  line-height: 1;
  font-weight: 420;
  font-variation-settings: "opsz" 120, "SOFT" 40;
  letter-spacing: -0.03em;
  color: var(--ink);
  /* the ink sits in the paper: a lighter lip below each letter, as if it were pressed in */
  text-shadow: 0 1px 0 rgba(255, 250, 240, 0.75), 0 -1px 0 rgba(60, 40, 20, 0.08);
}

.title em {
  font-style: italic;
  font-weight: 380;
  color: var(--accent);
  font-variation-settings: "opsz" 120, "SOFT" 100, "WONK" 1;
}

.lede {
  max-width: 40ch;
  text-wrap: balance;
  font-size: clamp(13px, min(3.6vw, 2.2vh), 17px);
  line-height: 1.5;
  color: var(--ink-soft);
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: clamp(2px, 0.8vh, 8px);
}

/* the button: GSAP scales the button, the face inside carries the CSS look */
.cta {
  border: 0;
  padding: 0;
  background: none;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cta__face {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(38px, 6vh, 46px);
  padding: 0 clamp(16px, 2.2vh, 20px);
  border-radius: 999px;
  overflow: hidden;
  isolation: isolate;
  color: var(--cta-ink);
  font-size: clamp(13px, 1.9vh, 15px);
  font-weight: 600;
  /* a block of dark ink with a soft top light and a lip below */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #3a3027, var(--cta));
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 220, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 1px 1px rgba(40, 25, 10, 0.3),
    0 8px 18px -8px rgba(60, 35, 10, 0.55),
    0 14px 32px -14px rgba(142, 51, 36, 0.45);
  transition: box-shadow 0.4s ease;
}

.cta.is-lit .cta__face {
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 220, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 1px 1px rgba(40, 25, 10, 0.3),
    0 10px 22px -8px rgba(60, 35, 10, 0.6),
    0 18px 40px -12px rgba(255, 170, 90, 0.7);
}

.cta__row {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.cta__row--busy,
.cta__row--done { opacity: 0; }

.cta__arrow,
.cta__spin,
.cta__tick {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cta__spin circle { stroke-dasharray: 22 40; }
.cta__tick path { stroke: #f2b37a; stroke-width: 2; stroke-dasharray: 14; stroke-dashoffset: 14; }

/* a narrow band of lamp light that crosses the button when the lamp reaches it */
.cta__shine {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 190, 120, 0.14) 46%, rgba(255, 230, 190, 0.5) 50%, rgba(255, 190, 120, 0.14) 54%, transparent 70%);
  transform: translateX(-110%);
}

.cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.note {
  font-size: clamp(11px, 1.6vh, 13px);
  color: var(--ink-soft);
}

.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  pointer-events: none;
  opacity: 0;
  fill: #fff;
  stroke: #000;
  stroke-width: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
  z-index: 5;
}
