.contact-page .contact-content { max-width: 860px; padding-bottom: 56px; }
.contact-page .work-intro { margin-bottom: 32px; }
.contact-page .work-intro p { max-width: 58ch; }
.inquiry-form { display: grid; gap: 20px; }
.inquiry-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.inquiry-form label { display: block; font-size: 17px; line-height: 1.5; }
.inquiry-form label span, .inquiry-help, .inquiry-actions span { color: rgba(var(--text-rgb),.76); }
.inquiry-form input, .inquiry-form textarea {
  display: block; box-sizing: border-box; width: 100%; margin-top: 8px; padding: 12px 14px;
  color: var(--text); background: var(--surface); border: 1px solid rgba(var(--text-rgb),.35);
  border-radius: 8px; font: inherit; font-size: 17px; line-height: 1.5; caret-color: var(--accent-hover);
}
.inquiry-form textarea { resize: vertical; min-height: 110px; }
.inquiry-form :is(input, textarea):focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 3px; }
.inquiry-help { margin: -10px 0 0; font-size: 15px; line-height: 1.6; }
.inquiry-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.inquiry-actions span { font-size: 14px; }
.inquiry-actions button { font-family: inherit; cursor: pointer; }
.inquiry-actions button:disabled { opacity: .6; cursor: wait; }
.inquiry-status { margin: 0; font-size: 16px; line-height: 1.6; }
.inquiry-status:empty { margin: 0; }
.inquiry-status:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 6px; }
.inquiry-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 600px) {
  .inquiry-fields { grid-template-columns: 1fr; }
  .contact-page .work-intro h1 { font-size: 36px; }
  .inquiry-actions .work-link { width: 100%; justify-content: center; }
}
.contact-page .sky-scene::after {
  background: rgba(var(--sky-rgb), .24);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.inquiry-form :is(label span, input, textarea), .inquiry-help, .inquiry-actions span { transition: color var(--theme-duration) ease, background-color var(--theme-duration) ease, border-color var(--theme-duration) ease; }

.inquiry-form fieldset { min-width: 0; border: 0; padding: 0; margin: 0 0 16px; display: grid; gap: 20px; }
.inquiry-form legend { padding: 0; margin-bottom: 24px; font-size: 27px; }
.inquiry-form select { display: block; width: 100%; margin-top: 8px; padding: 12px 14px; min-height: 51px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid rgba(var(--text-rgb),.35); border-radius: 8px; }
.inquiry-form select:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 3px; }
.inquiry-form .brief-intro { margin: 0 0 8px; }
.inquiry-form input::placeholder { color: rgba(var(--text-rgb),.65); }
/* Guided brief: one focused group of questions at a time. */
.contact-page .contact-content { max-width: 760px; }
.step-progress { margin: 0 0 28px; color: rgba(var(--text-rgb), .76); font-size: 16px; }
.brief-step { display: grid; gap: 20px; }
.brief-step h2, #brief-success h2 { margin: 0; font-size: clamp(25px, 3vw, 32px); font-weight: 400; line-height: 1.25; }
.brief-step > p, #brief-success p { margin: 0; font-size: 17px; line-height: 1.6; color: rgba(var(--text-rgb), .76); }
.brief-step .inquiry-help { margin-top: -10px; font-size: 15px; }
.inquiry-form .idea-options { gap: 12px; margin: 0; }
.idea-options label { display: flex; align-items: center; gap: 14px; padding: 17px 20px; border: 1px solid rgba(var(--text-rgb), .35); border-radius: 8px; background: var(--surface); cursor: pointer; }
.idea-options label:hover { background: var(--surface-raised); }
.idea-options label:has(input:checked) { border-color: var(--accent-hover); background: var(--surface-raised); }
.idea-options input { margin: 0; padding: 0; width: 20px; height: 20px; flex: 0 0 20px; accent-color: var(--accent-hover); }
.idea-options label span { color: var(--text); }
.brief-back { border: 0; background: transparent; color: var(--text); font: inherit; font-size: 18px; min-height: 48px; padding: 12px 18px; text-decoration: underline; text-underline-offset: 5px; cursor: pointer; }
.brief-back:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 3px; }
.inquiry-actions { margin-top: 8px; justify-content: space-between; }
#brief-next, .inquiry-actions [type="submit"] { margin-left: auto; }
.preview-note { margin-top: 8px; }
#brief-success { display: grid; gap: 20px; }
.brief-step[hidden], .inquiry-form[hidden], #brief-success[hidden], .inquiry-actions [hidden] { display: none; }
@media (max-width: 600px) { .inquiry-actions .work-link { width: auto; } .idea-options label { padding: 16px; } }
/* A focused dialog over the existing galaxy. */
body:has(.idea-dialog[open]) { overflow: hidden; }
.idea-dialog { position: fixed; inset: 0; margin: auto; width: min(820px, calc(100% - 48px)); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: 16px; background: #343434; color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.38); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(var(--text-rgb),.3) transparent; }
.idea-dialog::backdrop { background: rgba(0,0,0,.12); backdrop-filter: none; -webkit-backdrop-filter: none; }
.contact-page .idea-dialog .contact-content { width: 100%; max-width: none; min-height: 0; margin: 0; padding: 44px 48px; display: block; }
.dialog-close { position: absolute; top: 24px; right: 16px; z-index: 3; display: grid; place-items: center; width: 44px; height: 44px; color: var(--text); border: 1px solid rgba(var(--text-rgb), .45); border-radius: 8px; box-shadow: none !important; }
.dialog-close svg { width: 22px; height: 22px; }
.dialog-close:hover { background: var(--surface-raised); }
.dialog-close:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.contact-page .idea-dialog .work-intro { margin-bottom: 22px; }
.contact-page .idea-dialog .work-intro h1 { margin: 0 30px 10px 0; font-size: clamp(28px, 4vw, 36px); line-height: 1.2; }
.contact-page .idea-dialog .work-intro p { font-size: 16px; line-height: 1.55; }
.idea-dialog .step-progress { margin-bottom: 22px; font-size: 14px; }
.idea-dialog .brief-step { gap: 14px; }
.idea-dialog .brief-step h2 { font-size: 25px; }
.idea-dialog .brief-step > p { font-size: 15px; }
.idea-dialog .idea-options label { padding: 14px 16px; }
.idea-dialog .inquiry-actions { margin-top: 0; }
.idea-dialog .inquiry-actions .work-link { min-height: 48px; padding: 10px 24px; font-size: 18px; }
.idea-dialog .preview-note { font-size: 12px; margin: 0; }
.idea-dialog .inquiry-status:empty { display: none; }
@media (max-width: 600px) {
  .idea-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
  .contact-page .idea-dialog .contact-content { padding: 30px 22px 24px; }
  .idea-dialog .brief-step h2 { font-size: 23px; }
}
.idea-dialog :is(h1, h2)[tabindex="-1"]:focus { outline: none; }

.contact-page .sky-scene::after { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.idea-dialog { --surface: #292929; --surface-raised: #414141; }
.contact-page .idea-dialog .work-intro p { max-width: 65ch; font-size: 17px; }
html[data-theme="light"] .idea-dialog { background: #e5e5e5; --surface: #f5f5f5; --surface-raised: #d8d8d8; }

.brief-progress-track { --progress: 0%; position: sticky; top: 0; z-index: 4; width: 100%; height: 6px; background: rgba(var(--text-rgb), .14); overflow: hidden; }
.brief-progress-fill { display: block; width: 100%; height: 100%; clip-path: inset(0 calc(100% - var(--progress)) 0 0); background: var(--accent-hover); transition: clip-path 650ms cubic-bezier(.22, 1, .36, 1); }
.idea-dialog .step-progress { margin: 0 48px 26px 0; font-size: 14px; }
.contact-page .idea-dialog .contact-content { padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { .brief-progress-fill { transition: none; } }

/* Starlight travels only through the completed portion of the bar. */
.brief-progress-track { height: 10px; background: rgba(var(--text-rgb), .1); }
.brief-progress-fill { position: relative; overflow: hidden; background: #28686b; }
.progress-stars { position: absolute; inset: 0; overflow: hidden; }
.progress-stars i { position: absolute; left: 0; top: var(--lane); width: 100%; height: var(--size); animation: progress-starlight var(--speed) linear var(--delay) infinite; }
.brief-progress-fill::after { content: ''; position: absolute; inset: 0 calc(100% - var(--progress)) 0 auto; width: 36px; transition: right 650ms cubic-bezier(.22, 1, .36, 1); background: linear-gradient(90deg, transparent, rgba(180,232,232,.5)); pointer-events: none; }
.progress-stars i::before { content: ""; display: block; width: var(--size); height: var(--size); border-radius: 50%; background: #f5f4ef; box-shadow: 0 0 4px rgba(245,244,239,.55); }
@keyframes progress-starlight { 0% { opacity: 0; transform: translateX(-2%); } 15% { opacity: .9; } 70% { opacity: .55; } 100% { transform: translateX(102%); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .progress-stars i { animation: none; left: calc(var(--lane) * 1.1); opacity: .75; } }

/* Keep form controls steady as the galaxy light follows the pointer. */
.idea-dialog :is(button, a, label, input, textarea) { box-shadow: none !important; }

.explore-link { justify-self: center; padding: 12px 8px; min-height: 44px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; text-decoration: underline; text-underline-offset: 5px; cursor: pointer; }
.explore-link:hover { color: var(--accent-hover); }
.explore-link:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 3px; border-radius: 4px; }
.explore-link[hidden] { display: none; }

.idea-dialog .explore-link { display: flex; align-items: center; justify-content: center; margin: 0; min-height: 48px; padding: 10px 18px; border: 1px solid rgba(var(--text-rgb), .45); border-radius: 8px; background: transparent; color: var(--text); font-size: 16px; line-height: 1.4; text-decoration: none; text-align: center; }
.idea-dialog .explore-link:hover { background: var(--surface-raised); border-color: var(--accent-hover); }
@media (max-width: 480px) { .idea-dialog .explore-link { flex: 1 1 180px; } }

.idea-options .custom-answer-option { min-width: 0; }
.idea-options .custom-answer-option .sr-only { padding: 0; border: 0; }
.idea-options .custom-answer-option textarea { margin: 0; min-height: 74px; padding: 14px 16px; }
.idea-options:has(#custom-choice:checked) .custom-answer-option textarea { border-color: var(--accent-hover); background: var(--surface-raised); }

/* Enter after the shared 620ms sky transition, then let starlight fill the first step. */
.idea-dialog[open]::backdrop { animation: brief-backdrop-in 440ms var(--ease-out) both; }
.progress-entering .brief-progress-fill { transition-duration: 1600ms; transition-timing-function: cubic-bezier(.22, 1, .36, 1); }
.progress-entering .brief-progress-fill::after { transition-duration: 1600ms; }
@keyframes brief-backdrop-in { from { background-color: transparent; } to { background-color: rgba(0,0,0,.12); } }
@media (prefers-reduced-motion: reduce) {
  .idea-dialog[open]::backdrop { animation: none; }
  .brief-progress-fill, .brief-progress-fill::after, .progress-entering .brief-progress-fill { transition: none; }
}

/* Keep the surrounding home link available while the panel is open. */
.contact-page:has(.idea-dialog[open])::before { content: ''; position: fixed; inset: 0; z-index: 2; background: rgba(0,0,0,.12); pointer-events: none; animation: brief-backdrop-in 440ms var(--ease-out) both; }
.idea-dialog { z-index: 5; }
@media (max-width: 600px) { .idea-dialog { top: 112px; bottom: 12px; max-height: calc(100dvh - 124px); } }
@media (prefers-reduced-motion: reduce) { .contact-page:has(.idea-dialog[open])::before { animation: none; } }

/* Keep every quiz step below the fixed header, including with a phone keyboard. */
.contact-page .idea-dialog {
  top: calc(var(--header-height) + 12px);
  bottom: 12px;
  max-height: calc(100dvh - var(--header-height) - 24px);
}
.contact-page:has(.idea-dialog[open])::before { height: auto; border: 0; }
@media (max-width: 600px) {
  .contact-page .idea-dialog .contact-content { padding: 24px 18px; }
  .idea-dialog input, .idea-dialog textarea { font-size: 16px; }
  .idea-dialog .inquiry-actions { flex-wrap: wrap; gap: 12px; }
  .idea-dialog .step-progress { font-size: 13px; line-height: 1.5; }
}
