/* ============================================================
   HALE ACCORD — haleaccord.com
   A settlement instrument, not a brochure.
   Ink: Ledger Green · Ground: Bond White · Accent: Sealing Wax
   ============================================================ */

:root {
  --ink: #1E2A24;        /* Ledger Green — primary ink */
  --ground: #F7F7F2;     /* Bond White — document stock */
  --muted: #48564D;      /* Slate Moss — secondary text */
  --rule: #C8CCC1;       /* Register Rule — motivated rules only */
  --wax: #7A2E2B;        /* Sealing Wax — the single accent */

  --serif-display: "Libre Caslon Display", "Georgia", serif;
  --serif-text: "Source Serif 4", "Georgia", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Courier New", monospace;

  --frame: 1120px;
  --sp-section: clamp(5.5rem, 11vw, 11rem);
  --measure: 62ch;
}

/* ---------- Base ---------- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--ground);
  /* Bond-paper grain — a subtle 140px zero-mean noise tile (paper.png) so the
     ground reads as fine stationery, not flat white. Tiles seamlessly. */
  background-image: url("paper.png");
  background-repeat: repeat;
  color: var(--ink);
  font-family: var(--serif-text);
  font-size: 1.125rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }

::selection { background: var(--wax); color: var(--ground); }

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

.frame {
  max-width: var(--frame);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--ground);
  padding: 0.6rem 1rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  z-index: 10;
}
.skip-link:focus { left: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Type voices ---------- */

.mono {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.mono-sm { font-size: 0.6875rem; }

.display {
  font-family: var(--serif-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.005em;
}

/* Underline that grows in from both ends and meets in the middle —
   the accord, at micro scale. */
.u {
  text-decoration: none;
  background-image:
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: left calc(100% - 0.05em), right calc(100% - 0.05em);
  background-size: 0% 1px, 0% 1px;
  transition: background-size 160ms ease-out;
  padding-bottom: 0.2em;
}
.u:hover, .u:focus-visible { background-size: 51% 1px, 51% 1px; }

a.wax { color: var(--wax); }

/* ---------- Masthead / letterhead ---------- */

.masthead { padding-top: clamp(1.5rem, 3vw, 2.5rem); }

.masthead-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem 2.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.1rem;
}

.wordmark {
  font-family: var(--serif-display);
  font-size: 1.25rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.masthead nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: baseline;
  flex-wrap: wrap;
}

.masthead nav a[aria-current="page"] {
  background-size: 51% 1px, 51% 1px; /* accord underline held closed */
}

.masthead-rule {
  border: 0;
  border-top: 1px solid var(--ink);
  margin: 0;
}

.jurisdiction {
  color: var(--muted);
  padding-top: 0.65rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
}

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

.section { padding-top: var(--sp-section); }

.eyebrow {
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 1.4rem;
}

.section-title {
  font-size: clamp(2.25rem, 4.5vw, 3rem);
  max-width: 20ch;
  margin-bottom: clamp(1.75rem, 3vw, 2.75rem);
  text-wrap: balance;
}

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

.hero { padding-top: clamp(4.5rem, 9vw, 8.5rem); }

.hero h1 {
  font-size: clamp(2.75rem, 7vw, 5.25rem);
  max-width: 15ch;
  margin: 1.5rem 0 2.25rem;
  text-wrap: balance;
}

.hero .lead {
  font-size: clamp(1.15rem, 1.8vw, 1.3125rem);
  max-width: var(--measure);
  color: var(--ink);
}

.hero .lead strong { font-weight: 600; }

/* ---------- The Accord Line (signature device) ---------- */

.accord {
  margin-top: clamp(2.75rem, 5vw, 4rem);
  max-width: 640px;
}

.accord-line {
  position: relative;
  height: 22px;
}

.accord-line .stroke {
  position: absolute;
  left: 26px;
  right: 0;
  bottom: 6px;
  height: 1px;
  background: var(--ink);
  transform-origin: left center;
}

.accord-line .ex {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 15px;
  height: 15px;
  color: var(--wax);
}

.accord-caption {
  color: var(--muted);
  margin-top: 0.55rem;
}

/* Hero load — THE ACCORD, executed. Two hairline halves are ruled inward from
   opposite ends and meet in the middle (two parties reaching agreement), then
   D. Hale's × sets over the signatory line. Only the instrument moves; the copy
   is painted from the first frame. Slight L/R offset so it reads as two hands,
   not one symmetric transition. Reduced-motion falls back to the finished line. */
.hero .accord-line .stroke-l { right: 50%; }                          /* grows left→center */
.hero .accord-line .stroke-r { left: 50%; transform-origin: right center; } /* grows right→center */

.hero .accord-line .stroke-l { animation: converge 560ms cubic-bezier(0.22, 1, 0.36, 1) 700ms both; }
.hero .accord-line .stroke-r { animation: converge 560ms cubic-bezier(0.22, 1, 0.36, 1) 745ms both; }
.hero .accord-line .ex { animation: seal 300ms ease-out 1380ms both; }

@keyframes converge {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes seal {
  from { opacity: 0; transform: scale(1.06); }
  to   { opacity: 1; transform: scale(1); }
}

.hero-contact {
  display: flex;
  gap: 1.5rem 3rem;
  flex-wrap: wrap;
  margin-top: clamp(2.5rem, 4vw, 3.5rem);
}

/* ---------- The Record (register) ---------- */

.register {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.reg-row {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
}

.reg-idx {
  color: var(--muted);
  flex: 0 0 4.5rem;
}

.reg-body {
  max-width: 46ch;
  font-size: 1.0625rem;
}

/* Figures in the register speak in the body's own emphasis voice —
   the ledger's authority is the leader and the note, not a poster number. */
.reg-body .fig {
  font-family: var(--serif-text);
  font-weight: 600;
  font-size: 1.2em;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  padding-right: 0.06em;
}

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

/* Leader and note attach to the entry's last line, as in a true ledger. */
.reg-dots, .reg-note { align-self: last baseline; }

.reg-note {
  color: var(--muted);
  text-align: right;
  flex: 0 0 auto;
}

/* ---------- Schedule A — services ---------- */

.services {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.25rem, 4vw, 3.25rem) clamp(2.5rem, 5vw, 5rem);
}

.svc h3 {
  font-family: var(--serif-text);
  font-weight: 600;
  font-size: 1.1875rem;
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
}

.svc .svc-num {
  color: var(--muted);
  flex: 0 0 2.1rem;
  text-transform: none; /* lowercase roman numerals, as in a contract */
}

.svc p {
  color: var(--muted);
  font-size: 1rem;
  margin-top: 0.5rem;
  padding-left: 3rem;
  max-width: 48ch;
}

/* ---------- Schedule B — engagement ---------- */

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

.step .step-num { color: var(--muted); }

.step h3 {
  font-family: var(--serif-text);
  font-weight: 600;
  font-size: 1.1875rem;
  margin: 0.6rem 0 0.5rem;
}

.step p {
  color: var(--muted);
  font-size: 1rem;
  max-width: 40ch;
}

.engagement-terms {
  margin-top: clamp(2.5rem, 4vw, 3.5rem);
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  max-width: var(--measure);
  font-size: 1.0625rem;
}

.engagement-contact {
  display: flex;
  gap: 1.5rem 3rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* ---------- Catastrophe standing ---------- */

.prose { max-width: var(--measure); }
.prose p + p { margin-top: 1.4rem; }

/* ---------- Schedule C — licensure ---------- */

.licensure {
  list-style: none;
  padding: 0;
  max-width: 780px;
}

.lic-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0;
}

.lic-row + .lic-row { border-top: 1px solid var(--rule); }

.lic-key { color: var(--muted); flex: 0 0 8.5rem; }

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

.lic-val { text-align: right; }

/* ---------- Execution (closing) ---------- */

.execution .section-title { margin-bottom: 1rem; }

.execution-note {
  color: var(--muted);
  max-width: var(--measure);
  margin-bottom: clamp(2.75rem, 5vw, 4rem);
}

.countersign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem clamp(3rem, 7vw, 6.5rem);
  align-items: end;
}

.countersign .accord { margin-top: 0; max-width: none; }

.countersign .blank .accord-line .stroke {
  background: var(--muted);
}

.countersign .pen-link {
  display: inline-block;
  margin-bottom: 0.8rem;
}

.execution-contact {
  display: flex;
  gap: 1.5rem 3rem;
  flex-wrap: wrap;
  margin-top: clamp(2.75rem, 5vw, 4rem);
}

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

.footer {
  margin-top: var(--sp-section);
  background: var(--ink);
  color: var(--ground);
}

.footer-inner {
  padding-top: 2.75rem;
  padding-bottom: 2.75rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.25rem 3rem;
  flex-wrap: wrap;
}

.footer .colophon {
  padding-bottom: 2.25rem;
  color: var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
}

.footer a { color: inherit; }

/* ---------- Contact page ---------- */

.memo-head {
  list-style: none;
  padding: 0;
  max-width: 640px;
  margin-top: clamp(3rem, 6vw, 5rem);
}

.memo-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule);
}

.memo-key { color: var(--muted); flex: 0 0 4.5rem; }

.memo-blank {
  flex: 1;
  border-bottom: 1px solid var(--ink);
  transform: translateY(-0.2em);
  min-height: 1px;
}

.contact-display { padding-top: clamp(3.5rem, 7vw, 6rem); }

.contact-display a {
  text-decoration: none;
  display: inline-block;
}

.contact-tel {
  font-size: clamp(2.5rem, 6.5vw, 4.75rem);
}

.contact-email {
  font-family: var(--mono);
  font-size: 1.0625rem;
  letter-spacing: 0.05em;
  margin-top: 1.5rem;
  overflow-wrap: anywhere;
}

.contact-display a:hover, .contact-display a:focus-visible {
  color: var(--wax);
}

.contact-note {
  margin-top: clamp(2rem, 4vw, 3rem);
  color: var(--muted);
  max-width: var(--measure);
  font-size: 1.0625rem;
}

.contact-note .sla { color: var(--ink); }

/* Memo form */

.memo-form {
  max-width: 640px;
  display: grid;
  gap: 2rem;
  margin-top: clamp(2.25rem, 4vw, 3rem);
}

.field label {
  display: block;
  margin-bottom: 0.65rem;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  font-family: var(--serif-text);
  font-size: 1.0625rem;
  color: var(--ink);
  padding: 0.35rem 0 0.55rem;
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%2348564D' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.2rem center;
  padding-right: 1.6rem;
}

.field textarea { resize: vertical; min-height: 7.5rem; line-height: 1.6; }

.field input:focus, .field select:focus, .field textarea:focus {
  border-bottom-color: var(--wax);
  box-shadow: 0 1px 0 0 var(--wax);
}
/* Keyboard focus keeps the site-wide visible ring (global :focus-visible). */

.memo-form button {
  justify-self: start;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--wax);
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-hint { color: var(--muted); font-size: 0.9375rem; max-width: 52ch; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero .accord-line .stroke,
  .hero .accord-line .ex { animation: none; }
  .u { transition: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Print ---------- */

@media print {
  .masthead nav, .skip-link { display: none; }
  body { background: #fff; color: #000; }
  .footer { background: none; color: #000; }
  .accord-line .stroke, .reg-dots, .lic-dots, .memo-blank {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .accord-line .stroke { background: #000; }
}

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

@media (max-width: 860px) {
  .services { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .countersign { grid-template-columns: 1fr; gap: 3.25rem; }

  .reg-row { flex-wrap: wrap; row-gap: 0.6rem; }
  .reg-idx { flex-basis: 100%; }
  .reg-dots { display: none; }
  .reg-note { flex-basis: 100%; text-align: left; }
}

@media (max-width: 720px) {
  .lic-row { flex-wrap: wrap; row-gap: 0.4rem; }
  .lic-dots { display: none; }
  .lic-key { flex-basis: 100%; }
  .lic-val { text-align: left; }

  .svc p { padding-left: 0; }

  .masthead .head-tel { display: none; }
}

@media (max-width: 480px) {
  /* Keep the letterhead nav on one line regardless of font-swap timing. */
  .masthead nav { font-size: 0.6875rem; gap: 0.875rem; }
}

/* ============================================================
   Enhancements — seal, ink closing band, scroll choreography
   (paper grain lives on the body background, above)
   ============================================================ */

/* --- Ink closing band: execution + footer read as one dark foot to the page --- */
.footer {
  margin-top: 0;
  border-top: 1px solid rgba(247, 247, 242, 0.12);
}

.section.on-ink {
  background: var(--ink);
  color: var(--ground);
  /* full-bleed background without touching document width */
  box-shadow: 0 0 0 100vmax var(--ink);
  clip-path: inset(0 -100vmax);
  padding-bottom: clamp(4rem, 8vw, 7rem);
}
.on-ink .eyebrow { color: var(--rule); }
.on-ink .section-title { color: var(--ground); }
.on-ink .execution-note { color: var(--rule); }
.on-ink .accord-caption { color: var(--rule); }
.on-ink .accord-line .stroke { background: var(--ground); }
.on-ink .countersign .blank .accord-line .stroke { background: var(--rule); }
.on-ink .accord-line .ex { color: var(--ground); }
.on-ink a { color: var(--ground); }
.on-ink a.wax { color: var(--ground); }
.on-ink :focus-visible { outline-color: var(--ground); }

/* --- Scroll choreography — records and signatures write themselves in.
   Hiding is gated on .js so no-JS users always see content, and confined
   to no-preference so reduced-motion users get the finished state. --- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .js .reveal.in { opacity: 1; transform: none; }

  .js .register .reg-row:nth-child(2) { transition-delay: 0.06s; }
  .js .register .reg-row:nth-child(3) { transition-delay: 0.12s; }
  .js .register .reg-row:nth-child(4) { transition-delay: 0.18s; }
  .js .register .reg-row:nth-child(5) { transition-delay: 0.24s; }
  .js .licensure .lic-row:nth-child(2) { transition-delay: 0.05s; }
  .js .licensure .lic-row:nth-child(3) { transition-delay: 0.10s; }
  .js .licensure .lic-row:nth-child(4) { transition-delay: 0.15s; }

  .js .reveal .reg-dots,
  .js .reveal .lic-dots {
    transform: scaleX(0) translateY(-0.3em);
    transform-origin: left center;
    transition: transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) 0.12s;
  }
  .js .reveal.in .reg-dots,
  .js .reveal.in .lic-dots { transform: scaleX(1) translateY(-0.3em); }

  .js .reveal .accord-line .stroke {
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .js .reveal.in .accord-line .stroke { transform: scaleX(1); }
}

/* --- Print: don't waste ink on the dark band or grain --- */
@media print {
  body { background-image: none; }
  .section.on-ink { background: none; color: #000; box-shadow: none; clip-path: none; }
  .on-ink .eyebrow, .on-ink .section-title, .on-ink .execution-note,
  .on-ink .accord-caption, .on-ink a { color: #000; }
  .on-ink .accord-line .stroke { background: #000; }
  .footer { border-top: 1px solid #000; }
}
