/* ==========================================================================
   Level Headed Construction — contact-form.css

   Self-contained contact-form module, ported pixel-for-pixel from the
   handoff prototype (level-headed-construction-website-design /
   project / contact.jsx). Used on both /contact.html and on the
   homepage #contact section so the two forms read identically.

   The module owns its own type stack (Anton / Bitter / Inter) and color
   tokens, defined locally on the .lhc-contact wrapper so they don't
   bleed into the rest of the page. Anton + Bitter + Inter must be
   loaded by the host page; the wrapper falls back to system stacks if
   they're not available.

   Layout:
     - Two-column grid at >= 880px: form card on the LEFT, rust side
       panel on the RIGHT.
     - Stacks to a single column below 880px (form first, then panel).
   ========================================================================== */

.lhc-contact {
  /* Module-scoped tokens. Slightly different from the global brand
     palette (the handoff design uses warmer cream + a brighter rust). */
  --lhc-ink:        #1d130f;
  --lhc-cream:      #f5efe4;
  --lhc-cream-2:    #ece4d3;
  --lhc-rust:       #b8470e;
  --lhc-rust-2:     #d05a1c;
  --lhc-rust-soft:  #8a3508;
  --lhc-line-dark:  rgba(36, 23, 18, 0.14);

  background: var(--lhc-cream);
  color: var(--lhc-ink);
  padding: 80px 0 100px;
  font-family: "Bitter", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

.lhc-contact__container {
  width: min(1200px, calc(100% - 64px));
  margin: 0 auto;
}

.lhc-contact__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: stretch;
}
@media (max-width: 880px) {
  .lhc-contact__grid { grid-template-columns: 1fr; }
}

/* --- Display & label utility classes (scoped to this module) --- */
.lhc-contact .display {
  font-family: "Anton", Impact, sans-serif;
  letter-spacing: 0.01em;
}
.lhc-contact .label {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}


/* ==========================================================================
   1. FORM CARD (LEFT)
   Cream card, rounded 6px, top accent bar (gradient), soft layered
   shadow. Form fields stack vertically with one 1.3:1 row for email +
   phone.
   ========================================================================== */

.lhc-form {
  position: relative;
  background: var(--lhc-cream);
  padding: 40px 44px 36px;
  border-radius: 6px;
  border: 1px solid rgba(29, 19, 15, 0.06);
  box-shadow:
    0 1px 0 rgba(29, 19, 15, 0.04),
    0 12px 32px -16px rgba(29, 19, 15, 0.18),
    0 4px 12px -6px rgba(29, 19, 15, 0.08);
}

/* Top accent bar — rust gradient + soft glow. */
.lhc-form__accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--lhc-rust-soft) 0%,
    var(--lhc-rust) 50%,
    var(--lhc-rust-2) 100%);
  border-radius: 6px 6px 0 0;
  box-shadow: 0 1px 4px rgba(184, 71, 14, 0.25);
}

/* --- Field --- */
.lhc-field {
  margin-bottom: 22px;
}
.lhc-field__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.lhc-field__label {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lhc-rust);
}
.lhc-field__optional {
  font-family: "Bitter", Georgia, serif;
  font-style: italic;
  font-size: 12px;
  color: rgba(29, 19, 15, 0.45);
  letter-spacing: 0;
  text-transform: none;
}

/* Email + phone row: 1.3fr / 1fr until it collapses on mobile. */
.lhc-field-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}
@media (max-width: 880px) {
  .lhc-field-row { grid-template-columns: 1fr; }
}

/* --- Inputs / textarea / select share the same base. --- */
.lhc-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--lhc-cream);
  border: 1px solid rgba(29, 19, 15, 0.18);
  border-radius: 4px;
  color: var(--lhc-ink);
  font-family: "Bitter", Georgia, serif;
  font-size: 15px;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}
.lhc-input::placeholder {
  color: rgba(29, 19, 15, 0.5);
}
.lhc-input:focus {
  border-color: var(--lhc-rust);
  box-shadow: 0 0 0 3px rgba(184, 71, 14, 0.12);
  background: #fffbf3;
}

.lhc-textarea {
  resize: vertical;
  line-height: 1.55;
}

/* Custom select — strip native chrome, add a rust caret on the right. */
.lhc-select-wrap {
  position: relative;
}
.lhc-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  cursor: pointer;
}
/* Show the placeholder option (value="") in muted ink when nothing is
   selected. Browsers with :has() support get this; others fall back to
   normal ink color which is still legible. */
.lhc-select:has(option[value=""]:checked) {
  color: rgba(29, 19, 15, 0.5);
}
.lhc-select__caret {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  pointer-events: none;
}

/* --- Submit row --- */
.lhc-form__submit {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.lhc-form__note {
  font-family: "Bitter", Georgia, serif;
  font-style: italic;
  font-size: 13px;
  color: rgba(29, 19, 15, 0.55);
}

/* Send button — rust gradient pill with right-arrow that nudges on hover. */
.lhc-send {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border: none;
  border-radius: 4px;
  background: linear-gradient(
    180deg,
    var(--lhc-rust) 0%,
    var(--lhc-rust-soft) 100%);
  color: var(--lhc-cream);
  font-family: "Anton", Impact, sans-serif;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow:
    0 3px 10px -4px rgba(138, 53, 8, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.lhc-send:hover,
.lhc-send:focus-visible {
  background: linear-gradient(
    180deg,
    var(--lhc-rust-2) 0%,
    var(--lhc-rust) 100%);
  box-shadow:
    0 6px 18px -6px rgba(138, 53, 8, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}
.lhc-send__arrow {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}
.lhc-send:hover .lhc-send__arrow,
.lhc-send:focus-visible .lhc-send__arrow {
  transform: translateX(2px);
}

/* Attention animation — fires once when the button scrolls into view
   for the first time. JS in the page-bottom Formspree init block adds
   .is-noticed via an IntersectionObserver. The button lifts (gaining a
   chunky drop-shadow so it reads as 3D), wiggles side-to-side a few
   times, then settles back. */
.lhc-send.is-noticed {
  animation: lhcSendAttention 1300ms cubic-bezier(0.34, 1.56, 0.64, 1) 250ms both;
}

@keyframes lhcSendAttention {
  /* Rest */
  0% {
    transform: translateY(0) rotate(0);
    box-shadow:
      0 3px 10px -4px rgba(138, 53, 8, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }
  /* Push out — lift + chunky cast shadow reads as 3D depth */
  18% {
    transform: translateY(-10px) rotate(0);
    box-shadow:
      0 22px 30px -8px rgba(0, 0, 0, 0.35),
      0 8px 16px -4px rgba(138, 53, 8, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.24);
  }
  /* Wiggle left */
  34% {
    transform: translateY(-10px) rotate(-4deg);
    box-shadow:
      0 22px 30px -8px rgba(0, 0, 0, 0.35),
      0 8px 16px -4px rgba(138, 53, 8, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.24);
  }
  /* Wiggle right */
  50% {
    transform: translateY(-10px) rotate(4deg);
    box-shadow:
      0 22px 30px -8px rgba(0, 0, 0, 0.35),
      0 8px 16px -4px rgba(138, 53, 8, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.24);
  }
  /* Wiggle left, smaller */
  66% {
    transform: translateY(-10px) rotate(-2deg);
    box-shadow:
      0 22px 30px -8px rgba(0, 0, 0, 0.35),
      0 8px 16px -4px rgba(138, 53, 8, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.24);
  }
  /* Settle to neutral but still lifted */
  82% {
    transform: translateY(-3px) rotate(0);
    box-shadow:
      0 12px 18px -6px rgba(0, 0, 0, 0.22),
      0 4px 10px -3px rgba(138, 53, 8, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.20);
  }
  /* Rest back at original position */
  100% {
    transform: translateY(0) rotate(0);
    box-shadow:
      0 3px 10px -4px rgba(138, 53, 8, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lhc-send.is-noticed { animation: none; }
}


/* ==========================================================================
   2. SIDE PANEL (RIGHT)
   Rust gradient block with a subtle radial highlight + a faint diagonal
   line texture on top. Display heading where the second line ends in
   an italic Bitter accent ("day."). 1px hairline divider before the
   contact rows.
   ========================================================================== */

.lhc-panel {
  position: relative;
  overflow: hidden;
  padding: 44px 40px;
  border-radius: 6px;
  color: var(--lhc-cream);
  background:
    radial-gradient(circle at 85% 15%,
      rgba(255, 255, 255, 0.06) 0%,
      transparent 50%),
    linear-gradient(155deg,
      var(--lhc-rust) 0%,
      var(--lhc-rust-soft) 100%);
  box-shadow:
    0 12px 32px -16px rgba(138, 53, 8, 0.4),
    0 4px 12px -6px rgba(138, 53, 8, 0.2);
}

/* Subtle texture overlay: dark bottom-left blob + diagonal line tile. */
.lhc-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%,
      rgba(0, 0, 0, 0.12) 0%,
      transparent 40%),
    repeating-linear-gradient(45deg,
      rgba(0, 0, 0, 0.025) 0 1px,
      transparent 1px 4px);
  pointer-events: none;
}

.lhc-panel > * {
  position: relative;  /* sit above the ::before texture */
}

.lhc-panel__eyebrow {
  display: block;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 239, 228, 0.85);
  margin-bottom: 18px;
}

.lhc-panel__heading {
  font-family: "Anton", Impact, sans-serif;
  font-size: clamp(36px, 4.6vw, 52px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--lhc-cream);
  margin: 0;
}
.lhc-panel__accent {
  /* Match the surrounding "WE'LL GET BACK" heading — same Anton
     display sans, uppercase, full-cream. Reads as one unified
     headline instead of two-fonts side-by-side. */
  font-family: inherit;
  font-style: normal;
  font-weight: inherit;
  color: var(--lhc-cream);
  text-transform: inherit;
  letter-spacing: inherit;
}

.lhc-panel__intro {
  margin: 22px 0 36px;
  font-size: 15.5px;
  line-height: 1.65;
  color: rgba(245, 239, 228, 0.88);
}

/* Hairline divider between the heading block and the contact rows. */
.lhc-panel__rule {
  height: 1px;
  background: rgba(245, 239, 228, 0.18);
  margin-bottom: 28px;
}

/* --- Contact rows --- */
.lhc-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(245, 239, 228, 0.14);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s;
}
.lhc-row:last-of-type { border-bottom: none; }
a.lhc-row:hover,
a.lhc-row:focus-visible {
  transform: translateX(3px);
}

.lhc-row__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(245, 239, 228, 0.10);
  border: 1px solid rgba(245, 239, 228, 0.22);
  color: var(--lhc-cream);
  transition: background 0.18s;
}
a.lhc-row:hover .lhc-row__icon,
a.lhc-row:focus-visible .lhc-row__icon {
  background: rgba(245, 239, 228, 0.18);
}
.lhc-row__icon svg {
  width: 16px;
  height: 16px;
}

.lhc-row__label {
  display: block;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 239, 228, 0.7);
  margin-bottom: 3px;
}
.lhc-row__value {
  display: block;
  font-family: "Bitter", Georgia, serif;
  font-weight: 600;
  /* Shrink one step on narrow viewports so the longest value
     ("levelheadedconstruction@gmail.com") clears the column at the
     <wbr> break point instead of splitting mid-word. The browser
     prefers the explicit wbr opportunity to a mid-character break,
     but only if "levelheadedconstruction" itself fits on one line.
     At 15px Bitter, 23 chars is just barely too wide for the 175px
     value column on a 375px viewport; at 14px it fits with margin. */
  font-size: 14px;
  color: var(--lhc-cream);
  /* overflow-wrap: anywhere honors <wbr> first and falls back to a
     character break only as a last resort — preferable to the legacy
     word-break: break-word which is too eager to mid-word break. */
  overflow-wrap: anywhere;
}
@media (min-width: 480px) {
  .lhc-row__value { font-size: 15px; }
}

/* ==========================================================================
   Submission states (Formspree SDK populates these via [data-fs-*])
   --------------------------------------------------------------------------
   .lhc-form__success and .lhc-form__error are populated only on
   submit outcome — empty by default, hidden via :empty. Field-level
   errors render below each input via [data-fs-error="<name>"]. The SDK
   also adds aria-invalid="true" to the offending input so we can paint
   the field red.
   ========================================================================== */
.lhc-form__success:empty,
.lhc-form__error:empty,
.lhc-field__error:empty {
  display: none;
}

/* The SDK populates .lhc-form__success with a plain success message —
   we keep it for screen-reader announcement (role="status") but hide
   it visually since .lhc-form__sent below provides the rich animated
   state. The visually-hidden pattern keeps it in the a11y tree.    */
.lhc-form__success:not(:empty) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Sent animation
   --------------------------------------------------------------------------
   When the SDK drops content into [data-fs-success], the inline init
   script on each page adds .is-sent to the form. That hides the form
   fields, error containers, and submit, and reveals .lhc-form__sent
   with a draw-in checkmark followed by a fade-up title + subtitle.
   ========================================================================== */
.lhc-form__sent {
  display: none;
  text-align: center;
  padding: 20px 16px 8px;
}
.lhc-form.is-sent .lhc-form__sent {
  display: block;
}

/* Hide the active form contents once submission is confirmed. */
.lhc-form.is-sent .lhc-field,
.lhc-form.is-sent .lhc-field-row,
.lhc-form.is-sent .lhc-form__submit,
.lhc-form.is-sent .lhc-form__error {
  display: none;
}

/* Checkmark — circle ring draws first, then the tick. */
.lhc-form__check {
  display: block;
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  color: #4A7C3C; /* matches global --success token */
}
.lhc-form__check-ring {
  /* circumference of r=28: 2π·28 ≈ 175.93 */
  stroke-dasharray: 176;
  stroke-dashoffset: 176;
  animation: lhcCheckRing 520ms cubic-bezier(0.65, 0, 0.35, 1) 100ms forwards;
}
.lhc-form__check-tick {
  /* approx path length for "M20 33 L29 42 L46 24" */
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: lhcCheckTick 360ms cubic-bezier(0.65, 0, 0.35, 1) 520ms forwards;
}
@keyframes lhcCheckRing { to { stroke-dashoffset: 0; } }
@keyframes lhcCheckTick { to { stroke-dashoffset: 0; } }

.lhc-form__sent-title {
  font-family: "Anton", Impact, sans-serif;
  font-size: clamp(28px, 3vw, 36px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--lhc-ink);
  margin: 0 0 8px;
  opacity: 0;
  animation: lhcSentFadeUp 500ms cubic-bezier(0.16, 1, 0.3, 1) 720ms forwards;
}
.lhc-form__sent-sub {
  font-family: "Bitter", Georgia, serif;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(29, 19, 15, 0.7);
  margin: 0 auto;
  max-width: 360px;
  opacity: 0;
  animation: lhcSentFadeUp 500ms cubic-bezier(0.16, 1, 0.3, 1) 860ms forwards;
}
@keyframes lhcSentFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Reduced motion: skip the draw-in and the fade-up, just show the
   finished success state. */
@media (prefers-reduced-motion: reduce) {
  .lhc-form__check-ring,
  .lhc-form__check-tick {
    stroke-dashoffset: 0;
    animation: none;
  }
  .lhc-form__sent-title,
  .lhc-form__sent-sub {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

.lhc-form__error:not(:empty) {
  margin: 0 0 8px;
  padding: 14px 16px;
  background: rgba(184, 71, 14, 0.06);
  border: 1px solid rgba(184, 71, 14, 0.32);
  border-radius: 6px;
  font-family: "Bitter", Georgia, serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--lhc-rust-soft);
}

.lhc-field__error:not(:empty) {
  display: block;
  margin-top: 6px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: var(--lhc-rust-soft);
}

/* Invalid input — paint the border red and add a soft red wash without
   touching the rest of the input styling. */
.lhc-input[aria-invalid="true"] {
  border-color: var(--lhc-rust-soft);
  background: rgba(184, 71, 14, 0.04);
}
.lhc-input[aria-invalid="true"]:focus {
  border-color: var(--lhc-rust-soft);
  box-shadow: 0 0 0 3px rgba(184, 71, 14, 0.16);
}

/* In-flight state — the SDK disables [data-fs-submit-btn] during
   submission and re-enables on completion. */
.lhc-send[disabled],
.lhc-send[aria-disabled="true"] {
  opacity: 0.65;
  cursor: progress;
}
