/* ==========================================================================
   Work with me (#work): layout, fields, chips, reach pills, states.
   Blue section: the form is a blue glass card, fields sit darker inside it.
   Motion is transform and opacity only.
   ========================================================================== */

#work {
  --err: #ffb4ab;                          /* light red, about 8:1 on the form card */
  --err-bg: rgba(255, 120, 108, .10);
  --err-line: rgba(255, 164, 152, .55);
  --field-bg: rgba(3, 11, 29, .55);
  --field-bg-focus: rgba(3, 11, 29, .75);
  --field-line: rgba(168, 203, 230, .42);
  --focus: var(--blue-300);
}

/* ---------- layout ---------- */
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
@media (min-width: 960px) {
  .work-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .work-intro { position: sticky; top: calc(var(--nav-h) + 40px); }
}

.work-intro h2 { font-size: clamp(34px, 4.6vw, 58px); text-wrap: balance; }

.work-direct {
  list-style: none; margin: 32px 0 0; padding: 0;
  border-top: 1px solid var(--line);
}
.work-direct li {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 16px;
  min-height: 56px; padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px; color: var(--text);
}
.work-direct li > span {
  font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim);
}
.work-direct a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: #fff; font-weight: 400; text-decoration: underline;
  text-decoration-color: rgba(140, 196, 255, .55); text-underline-offset: 4px; text-decoration-thickness: 1px;
  overflow-wrap: anywhere;
  transition: transform .18s var(--ease-out);
}
.work-direct a:hover { color: var(--blue-200); text-decoration-color: currentColor; transform: translateX(2px); }
.work-direct a:active { transform: translateX(0) scale(.98); }
.work-direct a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

/* ---------- the card ---------- */
.work-form {
  position: relative;
  background:
    radial-gradient(110% 80% at 100% 0%, rgba(90, 168, 255, .10), transparent 60%),
    var(--glass);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  padding: clamp(20px, 3.4vw, 40px);
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 22px;
}

.field-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (min-width: 640px) {
  .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
}

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }

.field > label,
.field > legend {
  padding: 0;
  font-size: 15px; font-weight: 500; line-height: 1.4; color: #fff;
}
.field > legend { margin-bottom: 12px; }
.field label b { color: var(--blue-300); font-weight: 600; margin-left: 2px; }
.field .opt {
  margin-left: 6px;
  font-size: 12.5px; font-weight: 400; letter-spacing: .02em; color: var(--text-dim);
}

.work-form input[type="text"],
.work-form input[type="email"],
.work-form input[type="tel"],
.work-form textarea {
  display: block; width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  font-family: var(--f-body); font-size: 16px; font-weight: 400; line-height: 1.5; color: #fff;
  background: var(--field-bg);
  border: 1px solid var(--field-line);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 3px rgba(2, 8, 22, .45);
  caret-color: var(--blue-300);
  -webkit-appearance: none; appearance: none;
}
.work-form textarea { min-height: 148px; resize: vertical; }
.work-form input::placeholder,
.work-form textarea::placeholder { color: #8fa9c6; opacity: 1; } /* about 6:1 on the field */
.work-form input:hover,
.work-form textarea:hover { border-color: rgba(168, 203, 230, .65); }
.work-form input:focus,
.work-form textarea:focus { outline: none; }
.work-form input:focus-visible,
.work-form textarea:focus-visible,
.work-form input[type="text"]:focus,
.work-form input[type="email"]:focus,
.work-form input[type="tel"]:focus,
.work-form textarea:focus {
  background: var(--field-bg-focus);
  border-color: var(--blue-300);
  outline: 3px solid rgba(90, 168, 255, .55);
  outline-offset: 1px;
}
.work-form input:-webkit-autofill,
.work-form textarea:-webkit-autofill {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px #0a1a3a inset;
}
.work-form input[aria-invalid="true"],
.work-form textarea[aria-invalid="true"] { border-color: var(--err); }
.work-form input[aria-invalid="true"]:focus,
.work-form textarea[aria-invalid="true"]:focus { border-color: var(--err); outline: 3px solid rgba(255, 140, 128, .38); outline-offset: 1px; }

.field-error {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 0;
  font-size: 14px; font-weight: 400; line-height: 1.45; color: var(--err);
}
.field-error::before {
  content: "!";
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  background: var(--err); color: #3a0906;
  font-size: 12px; font-weight: 600; line-height: 1;
}

/* ---------- chips (offer toggles) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .reach label { position: relative; display: inline-flex; cursor: pointer; }
.chip input, .reach input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: pointer;
}
.chip span, .reach span {
  position: relative;
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 44px; padding: 9px 16px 9px 12px;
  border: 1px solid rgba(168, 203, 230, .38); border-radius: 999px;
  background: rgba(120, 175, 240, .07); color: var(--text);
  font-size: 14.5px; font-weight: 400; line-height: 1.25;
  box-shadow: 0 1px 0 rgba(212, 233, 255, .05) inset, 0 6px 14px -10px rgba(2, 8, 22, .8);
  transition: transform .18s var(--ease-out);
  -webkit-user-select: none; user-select: none;
}
/* the tick ring, reserved at all times so the pill never changes width */
.chip span::before {
  content: ""; flex: none;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid rgba(168, 203, 230, .65);
  background: transparent;
}
.chip span::after {
  content: "";
  position: absolute; left: 18px; top: 50%;
  width: 5px; height: 9px; margin-top: -6px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(.4);
  opacity: 0;
  transition: transform .2s var(--ease-out), opacity .15s;
}
.chip:hover span, .reach label:hover span { border-color: var(--blue-300); background: rgba(90, 168, 255, .14); color: #fff; transform: translateY(-1px); }
.chip:active span, .reach label:active span { transform: translateY(0) scale(.97); }
.chip input:focus-visible + span,
.reach input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 3px; }

/* checked: the bright brand blue, dark text, a filled tick */
.chip input:checked + span {
  background: var(--accent-metal) border-box;
  border-color: transparent;
  color: var(--on-accent); font-weight: 500;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 8px 20px -8px rgba(90, 168, 255, .75);
}
.chip input:checked + span::before { background: var(--on-accent); border-color: var(--on-accent); }
.chip input:checked + span::after { opacity: 1; transform: rotate(45deg) scale(1); }

.chip--soft span { border-style: dashed; background: transparent; }

/* "Get this" highlight: a blue ring that blooms out and the pill nudges */
.chip::after {
  content: ""; position: absolute; inset: -5px; border-radius: 999px;
  border: 2px solid var(--accent);
  opacity: 0; pointer-events: none;
}
.chip--flash::after { animation: chipRing 1.2s var(--ease-out) both; }
.chip--flash span { animation: chipNudge .6s var(--ease-out) both; }
@keyframes chipRing {
  0%   { opacity: 0; transform: scale(.92); }
  20%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.14); }
}
@keyframes chipNudge {
  0% { transform: scale(1); } 35% { transform: scale(1.07); } 100% { transform: scale(1); }
}

/* ---------- reach (radio pills) ---------- */
.reach { display: flex; flex-wrap: wrap; gap: 8px; }
.reach span { padding: 9px 20px 9px 14px; }
.reach span::before {
  content: ""; flex: none;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid rgba(168, 203, 230, .65); background: transparent;
}
.reach input:checked + span {
  background: var(--accent-metal) border-box; border-color: transparent; color: var(--on-accent); font-weight: 500;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 8px 20px -8px rgba(90, 168, 255, .75);
}
.reach input:checked + span::before { border: 5px solid var(--on-accent); background: #fff; }

/* ---------- phone: chips as a two-column grid, reach as three equal pills ---------- */
@media (max-width: 560px) {
  .chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .chip { display: flex; }
  .chip span { width: 100%; border-radius: 16px; padding: 8px 10px 8px 12px; font-size: 14px; line-height: 1.3; }
  .chip::after { border-radius: 21px; }
  .chip--soft { grid-column: 1 / -1; }
  .reach { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .reach label { display: flex; }
  .reach span { width: 100%; justify-content: center; gap: 8px; padding: 9px 10px; }
}

@media (max-width: 380px) {
  .work-form { padding: 18px 16px; }
  .chip span { gap: 7px; padding: 8px 8px 8px 10px; }
  .chip span::after { left: 16px; }
}

/* ---------- honeypot: off-screen, never visible ---------- */
.hp {
  position: absolute !important; left: -10000px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}

/* ---------- note, actions, status ---------- */
.privacy-note { font-size: 13.5px; line-height: 1.6; color: var(--text-dim); text-wrap: pretty; }
/* Inline links stay inline in the sentence, but the invisible ::after grows
   the tap area to 44px tall so a thumb can hit them. */
.privacy-note a,
.form-status a { position: relative; }
.privacy-note a::after,
.form-status a::after {
  content: ""; position: absolute; left: -6px; right: -6px; top: 50%;
  height: 44px; transform: translateY(-50%);
}
.privacy-note a {
  display: inline-block; padding: 2px 0;
  color: var(--blue-300); font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px;
  transition: transform .18s var(--ease-out);
}
.privacy-note a:hover { color: #fff; }
.privacy-note a:active { transform: scale(.97); }
.privacy-note a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

.form-actions { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.btn-send { width: 100%; min-height: 52px; font-size: 16px; }
@media (min-width: 640px) {
  .form-actions { align-items: flex-start; }
  .btn-send { width: auto; padding-left: 32px; padding-right: 32px; }
}
.btn-send:disabled { cursor: progress; opacity: .7; transform: none; box-shadow: none; }
.btn-send:disabled::after { opacity: 0; }
.work-form .btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.form-status { font-size: 15px; line-height: 1.6; color: var(--text); }
.form-status:empty { display: block; margin: 0; padding: 0; }
.form-status.is-error {
  width: 100%;
  padding: 12px 16px;
  background: var(--err-bg);
  border: 1px solid var(--err-line);
  border-radius: var(--radius-sm);
}
.form-status.is-error strong { color: var(--err); font-weight: 600; }
.form-status a {
  display: inline-block;
  color: #fff; font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--accent);
  text-underline-offset: 3px; text-decoration-thickness: 2px;
  transition: transform .18s var(--ease-out);
}
.form-status a:hover { color: var(--blue-200); }
.form-status a:active { transform: scale(.97); }
.form-status a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

/* ---------- sent state ---------- */
.work-form.is-sent > :not(.form-success) { display: none; }
.work-form.is-sent {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(90, 168, 255, .20), transparent 60%),
    var(--glass-hi);
  border-color: rgba(140, 196, 255, .5);
}
.form-success {
  display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
  padding: clamp(8px, 2vw, 24px) 0;
  scroll-margin-top: calc(var(--nav-h) + 24px);
  animation: sentIn .45s var(--ease-out) both;
  color: var(--text);
}
.form-success-mark {
  position: relative;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent-metal);
  box-shadow: var(--glow-accent);
}
.form-success-mark::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 12px; height: 22px; margin: -14px 0 0 -6px;
  border: solid var(--on-accent); border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.form-success-title {
  font-size: clamp(28px, 3.2vw, 38px); line-height: 1.15; color: #fff;
  text-wrap: balance;
}
.form-success p { color: var(--text-dim); }
.form-success-title:focus { outline: none; }
.form-success-title:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
@keyframes sentIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .chip span, .reach span, .chip span::after,
  .work-direct a, .privacy-note a, .form-status a { transition: none; }
  .chip:hover span, .reach label:hover span, .work-direct a:hover { transform: none; }
  .chip--flash span { animation: none; }
  .chip--flash::after { animation: chipRingStill 1.2s linear both; }
  .form-success { animation: none; }
}
@keyframes chipRingStill { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
