/* ============================================================
   GrantField · Matcher (editorial). Reuses explore.css tokens,
   header, glass, btn, toggle. Adds the profile form, the Singularity
   wait-state, and the editorial report. No em dashes.
   ============================================================ */

/* containment backstop: keep stray overflow from forcing a horizontal scrollbar */
body { overflow-x: hidden; }

.mt-mast, .mt-form { position: relative; z-index: 1; }
/* Centered marketing header (mirrors the landing hero: text-align center on the
   block, width-capped children centered with margin-inline auto). The form body
   below is a sibling, so this alignment does not leak into the fields. */
.mt-mast { padding: 40px 0 8px; text-align: center; }
.mt-mast .sec-num { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: 0.1em; color: var(--accent); }
.mt-mast h1 { font-weight: 650; letter-spacing: -0.035em; line-height: 0.98; font-size: clamp(37px, 5.3vw, 64px); margin: 12px 0 0; text-wrap: balance; }
.mt-mast .lede { margin: 16px auto 0; max-width: 56ch; font-size: 18px; line-height: 1.55; color: var(--ink-2); }
.mt-mast .lede a { color: var(--accent); border-bottom: 1px solid var(--hair); }

/* ---- form ---- */
/* Centered column: the 760px form is centered on the page, but its own contents
   (labels, inputs, hints) stay left-aligned for legibility. */
.mt-form { max-width: 760px; display: flex; flex-direction: column; gap: 22px; margin: 30px auto 70px; text-align: left; }
.mt-field { display: flex; flex-direction: column; gap: 9px; }
.mt-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.mt-input, .mt-textarea, .mt-seltrig { font-family: inherit; background: var(--paper); border: 1px solid var(--hair); border-radius: 8px; color: var(--ink); font-size: 14px; padding: 12px 14px; outline: 0; width: 100%; transition: border-color .15s, box-shadow .15s; }
.mt-input:focus, .mt-textarea:focus, .mt-seltrig:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(21,122,89,0.12); }
/* keyboard focus rings for every focusable control on the matcher surface */
.mt-input:focus-visible, .mt-textarea:focus-visible, .mt-seltrig:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mt-chipt:focus-visible, .mt-back:focus-visible,
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.mt-textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.mt-selw { position: relative; }
/* Trigger: same box as .mt-input, but a left-aligned button showing the current
   value (or the placeholder) with room on the right for the chevron. */
.mt-seltrig { cursor: pointer; padding-right: 32px; text-align: left; display: flex; align-items: center; }
.mt-seltrig.placeholder { color: var(--ink-3); }
.mt-seltrig-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Chevron sits on the trigger. Flip it up while the menu is open (aria-expanded
   is on the trigger button, which is the ::after's positioned parent's child). */
.mt-selw::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: translateY(-65%) rotate(45deg); pointer-events: none; transition: transform .15s; }
.mt-selw:has(.mt-seltrig[aria-expanded="true"])::after { transform: translateY(-30%) rotate(-135deg); }

/* Custom open menu. Replicates gf.css .gf-drop-menu (masthead dropdowns) so the
   open list matches the site: SOLID white surface, 14px radius, 7px padding,
   hairline ring + soft shadow. Values mirror .gf-drop-menu; do not edit gf.css.
   Long lists (State has ~55) scroll inside a capped height. */
.mt-selmenu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50;
  margin: 0; padding: 7px; list-style: none;
  max-height: 288px; overflow-y: auto; overscroll-behavior: contain;
  border-radius: 14px;
  background: #FDFDFB;
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(10, 92, 66, 0.08), 0 18px 50px rgba(10, 92, 66, 0.20);
  animation: mtSelIn .13s ease;
}
@keyframes mtSelIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.mt-selmenu:focus { outline: 0; }
/* Option rows mirror .gf-drop-menu a: same padding, radius, size, muted ink,
   green hover. Keyboard highlight (.active) uses the same green wash as hover. */
.mt-selopt {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 8px 12px; border-radius: 9px; font-size: 13.5px; color: var(--gf-ink-2);
  cursor: pointer; user-select: none;
}
.mt-selopt.active, .mt-selopt:hover { background: rgba(16, 163, 116, 0.09); color: var(--gf-deep); }
.mt-selopt.sel { color: var(--gf-deep); font-weight: 550; }
.mt-selopt.ph { color: var(--gf-ink-3); }
.mt-selopt svg { flex: none; color: var(--gf-deep); }
.mt-selopt-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-chipt { border: 1px solid var(--hair); border-radius: 20px; padding: 7px 13px; font-size: 12.5px; color: var(--ink-2); transition: all .14s; user-select: none; }
.mt-chipt:hover { border-color: var(--ink-3); color: var(--ink); }
.mt-chipt.on { background: rgba(21,122,89,0.12); border-color: var(--accent); color: var(--accent); }
.mt-charcount { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; color: var(--ink-3); }
.mt-charcount.warn { color: var(--warn); }
/* Report-size tier selector: three selectable cards. */
.mt-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mt-tier { display: flex; flex-direction: column; gap: 6px; text-align: left; border: 1px solid var(--hair); border-radius: 8px; padding: 13px 14px; background: var(--paper); cursor: pointer; transition: border-color .14s, background .14s; }
.mt-tier:hover { border-color: var(--ink-3); }
.mt-tier.on { border-color: var(--accent); background: rgba(21,122,89,0.06); box-shadow: inset 0 0 0 1px var(--accent); }
.mt-tier-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mt-tier-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.mt-tier.on .mt-tier-name { color: var(--accent); }
.mt-tier-cost { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; color: var(--ink-3); letter-spacing: 0.03em; }
.mt-tier-blurb { font-size: 12px; line-height: 1.45; color: var(--ink-2); }
@media (max-width: 640px) { .mt-tiers { grid-template-columns: 1fr; } }
.mt-runrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--hair); padding-top: 20px; }
.mt-hint { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; }
.mt-hint.err { color: var(--warn); }

/* ---- matching wait-state (Singularity on a dark band) ---- */
.mt-matching { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  /* B1 app ground (mirrors gf.css .gf-app): the match animation plays on the
     same aurora-over-near-white as every other surface. */
  background:
    radial-gradient(760px 420px at 8% -10%, rgba(52, 195, 147, 0.18), transparent 60%),
    radial-gradient(880px 460px at 96% -6%, rgba(15, 123, 87, 0.14), transparent 62%),
    radial-gradient(760px 480px at 16% 96%, rgba(52, 195, 147, 0.11), transparent 60%),
    radial-gradient(820px 520px at 94% 82%, rgba(15, 123, 87, 0.08), transparent 62%),
    linear-gradient(#F4FAF7, #F1F7F3); }
.mt-matching canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.mt-matching canvas:active { cursor: grabbing; }
.mt-white { position: absolute; inset: 0; z-index: 6; background: #F4FAF7; opacity: 0; pointer-events: none; transition: opacity .85s cubic-bezier(.5,0,.5,1); }
.mt-white.in { opacity: 1; }
/* Ignites as a small disc the size of the contracted orb, then blooms outward
   from the orb center as it re-expands (ease-out so it bursts, not creeps). */
.mt-flash { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; z-index: 5; border-radius: 50%; transform: translate(-50%, -50%) scale(0.5); background: radial-gradient(circle, #F4FAF7 60%, rgba(244,250,247,0.9) 100%); opacity: 0; pointer-events: none; transition: transform .72s cubic-bezier(.22,1,.32,1), opacity .42s ease .06s; }
.mt-flash.in { transform: translate(-50%, -50%) scale(80); opacity: 1; }

/* ---- report ---- */
/* Centered report masthead (back link, title, meta). The data below it
   (ranked-match header, cards, screening prose) stays left-aligned for
   scannability. The back link is inline-flex, so text-align: center places it
   above the centered title without stretching it. */
.mt-rep-head { padding: 36px 0 0; text-align: center; }
.mt-rep-head .meta { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; color: var(--ink-3); margin-top: 8px; letter-spacing: 0.03em; }
.mt-back { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); display: inline-flex; align-items: center; gap: 8px; }
.mt-back:hover { color: var(--accent); }
.mt-metricrow { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--glass-bd); border-radius: 12px; overflow: hidden; margin-top: 18px;
  background: var(--glass-bg); backdrop-filter: blur(14px) saturate(1.7); -webkit-backdrop-filter: blur(14px) saturate(1.7);
  will-change: backdrop-filter; backface-visibility: hidden;
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 18px 44px rgba(20,20,15,0.06); }
.mt-metric { padding: 16px 18px; border-right: 1px solid var(--hair); min-width: 0; }
.mt-metric:last-child { border-right: 0; }
.mt-metric .v { font-weight: 650; font-size: var(--gf-stat-num); letter-spacing: -0.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.mt-metric .v.ok { color: var(--accent); }

.mt-rankhead { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 26px; }
/* report precipitates out of the explosion: each block settles in, staggered */
@keyframes mtSettle { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.mt-settle { animation: mtSettle .5s cubic-bezier(.22,.61,.36,1) backwards; }
@media (prefers-reduced-motion: reduce) { .mt-settle { animation: none; } }
/* paper veil bridges the explosion: starts as the bloom's full paper fill and
   fades out as the report settles underneath, so the hand-off has no gap. */
.mt-veil { position: fixed; inset: 0; z-index: 40; background: var(--paper); pointer-events: none; animation: mtVeil 0.42s ease forwards; }
@keyframes mtVeil { 0% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mt-veil { display: none; } }
/* neutralize the large-area bloom/flash and the decorative bar/reveal motion */
@media (prefers-reduced-motion: reduce) {
  .mt-flash, .mt-white { transition: none; }
  .mt-input, .mt-textarea, .mt-seltrig, .mt-chipt, .mt-card { transition: none; }
  .mt-selmenu { animation: none; }
  .mt-rub .f, .mt-run svg { transition: none; }
}
.mt-mrows { display: flex; flex-direction: column; margin-top: 6px; }
.mt-mscore { font-weight: 600; font-size: 26px; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; padding-top: 2px; }
.mt-mscore .d { font-family: "Geist Mono", ui-monospace, monospace; font-size: 9px; color: var(--ink-3); margin-left: 1px; }

.mt-card { border: 1px solid var(--hair); border-radius: 12px; background: var(--panel); padding: 20px; margin-top: 13px;
  transition: box-shadow .2s ease, transform .2s cubic-bezier(.2,.7,.3,1); }
.mt-card.clickable { cursor: pointer; }
.mt-card.strong { border-color: var(--accent); }
.mt-card-top { display: flex; gap: 18px; align-items: flex-start; }
.mt-score { flex: none; width: 64px; text-align: center; }
.mt-score .n { font-weight: 600; font-size: 36px; line-height: 1; font-variant-numeric: tabular-nums; }
.mt-score .d { font-family: "Geist Mono", ui-monospace, monospace; font-size: 9px; color: var(--ink-3); margin-top: 3px; letter-spacing: 0.06em; }
.mt-card-main { flex: 1; min-width: 0; }
.mt-card-titlerow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt-card-title { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; text-wrap: pretty; min-width: 0; overflow-wrap: anywhere; }
.mt-card-meta { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.mt-rubric { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px 22px; }
.mt-rub { display: flex; align-items: center; gap: 10px; }
.mt-rub .l { font-family: "Geist Mono", ui-monospace, monospace; font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); width: 84px; flex: none; }
.mt-rub .t { flex: 1; height: 5px; border-radius: 3px; background: var(--hair-2); overflow: hidden; }
.mt-rub .f { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .6s cubic-bezier(.2,.7,.3,1); }
.mt-rub .val { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; color: var(--ink-2); width: 44px; text-align: right; flex: none; }
.mt-prose { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; margin: 14px 0 0; }
.mt-expand { margin-top: 14px; font-family: "Geist Mono", ui-monospace, monospace; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.mt-card.clickable:hover { box-shadow: 0 8px 26px rgba(20,20,15,0.10); transform: translateY(-1px); }
/* card body: short rationale on the left, the four ranking bars on the right.
   The deep report (advice, component reasoning, link) lives in the detail modal. */
.mt-card-body { display: grid; grid-template-columns: 1fr minmax(220px, 300px); gap: 26px; margin-top: 16px; align-items: start; }
.mt-card-desc { min-width: 0; }
.mt-card-desc .mt-prose { margin-top: 0; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.mt-card-bars { display: flex; flex-direction: column; gap: 11px; }
.mt-open-cue { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; font-family: "Geist Mono", ui-monospace, monospace; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); transition: color .15s; }
.mt-open-cue svg { width: 13px; height: 13px; transition: transform .15s; }
.mt-card.clickable:hover .mt-open-cue { color: var(--accent); }
.mt-card.clickable:hover .mt-open-cue svg { transform: translateX(3px); }
/* on-page progress readout for the wait-state: live timer + stage message at
   the bottom edge, off the orb */
.mt-progress { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 11px; font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); pointer-events: none; white-space: nowrap; }
.mt-progress-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: mtPulseDot 1.2s ease-in-out infinite; }
@keyframes mtPulseDot { 0%,100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.15); } }
.mt-progress-time { color: var(--accent); font-variant-numeric: tabular-nums; }
/* the centered nowrap readout can clip at narrow widths: let it wrap and cap
   its width to the viewport minus the page gutter */
@media (max-width: 520px) {
  .mt-progress { max-width: calc(100vw - 32px); white-space: normal; }
}

/* clickable match card (detail renders via the shared gf-assessment block) */
.mt-card[role="button"] { cursor: pointer; }

.mt-pill { display: inline-flex; align-items: center; gap: 6px; font-family: "Geist Mono", ui-monospace, monospace; font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.mt-pill svg { width: 13px; height: 13px; }
.mt-pill.ok { color: var(--accent); border: 1px solid var(--accent); }
.mt-pill.warn { color: var(--warn); border: 1px solid var(--warn); }

.mt-gate { display: flex; align-items: center; gap: 12px; border: 1px solid var(--accent); background: rgba(21,122,89,0.08); border-radius: 9px; padding: 13px 15px; }
.mt-gate svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.mt-gate .t { font-size: 13px; } .mt-gate .s { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

@media (max-width: 760px) {
  .mt-grid3 { grid-template-columns: 1fr; }
  .mt-metricrow { grid-template-columns: 1fr 1fr; }
  .mt-rubric, .mt-adv { grid-template-columns: 1fr; }
  .mt-card-body { grid-template-columns: 1fr; gap: 16px; }
}
/* the big clamped metric numbers overflow a 2-up grid at ~360-420px; go 1-up */
@media (max-width: 420px) {
  .mt-metricrow { grid-template-columns: 1fr; }
}

/* Print / save-as-PDF: Report portals .mt-print to <body>. Hidden on screen;
   under print media it is the ONLY visible subtree, so the browser's Save as
   PDF becomes the report export. Mirrors account.css .ac-print. */
.mt-print { display: none; }
@media print {
  body > #root { display: none !important; }
  .mt-print { display: block; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .mt-print .pr-match { break-inside: avoid-page; }
  @page { margin: 16mm 14mm; }
}

/* Reduce motion (Settings pref; gf-api sets data-reduce-motion on <html> on every page). */
html[data-reduce-motion="true"] *, html[data-reduce-motion="true"] *::before, html[data-reduce-motion="true"] *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
.mt-strength { border: 1px solid var(--hair); border-radius: 8px; padding: 13px 15px; margin-bottom: 20px; }
.mt-strength-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.mt-strength-top .h { font-family: "Geist Mono", ui-monospace, monospace; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.mt-strength-top .v { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11.5px; color: var(--ink-2); }
.mt-strength-bar { height: 5px; border-radius: 3px; background: var(--hair-2); overflow: hidden; }
.mt-strength-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .25s ease; }
.mt-strength-tip { font-size: 12.5px; line-height: 1.5; color: var(--ink-3); margin-top: 9px; }
