/* RecordEcho marketing page.
   Palette comes from the desk the product lives on: a scanner bed, paper,
   rubber-stamp ink and a highlighter. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("/fonts/literata.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("/fonts/literata-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --desk: #f3f5f5;
  --bed: #d5dbdd;
  --paper: #fdfdfb;
  --carbon: #16181d;
  --graphite: #4a525c;
  --rule: #c3cbce;
  --ink: #2e379a; /* stamp-pad indigo */
  --marker: #ffe45c; /* highlighter */
  --flag: #b3261e;

  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --text: "Literata", Georgia, "Times New Roman", serif;

  --gutter: clamp(20px, 4vw, 48px);
  --measure: 62ch;
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--desk);
  color: var(--carbon);
  font: 400 1.125rem/1.62 var(--text);
  font-optical-sizing: auto;
}

p {
  margin: 0;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 8px 14px;
  background: var(--carbon);
  color: var(--paper);
  z-index: 10;
}

.skip:focus {
  top: 8px;
}

.wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Type */

h1,
h2,
h3,
.wordmark,
.button,
nav a,
.bar,
dt,
.steps > li::before {
  font-family: var(--display);
}

h1 {
  margin: 0;
  max-width: 17ch;
  font-size: clamp(2.75rem, 6.3vw, 5.6rem);
  font-weight: 800;
  font-stretch: 70%;
  line-height: 0.94;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3.1vw, 2.5rem);
  font-weight: 750;
  font-stretch: 78%;
  line-height: 1.04;
  letter-spacing: -0.006em;
  text-wrap: balance;
}

h3,
dt {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 700;
  font-stretch: 88%;
  line-height: 1.2;
}

/* Header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin-inline: auto;
  padding: 20px var(--gutter);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--carbon);
  font-size: 1.45rem;
  font-weight: 800;
  font-stretch: 78%;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark svg {
  color: var(--ink);
  flex: none;
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.6vw, 30px);
}

nav a {
  color: var(--carbon);
  font-size: 1rem;
  font-weight: 550;
  font-stretch: 92%;
  text-decoration: none;
}

nav a:not(.button):hover {
  text-decoration: underline;
}

.button {
  display: inline-block;
  padding: 0.78em 1.35em;
  background: var(--ink);
  color: #fff;
  font-size: 1.06rem;
  font-weight: 650;
  font-stretch: 92%;
  line-height: 1.1;
  text-decoration: none;
  border-radius: 3px;
}

.button:hover {
  background: #232b7c;
}

.button.small {
  padding: 0.6em 1em;
  font-size: 0.98rem;
  color: #fff;
}

/* Hero */

.hero {
  padding-top: clamp(28px, 6vw, 76px);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: end;
}

.pitch {
  padding-bottom: 0.5rem;
}

.lede {
  max-width: 44ch;
  font-size: clamp(1.15rem, 1.7vw, 1.4rem);
  line-height: 1.5;
  color: var(--carbon);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  margin-top: clamp(22px, 3vw, 34px);
}

/* The light table: the scan and its echo, side by side on a scanner bed. */

.table {
  margin: clamp(36px, 6vw, 72px) 0 0;
  padding: clamp(18px, 3.4vw, 44px) var(--gutter) clamp(16px, 2.4vw, 26px);
  background: var(--bed);
  box-shadow: inset 0 14px 18px -16px rgb(22 24 29 / 45%);
}

.sheets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 28px);
  align-items: start;
  max-width: 1380px;
  margin-inline: auto;
}

.sheet {
  background: var(--paper);
  box-shadow:
    0 1px 0 rgb(22 24 29 / 22%),
    0 10px 22px -12px rgb(22 24 29 / 45%);
  /* The record carries on below the crop. */
  -webkit-mask-image: linear-gradient(#000 82%, transparent);
  mask-image: linear-gradient(#000 82%, transparent);
}

.bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  background: var(--carbon);
  color: #e9edee;
  font-size: 0.8rem;
  font-weight: 550;
  font-stretch: 92%;
  line-height: 1.3;
}

.bar .flagged {
  color: #ffb4ab;
}

.scan-img {
  position: relative;
  line-height: 0;
}

/* Both sheets show the same slice of the page, so they share its proportions. */
.scan-img,
.echo-body {
  aspect-ratio: 1240 / 900;
  overflow: hidden;
}

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

.hl {
  position: absolute;
  background: var(--marker);
  mix-blend-mode: multiply;
  opacity: 0;
  transform: rotate(-0.7deg);
  border-radius: 2px;
  cursor: default;
  transition: opacity 160ms ease-out;
}

.hl.on {
  opacity: 0.82;
}

/* Where each line of the record sits on the scan (from tools/make_hero.py). */
.hl[data-r="org"] { left: 9.1%; top: 6.87%; width: 39.09%; height: 14.38%; }
.hl[data-r="form"] { left: 60.88%; top: 6.35%; width: 28.26%; height: 8.63%; }
.hl[data-r="stamp"] { left: 66.17%; top: 19.36%; width: 22.1%; height: 15.82%; }
.hl[data-r="title"] { left: 31.32%; top: 22.04%; width: 38.02%; height: 8.34%; }
.hl[data-r="name"] { left: 8.26%; top: 31.74%; width: 34.83%; height: 4.22%; }
.hl[data-r="dob"] { left: 8.29%; top: 35.43%; width: 42.99%; height: 4.36%; }
.hl[data-r="addr"] { left: 8.32%; top: 39.33%; width: 39.16%; height: 4.3%; }
.hl[data-r="work"] { left: 8.36%; top: 43.45%; width: 21.37%; height: 4.0%; }
.hl[data-r="stay"] { left: 8.39%; top: 46.26%; width: 81.91%; height: 8.18%; }
.hl[data-r="dx"] { left: 8.49%; top: 57.87%; width: 84.32%; height: 8.22%; }
.hl[data-r="comp"] { left: 8.56%; top: 66.19%; width: 34.8%; height: 4.22%; }

/* The echo: the same page, in English, laid out like the original. */

.echo-body {
  padding: 4.2% 7.5% 0 8.3%;
  font-size: clamp(0.52rem, 0.9vw, 0.8rem);
  line-height: 1.36;
}

.echo-body p {
  margin: 0 0 0.42em;
}

.echo-body b {
  font-weight: 700;
}

.echo-body [data-r] {
  padding: 0.08em 0.18em;
  margin: 0 -0.18em;
  border-radius: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-color 160ms ease-out;
}

.echo-body [data-r].on {
  background: var(--marker);
}

.echo-body [data-r]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.echo-head {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 8%;
  font-size: 0.86em;
  line-height: 1.3;
}

.echo-head .org {
  text-align: center;
}

.echo-body .mark {
  margin: 0.5em 0 0.2em 44%;
  color: var(--ink);
  font-style: italic;
  line-height: 1.3;
}

.echo-body .title {
  margin: 0.5em 0 0.9em;
  text-align: center;
  line-height: 1.3;
}

.echo-body .title b {
  font-size: 1.22em;
  letter-spacing: 0.01em;
}

.echo-body .sub {
  margin-top: 0.9em;
}

.flag {
  display: inline-block;
  padding: 0 0.5em;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--flag);
  font-family: var(--display);
  font-size: 0.82em;
  font-style: normal;
  font-weight: 600;
  font-stretch: 90%;
  line-height: 1.45;
  white-space: nowrap;
}

figcaption {
  max-width: 1380px;
  margin: clamp(10px, 1.6vw, 18px) auto 0;
  color: #3b424b;
  font-size: 0.92rem;
  line-height: 1.45;
}

/* Sections: heading in the left column, content in the right. */

.band {
  padding-block: clamp(48px, 7.5vw, 104px);
  border-top: 1px solid var(--rule);
}

.hero + .band {
  border-top: 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(20px, 4vw, 64px);
  align-items: start;
}

.split > h2 {
  max-width: 14ch;
}

.prose {
  display: grid;
  gap: 1.05em;
  max-width: var(--measure);
}

/* A real sequence, so real numerals. */
.steps {
  display: grid;
  gap: clamp(22px, 3vw, 36px);
  max-width: var(--measure);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  column-gap: 10px;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  grid-row: span 2;
  color: var(--ink);
  font-size: 2.9rem;
  font-weight: 800;
  font-stretch: 62%;
  line-height: 0.82;
}

.steps p {
  margin-top: 0.3em;
}

.cares {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 3vw, 40px) clamp(22px, 3.4vw, 48px);
  margin: 0;
}

.cares dd {
  margin: 0.35em 0 0;
  font-size: 1.04rem;
  line-height: 1.55;
}

.bracket {
  color: var(--ink);
  font-style: italic;
}

.note {
  padding-left: clamp(16px, 2vw, 24px);
  border-left: 3px solid var(--ink);
}

/* Closing call */

.close {
  padding-block: clamp(56px, 8vw, 112px);
  background: var(--carbon);
  color: #eef1f2;
}

.close h1,
.close h2 {
  max-width: 16ch;
  margin: 0;
  letter-spacing: -0.008em;
  font-size: clamp(2.1rem, 5vw, 3.9rem);
  font-weight: 800;
  font-stretch: 72%;
  line-height: 0.98;
}

.close p {
  max-width: 50ch;
  margin-top: 1.1em;
}

.close a:not(.button) {
  color: #c9cdfb;
}

.close .button {
  background: var(--marker);
  color: var(--carbon);
}

.close .button:hover {
  background: #fff0a0;
}

.close :focus-visible {
  outline-color: var(--marker);
}

.close.missing {
  min-height: 100vh;
}

/* The contact form: a paper form lying on the dark desk. */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.close .fine {
  font-size: 0.95rem;
  color: #aab3bb;
}

.contact-form {
  background: var(--paper);
  color: var(--carbon);
  border-radius: 2px;
  box-shadow: 0 18px 40px rgb(0 0 0 / 35%);
}

.contact-form .bar {
  margin: 0;
  max-width: none;
  background: var(--ink);
  color: #fff;
  border-radius: 2px 2px 0 0;
}

.fields {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 28px);
}

.field {
  display: grid;
  gap: 5px;
}

.field label {
  font-family: var(--display);
  font-size: 0.92rem;
  font-weight: 650;
  font-stretch: 92%;
  line-height: 1.3;
}

.field .optional {
  margin-left: 0.4em;
  font-weight: 400;
  color: var(--graphite);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.6em 0.7em;
  background: #fff;
  color: var(--carbon);
  border: 1px solid #8a949b;
  border-radius: 2px;
  font: 400 1rem/1.45 var(--text);
}

.field textarea {
  min-height: 7.5em;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible,
.contact-form .button:focus-visible,
.form-done:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
}

.field [aria-invalid="true"] {
  border-color: var(--flag);
  box-shadow: inset 0 0 0 1px var(--flag);
}

.close .field-error {
  max-width: none;
  margin: 0;
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--flag);
}

/* Off the page for people, still a plain field to a script. */
.field.decoy {
  position: absolute;
  left: -200vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.close .send {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  max-width: none;
  margin: 4px 0 0;
}

.contact-form .button {
  border: 0;
  background: var(--ink);
  color: #fff;
  font-family: var(--display);
  cursor: pointer;
}

.contact-form .button:hover {
  background: #232b7c;
}

.contact-form .button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.form-status {
  font-family: var(--display);
  font-size: 0.95rem;
}

.form-status.problem {
  color: var(--flag);
  font-weight: 600;
}

.close .form-done {
  max-width: none;
  margin: 0;
  padding: clamp(22px, 4vw, 40px) clamp(18px, 3vw, 28px);
  font-size: 1.15rem;
}

.form-done b {
  display: block;
  margin-bottom: 0.3em;
  font-family: var(--display);
  font-size: 1.5rem;
  font-stretch: 80%;
  line-height: 1.1;
}

.foot {
  padding-block: 26px 34px;
  background: var(--carbon);
  color: #aab3bb;
  border-top: 1px solid #343a44;
  font-size: 0.92rem;
}

.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 32px;
}

/* Narrow screens */

@media (max-width: 860px) {
  .intro,
  .split,
  .cares,
  .contact {
    grid-template-columns: minmax(0, 1fr);
  }

  .split > h2 {
    max-width: 20ch;
  }
}

@media (max-width: 720px) {
  nav a:not(.button) {
    display: none;
  }

  .sheets {
    grid-template-columns: minmax(0, 1fr);
  }

  .echo-body {
    aspect-ratio: auto;
    padding-bottom: 12%;
    font-size: clamp(0.7rem, 2.75vw, 0.95rem);
  }

  .sheet.scan {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hl,
  .echo-body [data-r] {
    transition: none;
  }
}
