/* Closing section and accessible contact dialogs. */
.closing { min-height: 70svh; display: grid; align-items: center; border-top: 1px solid var(--line); position: relative; background: radial-gradient(ellipse at 50% 100%,rgba(79,141,255,.09),transparent 65%); }
.closing__inner { padding-block: clamp(4rem,9vw,8rem); text-align: center; }
.closing .section-label { justify-content: center; }
.closing h2 { font-size: clamp(2.8rem,6.5vw,6rem); line-height: 1.02; letter-spacing: -.055em; font-weight: 500; margin: 1.5rem 0; }
.closing h2 .text-flow { display: inline-block; padding-inline: .04em; }
.closing__copy { color: var(--muted); max-width: 37rem; margin-inline: auto; font-size: clamp(1rem,1.4vw,1.15rem); }
.site-footer { min-height: 30svh; display: grid; align-items: center; }
.footer-contact { display: flex; gap: 1.5rem; flex-wrap: wrap; grid-column: 1 / -1; color: var(--muted); }
.footer-contact a, .footer-contact button { overflow-wrap: anywhere; min-height: 44px; display: inline-flex; align-items: center; }
.footer-contact button { border: 0; background: none; color: inherit; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.nav-callback { display: inline-flex; align-items: center; justify-content: center; gap: .65rem; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--cyan-soft); min-height: 44px; padding: 0 1rem; cursor: pointer; border-radius: 999px; }
@media(min-width:768px) { .nav-callback span { display: none; } }
@media(max-width:767.98px) { .nav-callback { width: 100%; justify-content: flex-start; min-height: 4rem; padding: 0; border: 0; border-radius: 0; background: none; } .nav-callback svg { display: none; } }

/* Closing CTAs ------------------------------------------------------------ */

.closing__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .875rem; margin-top: 2.25rem; }

.closing__actions .button {
  min-height: 3.25rem;
  padding: 0 1.75rem;
  transition:
    background-color 200ms var(--ease),
    border-color 200ms var(--ease),
    color 200ms var(--ease),
    box-shadow 200ms var(--ease),
    transform 200ms var(--ease);
}

.closing__primary {
  border: 1px solid #fff;
  background: #fff;
  color: #05070a;
}

.closing__primary:hover {
  border-color: var(--ice);
  background: var(--ice);
  box-shadow: 0 10px 28px -14px rgba(143, 216, 251, 0.55);
}

.closing__secondary {
  border: 1px solid var(--line-strong);
  background: #080b0f;
  color: #fff;
}

.closing__secondary:hover {
  border-color: rgba(143, 216, 251, 0.45);
  background: #0d1218;
}

.closing__actions .button:active {
  transform: translateY(0) scale(0.985);
  box-shadow: none;
}

.closing__primary:active { background: #dcebf5; }
.closing__secondary:active { background: #06080b; }

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .closing__actions .button:hover { transform: translateY(-2px); }
  .closing__actions .button:active { transform: translateY(0) scale(0.985); }
}

@media (prefers-reduced-motion: reduce) {
  .closing__actions .button:active { transform: none; }
}

/* Dialog shell -------------------------------------------------------------- */

body.dialog-open { overflow: hidden; }

.contact-dialog {
  --dp: clamp(1.125rem, 3vw, 1.625rem);
  --dialog-bg: #0a0d11;
  color-scheme: dark;
  box-sizing: border-box;
  width: min(35rem, calc(100% - 1.5rem));
  max-width: none;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - max(1rem, env(safe-area-inset-top)) - max(1rem, env(safe-area-inset-bottom)));
  margin: auto;
  padding: 0 var(--dp) var(--dp);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.25rem;
  background: var(--dialog-bg);
  color: var(--text);
  box-shadow: 0 32px 80px -24px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.contact-dialog::-webkit-scrollbar { display: none; width: 0; height: 0; }

.contact-dialog::backdrop { background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

.contact-dialog [hidden] { display: none !important; }

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-top: var(--dp);
  padding-bottom: 0.25rem;
  background: var(--dialog-bg);
}

.contact-dialog h2 {
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.03em;
  padding-top: 0.3rem;
}

.contact-dialog h2:focus { outline: none; }

.dialog-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -0.125rem -0.625rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.dialog-close:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.dialog-intro { margin-top: 0.125rem; color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }

/* Form ------------------------------------------------------------------- */

.contact-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.875rem 0.875rem;
  margin-top: 1.125rem;
}

.contact-field {
  display: block;
  min-width: 0;
  color: var(--text-soft);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
}

.contact-field small { margin-left: 0.25rem; color: var(--muted); font-size: 0.75rem; font-weight: 400; }
.contact-req { color: var(--cyan-soft); }
.contact-wide { grid-column: 1 / -1; }
.contact-form:not(.is-general) .contact-field--email { grid-column: 1 / -1; }

.contact-field input,
.contact-field select,
.contact-field textarea {
  display: block;
  width: 100%;
  height: 2.875rem;
  margin-top: 0.375rem;
  padding: 0 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.625rem;
  background: #05070a;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.contact-field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.5rem;
  background: #05070a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%239ba3ad' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.875rem center;
}

.contact-field select:invalid,
.contact-field select option[value=""] { color: var(--muted); }
.contact-field select option { color: #fff; background: #0a0d11; }

.contact-field textarea {
  height: auto;
  min-height: 4.5rem;
  padding: 0.65rem 0.875rem;
  resize: vertical;
}

.contact-field input:hover,
.contact-field select:hover,
.contact-field textarea:hover { border-color: rgba(255, 255, 255, 0.22); }

.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: var(--cyan-soft);
  background-color: #070a0e;
  box-shadow: 0 0 0 3px rgba(92, 200, 250, 0.18);
}

.contact-field input:user-invalid,
.contact-field textarea:user-invalid { border-color: var(--error); }

.contact-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-top: 1.125rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.contact-disclosure { max-width: 21rem; color: var(--muted); font-size: 0.8125rem; line-height: 1.5; }

.contact-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-soft);
  font: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  text-underline-offset: 3px;
  cursor: pointer;
}

.contact-link:hover { color: #fff; text-decoration-color: currentColor; }

.contact-submit {
  flex: none;
  min-height: 2.875rem;
  padding: 0 1.5rem;
  border-color: #fff;
  background: #fff;
  color: #05070a;
  font-size: 0.9375rem;
}

.contact-submit:hover { border-color: var(--ice); background: var(--ice); }
.contact-submit:active { background: #dcebf5; }

@media (max-width: 559.98px) {
  .contact-fields { grid-template-columns: 1fr; gap: 0.75rem; margin-top: 1rem; }
  .contact-foot { flex-direction: column; align-items: stretch; }
  .contact-disclosure { max-width: none; }
  .contact-submit { width: 100%; }
  .closing__actions { flex-direction: column; align-items: stretch; }
  .closing__actions .button { justify-content: center; }
  .footer-contact { flex-direction: column; gap: .1rem; }
}

/* Leaving / entering --------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .contact-dialog { transition: opacity 160ms ease, transform 160ms ease; }
  .contact-dialog.is-leaving { opacity: 0; transform: scale(0.98); }
}

/* Confirmation ---------------------------------------------------------------- */

.success-dialog {
  position: relative;
  width: min(23.5rem, calc(100% - 1.5rem));
  padding: 2rem var(--dp) 1.75rem;
  text-align: center;
}

.success-close { position: absolute; top: 0.625rem; right: 0.625rem; margin: 0; }

.success-mark {
  display: block;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1.125rem;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-mark__track { stroke: rgba(92, 200, 250, 0.14); stroke-width: 2; }

.success-mark__ring {
  stroke: var(--cyan);
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-box: fill-box;
  transform-origin: center;
}

.success-mark__check {
  stroke: var(--ice);
  stroke-width: 2.25;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.success-dialog h2 { padding: 0; font-size: 1.375rem; }
#success-message { max-width: 19rem; margin: 0.5rem auto 0; color: var(--muted); font-size: 0.9375rem; line-height: 1.55; }
#success-message a { color: var(--text-soft); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.success-auto { margin-top: 0.875rem; color: #6f7883; font-size: 0.75rem; }

.success-timer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(92, 200, 250, 0.2), rgba(92, 200, 250, 0.6));
  transform-origin: left center;
  transform: scaleX(0);
}

@media (prefers-reduced-motion: no-preference) {
  .success-dialog.is-animating .success-mark__track { animation: success-fade 200ms ease both; }
  .success-dialog.is-animating .success-mark__ring { animation: success-draw 380ms cubic-bezier(0.65, 0, 0.35, 1) 60ms both; }
  .success-dialog.is-animating .success-mark__check { animation: success-draw 240ms cubic-bezier(0.65, 0, 0.35, 1) 360ms both; }
  .success-dialog.is-animating h2,
  .success-dialog.is-animating #success-message,
  .success-dialog.is-animating .success-auto { animation: success-rise 280ms var(--ease) 440ms both; }
  .success-dialog.is-counting .success-timer { animation: success-countdown var(--auto-ms, 5000ms) linear both; }
  .success-dialog.is-paused .success-timer { animation-play-state: paused; }
}

@keyframes success-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes success-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes success-rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes success-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Privacy policy -------------------------------------------------------------- */

.privacy-dialog { width: min(42rem, calc(100% - 1.5rem)); }
.policy-date { margin-top: 0.125rem; color: var(--muted); font-size: 0.8125rem; }
.policy-body { margin-top: 0.5rem; }
.policy-body h3 { margin: 1.125rem 0 0.3rem; font-size: 0.9375rem; font-weight: 500; }
.policy-body p { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
.policy-body a { color: var(--cyan-soft); overflow-wrap: anywhere; }
