/* The contact pop-up (js/contact.js, docs/CONTACT.md section 1). Ported from tomshaw.com's
   pages/_shared/contact-modal/contact-modal.css so the two sites show the same pop-up: a frosted
   deep-violet overlay with two slow glows, a light panel that warps in, and a dark brand column
   beside the form. Every rule is scoped to .tscm and restates what the site styles globally
   (p margins, inputs), so the page cannot leak in. Loaded on every page that has the header. */
.tscm {
  --tscm-violet: #9137FF; --tscm-purple: #4F1398; --tscm-cyan: #00F1FF; --tscm-ink: #1A1530;
  --tscm-muted: #4E4A5A; --tscm-line: #8B7AAE; --tscm-field: rgba(255, 255, 255, .82);
  --tscm-error: #B42318; --tscm-ok: #0F7A4A; --tscm-focus: #4F1398;
  --tscm-warp: cubic-bezier(.59, 0, .35, 1); --tscm-ease: cubic-bezier(.2, .8, .2, 1);
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--tscm-ink);
  overflow: hidden; overflow: clip; color-scheme: only light; overscroll-behavior: contain;
  font-family: var(--ts-font, "Neo Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif); font-weight: 400; font-size: 16px; line-height: 1.5;
}
.tscm[open] { display: grid; place-items: center; }
.tscm::backdrop { background: transparent; }
.tscm *, .tscm *::before, .tscm *::after { box-sizing: border-box; }
html.tscm-lock { overflow: hidden; scrollbar-gutter: stable; background: #07031A; }

/* the overlay: the page frosted and darkened to deep violet, two slow glows (violet, cyan) */
.tscm-overlay {
  position: absolute; inset: 0; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 120%, rgba(79, 19, 152, .55), rgba(79, 19, 152, 0) 70%), rgba(7, 3, 26, .74);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
}
.tscm-blob { position: absolute; display: block; border-radius: 50%; pointer-events: none; }
.tscm-blob-a { left: -22vmax; top: -26vmax; width: 78vmax; height: 78vmax; background: radial-gradient(closest-side, rgba(145, 55, 255, .55), rgba(145, 55, 255, .2) 50%, rgba(145, 55, 255, 0)); }
.tscm-blob-b { right: -26vmax; top: 18vh; width: 72vmax; height: 72vmax; background: radial-gradient(closest-side, rgba(0, 241, 255, .34), rgba(0, 241, 255, .12) 50%, rgba(0, 241, 255, 0)); }

/* the panel: brand column + form, up to 1040 x 760, never more than 94% x 92% of the window */
.tscm-panel {
  position: relative; z-index: 1; display: grid; grid-template-columns: 320px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  width: min(1040px, 94vw); max-height: min(760px, 92vh); max-height: min(760px, 92dvh);
  border-radius: 28px; overflow: hidden; transform-origin: 50% 0;
  background:
    radial-gradient(closest-side, rgba(145, 55, 255, .32), rgba(145, 55, 255, 0)) right -160px top -160px / 620px 560px no-repeat,
    radial-gradient(closest-side, rgba(0, 241, 255, .3), rgba(0, 241, 255, 0)) right -200px bottom -220px / 640px 600px no-repeat,
    #F9F6FF;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), 0 40px 120px rgba(4, 2, 20, .55), 0 0 90px rgba(145, 55, 255, .28);
}

@keyframes tscm-in-warp { from { opacity: 0; transform: perspective(1000px) scaleX(.4) scaleY(2) rotateX(-5deg) skewY(-1.5deg); } to { opacity: 1; transform: none; } }
@keyframes tscm-in-rise { from { translate: 0 100px; } to { translate: 0 0; } }
@keyframes tscm-out-warp { from { opacity: 1; transform: none; } to { opacity: 0; transform: perspective(1000px) scaleX(.4) scaleY(2) rotateX(-5deg) skewY(-1.5deg); translate: 0 100px; } }
@keyframes tscm-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes tscm-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes tscm-breathe { 0%, 100% { scale: 1; } 50% { scale: .7; } }
.tscm[open] .tscm-panel { animation: tscm-in-warp .35s var(--tscm-warp) backwards, tscm-in-rise .7s cubic-bezier(.22, 1.12, .36, 1) backwards; }
.tscm[open] .tscm-overlay { animation: tscm-fade-in .35s ease-out both; }
.tscm[open] .tscm-blob-a { animation: tscm-fade-in .8s ease-out both, tscm-breathe 15s ease-in-out .8s infinite; }
.tscm[open] .tscm-blob-b { animation: tscm-fade-in .8s ease-out .1s both, tscm-breathe 15s ease-in-out -7.5s infinite; }
.tscm.is-closing .tscm-panel { animation: tscm-out-warp .3s var(--tscm-warp) both; }
.tscm.is-closing .tscm-overlay { animation: tscm-fade-out .3s ease-in .04s both; }

/* the brand column: dark violet, the eyebrow, the heading, what the visitor was looking at */
.tscm-side {
  display: flex; flex-direction: column; gap: 18px; min-height: 0; overflow-y: auto; padding: 36px 30px 30px;
  color: #FFFFFF;
  background:
    radial-gradient(130% 55% at 0% 100%, rgba(145, 55, 255, .5), rgba(145, 55, 255, 0) 70%),
    radial-gradient(90% 35% at 100% 0%, rgba(0, 241, 255, .14), rgba(0, 241, 255, 0) 70%),
    linear-gradient(180deg, #0E0628 0%, #170742 100%);
}
.tscm .tscm-eyebrow { margin: 0; font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: #68F5FD; }
.tscm .tscm-title { margin: 0; font-weight: 700; font-size: 30px; line-height: 1.15; letter-spacing: 0; color: #FFFFFF; }
.tscm .tscm-lede { margin: 0; font-size: 16px; color: rgba(255, 255, 255, .82); }
.tscm-about { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 6px 0 0; padding: 16px 18px; border-radius: 16px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.tscm-about[hidden] { display: none; }
.tscm .tscm-about-label { margin: 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .72); }
.tscm .tscm-about-page { margin: 0; font-weight: 700; font-size: 16px; color: #FFFFFF; overflow-wrap: anywhere; }
.tscm .tscm-about-page[hidden] { display: none; }
.tscm .tscm-code { margin: 6px 0 0; font-size: 15px; color: rgba(255, 255, 255, .9); }
.tscm .tscm-code[hidden] { display: none; }
.tscm-code__value { font-weight: 700; color: #FFFFFF; white-space: nowrap; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.tscm-chip { display: inline-block; margin-top: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(145, 55, 255, .35); border: 1px solid rgba(185, 138, 255, .6); font-size: 14px; color: #FFFFFF; }
.tscm-chip[hidden] { display: none; }

/* the form column */
.tscm-main { position: relative; min-height: 0; overflow-y: auto; padding: 40px 44px 32px; }
.tscm-form-wrap[hidden] { display: none; }
.tscm .tscm-form-title { margin: 0 0 6px; padding-right: 52px; font-weight: 700; font-size: 22px; line-height: 1.3; letter-spacing: 0; color: var(--tscm-purple); }
.tscm .tscm-form-lede { margin: 0 0 22px; color: var(--tscm-muted); font-size: 15px; }
.tscm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.tscm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tscm-field-wide { grid-column: 1 / -1; }
.tscm .tscm-label { margin: 0; padding: 0; line-height: 1.35; font-weight: 700; font-size: 14px; color: var(--tscm-ink); }
.tscm-req { color: var(--tscm-purple); }
.tscm-opt { color: var(--tscm-muted); font-weight: 400; }
.tscm .tscm-input, .tscm .tscm-input:focus, .tscm .tscm-input:hover {
  width: 100%; min-height: 48px; margin: 0; padding: 11px 14px; border: 1px solid var(--tscm-line); border-radius: 12px;
  background: var(--tscm-field); color: var(--tscm-ink); font: inherit; font-size: 16px; line-height: 1.4; box-shadow: none;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.tscm select.tscm-input { appearance: auto; padding-right: 10px; cursor: pointer; }
.tscm textarea.tscm-input { min-height: 112px; resize: vertical; }
.tscm .tscm-input:hover { border-color: #6B5A92; background: #FFFFFF; }
.tscm .tscm-input:focus { outline: 2px solid transparent; outline-offset: 1px; border-color: var(--tscm-purple); background: #FFFFFF; box-shadow: 0 0 0 3px rgba(145, 55, 255, .28); }
.tscm .tscm-input[aria-invalid="true"] { border-color: var(--tscm-error); box-shadow: 0 0 0 3px rgba(180, 35, 24, .14); }
.tscm .tscm-input[aria-invalid="true"]:focus { border-color: var(--tscm-error); box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--tscm-error); }
.tscm .tscm-err { margin: 0; font-size: 14px; color: var(--tscm-error); }
.tscm .tscm-err:empty { display: none; }
.tscm .tscm-note { margin: 18px 0 0; font-size: 14px; color: var(--tscm-muted); }
.tscm .tscm-note a, .tscm .tscm-status a { color: var(--tscm-purple); text-decoration: underline; }
.tscm-turnstile { margin-top: 14px; }
.tscm-turnstile:empty { display: none; }
.tscm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 22px; }
.tscm .tscm-send, .tscm .tscm-send:hover, .tscm .tscm-send:focus {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; margin: 0; padding: 12px 30px;
  border: 0; border-radius: 999px; background: var(--tscm-violet); color: #FFFFFF; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 17px; line-height: 1.2; text-transform: none;
  box-shadow: 0 10px 26px rgba(145, 55, 255, .35); transition: background-color .15s, transform .2s var(--tscm-ease);
}
.tscm .tscm-send:hover { background: var(--tscm-purple); transform: translateY(-1px); }
.tscm .tscm-send:focus-visible { outline: 3px solid var(--tscm-purple); outline-offset: 3px; }
.tscm .tscm-note a:focus-visible, .tscm .tscm-status a:focus-visible { outline: 3px solid var(--tscm-purple); outline-offset: 2px; }
.tscm .tscm-send[disabled] { cursor: progress; opacity: .7; transform: none; }
.tscm .tscm-status { flex: 1 1 16rem; min-width: 0; margin: 0; font-size: 15px; color: var(--tscm-error); }
.tscm .tscm-status:empty { display: none; }

/* sent */
.tscm-done { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding-top: 30px; }
.tscm-done[hidden] { display: none; }
.tscm-done-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgba(31, 183, 115, .14); color: var(--tscm-ok); }
.tscm-done-mark svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tscm .tscm-done-title { margin: 0; font-weight: 700; font-size: 26px; line-height: 1.25; letter-spacing: 0; color: var(--tscm-purple); }
.tscm .tscm-done-title:focus { outline: none; }
.tscm .tscm-done-text { margin: 0; color: var(--tscm-muted); max-width: 46ch; }

/* close, top right of the panel */
.tscm .tscm-close, .tscm .tscm-close:hover, .tscm .tscm-close:focus {
  position: absolute; z-index: 3; top: 18px; right: 18px; display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0; margin: 0; border: 1px solid rgba(79, 19, 152, .14); border-radius: 50%;
  background: rgba(255, 255, 255, .78); color: var(--tscm-purple); cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 19, 152, .12); transition: background-color .15s;
}
.tscm .tscm-close:hover { background: #FFFFFF; }
.tscm .tscm-close:focus-visible { outline: 3px solid var(--tscm-focus); outline-offset: 2px; }
.tscm-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tscm-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* tablets: a narrower brand column */
@media (max-width: 960px) {
  .tscm-panel { grid-template-columns: 260px minmax(0, 1fr); }
  .tscm-side { padding: 30px 22px 24px; }
  .tscm .tscm-title { font-size: 26px; }
  .tscm-main { padding: 34px 28px 28px; }
}
/* phones: a full-screen sheet; the brand column becomes a short header, the whole sheet scrolls */
@media (max-width: 720px) {
  .tscm[open] { display: block; }
  .tscm-panel {
    display: block; width: 100%; height: 100%; max-height: none; border-radius: 0; overflow-y: auto; overscroll-behavior: contain;
  }
  .tscm-side { gap: 10px; overflow: visible; padding: 22px 70px 22px 18px; }
  .tscm .tscm-title { font-size: 23px; }
  .tscm .tscm-lede { font-size: 15px; }
  .tscm-about { margin-top: 2px; padding: 12px 14px; }
  .tscm-main { overflow: visible; padding: 22px 18px 28px; }
  .tscm .tscm-form-title { padding-right: 0; font-size: 20px; }
  .tscm-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tscm .tscm-send { width: 100%; }
  .tscm .tscm-close, .tscm .tscm-close:hover, .tscm .tscm-close:focus { position: fixed; top: 14px; right: 14px; background: rgba(255, 255, 255, .9); }
}
@media (prefers-reduced-motion: reduce) {
  .tscm[open] .tscm-panel, .tscm[open] .tscm-overlay, .tscm.is-closing .tscm-panel, .tscm.is-closing .tscm-overlay { animation-duration: .01s; animation-delay: 0s; }
  .tscm[open] .tscm-blob-a, .tscm[open] .tscm-blob-b { animation: none; }
  .tscm .tscm-send, .tscm .tscm-input, .tscm .tscm-close { transition: none; }
}
