/* DocSigned waitlist — styles
   Palette: cool document paper, blue-black ink, legal-tape raspberry.
   Type: Charter (the classic legal-document serif) with system fallbacks. */

:root {
  --paper: #f6f7f9;
  --sheet: #ffffff;
  --ink: #18213a;
  --graphite: #566078;
  --rule: #d5dae3;
  --wash: #eceff4;
  --tape: #b23a5b;
  --tape-deep: #8e2c47;
  --tape-soft: #f5e3e8;

  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.9375rem;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: 1.75rem;
  --step-3: 2.25rem;
  --step-4: clamp(2.25rem, 1.4rem + 3.6vw, 3.6rem);

  --measure: 34em;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 6px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.6;
  font-variant-numeric: oldstyle-nums proportional-nums;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

a:hover {
  color: var(--tape-deep);
}

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

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--step-3);
}

h3 {
  font-size: var(--step-1);
}

p {
  margin: 0 0 1em;
  max-width: var(--measure);
  text-wrap: pretty;
}

.wrap {
  width: min(72rem, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 10;
  font-family: var(--sans);
}

.skip:focus {
  top: 1rem;
}

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

/* Buttons ------------------------------------------------------------ */

.btn {
  display: inline-block;
  background: var(--tape);
  color: #fff;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  padding: 0.85rem 1.35rem;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.btn:hover {
  background: var(--tape-deep);
  color: #fff;
}

.btn[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.btn-small {
  padding: 0.55rem 0.95rem;
  font-size: 0.9375rem;
}

/* Header ------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.3rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.wordmark img {
  height: 3rem;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
}

.site-nav a:not(.btn) {
  text-decoration: none;
}

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

/* Hero --------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding-block: clamp(3rem, 7vw, 6rem) clamp(3rem, 6vw, 5rem);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink);
  max-width: 31em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.75rem;
  margin: 2rem 0 1.75rem;
  font-family: var(--sans);
}

.actions .link {
  font-weight: 600;
  font-size: 1rem;
}

.founding-note {
  font-size: var(--step--1);
  color: var(--graphite);
  border-left: 3px solid var(--tape);
  padding: 0.15rem 0 0.15rem 1rem;
  max-width: 30em;
}

.founding-note strong {
  color: var(--ink);
}

/* The signed sheet --------------------------------------------------- */

.sheet {
  margin: 0;
  position: relative;
}

.sheet-page {
  position: relative;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 2rem 2rem 1.75rem;
  font-size: 0.875rem;
  line-height: 1.55;
  box-shadow: 0 1px 0 var(--rule), 0 18px 40px -24px rgba(24, 33, 58, 0.35);
}

.sheet-stack {
  position: relative;
}

/* the second sheet underneath, slightly askew, like a bundle */
.sheet-stack::before {
  content: "";
  position: absolute;
  inset: 0.9rem -0.6rem -0.7rem 0.8rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 3px;
  transform: rotate(2.2deg);
}

.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
}

.doc-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0;
}

.doc-ref {
  color: var(--graphite);
  margin: 0;
  font-variant-numeric: lining-nums tabular-nums;
}

.doc-lines {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}

.doc-lines span {
  display: block;
  height: 0.45rem;
  background: var(--wash);
  border-radius: 2px;
}

.doc-lines span:nth-child(2) { width: 92%; }
.doc-lines span:nth-child(3) { width: 97%; }
.doc-lines span:nth-child(4) { width: 64%; }

.doc-clause {
  margin-bottom: 1.4rem;
}

.sig-block {
  position: relative;
  max-width: 17rem;
}

.signature {
  width: 100%;
  height: auto;
  margin-bottom: -0.6rem;
}

.signature path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sig-line {
  border-top: 1px solid var(--ink);
  margin-bottom: 0.45rem;
}

.sig-name {
  font-weight: 700;
  margin: 0;
}

.sig-meta {
  color: var(--graphite);
  margin: 0;
  font-variant-numeric: lining-nums;
}

.seal {
  position: absolute;
  right: 1.4rem;
  bottom: 1.3rem;
  width: 6.5rem;
  height: 6.5rem;
  color: var(--tape);
  transform: rotate(-9deg);
}

.seal text {
  font-family: var(--sans);
  font-size: 8.6px;
  font-weight: 600;
  letter-spacing: 0.08em;
  fill: currentColor;
}

.sheet figcaption {
  position: relative;
  margin-top: 1.6rem;
  font-size: var(--step--1);
  color: var(--graphite);
  max-width: 26em;
}

/* One orchestrated moment: the signature writes itself, then the seal presses in. */
@media (prefers-reduced-motion: no-preference) {
  .signature .sig-1 {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    animation: write 1.5s 0.35s cubic-bezier(0.55, 0.1, 0.35, 1) forwards;
  }

  .signature .sig-2 {
    stroke-dasharray: 260;
    stroke-dashoffset: 260;
    animation: write 0.45s 1.8s ease-out forwards;
  }

  .seal {
    opacity: 0;
    transform: rotate(-9deg) scale(1.25);
    animation: press 0.32s 2.3s cubic-bezier(0.2, 0.9, 0.3, 1.15) forwards;
  }
}

@keyframes write {
  to { stroke-dashoffset: 0; }
}

@keyframes press {
  to {
    opacity: 1;
    transform: rotate(-9deg) scale(1);
  }
}

/* Sections ----------------------------------------------------------- */

.section {
  padding-block: clamp(3.5rem, 7vw, 6rem);
  border-top: 1px solid var(--rule);
}

.section-band {
  background: var(--sheet);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.section-intro p {
  color: var(--graphite);
}

.small {
  font-size: var(--step--1);
  color: var(--graphite);
}

/* Calculator, set like a fee note ----------------------------------- */

.calc-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--sans);
}

.field label,
.field .label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}

.field .hint {
  font-size: 0.875rem;
  color: var(--graphite);
  margin: 0;
}

input[type="text"],
input[type="email"],
input[type="number"],
select {
  font: inherit;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #9aa3b5;
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  width: 100%;
  min-height: 2.9rem;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--tape);
  box-shadow: 0 0 0 3px rgba(178, 58, 91, 0.25);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--tape-deep);
}

.ledger {
  font-variant-numeric: lining-nums tabular-nums;
}

.ledger-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding-block: 0.55rem;
}

.ledger-label {
  flex: 0 1 auto;
}

.leader {
  flex: 1 1 2rem;
  border-bottom: 2px dotted var(--rule);
  transform: translateY(-0.3em);
  min-width: 1.5rem;
}

.ledger-amount {
  flex: 0 0 auto;
  font-weight: 700;
}

.ledger-total {
  border-top: 1px solid var(--ink);
  margin-top: 0.4rem;
  padding-top: 0.9rem;
  font-size: var(--step-1);
}

.ledger-total .ledger-amount {
  color: var(--tape-deep);
}

.ledger-note {
  margin-top: 0.6rem;
}

.fine {
  font-size: 0.875rem;
  color: var(--graphite);
  margin-top: 1.5rem;
}

/* What you get -------------------------------------------------------- */

.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(2rem, 5vw, 4rem);
  margin: 2.5rem 0 0;
}

.feature {
  border-top: 1px solid var(--rule);
  padding: 1.25rem 0 1.5rem;
}

.feature dt {
  font-weight: 700;
  font-size: var(--step-1);
  line-height: 1.25;
  margin-bottom: 0.4rem;
}

.feature dd {
  margin: 0;
  color: var(--graphite);
  max-width: 30em;
}

/* Founding places ----------------------------------------------------- */

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.5rem;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 1.5px solid var(--tape);
  border-radius: 50%;
  color: var(--tape-deep);
  font-weight: 700;
  font-variant-numeric: lining-nums;
}

.steps h3 {
  margin: 0.15rem 0 0.25rem;
}

.steps p {
  margin: 0;
  color: var(--graphite);
}

.places {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.places-title {
  font-weight: 700;
  font-size: var(--step-1);
  margin: 0 0 0.25rem;
  font-variant-numeric: lining-nums;
}

.places-sub {
  color: var(--graphite);
  font-size: var(--step--1);
  margin: 0 0 1rem;
}

.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(1.5rem, 1fr));
  gap: 0.4rem;
  max-width: 26rem;
}

.place {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid var(--tape);
  background: transparent;
}

.place.is-claimed {
  background: var(--tape);
}

.perks {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.perks li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.6rem;
}

.perks li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.55em;
  width: 0.7rem;
  height: 0.38rem;
  border-left: 2px solid var(--tape);
  border-bottom: 2px solid var(--tape);
  transform: rotate(-45deg);
}

/* Questions ------------------------------------------------------------ */

.faq {
  margin-top: 2rem;
  border-bottom: 1px solid var(--rule);
}

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

.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem 0;
  font-weight: 700;
  font-size: var(--step-1);
  line-height: 1.3;
}

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

.faq summary::after {
  content: "+";
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--tape);
  transition: transform 0.2s ease;
}

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

.faq details p {
  color: var(--graphite);
  padding-bottom: 0.5rem;
}

/* Waitlist form -------------------------------------------------------- */

.form-sheet {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2.25rem);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1rem;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.check {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.check input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.12rem 0 0;
  accent-color: var(--tape);
}

.field-error {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--tape-deep);
  font-weight: 600;
  margin: 0;
}

.field-error:empty {
  display: none;
}

.form-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.form-actions .small {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.875rem;
}

.form-alert {
  font-family: var(--sans);
  font-size: 0.9375rem;
  background: var(--tape-soft);
  border-left: 3px solid var(--tape-deep);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  max-width: none;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.success {
  text-align: left;
}

.success h3 {
  font-size: var(--step-2);
}

.success .position {
  font-size: var(--step-3);
  font-weight: 700;
  color: var(--tape-deep);
  line-height: 1.1;
  margin-bottom: 0.4rem;
  font-variant-numeric: lining-nums;
}

[hidden] {
  display: none !important;
}

/* Footer ---------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem 3rem;
  font-size: 0.875rem;
  color: var(--graphite);
}

.site-footer p {
  max-width: 60em;
  margin-bottom: 0.6rem;
}


/* Where your documents live: a register, set like the fee note ------------- */

.register {
  margin: 0;
  font-variant-numeric: lining-nums;
}

.register-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--rule);
}

.register-row:first-child {
  border-top: 1px solid var(--ink);
}

.register dt {
  font-weight: 700;
}

.register dd {
  margin: 0;
}

.register dd.leader {
  flex: 1 1 2rem;
}

.register dd:last-child {
  text-align: right;
}

/* Who it's for (homepage) ------------------------------------------------ */

.section-lede {
  color: var(--graphite);
  max-width: 38em;
}

.sector-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  border-bottom: 1px solid var(--rule);
}

.sector-row {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 3fr);
  gap: 0.35rem 2rem;
  align-items: baseline;
  padding: 1.15rem 0;
  border-top: 1px solid var(--rule);
}

.sector-name {
  font-weight: 700;
  font-size: var(--step-1);
  line-height: 1.25;
}

.sector-docs {
  color: var(--graphite);
}

.sector-places {
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--tape-deep);
  text-align: right;
}

/* Sector pages: the reason to switch, and the documents ------------------- */

.hook p {
  color: var(--graphite);
}

.doc-list {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem 1rem;
}

.doc-list h3 {
  margin-bottom: 1rem;
}

.doc-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.doc-list li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.6rem;
  border-top: 1px solid var(--rule);
}

.doc-list li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 1.05em;
  width: 0.7rem;
  height: 0.38rem;
  border-left: 2px solid var(--tape);
  border-bottom: 2px solid var(--tape);
  transform: rotate(-45deg);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.5rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
}

.footer-nav a {
  color: var(--ink);
}

/* Responsive ------------------------------------------------------------ */

@media (max-width: 960px) {
  .hero,
  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .sheet {
    max-width: 30rem;
  }
}

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

  .wordmark img {
    height: 2.1rem;
  }

  .calc-inputs,
  .form-grid,
  .features,
  .sector-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .sector-places,
  .register dd:last-child {
    text-align: left;
  }

  .register dd.leader {
    display: none;
  }

  .register-row {
    flex-direction: column;
  }

  .sheet-page {
    padding: 1.5rem 1.25rem 1.5rem;
  }

  .seal {
    width: 5.25rem;
    height: 5.25rem;
    right: 0.9rem;
    bottom: 1rem;
  }

  .ledger-total {
    font-size: var(--step-0);
  }
}

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

  .faq summary::after {
    transition: none;
  }
}

/* ---- <firm>.docsigned.uk address field ---- */
.subdomain-input {
  display: flex;
  align-items: stretch;
}

.subdomain-input input[type="text"] {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  text-align: right;
}

.subdomain-suffix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--graphite);
  background: var(--wash);
  border: 1px solid #9aa3b5;
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  white-space: nowrap;
}

.field .hint[data-state="ok"] { color: #1d6b3a; font-weight: 600; }
.field .hint[data-state="bad"] { color: var(--tape-deep); font-weight: 600; }

/* ---- confirm and message pages served by the API ---- */
.wrap.narrow { width: min(40rem, 100% - 2 * var(--gutter)); }
.wrap.narrow form { margin-block: 1.5rem; }

/* ---------- admin pages (/a) ---------- */
.admin { font-size: var(--step--1); }
.admin h1 { font-size: var(--step-2); margin: 0.5em 0; }
.admin h2 { font-size: var(--step-1); margin: 1.5em 0 0.5em; }
.admin-bar { display: flex; justify-content: space-between; align-items: center; padding-block: 1rem; border-bottom: 1px solid var(--rule); }
.admin-bar nav { display: flex; gap: 1.25rem; align-items: center; }
.admin-who { color: var(--graphite); }
.admin-stats { list-style: none; padding: 0; display: grid; gap: 0.35rem; }
.admin-note { color: var(--graphite); max-width: 60em; }
.admin-flash { background: var(--tape-soft); border-left: 4px solid var(--tape); padding: 0.75rem 1rem; border-radius: var(--radius); }
.admin-table { overflow-x: auto; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
.admin-table table { border-collapse: collapse; width: 100%; }
.admin-table th, .admin-table td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--rule); }
.admin-table th { background: var(--wash); font-weight: 600; white-space: nowrap; }
.admin-table small { color: var(--graphite); }
.admin-inline { display: flex; gap: 0.4rem; margin-top: 0.4rem; flex-wrap: wrap; }
.admin-inline input[type="text"] { font: inherit; padding: 0.3rem 0.5rem; border: 1px solid var(--rule); border-radius: var(--radius); min-width: 10em; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.tag { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--wash); font-size: 0.85em; }
.tag-ok { background: #e3f1e6; color: #1f5c2e; }
.tag-wait { background: #fff1d6; color: #7a5200; }
.admin-email { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.admin-email pre { white-space: pre-wrap; font: inherit; background: var(--paper); padding: 1rem; border-radius: var(--radius); margin: 0; }
.admin-login { display: grid; gap: 0.5rem; max-width: 24rem; }
.admin-login input { font: inherit; padding: 0.6rem 0.75rem; border: 1px solid var(--rule); border-radius: var(--radius); }
.admin-bar .admin-inline { margin: 0; }
