/* ==========================================================================
   COMPONENTS

   GESTALT: SIMILARITY + COMMON REGION + FOCAL POINT
   - Every card in the site is the same object with different contents.
   - A "region" is surface + hairline. Shadows only appear on interaction.
   - Brass is the focal color. It marks the single primary action in a
     viewport and nothing else. If two brass things are visible at once,
     one of them is wrong.
   ========================================================================== */


/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--color-text-strong);
  --btn-border: var(--color-line-strong);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: var(--control-height);
  min-width: var(--tap-target);
  padding: var(--space-3) var(--space-6);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition:
    background-color var(--dur-base) var(--ease-out),
    color var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Focal point. One per viewport. */
.btn--primary {
  --btn-bg: var(--color-accent);
  /* Dark label, not white. Measured, white on brass-500 is 3.60:1 — below AA
     for a 12px control. Darkening the fill instead would have dimmed the one
     focal colour on the page, so the label carries the change: ink on brass is
     5.19:1, and it is also the register @properties itself sets. */
  --btn-fg: var(--ink-900);
  --btn-border: var(--color-accent);
}
/* Hover lifts toward the light rather than darkening, so the label keeps its
   contrast through the whole interaction. */
.btn--primary:hover { --btn-bg: var(--brass-400); --btn-border: var(--brass-400); }

.btn--solid {
  --btn-bg: var(--color-inverse);
  --btn-fg: var(--color-text-on-dark);
  --btn-border: var(--color-inverse);
}
.btn--solid:hover { --btn-bg: var(--ink-700); --btn-border: var(--ink-700); }

.btn--outline { --btn-bg: transparent; --btn-fg: var(--color-text-strong); --btn-border: var(--color-line-strong); }
.btn--outline:hover { --btn-bg: var(--color-text-strong); --btn-fg: var(--color-ground); --btn-border: var(--color-text-strong); }

.is-inverse .btn--outline,
.section--inverse .btn--outline,
.hero .btn--outline { --btn-fg: var(--color-text-on-dark); --btn-border: var(--color-line-strong); }
/* The secondary hero button is the only control whose ground is the raw
   photograph. On a bright image the scrim alone left it at 3.2:1, so it
   carries a little of its own — enough to guarantee the label, not enough to
   read as a second filled button competing with the brass one. */
.hero .btn--outline { --btn-bg: rgba(20, 18, 15, .38); backdrop-filter: blur(2px); }
.is-inverse .btn--outline:hover,
.section--inverse .btn--outline:hover,
.hero .btn--outline:hover { --btn-bg: var(--bone-100); --btn-fg: var(--ink-900); --btn-border: var(--bone-100); }

.btn--sm { min-height: var(--control-height-sm); padding: var(--space-2) var(--space-5); }
.btn--block { display: flex; width: 100%; }

/* Text link with a rule that draws itself — continuity cue on hover. */
.link-underline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding-block: var(--space-1);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--color-text-strong);
  position: relative;
}
.link-underline::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform-origin: left;
  transform: scaleX(1);
  opacity: .35;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.link-underline:hover::after { opacity: 1; }
.link-underline .icon { transition: transform var(--dur-base) var(--ease-out); }
.link-underline:hover .icon { transform: translateX(4px); }

.icon { width: 1em; height: 1em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.25; }
.icon--lg { width: 1.5em; height: 1.5em; }


/* ==========================================================================
   SECTION HEADER — one component, used by every section on every page.
   ========================================================================== */

.section-head { max-width: var(--measure); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head__eyebrow { margin-block-end: var(--space-3); }
.section-head__title { margin-block-end: var(--space-4); }
.section-head__lede { color: var(--color-text-muted); }

/* Section labels are plain letter-spaced uppercase — no leading dash, no
   accent tick. Tracking and color do the whole job, which is how brokerage
   sites set them. */
.rule-eyebrow { display: inline-flex; align-items: center; }


/* ==========================================================================
   CARD — the site's single container object.
   COMMON REGION: surface + hairline defines the boundary.
   ========================================================================== */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--color-surface);
  border: var(--border-hair);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.card--lg { padding: clamp(var(--space-6), 3vw, var(--space-8)); }
.card--plain { background: transparent; border-color: transparent; padding-inline: 0; }
.card--sunk { background: var(--color-surface-sunk); }

.card--interactive:hover {
  border-color: var(--color-line-strong);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

/* Reserved for content that is genuinely a numbered sequence. Not applied to
   card sets, where a number encodes nothing the reader needs. */
.card__index {
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  color: var(--color-text-faint);
  font-variant-numeric: lining-nums tabular-nums;
}
.card__title { font-size: var(--fs-lg); }
.card__body { color: var(--color-text-muted); font-size: var(--fs-sm); line-height: var(--lh-relaxed); }
.card__foot { margin-block-start: auto; padding-block-start: var(--space-2); }


/* ==========================================================================
   STAT — credential figures.
   PROXIMITY: figure and label are 4px apart; stats are 32px apart. The pairs
   read as pairs with no dividers required.
   ========================================================================== */

.stat { display: flex; flex-direction: column; gap: var(--space-1); }
.stat__figure { font-size: var(--fs-2xl); font-weight: var(--fw-light); line-height: 1; letter-spacing: var(--ls-tightest); color: var(--color-text-strong); font-variant-numeric: lining-nums tabular-nums; }
.stat__label { font-size: var(--fs-2xs); letter-spacing: var(--ls-widest); text-transform: uppercase; color: var(--color-text-muted); }

/* Stat row, separated by hairlines rather than gaps.
   Flex rather than grid on purpose: an auto-fit grid leaves an empty cell
   whenever the count does not divide evenly, and an empty bordered cell reads
   as a mistake. Flex wrapping never produces one. */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  background: var(--color-surface);
  border: var(--border-hair);
}
.stat-row > .stat {
  flex: 1 1 10rem;
  padding: var(--space-6) var(--space-5);
  border-inline-start: var(--border-hair);
}
.stat-row > .stat:first-child { border-inline-start: 0; }


/* ==========================================================================
   DISCLOSURE — the progressive-disclosure primitive.
   Used for FAQ, for the approach panels, and for the footer groups on mobile.
   Native <details>: works with JS disabled, keyboard accessible by default.
   ========================================================================== */

.disclosure {
  border-block-end: var(--border-hair);
}
.disclosure:first-of-type { border-block-start: var(--border-hair); }

.disclosure__summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  width: 100%;
  min-height: var(--tap-target);
  padding-block: var(--space-5);
  cursor: pointer;
  list-style: none;
  color: var(--color-text-strong);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  line-height: var(--lh-snug);
  transition: color var(--dur-fast) var(--ease-out);
}
.disclosure__summary::-webkit-details-marker { display: none; }
.disclosure__summary:hover { color: var(--color-accent-strong); }

.disclosure__icon {
  position: relative;
  flex: none;
  width: 1rem;
  height: 1rem;
  margin-block-start: .35em;
}
.disclosure__icon::before,
.disclosure__icon::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: 1px;
  background: currentColor;
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
.disclosure__icon::after { transform: rotate(90deg); }
.disclosure[open] .disclosure__icon::after { transform: rotate(0deg); opacity: 0; }

.disclosure__panel {
  padding-block-end: var(--space-6);
  padding-inline-end: var(--space-8);
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  max-width: var(--measure);
}
.disclosure[open] .disclosure__panel {
  animation: disclose var(--dur-base) var(--ease-out) both;
}
@keyframes disclose {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}


/* ==========================================================================
   MEDIA SLOT — every image on the site sits in a ratio-locked frame.
   Empty slots render as labeled placeholders so the layout is never wrong
   while photography is outstanding.
   ========================================================================== */

.media {
  position: relative;
  overflow: hidden;
  background: var(--color-ground-alt);
  border-radius: var(--radius-md);
  aspect-ratio: var(--media-ratio, var(--ratio-landscape));
}
.media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.media--zoom:hover > img { transform: scale(1.03); }

.media--portrait { --media-ratio: var(--ratio-portrait); }
.media--square { --media-ratio: var(--ratio-square); }
.media--landscape { --media-ratio: var(--ratio-landscape); }
.media--wide { --media-ratio: var(--ratio-wide); }
.media--free { aspect-ratio: auto; }

.media__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-5);
  text-align: center;
  background:
    repeating-linear-gradient(
      135deg,
      var(--bone-200) 0 10px,
      var(--bone-100) 10px 20px
    );
  border: 1px dashed var(--color-line-strong);
  border-radius: inherit;
  /* Faint would be the obvious choice and it measured 3.21:1 on the striped
     ground. A placeholder still has to be readable — it is instructions for
     whoever is filling the slot. */
  color: var(--color-text-muted);
}
.media__placeholder-label { font-size: var(--fs-2xs); letter-spacing: var(--ls-widest); text-transform: uppercase; color: var(--ink-700); }
.media__placeholder-ratio { font-size: var(--fs-md); font-weight: var(--fw-light); color: var(--color-text-muted); }

.media__caption {
  margin-block-start: var(--space-3);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

/* Overlapping media pair — depth without a shadow. */
.media-pair { position: relative; }
.media-pair__back { --media-ratio: var(--ratio-portrait); }
.media-pair__front {
  --media-ratio: var(--ratio-square);
  position: absolute;
  width: 46%;
  right: calc(var(--space-6) * -1);
  bottom: calc(var(--space-7) * -1);
  border: var(--space-2) solid var(--color-ground);
  border-radius: var(--radius-md);
}
@media (max-width: 47.99rem) {
  .media-pair__front { position: static; width: 100%; margin-block-start: var(--space-4); border-width: 0; }
}


/* ==========================================================================
   TESTIMONIAL
   ========================================================================== */

.quote {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-6);
  background: var(--color-surface);
  border: var(--border-hair);
  border-radius: var(--radius-md);
  position: relative;
}
.quote__text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-md);
  line-height: var(--lh-snug);
  color: var(--color-text-strong);
}
.quote__attrib { margin-block-start: auto; display: flex; flex-direction: column; gap: var(--space-1); }
.quote__name { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--color-text-strong); }
.quote__meta { font-size: var(--fs-2xs); letter-spacing: var(--ls-wide); text-transform: uppercase; color: var(--color-text-muted); }


/* ==========================================================================
   FORM
   ========================================================================== */

.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field__label {
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.field__control {
  width: 100%;
  min-height: var(--control-height);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  color: var(--color-text-strong);
  border: var(--border-hair-strong);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.field__control::placeholder { color: var(--color-text-faint); }
.field__control:hover { border-color: var(--ink-400); }
.field__control:focus { border-color: var(--color-accent); }
textarea.field__control { min-height: 8rem; resize: vertical; line-height: var(--lh-relaxed); }
.field__hint { font-size: var(--fs-xs); color: var(--color-text-muted); }

/* Two-up field row that collapses to one column before it gets cramped. */
.field-row {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
}

select.field__control {
  appearance: none;
  padding-inline-end: var(--space-7);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% + 2px), calc(100% - 15px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}


/* ==========================================================================
   EMBEDDED FORM
   The frame is chromeless — the surrounding card supplies the common region,
   so the embed reads as part of the page rather than a bolted-on widget.
   ========================================================================== */

.embed-form { display: flex; flex-direction: column; gap: var(--space-5); }
/* The embed renders its own light UI. On the inverted contact band the card
   behind it has to be pinned to a literal light value — inside .is-inverse the
   semantic surface tokens have already been re-pointed to the dark ramp, so
   naming one here would paint the card black and leave the frame as a bright
   rectangle floating on it. This is also the page's single focal object: a lit
   panel on the one dark plane. */
.card--embed { background: var(--bone-050); border-color: var(--bone-200); }
.is-inverse .card--embed { border-color: transparent; }
.is-inverse .card--embed,
.is-inverse .card--embed .embed-form__title { color: var(--ink-900); }
.embed-form__title { margin: 0; }
.embed-form__frame {
  display: block;
  /* iOS ignores width:100% on an iframe; this pair is the standard fix. */
  width: 1px;
  min-width: 100%;
  max-width: 100%;
  height: 40rem;          /* first paint, before the frame reports its height */
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color-scheme: light;
  transition: height var(--dur-base) var(--ease-out);
}
@media (prefers-reduced-motion: reduce) {
  .embed-form__frame { transition: none; }
}


/* ==========================================================================
   BADGE / PILL
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent-soft);
  border: 1px solid var(--brass-200);
  border-radius: var(--radius-pill);
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--color-accent-strong);
}
.is-inverse .badge, .section--inverse .badge {
  background: rgba(198, 162, 101, .12);
  border-color: rgba(198, 162, 101, .3);
  color: var(--brass-400);
}


/* ==========================================================================
   REVEAL — entrance motion.
   COMMON FATE: children of one group share the curve and duration and differ
   only by --i * --motion-stagger. They read as one moving object.
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(var(--space-5));
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--motion-stagger));
}
.reveal.is-visible { opacity: 1; transform: none; }

/* No JS / reduced motion: content is simply present. */
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
