/* ==========================================================================
   Closing — the reversed band with the form in it
   The ink band a page ends on, the form inside it, and the contact page,
   which is that band as a page of its own. Moved out of home.css so a page
   can ask somebody to talk to us without loading the homepage: the guides
   and the hub end on it too. Load after home.css where a page has both, and
   before the page's own sheet, which may adjust it (guide-offer.css does).
   ========================================================================== */

.closing { padding-block: var(--section-lg); }

/* ---------- Closing ---------- */
.closing { position: relative; overflow: hidden; background: var(--ink); color: var(--paper); }
.closing-band { position: absolute; inset: 0; z-index: 0; background: var(--img, transparent) center / cover no-repeat; opacity: 0.24; }
/* A scrim between the band and the copy. The photograph has bright patches —
   a lamp, in this one — that measure brighter than --paper-body, so reversed
   text sitting over them disappears. Dropping the band's opacity would take
   the texture with it; this keeps the picture and guarantees the contrast.
   It is a sibling layer rather than a child of .closing-band, because a child
   would inherit that element's 0.24 and barely register. */
.closing::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: rgba(17, 17, 16, 0.62);
}
.closing .wrap { position: relative; z-index: 2; }
.closing-copy { max-width: 54rem; }
.closing h2 {
  font-weight: 300; font-style: italic; font-size: var(--d-1);
  line-height: 1.05; letter-spacing: -0.025em; margin-bottom: var(--sp-6);
}
.closing p { font-size: var(--fs-lg); line-height: 1.6; color: var(--paper-body); margin-bottom: var(--sp-7); max-width: 58ch; }
.closing-cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.closing .btn { background: var(--paper); border-color: var(--paper); color: var(--ink); }
/* The reversed ghost: the docs are the secondary route out of this section,
   so the button reads as an outline against the band rather than a second
   solid competing with the walkthrough. */
.closing .btn-ghost { background: transparent; border-color: var(--line-field); color: var(--paper); }
.closing .small { margin-top: var(--sp-5); font-size: var(--fs-sm); color: var(--paper-faint); }
@media (hover: hover) and (pointer: fine) {
  .closing .btn:hover { background: var(--thread); border-color: var(--thread); color: var(--paper); }
  .closing .btn-ghost:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }
}

/* ---------- The form ----------
   Reversed out on the closing band. Fields are underlines rather than boxes:
   a stack of outlined rectangles fights the rest of the page, and this is the
   only form on the site. */
.lead { margin-top: var(--sp-8); }
/* The panel is opaque enough to be a reading surface in its own right rather
   than a tint over the photograph: --paper-faint is a 6.4:1 colour on ink,
   and every point the background is lifted off ink comes straight out of
   that. The fine print underneath is the field that fails first. */
.lead-form {
  max-width: 46rem;
  padding: clamp(28px, 3.6vw, 48px);
  background: rgba(17, 17, 16, 0.82);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  backdrop-filter: blur(3px);
}
.lf-title { font-weight: 300; font-size: var(--d-3); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: var(--sp-3); }
/* Scoped under .closing on purpose. `.closing p` sets the section's lead
   paragraph size and colour at (0,1,1); a bare .lf-intro is (0,1,0) and loses
   to it, which silently renders the form's fine print at hero size. Every
   <p> inside the form needs the extra class to say what it means. */
.closing .lf-intro { font-size: var(--fs-sm); line-height: 1.6; color: var(--paper-faint); margin-bottom: var(--sp-7); max-width: 46ch; }

.lf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5) var(--sp-6); }
.lf-field { display: flex; flex-direction: column; gap: 6px; }
/* The fields are <p>s, and `.closing p` gives every paragraph in the section
   a lead's bottom margin — 52px of air under each field. The grid's gap is the
   only spacing they need. */
.closing .lf-field { margin-bottom: 0; }
.lf-field.lf-wide { grid-column: 1 / -1; }
.lf-field label {
  font-size: var(--fs-xs); letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--paper-faint);
}
.lf-field .lf-opt { text-transform: none; letter-spacing: 0; font-style: italic; font-family: var(--font-serif); }
.lf-field input,
.lf-field select,
.lf-field textarea {
  width: 100%;
  background: transparent; color: var(--paper);
  border: 0; border-bottom: 1px solid var(--line-field);
  border-radius: 0;                 /* iOS rounds inputs by default */
  padding: 9px 0;
  font-size: var(--fs-ui);
  transition: border-color .2s ease;
}
.lf-field textarea { resize: vertical; min-height: 3.4em; }
.lf-field select { appearance: none; padding-right: 22px; background-image: none; }
/* The chevron is drawn on the wrapper, so the select keeps its native menu. */
.lf-field:has(select) { position: relative; }
.lf-field:has(select)::after {
  content: ''; position: absolute; right: 4px; bottom: 18px;
  width: 7px; height: 7px; pointer-events: none;
  border-right: 1px solid var(--paper-faint); border-bottom: 1px solid var(--paper-faint);
  transform: rotate(45deg);
}
.lf-field select option { background: var(--ink); color: var(--paper); }
.lf-field input:focus,
.lf-field select:focus,
.lf-field textarea:focus { border-bottom-color: var(--thread); }
.lf-field input:focus-visible,
.lf-field select:focus-visible,
.lf-field textarea:focus-visible { outline-offset: 4px; }

/* The spam trap. Off-screen rather than display:none, because a submitter
   that reads computed styles skips anything hidden. */
.lf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.lf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4) var(--sp-6); margin-top: var(--sp-7); }
.closing .lf-note { font-size: var(--fs-sm); line-height: 1.6; color: var(--paper-faint); margin: 0; max-width: 34ch; }
.lf-note a { color: var(--paper); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-field); }
.lf-note a:hover { text-decoration-color: var(--thread); }

/* Empty until the submit says something, so it takes no space on arrival. */
.closing .lf-status { margin-top: var(--sp-5); font-size: var(--fs-sm); line-height: 1.55; color: var(--paper-body); margin-bottom: 0; max-width: 52ch; }
.lf-status:empty { display: none; }
.lf-status[data-state="error"] { color: var(--thread); }
.lf-status[data-state="ok"] {
  font-family: var(--font-serif); font-style: italic; font-size: var(--fs-lg);
  color: var(--paper);
}
.lead-form[data-sent] .lf-grid,
.lead-form[data-sent] .lf-actions { display: none; }

/* ---------- Talk to us ----------
   The form beside the introduction, with the quicker routes under it rather
   than a second section above. The routes come after the form in the
   source, so a phone reaches the form first; on a wide screen they move up
   under the introduction. The contact page is this band as a page of its
   own; a landing page and every guide end on it. */
.contact { min-height: calc(100svh - var(--nav-h)); padding-block: var(--sp-9) var(--section); }
.contact-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-rows: auto 1fr;
  gap: 0 clamp(40px, 6vw, 96px); align-items: start;
}
.contact-layout > .closing-copy { grid-column: 1; grid-row: 1; }
.contact-layout > .lead { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
.contact-routes { grid-column: 1; grid-row: 2; }
.contact h1 {
  font-weight: 300; font-style: italic; font-size: var(--d-1);
  line-height: 1.05; letter-spacing: -0.025em; margin-bottom: var(--sp-6);
}
.contact-layout .lead-form { max-width: none; }
.contact-routes { list-style: none; border-top: 1px solid var(--line-dark); }
.contact-routes li { border-bottom: 1px solid var(--line-dark); }
.contact-routes a {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px var(--sp-5);
  padding-block: 16px; color: var(--paper); text-decoration: none; font-size: var(--fs-ui);
}
.contact-routes span { color: var(--paper-faint); font-size: var(--fs-sm); transition: color .2s ease; }
@media (hover: hover) and (pointer: fine) {
  .contact-routes a:hover span { color: var(--paper); }
}
@media (max-width: 1000px) {
  .contact { min-height: 0; padding-block: var(--sp-8) var(--section); }
  .contact-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: var(--sp-7); }
  .contact-layout > .closing-copy, .contact-layout > .lead, .contact-routes { grid-column: auto; grid-row: auto; }
  .contact-layout > .closing-copy p { margin-bottom: 0; }
}

/* Phone. One field per row, and the submit goes full width — this is the
   only thing on the page a phone visitor is being asked to do. */
@media (max-width: 620px) {
  .lf-grid { grid-template-columns: minmax(0, 1fr); }
  .lf-actions .btn { width: 100%; text-align: center; }
}

/* The app-like phone layout (home.css draws the rest of it). */
@media (max-width: 760px) {
  .closing { padding-block: 64px; }
  .lead { margin-top: var(--sp-6); }
  .lead-form { padding: 24px 20px; border-radius: var(--radius-card); }
  .lf-grid { gap: var(--sp-5); }
  .closing .lf-intro { margin-bottom: var(--sp-5); }
  .lf-actions { margin-top: var(--sp-6); }
}
