/* ==========================================================================
   Elevate 360 — Contact (10/8)
   Head (photo under a navy grade, same height as the Case Studies head) →
   two ways to start → the form → the office with a drawn map.
   Reads from tokens.css. The head rules are a copy of .ph in cases.css
   until a shared page-head lands in components.css (PAGES.md request).
   ========================================================================== */

/* --- Page head ----------------------------------------------------------- */

.ph { display: grid; background: var(--navy); color: var(--text-inverse); }
.ph__inner { display: grid; align-content: center; padding-block: var(--space-3xl) var(--section-y); }
.ph--photo { position: relative; overflow: hidden; }
.ph__media { position: absolute; inset: 0; margin: 0; z-index: 0; }
.ph__media picture, .ph__media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 72% 50%; }
.ph__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 41, 66, 0.35) 0%, rgba(15, 41, 66, 0) 35%, rgba(15, 41, 66, 0.55) 100%),
    linear-gradient(90deg, rgba(15, 41, 66, 0.94) 0%, rgba(15, 41, 66, 0.78) 42%, rgba(15, 41, 66, 0.28) 75%, rgba(15, 41, 66, 0.10) 100%);
}
.ph--photo .ph__inner { position: relative; z-index: 1; }
.ph__title {
  margin: var(--space-sm) 0 0;
  max-width: 14ch;
  font-size: var(--step-5);
  font-weight: var(--weight-regular);
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--on-navy);
}
.ph__title em { font-style: italic; }
.ph__lede {
  margin: var(--space-lg) 0 0;
  max-width: 46ch;
  font-size: var(--step-1);
  line-height: var(--leading-snug);
  color: var(--text-inverse-muted);
}
@media (max-width: 767px) {
  .ph--photo { min-height: 460px; }
  .ph__media img { object-position: 80% 50%; }
  .ph__media::after { background: linear-gradient(180deg, rgba(15, 41, 66, 0.55) 0%, rgba(15, 41, 66, 0.82) 100%); }
}
@media (min-width: 1024px) {
  .ph { min-height: calc(464px + 8.65vw); }
  .ph__inner { padding-block: var(--space-4xl) var(--space-5xl); }
}

/* --- Two ways to start --------------------------------------------------- */
/* Both cards share five rows (subgrid) so the titles, bodies, buttons and
   notes sit on the same lines. */

.ways { padding-block: var(--section-y); background: var(--paper); }
.ways__grid { display: grid; gap: var(--space-2xl); }
.way {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  row-gap: var(--space-md);
  padding: var(--space-2xl) 0 0;
  border-top: 1px solid var(--rule);
  overflow: hidden;
}
.way .eyebrow { margin: 0; }
.way__title {
  margin: 0;
  max-width: 14ch;
  font-size: var(--step-3);
  font-weight: var(--weight-regular);
  line-height: 1.06;
  letter-spacing: -0.024em;
  color: var(--ink);
}
.way__title em { font-style: italic; }
.way__body { margin: 0; max-width: 42ch; color: var(--text-muted); }
/* Both buttons the same width: the width of the longer label. */
.way .btn { justify-self: start; align-self: start; width: min(100%, 24.5rem); justify-content: center; margin-top: var(--space-sm); white-space: normal; text-align: center; }
.way__note { margin: 0; font-size: var(--step--1); color: var(--text-meta); }
.way__note a { color: var(--navy); font-weight: var(--weight-medium); text-decoration: none; border-bottom: 1px solid var(--gold); }
.way__note a:hover { color: var(--gold); }

@media (min-width: 768px) {
  .ways__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(5, auto); column-gap: var(--space-3xl); row-gap: 0; }
  .way { grid-row: 1 / span 5; grid-template-rows: subgrid; }
  .way:nth-child(2) { grid-column: 2; }
  /* the top padding and rule belong to the first row only */
  .way { padding-top: 0; border-top: 0; }
  .way > .eyebrow { padding-top: var(--space-2xl); border-top: 1px solid var(--rule); }
}
@media (min-width: 1024px) {
  .ways__grid { column-gap: var(--space-4xl); }
}

/* --- The form (navy band) ------------------------------------------------- */

.write { padding-block: var(--section-y-tight); background: var(--navy); background-image: radial-gradient(ellipse at 85% 20%, rgba(29, 63, 95, 0.9) 0%, rgba(15, 41, 66, 0) 55%); color: var(--text-inverse); }
.write__grid { display: grid; gap: var(--space-xl); }
.write__title {
  margin: 0 0 var(--space-sm);
  max-width: 14ch;
  font-size: var(--step-3);
  font-weight: var(--weight-regular);
  line-height: 1.06;
  letter-spacing: -0.024em;
  color: var(--on-navy);
}
.write__title em { font-style: italic; }
.write__body { margin: 0; max-width: 34ch; font-size: var(--step-0); line-height: var(--leading-normal); color: var(--text-inverse-muted); }

/* Each field is a soft filled box with its underline, so the inputs read
   as places to type. (A lighter panel behind the whole form was tried 10/8
   and taken out.) */
.form { display: grid; gap: var(--space-md); position: relative; padding-top: var(--space-lg); }
/* The progress line: a hairline along the top of the form; the gold fills
   left to right as the four required fields are completed (contact.js). */
.form__progress { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--on-navy-line); overflow: hidden; }
.form__progress-bar { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transform: scaleX(0); transform-origin: left center; transition: transform 700ms var(--ease-emph); }
.form__row { display: grid; gap: var(--space-md); }
.field { position: relative; display: grid; gap: var(--space-xs); }
.field__label {
  font-size: var(--step--1);
  font-weight: var(--weight-bold);
  font-stretch: var(--width-narrow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-navy-muted);
  transition: color var(--dur-base) var(--ease-out);
}
.field__opt { margin-left: 0.4em; font-weight: var(--weight-regular); letter-spacing: 0.04em; text-transform: none; opacity: 0.7; }
.field__input {
  width: 100%;
  padding: 0.7rem 0.9rem 0.75rem;
  border: 0;
  border-radius: 4px 4px 0 0;
  background: rgba(244, 242, 237, 0.05);
  transition: background var(--dur-base) var(--ease-out);
  font: inherit;
  font-size: var(--step-1);
  font-weight: var(--weight-medium);
  color: var(--on-navy);
  outline: none;
  caret-color: var(--gold-light);
}
.field__input::placeholder { color: transparent; }
.field__input:hover { background: rgba(244, 242, 237, 0.07); }
.field__input:focus { background: rgba(244, 242, 237, 0.09); }
.field__input:-webkit-autofill { -webkit-text-fill-color: var(--on-navy); -webkit-box-shadow: 0 0 0 1000px #1A3A58 inset; transition: background-color 9999s; }
textarea.field__input { resize: vertical; min-height: 5.25rem; line-height: var(--leading-normal); }
/* The hairline under each field: muted at rest, paper while typing, gold
   once valid. The colour draws in from the left. */
.field::after { content: ""; height: 1px; margin-top: calc(var(--space-xs) * -1); background: rgba(244, 242, 237, 0.22); }
.field::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--on-navy);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-slow) var(--ease-emph), background var(--dur-base) var(--ease-out);
}
.field:focus-within::before { transform: scaleX(1); }
.field:focus-within .field__label { color: var(--on-navy); }
.field:has(.field__input:valid:not(:placeholder-shown))::before { transform: scaleX(1); background: var(--gold-light); }
.field:has(.field__input:valid:not(:placeholder-shown)) .field__label { color: var(--gold-light); }
.field:has(.field__input:invalid:not(:placeholder-shown):not(:focus))::before { transform: scaleX(1); background: var(--on-navy-muted); }
/* Fields arrive one after another under the lead. */
.js .form .field { opacity: 0; transform: translateY(10px); transition: opacity var(--dur-scroll) var(--ease-out), transform var(--dur-scroll) var(--ease-emph); }
.js .form.is-in .field { opacity: 1; transform: none; }
.js .form.is-in .form__row:nth-child(2) .field:nth-child(1) { transition-delay: 120ms; }
.js .form.is-in .form__row:nth-child(2) .field:nth-child(2) { transition-delay: 200ms; }
.js .form.is-in .form__row:nth-child(3) .field:nth-child(1) { transition-delay: 280ms; }
.js .form.is-in .form__row:nth-child(3) .field:nth-child(2) { transition-delay: 360ms; }
.js .form.is-in .field--area { transition-delay: 440ms; }

.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form__foot { display: grid; gap: var(--space-sm); align-items: center; margin-top: var(--space-xs); }
.form__submit { display: inline-flex; align-items: center; gap: 0.6rem; justify-self: start; transition: background var(--dur-slow) var(--ease-out), color var(--dur-slow) var(--ease-out), border-color var(--dur-slow) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.form__submit svg { width: 18px; transition: transform var(--dur-base) var(--ease-emph); }
.form__submit:hover svg { transform: translateX(4px); }
/* Once every required field is valid the button fills gold. */
.form:valid .form__submit { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.form:valid .form__submit:hover { background: var(--gold-light); border-color: var(--gold-light); }
.form__hint { margin: 0; font-size: var(--step-0); font-weight: var(--weight-medium); color: var(--gold-light); transition: color var(--dur-base) var(--ease-out); }
.form.is-shaking .form__submit { animation: form-nudge 420ms var(--ease-out); }
@keyframes form-nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 55% { transform: translateX(4px); } 80% { transform: translateX(-2px); } }

/* The thanks state replaces the fields in place. */
.form.is-done > :not(.form__done) { visibility: hidden; }
.form__done { position: absolute; inset: 0; display: grid; align-content: center; gap: var(--space-sm); }
.form__done[hidden] { display: none; }
.form__done-title { margin: 0; font-size: var(--step-3); font-weight: var(--weight-regular); letter-spacing: -0.024em; line-height: 1.06; color: var(--on-navy); }
.form__done-body { margin: 0; max-width: 36ch; color: var(--text-inverse-muted); }
.js .form__done > * { opacity: 0; transform: translateY(12px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-emph); }
.js .form.is-done .form__done > * { opacity: 1; transform: none; }
.js .form.is-done .form__done > :nth-child(2) { transition-delay: 140ms; }

@media (min-width: 640px) {
  .form__row { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-xl); }
  .form__foot { grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-lg); }
}
@media (min-width: 1024px) {
  .write__grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: var(--space-4xl); align-items: start; }
}

/* --- The office (compact) ------------------------------------------------- */

.office { padding-block: var(--section-y-tight); background: var(--paper); }
.office__grid { display: grid; gap: var(--space-xl); }
.office__title {
  margin: 0 0 var(--space-lg);
  font-size: var(--step-2);
  font-weight: var(--weight-regular);
  line-height: 1.06;
  letter-spacing: -0.024em;
  color: var(--ink);
}
.office__title em { font-style: italic; }
.office__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-lg) var(--space-xl); margin: 0 0 var(--space-lg); }
.office__fact { display: grid; align-content: start; gap: var(--space-2xs); padding-top: var(--space-sm); border-top: 1px solid var(--rule); }
.office__fact--hours { grid-column: 1 / -1; }
.office__fact:first-child { grid-row: span 2; }
.office__fact dt {
  display: flex; align-items: center; gap: var(--space-md);
  font-size: var(--step--2);
  font-weight: var(--weight-medium);
  font-stretch: var(--width-narrow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.office__fact dd { margin: 0; font-size: var(--step--1); line-height: var(--leading-snug); color: var(--ink); }
.office__fact dd a { color: inherit; text-decoration: none; }
.office__fact dd a:hover { color: var(--gold); }
.office__addr { display: inline-block; }
.hours { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; max-width: 22rem; }
.hours li { display: flex; justify-content: space-between; gap: var(--space-lg); padding: 0.1rem 0; transition: color var(--dur-base) var(--ease-out); }
.hours li.is-today { color: var(--navy); font-weight: var(--weight-medium); }
.hours li.is-today span:first-child::after { content: ""; display: inline-block; width: 1.25rem; height: 1px; margin-left: 0.6rem; vertical-align: middle; background: var(--gold); }
.office__tz { margin: var(--space-2xs) 0 0; font-size: var(--step--2); color: var(--text-meta); }
/* "Open now": a small dot that breathes while the office is open. */
.office__now { display: inline-flex; align-items: center; gap: 0.45rem; letter-spacing: 0.04em; text-transform: none; font-stretch: var(--width-normal); color: var(--text-muted); }
.office__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-300); }
.office__now.is-open { color: var(--navy); }
.office__now.is-open .office__dot { background: var(--gold); box-shadow: 0 0 0 0 rgba(184, 137, 44, 0.5); animation: now-breathe 2.6s var(--ease-in-out) infinite; }
@keyframes now-breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(184, 137, 44, 0.45); } 50% { box-shadow: 0 0 0 6px rgba(184, 137, 44, 0); } }

/* The map: streets draw in one after another when it arrives; the office
   marker drops last and its halo breathes. Under the pointer a gold
   spotlight follows the mouse and the streets inside it go gold
   (contact.js moves the circle). Schematic, not to scale. */
.cmap { margin: 0; width: 100%; }
.cmap__svg { display: block; width: 100%; height: auto; overflow: visible; cursor: crosshair; }
.cmap__plate { fill: var(--paper-warm); }
.cmap__road { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.cmap__road--main { stroke: var(--navy); stroke-width: 3; }
.cmap__road--minor { stroke: var(--navy-300); stroke-width: 1.6; }
.cmap__road--fwy { stroke: var(--navy-100); stroke-width: 10; }
.cmap__road--fwy-line { stroke: var(--paper); stroke-width: 1.2; stroke-dasharray: 6 5; }
.cmap__road--runway { stroke: var(--navy-100); stroke-width: 4; }
.js .cmap__road { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .cmap.is-in .cmap__road { animation: cmap-draw 1200ms var(--ease-out) forwards; animation-delay: calc(var(--o, 0) * 160ms + 200ms); }
.js .cmap.is-in .cmap__road--fwy-line { stroke-dasharray: 6 5; stroke-dashoffset: 0; animation: cmap-fade 900ms var(--ease-out) 900ms both; }
@keyframes cmap-draw { to { stroke-dashoffset: 0; } }
@keyframes cmap-fade { from { opacity: 0; } to { opacity: 1; } }
/* the spotlight layer */
.cmap__spot { pointer-events: none; transition: r 320ms var(--ease-out); }
.cmap__spot-clip { transition: r 320ms var(--ease-out); }
.cmap__spot-roads { pointer-events: none; }
.cmap__gold { fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cmap__gold--main { stroke-width: 3.4; }
.cmap__gold--fwy { stroke-width: 10; stroke-opacity: 0.45; }
.cmap__gold--fwy-line { stroke: var(--paper); stroke-width: 1.2; stroke-dasharray: 6 5; }
.js .cmap__spot-roads { opacity: 0; transition: opacity 600ms var(--ease-out); }
.js .cmap.is-in .cmap__spot-roads { opacity: 1; transition-delay: 1800ms; }
.cmap text { font-family: var(--font-sans); }
.cmap__label { font-size: 11px; font-weight: var(--weight-medium); letter-spacing: 0.06em; text-transform: uppercase; fill: var(--ink-500); }
.cmap__label--main { font-size: 12px; fill: var(--navy); }
.cmap__label--fwy { font-size: 10px; fill: var(--ink-300); }
.cmap__label--meta { font-size: 9.5px; letter-spacing: 0.08em; fill: var(--ink-300); }
.js .cmap__label { opacity: 0; transition: opacity 700ms var(--ease-out); }
.js .cmap.is-in .cmap__label { opacity: 1; transition-delay: 1500ms; }
.cmap__halo { fill: var(--gold); fill-opacity: 0.14; }
.cmap__pin-ring { fill: var(--paper); stroke: var(--gold); stroke-width: 2.2; }
.cmap__pin-dot { fill: var(--navy); }
.cmap__pin-label { font-size: 12px; font-weight: var(--weight-medium); fill: var(--navy); letter-spacing: -0.005em; }
.cmap__pin-sub { font-size: 10px; fill: var(--ink-500); letter-spacing: 0.02em; }
.js .cmap__pin { opacity: 0; transform: translate(262px, 170px); transition: opacity var(--dur-slow) var(--ease-out), transform 620ms cubic-bezier(0.34, 1.4, 0.64, 1); }
.js .cmap.is-in .cmap__pin { opacity: 1; transform: translate(262px, 194px); transition-delay: 1700ms; }
.js .cmap__halo { transform-box: fill-box; transform-origin: center; }
.js .cmap.is-in .cmap__halo { animation: cmap-breathe 3.2s var(--ease-in-out) 2400ms infinite; }
@keyframes cmap-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }

@media (min-width: 1024px) {
  .office__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--space-3xl); align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  .js .cmap__road, .js .cmap.is-in .cmap__road { animation: none; stroke-dashoffset: 0; }
  .js .cmap__label, .js .cmap__pin { opacity: 1; transition: none; }
  .js .cmap.is-in .cmap__halo { animation: none; }
  .office__now.is-open .office__dot { animation: none; }
  .field::before, .form__submit, .form__progress-bar, .cmap__spot, .cmap__spot-clip { transition: none; }
  .js .form .field { opacity: 1; transform: none; transition: none; }
  .form.is-shaking .form__submit { animation: none; }
}

/* Sending state for the contact form button (10/13) */
.form .btn.is-busy { opacity: .6; pointer-events: none; }
