/* Contact page layer - extracted VERBATIM from the prototype's inline
   <style> block (handoff/site/Contact.html) by tools/port-page.py. Loads at the SAME
   cascade position the inline block held (after site-iie.css, before print.css). */

  main { position: relative; z-index: 1; }

  /* hero - quiet beam, mirrors the Resources page-hero */
  .page-hero { padding: var(--hero-y-top) 0 64px; position: relative; overflow: hidden; }
  #beam { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
  .beamfb { position: absolute; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(60% 80% at 82% 40%, rgba(202,169,11,0.10), transparent 60%); }
  .page-hero .wrap { position: relative; z-index: 2; }
  .page-hero h1 { font-size: clamp(44px, 6.2vw, 88px); margin-top: 22px; max-width: 15ch; }
  .page-hero .lead { margin-top: 24px; max-width: 52ch; font-family: var(--font-ui); font-weight: 400; font-size: var(--fs-lead); line-height: 1.55; color: var(--text-secondary); }

  /* intake (the dossier form) */
  .intake { padding: 8px 0 150px; position: relative; z-index: 1; }

  /* T2 - the routing rail beside the form: 2-col grid, rail left, filebox centerpiece right */
  .contact-grid { display: grid; grid-template-columns: minmax(230px, 300px) minmax(0, 640px); gap: 40px 64px; justify-content: center; align-items: start; }
  .route h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.02; margin: 14px 0 0; max-width: 13ch; }
  .route-list { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
  .route-list li { display: grid; grid-template-columns: 26px 1fr; gap: 0 14px; border-top: 1px solid var(--hair); padding-top: 14px; }
  .route-list .rn { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; color: var(--periwinkle); padding-top: 4px; }
  .route-list p { margin: 0; font-family: var(--font-ui); font-size: 15px; line-height: 1.6; color: var(--text-secondary); }
  .route-list strong { color: var(--text-primary); font-weight: 600; }
  @media (max-width: 960px) {
    .contact-grid { grid-template-columns: minmax(0, 640px); }
  }

  /* hash anchors (Site C routing pattern): #lighthouse/#fde/#practice/#general + legacy
     aliases land the scroll on the filebox, clear of the fixed top bar */
  .contact-anchor { position: absolute; top: 0; left: 0; width: 1px; height: 1px; scroll-margin-top: 120px; }

  /* the "file" - hairline frame + marigold corner brackets, left-aligned under the headline */
  .filebox { position: relative; max-width: 640px; margin: 0 auto; border: 1px solid var(--hair-strong); background: var(--canvas-2); padding: 34px 36px 40px; }
  .filebox > .corner { position: absolute; width: 14px; height: 14px; border: 1.5px solid var(--marigold); pointer-events: none; }
  .filebox > .corner.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
  .filebox > .corner.tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
  .filebox > .corner.bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
  .filebox > .corner.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

  /* file collar - classification band + intake reference */
  .intake-collar { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; padding-bottom: 20px; margin-bottom: 26px; border-bottom: 1px solid var(--hair); }
  .intake-collar .cls { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--periwinkle); }
  .intake-collar .ref { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-tertiary); }
  .intake-collar .ref b { color: var(--text-secondary); font-weight: 500; }

  .form { display: flex; flex-direction: column; }
  /* the fields live in .form-body; the gap here is the headroom above each label (label-to-its-own-box stays 8px via .field) */
  .form-body { display: flex; flex-direction: column; gap: 30px; }
  .form-note { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-tertiary); margin: 0; }
  .req { color: var(--marigold); }
  .reqmark.opt { color: var(--text-tertiary); }

  /* intent - accessible radio group styled as a classification toggle */
  .intent { border: 0; padding: 0; margin: 0; min-width: 0; }
  .intent legend { padding: 0; margin-bottom: 10px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-secondary); }
  /* T3/round-4 - two intents in one 2-col row (the sr-only radios are absolutely positioned,
     so the labels alone form the cells; input + label adjacency preserved for :checked styling) */
  .seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; border: 1px solid var(--hair); }
  .seg label { position: relative; min-width: 0; display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: 12px 14px; cursor: pointer; font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-tertiary); transition: color 140ms, background 140ms; }
  .seg label:nth-of-type(odd) { border-right: 1px solid var(--hair); }
  .seg label:nth-of-type(n+3) { border-top: 1px solid var(--hair); }
  .seg label:hover { color: var(--text-primary); background: rgba(255,255,255,0.02); }
  .seg input:checked + label { color: var(--marigold); background: rgba(202,169,11,0.07); }
  /* M23 house grammar - activation is a hairline of light being DRAWN left to
     right (260ms expo, matching .ap-chip::after), never popped; hover stays
     pure illumination (color lifts only) */
  .seg label::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--marigold); transform: scaleX(0); transform-origin: left; transition: transform 260ms var(--ease-out-expo); }
  .seg input:checked + label::before { transform: scaleX(1); }
  .seg input:focus-visible + label { outline: 2px solid var(--marigold-hover); outline-offset: 3px; }

  /* fields */
  .field { display: flex; flex-direction: column; gap: 8px; }
  .field label { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-secondary); }
  .field label .num { color: var(--periwinkle); margin-right: 6px; transition: color 140ms; }
  .field label .num svg { vertical-align: -3px; }
  /* M26 - the row index lights as you work: focus lifts it periwinkle to marigold; a non-empty,
     format-valid value keeps it lit on blur (.filled, set by the intake script). A flagged field
     never wears the resolved mark. */
  .field:focus-within label .num, .field.filled label .num { color: var(--marigold); }
  .field.error label .num { color: var(--periwinkle); }
  .field input, .field textarea { font-family: var(--font-ui); font-size: 16px; line-height: 1.5; color: var(--text-primary); background: var(--surface); border: 1px solid var(--hair); border-radius: 0; padding: 12px 14px; width: 100%; transition: border-color 140ms; } /* 16px = deliberate iOS anti-zoom floor (body is 17px) */
  .field input::placeholder, .field textarea::placeholder { color: var(--text-tertiary); }
  .field input:hover, .field textarea:hover,
  .field input:focus, .field textarea:focus { border-color: var(--hair-strong); } /* marigold rule on this form: focus ring, submit CTA, checked intent segment, and completed-field indexes (M26) - never the input border */
  .field textarea { min-height: 120px; resize: vertical; }
  .hint { font-family: var(--font-ui); font-size: 13px; line-height: 1.5; color: var(--text-tertiary); margin: 0; }
  .field.error input, .field.error textarea { border-color: var(--flag); }
  .field-error { font-family: var(--font-ui); font-size: 13px; color: var(--flag); margin: 0; }

  /* T4 - form hygiene: sensitive-material note + routing disclaimer (quiet, in the hint register) */
  .form-hygiene { display: flex; flex-direction: column; gap: 12px; }
  .form-sensitive { border: 1px solid var(--hair); border-left: 2px solid var(--hair-strong); background: var(--surface); padding: 14px 16px 15px; }
  .form-sensitive .fs-head { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-secondary); margin: 0; }
  .form-sensitive .fs-body { font-family: var(--font-ui); font-size: 13px; line-height: 1.55; color: var(--text-tertiary); margin: 8px 0 0; }
  .form-disclaimer { font-family: var(--font-ui); font-size: 13px; line-height: 1.5; color: var(--text-tertiary); margin: 0; }

  .form-actions { margin-top: 6px; display: flex; justify-content: center; }

  /* filed-into-record confirmation */
  /* filed-record stamp: a marigold top rule (the dossier open/active motif) rather than repeating the file box's corner brackets */
  .form-status { position: relative; border: 1px solid var(--hair); border-top: 2px solid var(--marigold); background: var(--surface-2); padding: 24px 28px 26px; }
  .form-status:focus { outline: none; }
  .form-status .st-head { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--marigold); margin: 0; }
  .form-status .st-ref { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--periwinkle); margin: 10px 0 0; }
  .form-status .st-body { font-family: var(--font-ui); font-size: 15px; line-height: 1.6; color: var(--text-secondary); margin: 12px 0 0; }

  /* M27 - the "Entered into record" filing ceremony (play-once, <=900ms, quint/expo only).
     .filing on the CTA sends the arrow off the button edge (the request leaves your hands);
     .stamp-in on #formStatus redraws the marigold top rule left to right (the record seals),
     then the three lines rise in a short stagger. The intake script never adds these classes
     under prefers-reduced-motion or body.frozen (instant swap instead); the overrides below
     make the classes inert regardless, so the static 2px border-top remains the fallback. */
  .btn.filing { overflow: hidden; pointer-events: none; }
  .btn.filing .arr { animation: intake-arr-depart 250ms var(--ease-out-quint) forwards; }
  @keyframes intake-arr-depart { to { transform: translateX(26px); opacity: 0; } }

  .form-status::before { content: ''; position: absolute; top: -2px; left: -1px; right: -1px; height: 2px; background: var(--marigold); transform: scaleX(0); transform-origin: left; }
  .form-status.stamp-in { border-top-color: transparent; }
  .form-status.stamp-in::before { animation: intake-seal-draw 500ms var(--ease-out-expo) both; }
  @keyframes intake-seal-draw { to { transform: scaleX(1); } }
  .form-status.stamp-in .st-head { animation: intake-stamp-lift 400ms var(--ease-out-quint) 500ms both; }
  .form-status.stamp-in .st-ref { animation: intake-stamp-lift 400ms var(--ease-out-quint) 590ms both; }
  .form-status.stamp-in .st-body { animation: intake-stamp-lift 400ms var(--ease-out-quint) 680ms both; }
  @keyframes intake-stamp-lift { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

  @media (prefers-reduced-motion: reduce) {
    .field label .num { transition: none; }
    .seg label::before { transition: none; }
    .btn.filing .arr { animation: none; }
    .form-status.stamp-in { border-top-color: var(--marigold); }
    .form-status.stamp-in::before { animation: none; }
    .form-status.stamp-in .st-head, .form-status.stamp-in .st-ref, .form-status.stamp-in .st-body { animation: none; }
  }
  body.frozen .btn.filing .arr { animation: none; }
  body.frozen .form-status.stamp-in { border-top-color: var(--marigold); }
  body.frozen .form-status.stamp-in::before { animation: none; }
  body.frozen .form-status.stamp-in .st-head, body.frozen .form-status.stamp-in .st-ref, body.frozen .form-status.stamp-in .st-body { animation: none; }

  .form-body[hidden], .form-status[hidden] { display: none !important; }

  @media (max-width: 760px) {
    .page-hero h1 { font-size: clamp(40px, 10.5vw, 44px); }
    .filebox { padding: 24px 20px 28px; }
    .intake { padding: 4px 0 110px; }
  }

  /* small screens: shrink the toggle type so the longest label fits a 2x2 cell */
  @media (max-width: 520px) {
    .seg label { font-size: 11px; letter-spacing: 0.05em; padding: 12px 8px; }
  }

/* ============================================================
   POST-TRANSPLANT ADDITIONS (dev-scope — not part of the verbatim
   block above; keep appended, never interleave).
   C23: the Country select in the house field grammar.
   (D172's caution rules removed with the note itself — C24; the
   verbatim .form-sensitive rules above stay untouched as carried
   prototype CSS, now unused on this page.)
   ============================================================ */
.field select {
  font-family: var(--font-ui); font-size: 16px; line-height: 1.5;
  color: var(--text-primary); background: var(--surface);
  border: 1px solid var(--hair); border-radius: 0; padding: 12px 14px;
  width: 100%; transition: border-color 140ms;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23808086' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8.5 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.field select:hover, .field select:focus { border-color: var(--hair-strong); }
.field select:required:invalid { color: var(--text-tertiary); } /* the "Select country" placeholder state */
.field select option { background: var(--surface); color: var(--text-primary); }
.field.error select { border-color: var(--flag); }

/* D173 (owner, 2026-07-24) — mobile Contact UX:
   (a) the hero lead was running through the beam's bright core (drawn at 78vw
       by pages.js); a 66vw text gutter keeps the copy clear of the line and
       its glow at every width in the mobile band;
   (b) CTA-first on mobile: when .contact-grid stacks (its own 960px collapse),
       the form files ABOVE the "From request to system." rail. Visual order
       only (the rail has no focusable elements, so tab order is unaffected). */
@media (max-width: 760px) {
  .page-hero .lead { max-width: 66vw; }
}
@media (max-width: 960px) {
  .contact-grid .filebox { order: -1; }
}
