/* Contact page base */
.contact-page {
  overflow-x: clip;
}

.contact-page main > .wrap,
.contact-page .contact-hero > .wrap,
.contact-page .footer {
  width: calc(100% - 64px);
  max-width: 1536px;
  margin-inline: auto;
}

/* Hero section */
.contact-hero {
  min-height: 620px;
  display: flex;
  align-items: center;
  padding: 145px 0 65px;
  border-bottom: 1px solid var(--line);
  background-color: #fff;
  background-image: radial-gradient(
    circle,
    rgba(194, 205, 200, 0.72) 1px,
    transparent 1.25px
  );
  background-size: 18px 18px;
}

.contact-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 50px;
  align-items: center;
}

.contact-copy h1 {
  margin: 16px 0 22px;
  font-size: clamp(62px, 5.5vw, 94px);
  line-height: 0.98;
  font-weight: 400;
}

.contact-copy > p {
  max-width: 690px;
  font-size: 20px;
}

.hero-actions {
  display: flex;
  gap: 13px;
  margin-top: 28px;
}

.contact-terminal { position: relative; width: 60%; max-width: 620px; justify-self: center; container-type: inline-size; }
.terminal-hardware { display: block; width: 100%; height: auto; }
.terminal-screen { position: absolute; left: 16%; top: 17%; width: 61%; height: 46.5%; overflow: hidden; border-radius: 10% / 9%; }
.terminal-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, transparent 0 2px, #00170844 2px 3px); }
.terminal-content { position: relative; z-index: 1; padding: 7% 6%; color: #a0fa74; font: 500 2.45cqw/1.45 "Courier New", monospace; text-shadow: 0 0 5px #81ff7066; }
.terminal-content dl { margin: 6% 0; }
.terminal-entry + .terminal-entry { margin-top: 5%; }
.terminal-content dd { margin: 0 0 0 1.2em; }
.terminal-line { display: block; width: max-content; max-width: 100%; white-space: nowrap; }
.terminal-content a { color: inherit; text-decoration: none; }
.terminal-content a:hover { text-decoration: underline; }
.terminal-content a:focus-visible { outline: 1px solid #a0fa74; outline-offset: 2px; }
.terminal-ready { font-size: 2.08cqw; }
.terminal-led { position: absolute; left: 74.55%; top: 77%; width: 1%; aspect-ratio: 1; border-radius: 50%; background: #acff81; box-shadow: 0 0 8px 2px #91ff63; }
.contact-terminal.is-booting { animation: terminal-enter .8s cubic-bezier(.2,.75,.25,1) both; }
.is-booting .terminal-screen::before { content: ""; position: absolute; z-index: 2; inset: 0; background: #07130c; animation: terminal-power 1.4s linear both; pointer-events: none; }
.is-booting .terminal-led { animation: terminal-led-on 1.4s steps(1) both; }
.is-booting .terminal-line { clip-path: inset(0 100% 0 0); }
.is-booting .terminal-line:focus-visible { clip-path: none !important; }
.is-booting .terminal-line.is-typing::after { content: ""; display: inline-block; width: .55em; height: .95em; background: currentColor; vertical-align: -.1em; }
.contact-terminal.is-ready .terminal-screen { animation: terminal-glow 1.4s ease-out; }
@keyframes terminal-enter { from { opacity: 0; transform: translateY(45px); } to { opacity: 1; transform: translateY(0); } }
@keyframes terminal-power { 0%, 56% { opacity: 1; } 60% { background: #a0fa74; transform: scaleY(.006); opacity: 1; box-shadow: 0 0 20px #91ff63; } 75% { transform: scaleY(.01); opacity: .9; } 99% { transform: scaleY(1); opacity: 0; } 100% { opacity: 0; } }
@keyframes terminal-led-on { 0% { background: #78896a; box-shadow: none; } 58%, 100% { background: #acff81; box-shadow: 0 0 8px 2px #91ff63; } }
@keyframes terminal-glow { 45% { box-shadow: 0 0 20px #8cfb6433, inset 0 0 20px #8cfb641a; } }
@media (prefers-reduced-motion: reduce) {
  .contact-terminal, .contact-terminal * { animation: none !important; }
  .is-booting .terminal-line { clip-path: none !important; }
  .is-booting .terminal-screen::before { display: none; }
}

.contact-copy { min-width: 0; }

/* Inquiry form section */
.inquiry {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 100px;
  padding: 105px 40px 120px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 100px;
}

.inquiry header {
  max-width: 430px;
}

.inquiry h2 {
  margin-top: 20px;
  font-size: clamp(45px, 4.2vw, 64px);
  line-height: 1.08;
  font-weight: 400;
}

.inquiry header p {
  margin-top: 28px;
  font-size: 18px;
  line-height: 1.85;
}

.inquiry form {
  display: grid;
  gap: 30px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}

.inquiry label,
.inquiry legend {
  color: #777e7a;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.inquiry input,
.inquiry textarea {
  box-sizing: border-box;
  width: 100%;
  margin-top: 10px;
  padding: 15px 0;
  border: 0;
  border-bottom: 1px solid #cfd7d3;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 18px var(--font-heading);
  transition: border-color 0.25s ease;
}

.inquiry textarea {
  min-height: 145px;
  resize: vertical;
}

.inquiry input:focus,
.inquiry textarea:focus {
  border-color: var(--green);
}

.inquiry input::placeholder,
.inquiry textarea::placeholder {
  color: #a0a6a3;
}

.inquiry fieldset {
  margin: 5px 0;
  padding: 0;
  border: 0;
}

.service-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.service-options label {
  position: relative;
  cursor: pointer;
}

.service-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.service-options span {
  display: block;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #69706c;
  font-size: 13px;
  letter-spacing: 0;
  transition: 0.25s ease;
}

.service-options input:checked + span {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.service-options input:focus-visible + span {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}

.form-footer p {
  max-width: 360px;
  margin: 0;
  font-size: 12px;
}

.inquiry button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

/* The submit button becomes a small postal scene while preparing the email. */
.form-footer { flex-wrap: wrap; }
.inquiry .inquiry-send {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  flex: 0 0 auto;
  justify-content: center;
  width: 170px;
  max-width: 100%;
  height: 48px;
  padding: 10px 16px;
  gap: 12px;
  font-size: 14px;
  transition: width .55s ease, height .55s ease, background-color .35s ease, box-shadow .25s ease;
}
.inquiry-send:focus-visible { outline: 3px solid #075b3d; outline-offset: 4px; }
.inquiry .inquiry-send .send-icon { width: 20px; height: 20px; }
.inquiry .inquiry-send .send-label,
.inquiry .inquiry-send .send-caption {
  display: block;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  color: inherit;
  white-space: nowrap;
  transform: none;
}
.inquiry-send .send-label::after,
.inquiry-send .send-caption::after { content: none; }
.send-scene { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.inquiry .inquiry-send .send-caption {
  position: absolute;
  right: 20px;
  top: 43%;
  color: #075b3d;
  font-size: 11px;
  opacity: 0;
}
.inquiry .inquiry-send[data-state="sending"] {
  width: 340px;
  height: 94px;
  background: #f0f7f3;
  box-shadow: inset 0 0 0 1px #dfede5;
  transform: none;
  cursor: progress;
}
.inquiry-send[data-state="sending"] .send-label,
.inquiry-send[data-state="sending"] .send-icon { opacity: 0; }
.inquiry-send[data-state="sending"] .send-scene { opacity: 1; transition: opacity .3s .3s; }
.inquiry-send[data-state="sending"] .send-caption { animation: send-caption 6.2s both; }
.send-rider { transform: translateX(420px); }
.send-rider-facing { transform-origin: 45px 55px; transform: scaleX(-1); }
.inquiry-send[data-state="sending"] .send-rider { animation: send-ride 6.2s both; }
.inquiry-send[data-state="sending"] .send-rider-facing { animation: send-face 6.2s steps(1, end) both; }
.inquiry-send[data-state="sending"] .send-envelope { animation: send-letter 6.2s both; transform-origin: 86px 32px; }
.send-wheel { transform-box: fill-box; transform-origin: center; }
.inquiry-send[data-state="sending"] .send-wheel { animation: send-spin .65s linear infinite; }
.send-leg, .send-leg-back { transform-origin: 45px 52px; }
.inquiry-send[data-state="sending"] .send-leg { animation: send-pedal .65s ease-in-out infinite alternate; }
.inquiry-send[data-state="sending"] .send-leg-back { animation: send-pedal .65s ease-in-out infinite alternate-reverse; }
.send-arm { transform-origin: 55px 32px; }
.inquiry-send[data-state="sending"] .send-arm { animation: send-collect 6.2s both; }
.inquiry-send[data-state="complete"] .send-icon { order: -1; transform: none; }
.inquiry-send[data-state="complete"] .send-icon::after {
  width: 10px;
  height: 6px;
  background: none;
  mask: none;
  -webkit-mask: none;
  border-left: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  transform: translateY(-1px) rotate(-45deg);
}
.send-status { margin: 0; color: #587365; font-size: 14px; line-height: 1.6; }
.send-status:empty { display: none; }
.send-status.is-success { color: var(--green, #075b3d); font-weight: 500; }
.send-status.is-error { color: #d63130; font-weight: 500; }
@keyframes send-caption { 0%, 8% { opacity: 0; } 15%, 30% { opacity: 1; } 38%, 100% { opacity: 0; } }
@keyframes send-ride { 0%, 28% { transform: translateX(420px); } 49%, 66% { transform: translateX(106px); } 100% { transform: translateX(440px); } }
@keyframes send-face { 0% { transform: scaleX(-1); } 66%, 100% { transform: scaleX(1); } }
@keyframes send-letter {
  0%, 8% { opacity: 0; transform: translateY(-18px) rotate(-14deg); }
  18%, 49% { opacity: 1; transform: translateY(0) rotate(-10deg); }
  58% { opacity: 1; transform: translate(50px, -10px) rotate(12deg); }
  65%, 100% { opacity: 0; transform: translate(54px, 17px) scale(.35); }
}
@keyframes send-spin { to { transform: rotate(360deg); } }
@keyframes send-pedal { to { transform: rotate(-18deg); } }
@keyframes send-collect { 0%, 49%, 67%, 100% { transform: rotate(0); } 55%, 61% { transform: rotate(-115deg); } }
@media (prefers-reduced-motion: reduce) {
  .inquiry .inquiry-send, .inquiry-send * { animation: none !important; transition: none !important; }
  .inquiry .inquiry-send[data-state="sending"] { width: 170px; height: 48px; }
  .inquiry-send[data-state="sending"] .send-scene { opacity: 0; }
  .inquiry .inquiry-send .send-caption { inset: auto; font-size: 11px; }
  .inquiry-send[data-state="sending"] .send-caption { opacity: 1; }
}

/* Footer section */
.contact-page .footer {
  margin-top: 20px;
}

/* Responsive layout */
@media (max-width: 900px) {
  .contact-hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 50px;
  }

  .contact-terminal { max-width: 540px; }

  .inquiry {
    grid-template-columns: 1fr;
    gap: 55px;
    padding-inline: 0;
  }

  .inquiry header {
    max-width: 650px;
  }
}

@media (max-width: 800px) {
  .contact-page main > .wrap,
  .contact-page .contact-hero > .wrap,
  .contact-page .footer {
    width: calc(100% - 28px);
  }

  .contact-hero {
    padding-top: 150px;
  }

  .contact-copy h1 {
    font-size: 62px;
  }
}

@media (max-width: 520px) {
  .contact-hero {
    min-height: 0;
    padding: 130px 0 55px;
  }

  .contact-copy h1 {
    font-size: 46px;
  }

  .contact-copy h1 br {
    display: block;
  }

  .contact-copy > p {
    font-size: 16px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }


  .inquiry {
    padding: 75px 0 85px;
  }

  .inquiry h2 {
    font-size: 40px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .form-footer {
    align-items: flex-start;
    flex-direction: column;
  }

}
