/* Offscript site. The Record design kit: ink on paper, Literata for everything. */
:root {
  --bg: #f1f2ef;
  --surface: #ffffff;
  --ink: #14171b;
  --ink-hover: #2a2f35;
  --muted: #5b616a;
  --muted-strong: #3f444a;
  --disabled: #9aa0a6;
  --hairline: #cbcfcf;
  --highlight: #cce0f0;
  --pen: #c8262c;
  --weak: #a0392c;
  --strong: #2e6a55;
  --radius: 2px;
  --gutter: 16px;
  --max: 1180px;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Literata, Georgia, serif;
  font-optical-sizing: auto;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; }
button, input, select { font: inherit; color: inherit; }

/* Type */
.label {
  font-size: 14px;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.1em;
  color: var(--muted);
}

h1 {
  font-size: clamp(38px, 5.2vw, 60px);
  font-weight: 450;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-wrap: balance;
}

h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 450;
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-wrap: balance;
  max-width: 24ch;
}

h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.lede {
  font-size: 20px;
  line-height: 1.5;
  color: var(--muted-strong);
  text-wrap: pretty;
  max-width: 56ch;
}

.todo {
  background: #fff3c4;
  color: #6b4f00;
  padding: 0 4px;
  border-radius: var(--radius);
  font-style: italic;
}
/* In headings the tight line-height would let the highlight paint over the line above, so underline instead. */
h1 .todo, h2 .todo { background: none; padding: 0; box-shadow: inset 0 -0.4em 0 #fff3c4; }

/* Header bar, as in the product */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  height: 64px;
  padding: 0 clamp(var(--gutter), 4vw, 48px);
  border-bottom: 1px solid var(--hairline);
}

.brand { display: inline-flex; align-items: center; }
.brand img { height: 20px; width: auto; }

.bar-cta {
  font-size: 15px;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}

/* Layout */
main { display: block; }

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px clamp(var(--gutter), 4vw, 48px);
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px clamp(var(--gutter), 4vw, 48px) 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.hero h1 { max-width: 18ch; }

/* The demo: the pen call itself, shown from the app. The demo is laid out at its full height and
   tells this page how tall that is (the script in index.html sets it), so there is one scroll: the page's. */
.demo {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(var(--gutter), 4vw, 48px) 72px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.demo-frame {
  display: block;
  width: 100%;
  /* Until the demo has said how tall it is. */
  height: 820px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
}

/* During a call, once the call has scrolled out of view: the timer and "End call", always in reach. */
.callbar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 10px 10px 10px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  font-size: 16px;
}
.callbar[hidden] { display: none; }
.callbar-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #fff; }
.callbar-speaking .callbar-dot { background: #fff; }
.callbar-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.callbar-clock { font-variant-numeric: lining-nums tabular-nums; color: #c9cdd1; }
.callbar-end {
  flex: none;
  height: 40px;
  padding: 0 18px;
  background: #fff;
  color: var(--ink);
  border: 0;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.callbar-end:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Form */
.form {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; font-variant-caps: all-small-caps; letter-spacing: 0.08em; color: var(--muted); }
.field input, .field select {
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: #fff;
  font-size: 17px;
  width: 100%;
}
.field select { appearance: none; -webkit-appearance: none; background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%2314171b' stroke-width='1.5'/></svg>") no-repeat right 12px center; padding-right: 32px; }
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }

.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.btn {
  height: 52px;
  width: 100%;
  border-radius: var(--radius);
  background: var(--ink);
  border: 1px solid var(--ink);
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-top: 6px;
}
.btn:hover { background: var(--ink-hover); }
.btn:disabled { background: transparent; border-color: var(--hairline); color: var(--disabled); cursor: default; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn-inline { width: auto; align-self: flex-start; padding: 0 32px; }

.form-note { font-size: 14px; font-style: italic; color: var(--muted); line-height: 1.5; }
.form-status { font-size: 15px; line-height: 1.5; min-height: 0; }
.form-status:empty { display: none; }
.form-status.ok { color: var(--strong); }
.form-status.err { color: var(--weak); }

.form.sent .field, .form.sent .btn, .form.sent .form-note, .form.sent .hp { display: none; }
.form.sent .form-status { font-size: 20px; }

/* How it works and the rules: one section above the call, kept short so the call stays close. */
.how { padding-top: 28px; padding-bottom: 32px; gap: 20px; }
/* Wide: the steps on the left, the rules on the right. Narrow: steps, then rules. */
.how-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 56px; align-items: start; }
.how-col { display: flex; flex-direction: column; gap: 10px; }
.rules { list-style: none; counter-reset: rule; }
.rules li { counter-increment: rule; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-top: 1px solid var(--hairline); font-size: 17px; line-height: 1.45; text-wrap: pretty; }
.rules li:first-child { border-top: 1px solid var(--ink); }
.rules li::before { content: counter(rule); font-size: 14px; color: var(--muted); padding-top: 3px; font-variant-numeric: lining-nums; }
.rules b { font-weight: 600; }

/* Register */
.register-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.register-grid > div { display: flex; flex-direction: column; gap: 20px; }

/* Footer */
.foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px clamp(var(--gutter), 4vw, 48px) 48px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}
.foot img { height: 16px; width: auto; }

/* Phone and tablet */
@media (max-width: 900px) {
  .hero { padding-top: 40px; padding-bottom: 28px; }
  .demo { padding-bottom: 48px; }
  .register-grid { grid-template-columns: 1fr; gap: 32px; }
  .how-cols { grid-template-columns: 1fr; gap: 24px; }
  .bar { grid-template-columns: auto auto; justify-content: space-between; }
}

@media (max-width: 600px) {
  body { font-size: 17px; }
  .section { padding: 48px var(--gutter); gap: 22px; }
  .hero { padding-left: var(--gutter); padding-right: var(--gutter); }
  .row { grid-template-columns: 1fr; }
  .form { padding: 20px; }
  .foot { flex-direction: column; align-items: flex-start; }
}

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