:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --testo: #16171b;
  --testo-2: #5b5f6a;
  --testo-3: #a3a6af;
  --linea: #ebecef;
  --traccia: #f2f2f4;
  --accento: #b3243b;        /* the single accent: Northwind's crimson, on the yearly tag, the checks and the unlock */
  --accento-velo: #fbedef;
  --ombra: 22, 23, 27;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 12px;
  /* everything inside is in em: the piece grows with the width and with the height of the window */
  font-size: clamp(9px, min(3.2vw, 2.75vh), 17px);
}

/* ---------------------------------------------------------------- the article */
.art {
  position: relative;
  width: min(30em, calc(100vw - 24px));
}
.art__row { display: flex; align-items: center; justify-content: space-between; }
.art__kicker {
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accento);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.72em;
  font-weight: 560;
  color: var(--testo-2);
  padding: 0.3em 0.7em 0.3em 0.6em;
  border-radius: 99px;
  background: var(--traccia);
  transition: background-color 0.5s, color 0.5s;
}
.status.is-open { background: var(--accento-velo); color: var(--accento); }
.status__lock { width: 0.95em; height: 1.1em; display: block; overflow: visible; }
.status__lock path { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.status__lock rect { fill: currentColor; }

.art__title {
  margin-top: 0.55em;
  font-family: "Newsreader Variable", Georgia, serif;
  font-variation-settings: "opsz" 48;
  font-weight: 460;
  font-size: 1.95em;
  line-height: 1.06;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.art__by {
  display: flex;
  align-items: center;
  gap: 0.55em;
  margin-top: 0.75em;
  font-size: 0.78em;
  font-weight: 560;
}
.art__avatar {
  display: grid;
  place-items: center;
  width: 2.1em;
  height: 2.1em;
  border-radius: 50%;
  font-size: 0.82em;
  letter-spacing: 0.02em;
  color: var(--testo-2);
  background: linear-gradient(160deg, #f4f4f6, #e6e7ea);
  box-shadow: inset 0 0 0 1px rgba(var(--ombra), 0.06);
}
.art__date { color: var(--testo-3); font-weight: 460; }

/* the body: a window of fixed height, with the fade that the paywall lifts */
.art__body {
  --keep: 1em;                  /* how much of the excerpt stays sharp before the fade (set by the script) */
  position: relative;
  height: 23.5em;
  margin-top: 1.1em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 var(--keep), transparent calc(var(--keep) + var(--fade, 4.2em)));
  mask-image: linear-gradient(to bottom, #000 var(--keep), transparent calc(var(--keep) + var(--fade, 4.2em)));
}
.art__p {
  font-family: "Newsreader Variable", Georgia, serif;
  font-variation-settings: "opsz" 14;
  font-size: 1.08em;
  line-height: 1.55;
  color: #26272d;
}
.art__p + .art__p { margin-top: 0.75em; }
.art__p:first-child::first-letter {
  float: left;
  font-size: 3.05em;
  line-height: 0.86;
  padding: 0.08em 0.08em 0 0;
  font-variation-settings: "opsz" 72;
  color: var(--testo);
}

.relock {
  position: absolute;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-size: 0.74em;
  font-weight: 560;
  color: var(--testo-2);
  padding: 0.55em 0.95em 0.55em 0.8em;
  border-radius: 99px;
  background: var(--carta);
  box-shadow: 0 0 0 1px rgba(var(--ombra), 0.08), 0 4px 14px -6px rgba(var(--ombra), 0.2);
  opacity: 0;
  visibility: hidden;
}
.relock svg { width: 0.95em; height: 1.1em; overflow: visible; }
.relock path { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.relock rect { fill: currentColor; }
@media (hover: hover) {
  .relock:hover { color: var(--testo); }
}
.relock:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

/* ---------------------------------------------------------------- the paywall card */
.wall {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.25em 1.3em 1.3em;
  border-radius: 1.15em;
  background: linear-gradient(180deg, #ffffff 0%, #fcfcfd 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 1px rgba(var(--ombra), 0.07),
    0 1px 2px rgba(var(--ombra), 0.04),
    0 10px 24px -10px rgba(var(--ombra), 0.16),
    0 30px 60px -28px rgba(var(--ombra), 0.28);
  overflow: hidden;
  will-change: transform;
}
/* a thin line of light along the top edge, once when the card lands */
.wall__shine {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(179, 36, 59, 0.55), transparent);
  opacity: 0;
  pointer-events: none;
}
.wall__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1em; }
.wall__title {
  font-size: 1.18em;
  font-weight: 620;
  font-variation-settings: "wdth" 96;
  line-height: 1.16;
  letter-spacing: -0.01em;
  max-width: 11.5em;
}
.wall__title em {
  font-style: normal;
  font-family: "Newsreader Variable", Georgia, serif;
  font-weight: 520;
  font-variation-settings: "opsz" 36;
  font-size: 1.08em;
  letter-spacing: 0;
}

/* the monthly / yearly pill, with a thumb that moves on a spring */
.plans {
  position: relative;
  flex: none;
  display: inline-flex;
  padding: 0.22em;
  border-radius: 99px;
  background: var(--traccia);
  box-shadow: inset 0 0 0 1px rgba(var(--ombra), 0.05);
}
.plans__thumb {
  position: absolute;
  top: 0.22em;
  bottom: 0.22em;
  left: 0;
  width: 0;
  border-radius: 99px;
  background: var(--carta);
  box-shadow: 0 0 0 1px rgba(var(--ombra), 0.06), 0 1px 2px rgba(var(--ombra), 0.08), 0 3px 8px -3px rgba(var(--ombra), 0.18);
}
.plans__opt {
  position: relative;
  font-size: 0.76em;
  font-weight: 580;
  padding: 0.55em 0.95em;
  border-radius: 99px;
  color: var(--testo-3);
  transition: color 0.35s;
}
.plans__opt.is-on { color: var(--testo); }
@media (hover: hover) {
  .plans__opt:not(.is-on):hover { color: var(--testo-2); }
}
.plans__opt:focus-visible { outline: 2px solid var(--accento); outline-offset: 1px; }

/* the price */
.price { margin-top: 0.85em; }
.price__main { display: flex; align-items: baseline; gap: 0.35em; flex-wrap: nowrap; }
.roll--big {
  font-size: 2.55em;
  font-weight: 640;
  font-variation-settings: "wdth" 92;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.roll--per { font-size: 0.86em; font-weight: 520; color: var(--testo-2); }
.tag {
  position: relative;
  align-self: center;
  margin-left: 0.35em;
  font-size: 0.66em;
  font-weight: 620;
  letter-spacing: 0.02em;
  padding: 0.38em 0.7em;
  border-radius: 99px;
  color: var(--testo-3);
  background: var(--traccia);
  overflow: hidden;
  white-space: nowrap;
  transition: color 0.4s, background-color 0.4s;
}
.tag.is-on { color: var(--accento); background: var(--accento-velo); }
.tag__shine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  transform: translateX(-120%);
  pointer-events: none;
}
.price__sub { margin-top: 0.3em; font-size: 0.76em; color: var(--testo-3); }

/* the rolling windows: every line sits in the same cell, the width is animated by hand */
.roll {
  position: relative;
  display: inline-grid;
  /* clipped only above and below: a longer line can show while the window is still growing */
  clip-path: inset(0 -3em);
  vertical-align: bottom;
  white-space: nowrap;
}
.roll__line { grid-area: 1 / 1; justify-self: start; display: inline-block; }
.roll--big { padding-bottom: 0.04em; }

/* the perks */
.perks { list-style: none; margin-top: 0.95em; display: grid; gap: 0.42em; }
.perk {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: 0.82em;
  color: var(--testo-2);
}
.perk svg { width: 1.2em; height: 1.2em; flex: none; padding: 0.12em; border-radius: 50%; background: var(--accento-velo); overflow: visible; }
.perk path { fill: none; stroke: var(--accento); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }

/* the button */
.cta {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 1.05em;
  height: 3.05em;
  border-radius: 0.8em;
  color: #fff;
  background: linear-gradient(180deg, #2a2b31 0%, var(--testo) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 0 1px rgba(var(--ombra), 0.9),
    0 2px 4px rgba(var(--ombra), 0.12),
    0 8px 18px -8px rgba(var(--ombra), 0.5);
  overflow: hidden;
  transition: background-color 0.4s;
}
.cta::after {
  /* the accent wash that fills the button on success */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #c22d45, var(--accento));
  opacity: var(--done, 0);
}
.cta:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }
.cta__face {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  height: 100%;
  font-size: 0.9em;
  font-weight: 600;
  letter-spacing: 0.005em;
}
.cta__icon { position: relative; width: 1.1em; height: 1.1em; flex: none; order: 2; }
.cta__icon svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cta__spin { opacity: 0; }
.cta__spin circle { stroke-dasharray: 0.68 1; stroke-width: 1.8; }
.cta__check { opacity: 0; }
.cta__check path { stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; }
@media (hover: hover) {
  .cta:hover .cta__arrow { transform: translateX(2px); }
}
.cta__arrow { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }

@media (max-width: 380px) {
  .tag { display: none; }
  .art__date { display: none; }
}
