/* "Get in touch" panel (scout/pitchlead.py, lead.js). A side sheet on a computer, a bottom sheet on a phone; Kondor's
   night, ivory and gold, one gold button. Self-contained (its own colours, button and motion), so the pitch pages and
   the Kondor website (brand/website/site-c) both carry it as is; both load Cormorant Garamond and Hanken Grotesk. */
.lead {
  --night: #030A26; --night-2: #08113A; --ivory: #EDE6D3; --mist: #A6ABC6; --gold: #FFE79A;
  --gold-line: rgba(255, 231, 154, 0.26); --gold-wash: rgba(255, 231, 154, 0.07); --hair: rgba(237, 230, 211, 0.12);
  --display: "Cormorant Garamond", "Kondor Serif Fallback", Georgia, serif;
  --text: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sheet-w: 520px;
  --err: #FFA48F;
  color-scheme: dark; font: 400 16px/1.65 var(--text); -webkit-font-smoothing: antialiased;
  position: fixed; inset: 0 0 0 auto; width: min(var(--sheet-w), 100vw); max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--ivory); overflow: visible;
}
.lead::backdrop { background: rgba(1, 4, 18, 0.66); -webkit-backdrop-filter: blur(10px) saturate(0.9); backdrop-filter: blur(10px) saturate(0.9); }
.lead-sheet {
  position: relative; height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  padding: 0 clamp(28px, 4vw, 48px) max(36px, env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 50% at 100% 0%, rgba(255, 217, 166, 0.10), transparent 60%),
    radial-gradient(80% 40% at 0% 100%, rgba(70, 92, 190, 0.10), transparent 70%),
    var(--night-2);
  box-shadow: -1px 0 0 var(--gold-line), -40px 0 120px -40px rgba(0, 0, 0, 0.9);
}
.lead-sheet::before {     /* the page's grain, so the sheet is the same paper */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.lead-sheet > * { position: relative; }

.lead *, .lead *::before, .lead *::after { box-sizing: border-box; }
.lead .ic { width: 1em; height: 1em; flex: none; fill: currentColor; }
.lead :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.lead .field-input:focus-visible { outline: none; }    /* a field shows its gold underline instead */
.lead .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 30px; border: 0;
  border-radius: 999px; cursor: pointer; background: var(--gold); color: var(--night); font: 500 16px/1 var(--text); letter-spacing: 0.01em;
  box-shadow: 0 10px 30px -12px rgba(255, 231, 154, 0.45);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background-color 0.35s var(--ease);
}
.lead .btn:hover { transform: translateY(-1px); background: #FFEDB4; box-shadow: 0 0 0 6px rgba(255, 231, 154, 0.08), 0 16px 40px -14px rgba(255, 231, 154, 0.6); }
.lead .btn:active { transform: translateY(0); }
.lead .quiet { display: inline-flex; align-items: center; gap: 8px; padding: 12px 2px; border: 0; background: none; cursor: pointer; color: var(--ivory); font: 500 16px/1 var(--text); text-decoration: none; }
@keyframes lead-fade { from { opacity: 0; transform: translateY(14px); } }
@keyframes lead-pulse { 70% { box-shadow: 0 0 0 9px rgba(255, 231, 154, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 231, 154, 0); } }

/* top bar: the mark and the close button, sticky while the sheet scrolls */
.lead-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  margin: 0 calc(-1 * clamp(28px, 4vw, 48px)); padding: max(22px, env(safe-area-inset-top)) clamp(28px, 4vw, 48px) 18px;
  background: linear-gradient(var(--night-2) 70%, rgba(8, 17, 58, 0));
}
.lead-grab { display: none; }
.lead-mark { width: 34px; height: 34px; border-radius: 9px; }
.lead-x {
  display: grid; place-items: center; width: 44px; height: 44px; margin-right: -6px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--hair); background: transparent; color: var(--mist); font-size: 18px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.4s var(--ease);
}
.lead-x:hover { color: var(--ivory); border-color: var(--gold-line); transform: rotate(90deg); }

/* ---------- the form ---------- */
/* the form sits in the middle of the sheet's height on a computer (no empty half under it) */
.lead-form { display: grid; align-content: center; min-height: calc(100% - 96px); padding: clamp(12px, 3vh, 32px) 0 clamp(24px, 5vh, 56px); }
.lead-title { margin: 0; font: 500 clamp(2.6rem, 4.6vw, 3.4rem)/1 var(--display); letter-spacing: -0.02em; font-variant-numeric: lining-nums; }
.lead-sub { margin: 14px 0 0; color: var(--mist); font-size: 17px; line-height: 1.55; }

.field { position: relative; display: grid; margin-top: 34px; }
.field + .field { margin-top: 28px; }
.field-label { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; padding: 0; color: var(--mist); font: 500 14px/1.2 var(--text); letter-spacing: 0.01em; }
.tag {
  padding: 4px 9px 3px; border-radius: 999px; color: var(--gold); font: 600 11px/1 var(--text); letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--gold-wash); box-shadow: inset 0 0 0 1px var(--gold-line);
}
.field-label .opt { color: rgba(166, 171, 198, 0.55); font-weight: 400; }
.field-input {
  width: 100%; height: 56px; padding: 0; border: 0; border-radius: 0; outline: 0; background: transparent;
  color: var(--ivory); font: 400 19px/1.2 var(--text); letter-spacing: 0.005em; caret-color: var(--gold);
  border-bottom: 1px solid rgba(237, 230, 211, 0.2); font-variant-numeric: tabular-nums;
  background-image: linear-gradient(var(--gold), var(--gold)); background-repeat: no-repeat; background-position: 0 100%; background-size: 0 1px;
  transition: background-size 0.5s var(--ease), border-color 0.3s var(--ease);
}
.field-input::placeholder { color: rgba(166, 171, 198, 0.42); }
.field-input:focus { background-size: 100% 1px; border-bottom-color: transparent; }
.field-input:-webkit-autofill { -webkit-text-fill-color: var(--ivory); box-shadow: inset 0 0 0 100px var(--night-2); transition: background-color 9999s; }
.field.has-err .field-input { border-bottom-color: var(--err); }
.field-help { margin: 10px 0 0; color: var(--mist); font-size: 14px; }
.field-err, .lead-err { margin: 10px 0 0; color: var(--err); font-size: 14px; line-height: 1.45; }
.field-err[hidden], .lead-err[hidden], .field-help[hidden] { display: none; }

/* the call choices open under the phone once a number is typed */
.lead-call { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
  transition: grid-template-rows 0.6s var(--ease), opacity 0.4s var(--ease), visibility 0s 0.6s; }
.lead-call-in { min-height: 0; overflow: hidden; margin: 0 -8px; padding: 0 8px; }
.lead.has-phone .lead-call { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows 0.6s var(--ease), opacity 0.5s var(--ease) 0.1s, visibility 0s; }
.seg-field { min-width: 0; margin: 30px 0 0; padding: 0; border: 0; }
.seg {
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--hair); background: rgba(3, 10, 38, 0.35);
}
.seg-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 2); border-radius: 999px; pointer-events: none;
  background: var(--gold-wash); box-shadow: inset 0 0 0 1px rgba(255, 231, 154, 0.5), 0 8px 24px -12px rgba(255, 231, 154, 0.35);
  transform: translateX(calc(var(--i, 0) * 100%)); transition: transform 0.5s var(--ease);
}
.seg-opt { position: relative; display: block; cursor: pointer; }
.seg-opt input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg-opt > span {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 12px; border-radius: 999px;
  color: var(--mist); font: 500 15px/1.15 var(--text); text-align: center; transition: color 0.35s var(--ease);
}
.seg-opt .ic { font-size: 18px; }
.seg-opt input:checked + span { color: var(--ivory); }
.seg-opt input:checked + span .ic { color: var(--gold); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: -2px; }
.seg-opt:hover input:not(:checked) + span { color: var(--ivory); }

.lead-hint[hidden] { display: none; }
.lead-hint { display: flex; align-items: center; gap: 9px; min-height: 22px; margin: 14px 0 0; color: var(--mist); font-size: 14.5px; line-height: 1.45; }
.lead-hint .now { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.lead-hint .off { flex: none; width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--mist); }   /* offline: an empty ring */
@media (prefers-reduced-motion: no-preference) {
  .lead-hint .now { animation: lead-pulse 2.4s var(--ease) infinite; }
}

/* the times: a row of days, then that day's times */
.slots { margin-top: 22px; }
.slots[hidden] { display: none; }
.days { display: flex; gap: 8px; margin: 0 -8px; padding: 2px 8px 10px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: 1 0 58px; max-width: 84px; display: grid; justify-items: center; gap: 2px; padding: 10px 0 9px; border-radius: 16px; cursor: pointer; scroll-snap-align: start;
  border: 1px solid var(--hair); background: transparent; color: var(--mist);
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.day b { font: 600 11px/1.2 var(--text); letter-spacing: 0.08em; text-transform: uppercase; }
.day span { color: var(--ivory); font: 500 26px/1 var(--display); font-variant-numeric: lining-nums; }
.day:hover { border-color: var(--gold-line); }
.day[aria-pressed="true"] { border-color: rgba(255, 231, 154, 0.6); background: var(--gold-wash); color: var(--gold); }
.times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.time {
  min-height: 46px; border-radius: 999px; cursor: pointer; border: 1px solid var(--hair); background: transparent;
  color: var(--ivory); font: 500 15px/1 var(--text); font-variant-numeric: tabular-nums;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.time:hover { border-color: var(--gold-line); }
.time[aria-pressed="true"] { border-color: var(--gold); background: var(--gold); color: var(--night); }
.slots-note { margin: 14px 0 0; color: var(--mist); font-size: 13.5px; }
.slots-fail { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin: 6px 0 0; color: var(--mist); font-size: 14.5px; }
.slots-fail button { padding: 6px 0; border: 0; background: none; cursor: pointer; color: var(--gold); font: 500 14.5px/1 var(--text); }
/* while the times load: their own shapes, standing still */
.day.is-ghost, .time.is-ghost { pointer-events: none; border-color: transparent; background: rgba(237, 230, 211, 0.05); }
.day.is-ghost { height: 66px; }
@media (prefers-reduced-motion: no-preference) {
  .is-ghost { animation: lead-ghost 1.6s ease-in-out infinite; }
  @keyframes lead-ghost { 50% { opacity: 0.45; } }
}
.times.is-nudged .time { animation: lead-nudge 0.5s var(--ease); }
@keyframes lead-nudge { 30% { transform: translateY(-3px); border-color: var(--gold-line); } }

.lead-err { margin-top: 26px; }
.lead-go { width: 100%; min-height: 60px; margin-top: 30px; font-size: 17px; }
.lead-err:not([hidden]) + .lead-go { margin-top: 14px; }
.lead-go[aria-disabled="true"] { background: rgba(255, 231, 154, 0.22); color: rgba(237, 230, 211, 0.75); box-shadow: none; transform: none; cursor: default; }
.lead-go span { display: inline-block; transition: opacity 0.2s var(--ease), transform 0.3s var(--ease); }
.lead-go.is-swapping span { opacity: 0; transform: translateY(4px); }
.lead-fine { margin: 16px 0 0; color: var(--mist); font-size: 13px; text-align: center; }

/* ---------- thank you ---------- */
.lead-done { display: grid; justify-items: center; align-content: center; min-height: calc(100% - 120px); padding: 24px 0 40px; text-align: center; outline: 0; }
.lead-done[hidden], .lead-form[hidden] { display: none; }
.done-seal { position: relative; display: grid; place-items: center; width: 92px; height: 92px; margin-bottom: 30px; }
.done-seal::before { content: ""; position: absolute; inset: -18px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 231, 154, 0.28), transparent); }
.done-seal svg { position: relative; width: 100%; height: 100%; overflow: visible; }
.seal-ring { fill: var(--gold-wash); stroke: var(--gold); stroke-width: 1.4; }
.seal-tick { fill: none; stroke: var(--gold); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.done-line { margin: 16px 0 0; max-width: 26ch; color: var(--mist); font-size: 18px; line-height: 1.55; text-wrap: balance; }
.done-ticket {
  display: grid; justify-items: center; gap: 4px; min-width: 240px; margin-top: 30px; padding: 22px 28px 20px; border-radius: 22px;
  background: rgba(3, 10, 38, 0.45); box-shadow: inset 0 0 0 1px var(--gold-line);
}
.done-ticket[hidden] { display: none; }
.ticket-day { color: var(--mist); font: 500 14px/1.3 var(--text); }
.ticket-time { font: 500 2.6rem/1.05 var(--display); color: var(--gold); font-variant-numeric: lining-nums; }
.ticket-note { color: var(--mist); font-size: 12.5px; letter-spacing: 0.04em; }
.done-cal { margin-top: 14px; color: var(--ivory); }
.done-cal .ic { color: var(--gold); font-size: 19px; }
.done-cal[hidden] { display: none; }
.ghost {
  min-width: 180px; min-height: 52px; margin-top: 36px; padding: 0 30px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--gold-line); background: transparent; color: var(--ivory); font: 500 16px/1 var(--text);
  transition: border-color 0.35s var(--ease), background-color 0.35s var(--ease);
}
.ghost:hover { border-color: rgba(255, 231, 154, 0.6); background: var(--gold-wash); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .lead[open] .lead-sheet { animation: lead-sheet-in 0.7s var(--ease) both; }
  .lead[open]::backdrop { animation: lead-fade-in 0.5s ease both; }
  @keyframes lead-fade-in { from { opacity: 0; } }
  .lead.is-closing .lead-sheet { animation: lead-sheet-out 0.38s cubic-bezier(0.4, 0, 1, 1) both; }
  .lead.is-closing::backdrop { animation: lead-fade-out 0.38s ease both; }
  @keyframes lead-sheet-in { from { transform: translateX(104%); } }
  @keyframes lead-sheet-out { to { transform: translateX(104%); } }
  @keyframes lead-fade-out { to { opacity: 0; } }
  .lead[open] .lead-form > * { animation: lead-fade 0.8s var(--ease) both; }
  .lead[open] .lead-form > :nth-child(1) { animation-delay: 0.16s; }
  .lead[open] .lead-form > :nth-child(2) { animation-delay: 0.22s; }
  .lead[open] .lead-form > :nth-child(3) { animation-delay: 0.28s; }
  .lead[open] .lead-form > :nth-child(4) { animation-delay: 0.34s; }
  .lead[open] .lead-form > :nth-child(n + 5) { animation-delay: 0.4s; }
  .lead-done:not([hidden]) > * { animation: lead-fade 0.8s var(--ease) both; }
  .lead-done:not([hidden]) > :nth-child(2) { animation-delay: 0.32s; }
  .lead-done:not([hidden]) > :nth-child(3) { animation-delay: 0.4s; }
  .lead-done:not([hidden]) > :nth-child(n + 4) { animation-delay: 0.5s; }
  .lead-done:not([hidden]) .seal-ring { stroke-dasharray: 189; stroke-dashoffset: 189; animation: lead-draw 0.9s var(--ease) 0.05s forwards; }
  .lead-done:not([hidden]) .seal-tick { stroke-dasharray: 40; stroke-dashoffset: 40; animation: lead-draw 0.55s var(--ease) 0.55s forwards; }
  .lead-done:not([hidden]) .done-seal::before { animation: lead-bloom 1.4s var(--ease) 0.5s both; }
  @keyframes lead-draw { to { stroke-dashoffset: 0; } }
  @keyframes lead-bloom { from { opacity: 0; transform: scale(0.6); } }
}

/* ---------- a phone: the sheet rises from the bottom ---------- */
@media (max-width: 640px) {
  .lead { inset: auto 0 0 0; width: 100%; height: auto; max-height: 94svh; }
  .lead-sheet {
    height: auto; max-height: 94svh; padding: 0 22px max(28px, env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0;
    box-shadow: 0 -1px 0 var(--gold-line), 0 -30px 90px -30px rgba(0, 0, 0, 0.95);
  }
  .lead-bar { margin: 0 -22px; padding: 12px 22px 12px; border-radius: 28px 28px 0 0; touch-action: none; }
  .lead-grab { display: block; position: absolute; left: 50%; top: 9px; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: rgba(237, 230, 211, 0.22); }
  .lead-mark { width: 30px; height: 30px; margin-top: 8px; }
  .lead-x { margin-top: 8px; }
  .lead-form { min-height: 0; padding: 14px 0 0; }
  .lead-title { font-size: 2.5rem; }
  .lead-sub { font-size: 16px; }
  .field { margin-top: 28px; }
  .seg-opt > span { font-size: 14.5px; padding: 0 8px; }
  .lead-done { min-height: 0; padding: 30px 0 18px; }
  @media (prefers-reduced-motion: no-preference) {
    @keyframes lead-sheet-in { from { transform: translateY(104%); } }
    @keyframes lead-sheet-out { to { transform: translateY(104%); } }
  }
}
@media (prefers-reduced-motion: reduce) {
  .lead-call, .seg-thumb, .lead-go span { transition: none; }
}
