/* Fonts: self-hosted, all SIL Open Font Licence (via Fontsource). */
@font-face {
  font-family: "Cinzel";
  src: url("/assets/fonts/cinzel-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "La Belle Aurore";
  src: url("/assets/fonts/la-belle-aurore-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("/assets/fonts/alegreya-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("/assets/fonts/alegreya-sans-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("/assets/fonts/alegreya-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("/assets/fonts/alegreya-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #16161a;
  --ink-muted: #5c5b5e; /* body secondary, 6:1 on paper */
  --ink-soft: rgb(22 22 26 / 0.62); /* large display text only, 4.7:1 on paper */
  --cream: #f3eee4;
  --sheet: #fffdf8; /* a sheet of letter paper on the page */
  --paper: #fbf8f2;
  --rule: rgb(22 22 26 / 0.14);
  --wax: #7a2e2a; /* the one accent: seal warmth, link hover, end of the line */

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Alegreya Sans", "Gill Sans", "Segoe UI", system-ui, sans-serif;
  --roman: "Cinzel", "Trajan Pro", Georgia, serif;
  --hand: "La Belle Aurore", "Segoe Script", cursive;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 80rem; /* 1280px */
  --section: clamp(5rem, 10vw, 9rem);

  /* Type scale. Body runs 17 to 19px; display sizes grow with the window. */
  --text-body: clamp(1.0625rem, 0.95rem + 0.25vw, 1.1875rem);
  --text-small: clamp(0.9375rem, 0.88rem + 0.15vw, 1rem);
  --text-lede: clamp(1.1875rem, 1rem + 0.45vw, 1.4375rem);
  --text-h3: clamp(1.5rem, 1rem + 1.3vw, 2.25rem);
  --text-h2: clamp(2.125rem, 1rem + 2.4vw, 3.5rem);
  --text-display: clamp(2.5rem, 1.25rem + 4.2vw, 5.5rem);
  --radius: 2px;
  --header-h: 6rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* The scroll story measures the page itself; smooth jumps would fight it. */
html.story-live {
  scroll-behavior: auto;
}

body {
  position: relative;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a,
summary,
button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 200ms ease;
}

a:hover {
  text-decoration-color: var(--wax);
}

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

p {
  margin: 0;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--paper);
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

/* Shared type */

.section-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-h2);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.lede {
  max-width: 36rem;
  margin-top: 1.25rem;
  color: var(--ink-muted);
  font-size: var(--text-lede);
  line-height: 1.45;
  text-wrap: pretty;
}

.text-link {
  display: inline-block;
  padding: 0.25rem 0;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.text-link:hover {
  text-decoration-thickness: 2px;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.lockup__emblem {
  width: auto;
  height: 2.875rem;
}

.lockup__word {
  font-family: var(--roman);
  font-weight: 600;
  font-size: 1.3125rem;
  letter-spacing: 0.2em;
  /* Letter-spacing adds trailing space after the last letter; pull it back. */
  margin-right: -0.2em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
}

.site-nav__link {
  font-size: var(--text-body);
  text-decoration: none;
  padding: 0.5rem 0;
}

.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  text-decoration: underline;
}

@media (max-width: 40rem) {
  .site-nav__link--wide {
    display: none;
  }
}

/* Buttons: hairline ink at rest; ink sweeps in from the left on hover or focus. */

.button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-block;
  padding: 1rem 1.75rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 500;
  font-size: var(--text-body);
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: color 300ms var(--ease-out);
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 400ms var(--ease-out);
}

.button:hover,
.button:focus-visible,
.button:active {
  color: var(--paper);
}

.button:hover::before,
.button:focus-visible::before,
.button:active::before {
  transform: scaleX(1);
}

/* On touch screens there is no hover, so the main button rests filled. */
@media (hover: none) {
  .button:not(.button--quiet) {
    background: var(--ink);
    color: var(--paper);
  }
}

.button--quiet {
  padding: 0.625rem 1.125rem;
  border-color: var(--rule);
}

.button--quiet:hover,
.button--quiet:focus-visible {
  border-color: var(--ink);
}

/* Hero */

/* The hero and its dot texture, full width. This is what stays pinned while the letter is sealed. */
.hero-wrap {
  position: relative;
  isolation: isolate;
}

.dot-field {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Header plus hero fill exactly one screen. */
.hero {
  display: grid;
  /* The envelope column is the hero image: about 560 to 640px on desktop. */
  grid-template-columns: minmax(0, 1fr) clamp(26rem, 42vw, 40rem);
  align-items: center;
  gap: clamp(2rem, 4vw, 4.5rem);
  max-width: var(--max);
  height: calc(100svh - var(--header-h));
  min-height: 36rem;
  margin: 0 auto;
  padding: 0 var(--gutter) var(--header-h);
}

.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-display);
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.hero__title-soft {
  display: block;
  margin-top: 0.4em;
  font-size: 0.56em;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink-soft);
}

.hero__sub {
  max-width: 30rem;
  margin-top: 1.75rem;
  color: var(--ink-muted);
  font-size: var(--text-lede);
  line-height: 1.45;
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2.25rem;
}

/* The envelope is as large as its cell allows in both directions. */
.hero__art {
  align-self: stretch;
  container-type: size;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.letter {
  --lift: 0;
  position: relative;
  width: min(100cqw, 100cqh * 128 / 104);
  aspect-ratio: 128 / 104;
}

/* While it travels, the letter is lifted off the page: a soft shadow under the body. */
.letter::before {
  content: "";
  position: absolute;
  left: 1.2%;
  top: 17.8%;
  width: 97.6%;
  height: 80%;
  border-radius: var(--radius);
  box-shadow: 0 1.5rem 3rem -1rem rgb(22 22 26 / 0.35);
  opacity: var(--lift);
  pointer-events: none;
}

.seal {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

/* Handwritten address, bottom left of the envelope. Sized with the letter. */
.letter {
  container-type: inline-size;
}

.letter__address {
  position: absolute;
  left: 6%;
  bottom: 6%;
  width: 40%;
  margin: 0;
  font-family: var(--hand);
  font-size: 3.6cqw;
  line-height: 1.5;
  color: var(--ink);
  transition: opacity 400ms ease;
}

.letter__address span {
  display: block;
}

.letter__address.is-writing {
  animation: write-in 1100ms var(--ease-out) both;
}

.letter__address.is-hidden {
  opacity: 0;
}

@keyframes write-in {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* Postmark: ink, slightly turned, top right of the envelope. */
.letter__postmark {
  position: absolute;
  right: 2.5%;
  top: 21%;
  width: 24%;
  height: auto;
  color: var(--ink);
  opacity: 0;
  transform: rotate(-9deg) scale(1.15);
  transition: opacity 300ms ease, transform 500ms cubic-bezier(0.3, 1.6, 0.5, 1);
}

.letter.is-drawn .letter__postmark {
  opacity: 0.78;
  transform: rotate(-9deg);
}

.letter__postmark text {
  font-family: var(--sans);
}

/* The letter as courier: lifted out of the hero and carried by js/story.js. */
.letter.is-courier {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 5;
  transform-origin: 0 0;
  pointer-events: none;
  will-change: transform;
}

@media (max-width: 52rem) {
  :root {
    --header-h: 4.5rem;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    align-items: start;
    min-height: 0;
    padding: 1rem var(--gutter) 1.5rem;
    gap: 1.5rem;
  }

  .hero__sub {
    margin-top: 1rem;
  }

  .hero__actions {
    margin-top: 1.5rem;
  }

  .lockup__emblem {
    height: 2.25rem;
  }
}

/* Ribbon: a dark band, slightly turned, with two lines of names moving opposite ways. Text only. */

.ribbon {
  position: relative;
  overflow: clip;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.ribbon__band {
  display: grid;
  gap: 0.25rem;
  margin: 0 -4vw;
  padding: clamp(1.25rem, 3vw, 2.25rem) 4vw;
  background: var(--ink);
  color: var(--paper);
  transform: rotate(-2deg);
}

.ribbon__row {
  display: block;
}

.ribbon__window {
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, #000 3rem, #000 calc(100% - 3rem), transparent);
}

.ribbon__belt {
  display: flex;
  width: max-content;
}

.ribbon__list {
  display: flex;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 1rem + 2.6vw, 3.5rem);
  line-height: 1.3;
  white-space: nowrap;
}

.ribbon__list li {
  display: flex;
  align-items: center;
}

/* Separators: Mercury between the systems, a wax dot between the roles. */
.ribbon__list li::after {
  content: "";
  flex-shrink: 0;
  width: 0.8em;
  height: 0.8em;
  margin: 0 0.7em;
  background: var(--paper);
  -webkit-mask: url("/assets/legaro-emblem-mercury-right.svg") center / contain no-repeat;
  mask: url("/assets/legaro-emblem-mercury-right.svg") center / contain no-repeat;
}

.ribbon__row--reverse .ribbon__list li::after {
  width: 0.3em;
  height: 0.3em;
  margin: 0 1.1em;
  border-radius: 50%;
  background: var(--wax);
  box-shadow: 0 0 0 1px rgb(251 248 242 / 0.35);
  -webkit-mask: none;
  mask: none;
}

.ribbon__toggle {
  justify-self: end;
  margin-top: 0.25rem;
  padding: 0.5rem 0;
  border: 0;
  background: none;
  color: rgb(251 248 242 / 0.8);
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.ribbon__toggle:hover {
  color: var(--paper);
  text-decoration-color: var(--wax);
}

.ribbon__toggle:focus-visible {
  outline-color: var(--paper);
}

@media (prefers-reduced-motion: no-preference) {
  .ribbon__belt {
    animation: belt 70s linear infinite;
  }

  .ribbon__row--reverse .ribbon__belt {
    animation-direction: reverse;
    animation-duration: 60s;
  }

  .ribbon__band:hover .ribbon__belt,
  .ribbon.is-paused .ribbon__belt {
    animation-play-state: paused;
  }
}

@keyframes belt {
  to {
    transform: translateX(-50%);
  }
}

/* Reduced motion: still lines that wrap, no copies, no pause button. */
@media (prefers-reduced-motion: reduce) {
  .ribbon__window {
    mask-image: none;
  }

  .ribbon__belt {
    width: auto;
  }

  .ribbon__list {
    flex-wrap: wrap;
    flex-shrink: 1;
    white-space: normal;
  }

  .ribbon__list[aria-hidden="true"],
  .ribbon__toggle {
    display: none;
  }

  .ribbon__list li:last-child::after {
    display: none;
  }
}

@media (max-width: 40rem) {
  .ribbon__row + .ribbon__row {
    margin-top: 0.5rem;
  }
}

/* The story: steps on the left, the letter on a desk on the right. Without
   the scroll story (reduced motion, no script) it is a still page with every
   example showing. */

.story {
  position: relative;
  overflow-x: clip; /* the reply card starts just off to the right */
}

.story__stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--section) var(--gutter);
}

.story__head {
  max-width: 34rem;
}

.story__note {
  margin-top: 0.75rem;
  color: var(--ink-muted);
  font-size: var(--text-small);
}

.story__caption {
  display: none;
}

/* The steps, on a line that inks down as the letter moves on. */
.story__steps {
  --line-x: 0.4375rem;
  position: relative;
  display: grid;
  gap: clamp(1.25rem, 3.5vh, 2.25rem);
  margin: clamp(2rem, 5vh, 3.5rem) 0 0;
  padding: 0 0 0 2.75rem;
  list-style: none;
}

.story__steps::before,
.story__steps::after {
  content: "";
  position: absolute;
  left: var(--line-x);
  top: 0.9rem;
  bottom: 0.9rem;
  width: 1px;
  background: var(--rule);
}

.story__steps::after {
  background: var(--ink);
  transform-origin: top;
  transform: scaleY(var(--ink-progress, 1));
}

.story__step {
  position: relative;
}

.story__step::before {
  content: "";
  position: absolute;
  left: calc(var(--line-x) - 2.75rem - 6px);
  top: 0.65rem;
  z-index: 1;
  width: 13px;
  height: 13px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
  transition: background-color 300ms ease, border-color 300ms ease;
}

.story__step:last-child::before {
  border-color: var(--wax);
  background: var(--wax);
}

.story__name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-h3);
  line-height: 1.1;
  transition: color 300ms ease;
}

.story__step p {
  max-width: 28rem;
  margin-top: 0.375rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* The desk: where the letter rests, and the example for each step. */
.story__desk {
  display: grid;
  justify-items: center;
  gap: 1.5rem;
}

.story__spot {
  display: none;
  width: min(100%, clamp(18rem, 34vw, 32rem));
  aspect-ratio: 128 / 104;
}

.story__cards {
  display: grid;
  gap: 1rem;
  width: min(100%, 30rem);
}

/* Live: the stage fills the screen and stays pinned while the letter works through the steps. */
.story-live .story__stage {
  height: 100svh;
  padding-top: clamp(1.5rem, 5vh, 3.5rem);
  padding-bottom: clamp(1.5rem, 5vh, 3.5rem);
}

.story-live .story__desk {
  align-self: stretch;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0;
}

.story-live .story__spot {
  display: block;
  /* As big as the desk allows, leaving room for a card underneath. */
  width: min(100%, clamp(18rem, 36vw, 34rem), (100svh - 19rem) * 128 / 104);
  align-self: end;
}

.story-live .story__cards {
  position: relative;
  display: block;
  height: 12.5rem;
  margin-top: -1.5rem; /* tucked just under the letter */
}

.story-live .story__card {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
}

.story-live .story__name {
  color: var(--ink-muted);
}

.story-live .story__step.is-active .story__name {
  color: var(--ink);
}

.story-live .story__step::before {
  background: var(--paper);
}

.story-live .story__step.is-reached::before {
  background: var(--ink);
}

.story-live .story__step:last-child.is-reached::before {
  background: var(--wax);
}

/* Example cards. */
.card {
  padding: clamp(1rem, 2vw, 1.5rem) clamp(1.125rem, 2.2vw, 1.75rem);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--sheet);
  box-shadow: 0 1rem 2rem -1.25rem rgb(22 22 26 / 0.35);
}

.card__meta {
  color: var(--ink-muted);
  font-size: var(--text-small);
}

.card__title {
  margin-top: 0.25rem;
  font-family: var(--serif);
  font-size: clamp(1.375rem, 1rem + 0.9vw, 1.875rem);
  line-height: 1.2;
}

.card__body {
  margin-top: 0.375rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

.card__tag {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
  font-weight: 500;
}

.card--reply {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.card--reply .card__meta {
  color: rgb(251 248 242 / 0.72);
}

.card__quote {
  margin-top: 0.25rem;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 1rem + 1.6vw, 2.5rem);
  line-height: 1.15;
}

/* A day in the client's calendar, with the 10:00 slot waiting. */
.cal {
  padding: clamp(0.875rem, 1.8vw, 1.25rem) clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--sheet);
  box-shadow: 0 1rem 2rem -1.25rem rgb(22 22 26 / 0.35);
}

.cal__day {
  margin-bottom: 0.5rem;
  font-family: var(--serif);
  font-size: 1.375rem;
}

.cal__row {
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr);
  align-items: stretch;
  min-height: 2.75rem;
  border-top: 1px solid var(--rule);
}

.cal__time {
  padding-top: 0.5rem;
  color: var(--ink-muted);
  font-size: var(--text-small);
  font-variant-numeric: tabular-nums;
}

.cal__event,
.cal__slot {
  position: relative;
  margin: 0.3125rem 0;
  border-radius: var(--radius);
}

.cal__event {
  padding: 0.375rem 0.75rem;
  background: var(--cream);
  color: var(--ink-muted);
}

.cal__slot {
  outline: 1px dashed rgb(22 22 26 / 0.4);
  outline-offset: -1px;
}

.cal__booked {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}

@media (max-width: 52rem) {
  .story__stage {
    grid-template-columns: minmax(0, 1fr);
  }

  /* While pinned on a phone: heading, a row of step names, the current
     sentence, then the letter and its example underneath. */
  .story-live .story__stage {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.75rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .story-live .story__note {
    display: none;
  }

  .story-live .story__steps {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.875rem 0 0;
    border-top: 1px solid var(--rule);
  }

  .story-live .story__steps::before,
  .story-live .story__steps::after,
  .story-live .story__step::before {
    display: none;
  }

  .story-live .story__name {
    font-family: var(--sans);
    font-size: 1rem;
  }

  .story-live .story__step.is-active .story__name {
    text-decoration: underline;
    text-decoration-color: var(--wax);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.35em;
  }

  .story-live .story__step p {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .story-live .story__caption {
    display: block;
    min-height: 2.9em;
    margin-top: 0.75rem;
    color: var(--ink-muted);
    line-height: 1.45;
  }

  /* The letter and its example sit together in the middle of what's left. */
  .story-live .story__desk {
    grid-template-rows: auto auto;
    align-content: center;
  }

  .story-live .story__spot {
    width: min(100%, (100svh - 28rem) * 128 / 104);
    align-self: auto;
  }

  .story-live .story__cards {
    height: 9.5rem;
    margin-top: -1rem;
  }

  .card__title {
    font-size: 1.25rem;
  }

  .card__quote {
    font-size: 1.625rem;
  }

  .cal__row {
    min-height: 2.25rem;
  }

  .cal__day {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
  }
}

/* The brief a client receives: a letter on the desk. */

.brief {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 6rem);
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--section) var(--gutter);
}

.brief-card {
  position: relative;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--sheet);
  box-shadow: 0 2rem 3.5rem -2rem rgb(22 22 26 / 0.3);
  rotate: -0.8deg;
}

.brief-card__example {
  position: absolute;
  top: clamp(1rem, 2.5vw, 1.5rem);
  right: clamp(1rem, 2.5vw, 1.5rem);
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink-muted);
  font-size: var(--text-small);
}

.brief-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.brief-card__emblem {
  width: auto;
  height: 2.25rem;
}

.brief-card__word {
  font-family: var(--roman);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.2em;
}

.brief-card__kind {
  flex-basis: 100%;
  margin: 1.25rem 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 1rem + 1.6vw, 2.75rem);
  line-height: 1.15;
}

.brief-card__fields {
  margin: 1.25rem 0 0;
}

.brief-card__fields div {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
}

.brief-card__fields dt {
  color: var(--ink-muted);
  font-size: var(--text-small);
  line-height: 1.6;
}

.brief-card__fields dd {
  margin: 0;
  line-height: 1.5;
}

.brief-card__fields div:nth-child(4) dd {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1rem + 0.6vw, 1.625rem);
  line-height: 1.4;
}

.brief-card__sign {
  margin-top: 0.75rem;
  font-family: var(--hand);
  font-size: 2.25rem;
  text-align: right;
}

@media (max-width: 52rem) {
  .brief {
    grid-template-columns: minmax(0, 1fr);
  }

  .brief-card__fields div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.125rem;
  }

  .brief-card__example {
    position: static;
    display: inline-block;
    margin-bottom: 1rem;
  }
}

/* /book: the Cal.com calendar on a sheet of paper, on the cream page. */

.book {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
}

.book__head .lede {
  max-width: 30rem;
}

.book__panel {
  position: relative;
  padding: clamp(0.5rem, 2vw, 1.5rem);
  border-radius: var(--radius);
  background: var(--cream);
}

.book__embed {
  min-height: 34rem;
  border-radius: var(--radius);
  background: var(--sheet);
}

.book__embed.is-ready {
  min-height: 0;
  background: none;
}

.book__fallback {
  padding: 1rem 0.5rem 0.25rem;
  color: var(--ink-muted);
}

@media (max-width: 40rem) {
  .book__panel {
    margin: 0 calc(-1 * var(--gutter));
    padding: 0;
    border-radius: 0;
  }
}

/* The booked note: shown on /book once Cal.com reports the booking, and on /booked. */

.booked-note {
  display: grid;
  justify-items: start;
  gap: 0.75rem;
  max-width: 48rem;
  padding: clamp(2rem, 6vw, 4rem) clamp(1.5rem, 5vw, 3.5rem);
  border-radius: var(--radius);
  background: var(--sheet);
  box-shadow: 0 2rem 3.5rem -2rem rgb(22 22 26 / 0.3);
}

.booked-note[hidden] {
  display: none;
}

.booked-note:focus {
  outline: none;
}

.booked-note__emblem {
  width: auto;
  height: 4rem;
  margin-bottom: 0.5rem;
}

.booked-note__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-display);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.booked-note__when {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 1rem + 1.2vw, 2.25rem);
  line-height: 1.3;
}

.booked-note__line {
  color: var(--ink-muted);
}

.booked-note .text-link {
  margin-top: 0.75rem;
}

@media (prefers-reduced-motion: no-preference) {
  .booked-note.is-in,
  .booked-note--page {
    transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
  }

  .booked-note.is-in {
    animation: note-in 600ms var(--ease-out) both;
  }
}

@keyframes note-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* /booked: the note in the middle of the page; it waits for the send-off. */
.booked__stage {
  display: grid;
  place-items: center;
  min-height: calc(100svh - var(--header-h) - 12rem);
}

.will-send .booked-note--page {
  opacity: 0;
  transform: translateY(12px);
}

/* The send-off stage: the letter in the middle of the screen, over the page. */
.send-off {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.send-off[hidden] {
  display: none;
}

.send-off__art {
  container-type: size;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(86vw, 34rem);
  aspect-ratio: 128 / 104;
}

.send-off .letter__address {
  display: none;
}

/* Old new-tab send-off. Only the privacy page still loads js/book.js. */

.post-note {
  position: fixed;
  top: 1rem;
  right: var(--gutter);
  z-index: 21;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-size: 1rem;
  box-shadow: 0 1rem 2rem -1rem rgb(22 22 26 / 0.5);
  opacity: 0;
  transform: translateY(-0.5rem);
  transition: opacity 250ms ease, transform 400ms var(--ease-out);
  pointer-events: none;
}

.post-note:empty {
  display: none;
}

.post-note.is-shown {
  opacity: 1;
  transform: none;
}

.flyer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 22;
  width: 56px;
  height: 40px;
  color: var(--ink);
  pointer-events: none;
}

/* What counts */

.qualified {
  background: var(--cream);
}

.qualified__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--section) var(--gutter);
}

.criteria {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem clamp(2rem, 4vw, 4rem);
  margin: clamp(2.5rem, 5vw, 4rem) 0;
  padding: 0;
  list-style: none;
}

.criteria li {
  padding-top: 1.25rem;
  border-top: 1px solid var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.375rem, 1rem + 0.8vw, 1.875rem);
  line-height: 1.3;
  text-wrap: pretty;
}

@media (max-width: 52rem) {
  .criteria {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* The price, said where a qualified meeting is defined. */
.qualified__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.qualified__price p {
  max-width: 34rem;
  font-family: var(--serif);
  font-size: clamp(1.375rem, 1rem + 0.8vw, 1.875rem);
  line-height: 1.35;
}

.qualified__figure {
  font-size: 1.6em;
  letter-spacing: -0.02em;
}

/* FAQ */

.faq {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 2rem clamp(2rem, 5vw, 5rem);
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--section) var(--gutter);
}

.faq__ask {
  max-width: 24rem;
  margin-top: 1.25rem;
  color: var(--ink-muted);
}

.faq__list details {
  border-bottom: 1px solid var(--rule);
}

.faq__list details:first-child {
  border-top: 1px solid var(--rule);
}

.faq__list summary {
  position: relative;
  padding: 1.5rem 3rem 1.5rem 0;
  font-family: var(--serif);
  font-size: clamp(1.3125rem, 1rem + 0.6vw, 1.75rem);
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}

.faq__list summary::-webkit-details-marker {
  display: none;
}

.faq__list summary::before,
.faq__list summary::after {
  content: "";
  position: absolute;
  right: 0.25rem;
  top: calc(1.375rem + 0.65em);
  width: 0.875rem;
  height: 1px;
  background: currentColor;
  transition: transform 250ms var(--ease-out);
}

.faq__list summary::after {
  transform: rotate(90deg);
}

.faq__list details[open] summary::after {
  transform: rotate(0deg);
}

.faq__list summary:hover {
  text-decoration: underline;
  text-decoration-color: var(--wax);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.faq__list details p {
  max-width: 38rem;
  padding: 0 3rem 1.5rem 0;
  color: var(--ink-muted);
}

@media (max-width: 52rem) {
  .faq {
    grid-template-columns: 1fr;
  }
}

/* Closing call to action over the glyph field */

.close {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--rule);
}

.glyph-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.close__inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(5rem, 11vw, 9rem) var(--gutter);
  pointer-events: none;
}

.close__inner a {
  pointer-events: auto;
}

.close__title {
  max-width: 12em;
  margin: 0 0 2.5rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-display);
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.close__alt {
  margin-top: 1.25rem;
  color: var(--ink-muted);
  font-size: var(--text-body);
}

/* Desktop: headline and button on the left, the terms that matter on the right. */
.close__inner {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  column-gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
}

.close__inner > :not(.close__terms) {
  grid-column: 1;
  justify-self: start;
}

.close__terms {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: end;
  margin: 0;
  padding: 0.5rem 1.5rem;
  list-style: none;
  background: rgb(251 248 242 / 0.88); /* keeps the text clear of the dots */
  border-radius: var(--radius);
}

.close__terms li {
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
}

.close__terms li:first-child {
  border-top: 0;
}

.close__terms strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 1rem + 0.9vw, 2rem);
}

@media (max-width: 52rem) {
  .close__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .close__terms {
    grid-column: 1;
    grid-row: auto;
    margin-top: 2.5rem;
    padding: 0.5rem 1rem;
  }
}

/* Footer */

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--rule);
  font-size: var(--text-body);
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__legal {
  display: grid;
  gap: 0.25rem;
  margin-top: 2.5rem;
  color: var(--ink-muted);
  font-size: var(--text-small);
}

/* Inner pages: pricing and privacy */

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) var(--gutter) var(--section);
}

.page__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-display);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.prices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem clamp(2rem, 6vw, 6rem);
  max-width: 60rem;
  margin: clamp(3rem, 6vw, 5rem) 0;
}

.price {
  padding-top: 1.5rem;
  border-top: 1px solid var(--ink);
}

.price__amount {
  display: block;
  font-family: var(--serif);
  font-size: clamp(4rem, 2rem + 6vw, 8rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.price__unit {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 1rem + 0.9vw, 2rem);
  line-height: 1.2;
}

.price p {
  max-width: 22rem;
  margin-top: 0.75rem;
  color: var(--ink-muted);
}

.prices__vat {
  margin: calc(-1 * clamp(1.5rem, 3vw, 2.5rem)) 0 clamp(2.5rem, 5vw, 4rem);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1rem + 0.5vw, 1.625rem);
}

.terms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  max-width: 60rem;
  margin: 0;
  padding: 2rem 0 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}

.terms strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 1rem + 0.7vw, 1.875rem);
}

.terms span {
  color: var(--ink-muted);
}

.example {
  max-width: 60rem;
  margin-top: clamp(3rem, 6vw, 5rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--cream);
  border-radius: var(--radius);
}

.example__label {
  font-size: var(--text-small);
  color: var(--ink-muted);
}

.example__sum {
  margin-top: 0.5rem;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 1rem + 1.6vw, 2.75rem);
  line-height: 1.25;
  font-variant-numeric: lining-nums tabular-nums;
}

.page__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem 2rem;
  margin-top: clamp(3rem, 6vw, 5rem);
}

@media (max-width: 40rem) {
  .prices,
  .terms {
    grid-template-columns: 1fr;
  }
}

.page__meta {
  margin-top: 1rem;
  color: var(--ink-muted);
}

.prose {
  max-width: 46rem;
  margin-top: 2.5rem;
}

.prose h2 {
  margin: 2.5rem 0 0.75rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-h3);
  line-height: 1.2;
}

.prose p + p {
  margin-top: 1.25rem;
}

.prose strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.125em;
}

.notice {
  max-width: 40rem;
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  border: 1px dashed var(--ink);
  border-radius: var(--radius);
}

/* Sections fade in and rise once as they arrive. Content is visible without JavaScript. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
  }

  .js [data-reveal].is-in {
    opacity: 1;
    transform: none;
  }
}

/* Reduced motion: state still changes, it just doesn't move. */
@media (prefers-reduced-motion: reduce) {
  .button::before,
  .steps::after,
  .faq__list summary::after {
    transition: none;
  }
}
