/*
 * Ethos R49 detail craft.
 * Restrained interaction and finishing layer for the existing homepage DOM.
 * The native pointer, approved hero media, copy, and document structure remain intact.
 */

body.home.ethos-detail-craft-ready {
  --ethos-detail-gold: var(--home-gold, #c9a96e);
  --ethos-detail-ink-2: var(--home-ink-2, #141414);
  --ethos-detail-hairline: rgba(201, 169, 110, 0.38);
  --ethos-detail-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Gold cursor ring. The browser's native cursor intentionally remains visible. */
.ethos-detail-cursor {
  align-items: center;
  border: 1px solid rgba(201, 169, 110, 0.78);
  border-radius: 999px;
  display: none;
  height: 10px;
  justify-content: center;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  transform: translate3d(var(--ethos-cursor-x, -100px), var(--ethos-cursor-y, -100px), 0) translate(-50%, -50%);
  transition:
    width 260ms var(--ethos-detail-ease),
    height 260ms var(--ethos-detail-ease),
    border-color 220ms ease,
    background-color 220ms ease,
    opacity 150ms ease;
  width: 10px;
  will-change: transform, width, height;
  z-index: 2147483000;
}

.ethos-detail-cursor.is-visible {
  opacity: 1;
}

html.ethos-home-intro-pending .ethos-detail-cursor,
html.ethos-page-arrival-pending .ethos-detail-cursor,
html.ethos-page-arrival-active .ethos-detail-cursor,
html.ethos-page-departure-active .ethos-detail-cursor {
  opacity: 0 !important;
}

.ethos-detail-cursor.is-expanded {
  background: rgba(10, 10, 10, 0.13);
  border-color: rgba(201, 169, 110, 0.96);
  height: 36px;
  width: 36px;
}

.ethos-detail-cursor.has-view-label {
  background: rgba(10, 10, 10, 0.2);
  height: 64px;
  width: 64px;
}

.ethos-detail-cursor__label {
  color: #fbfaf7;
  font-family: var(--font-sans, Inter, sans-serif);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3em;
  opacity: 0;
  padding-left: 0.2em;
  text-shadow: 0 1px 6px rgba(10, 10, 10, 0.68);
  transform: translateY(2px);
  transition: opacity 180ms ease, transform 220ms var(--ethos-detail-ease);
}

.ethos-detail-cursor.has-view-label .ethos-detail-cursor__label {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
  .ethos-detail-cursor {
    display: flex;
  }
}

/* Only one primary action inside the current viewport receives magnetism. */
@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
  body.home .ethos-detail-magnetic[data-ethos-magnetic-active="true"] {
    transform: translate3d(var(--ethos-magnet-x, 0px), var(--ethos-magnet-y, 0px), 0);
    transition:
      transform 180ms var(--ethos-detail-ease),
      background-color 250ms ease,
      border-color 250ms ease,
      color 250ms ease;
    will-change: transform;
  }
}

/* Link hairlines draw across rather than snapping on. */
body.home.ethos-detail-craft-ready .ethos-home-text-link::after {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 460ms var(--ethos-detail-ease);
}

/* Desktop navigation uses the same directional 300ms hairline language. */
@media (hover: hover) and (pointer: fine) {
  .desktop-navigation .primary-menu > li > a:not(.button)::after {
    opacity: 0.76;
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 300ms var(--ethos-detail-ease, cubic-bezier(0.22, 1, 0.36, 1));
  }

  .desktop-navigation .primary-menu > li > a:not(.button):hover::after,
  .desktop-navigation .primary-menu > li:focus-within > a:not(.button)::after,
  .desktop-navigation .primary-menu > .current-menu-item > a:not(.button)::after,
  .desktop-navigation .primary-menu > .current-menu-ancestor > a:not(.button)::after {
    transform: scaleX(1);
    transform-origin: left center;
  }
}

body.home.ethos-detail-craft-ready .ethos-home-text-link:hover::after,
body.home.ethos-detail-craft-ready .ethos-home-text-link:focus-visible::after,
body.home.ethos-detail-craft-ready .ethos-home-text-link:focus-within::after {
  transform: scaleX(1);
}

body.home.ethos-detail-craft-ready :where(
  .site-footer__markets > a,
  .site-footer .footer-links a,
  .site-footer__legal a,
  .ethos-home-review footer a
) {
  display: inline-block;
  position: relative;
}

body.home.ethos-detail-craft-ready :where(
  .site-footer__markets > a,
  .site-footer .footer-links a,
  .site-footer__legal a,
  .ethos-home-review footer a
)::after {
  background: currentColor;
  bottom: -5px;
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 420ms var(--ethos-detail-ease);
  width: 100%;
}

body.home.ethos-detail-craft-ready :where(
  .site-footer__markets > a,
  .site-footer .footer-links a,
  .site-footer__legal a,
  .ethos-home-review footer a
):is(:hover, :focus-visible)::after {
  transform: scaleX(1);
}

/* Static three-percent grain, limited to dark homepage surfaces. */
body.home.ethos-detail-craft-ready .ethos-home-markets,
body.home.ethos-detail-craft-ready .ethos-home-sell,
body.home.ethos-detail-craft-ready .ethos-home-close,
body.home.ethos-detail-craft-ready .site-footer {
  isolation: isolate;
  position: relative;
}

body.home.ethos-detail-craft-ready .ethos-home-hero__scrim {
  isolation: isolate;
}

body.home.ethos-detail-craft-ready .ethos-home-hero__scrim::after,
body.home.ethos-detail-craft-ready .ethos-home-markets::after,
body.home.ethos-detail-craft-ready .ethos-home-sell::after,
body.home.ethos-detail-craft-ready .ethos-home-close::after,
body.home.ethos-detail-craft-ready .site-footer::after {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
  content: "";
  inset: 0;
  opacity: 0.03;
  mix-blend-mode: overlay;
  pointer-events: none;
  position: absolute;
  z-index: 8;
}

/*
 * A shared editorial grade is applied only to lifestyle and Journal photography.
 * Advisor headshots, brand marks, logos, SVGs, and all map imagery are explicitly
 * outside these selectors and retain their established rendering.
 */
body.home.ethos-detail-craft-ready .ethos-home-lifestyle img {
  filter: saturate(0.92) contrast(1.04) brightness(0.99);
}

body.home.ethos-detail-craft-ready .ethos-home-lifestyle:is(:hover, :focus-within) img {
  filter: saturate(0.92) contrast(1.04) brightness(0.92);
}

body.home.ethos-detail-craft-ready .ethos-home-journal-card img {
  filter: saturate(0.92) contrast(1.04) brightness(0.99);
}

body.home.ethos-detail-craft-ready .ethos-home-journal-card:is(:hover, :focus-within) img {
  filter: saturate(0.92) contrast(1.04) brightness(0.99);
}

/* One restrained photographic grade across the site; people and brand art stay true. */
main img:not([src*="/agents/"]):not([src*="/brand/"]):not([src*="/maps/"]):not([data-advisor-image]),
main video {
  filter: saturate(0.92) contrast(1.04) brightness(0.99);
}

main :is(
  .agent-card,
  .agent-profile,
  .agent-related,
  .ethos-home-advisor,
  .ethos-advisor-hero,
  .ethos-properties-agent,
  .ethos-about-r47__leader,
  .leadership-card
) img,
main img[data-advisor-image] {
  filter: none !important;
}

body.home.ethos-detail-craft-ready .ethos-home-lifestyle picture {
  isolation: isolate;
}

body.home.ethos-detail-craft-ready .ethos-home-lifestyle picture::after {
  background: rgba(201, 169, 110, 0.05);
  content: "";
  inset: 0;
  mix-blend-mode: soft-light;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

/* Ethos Private becomes a full-width, quietly architectural door. */
body.home.ethos-detail-craft-ready .ethos-home-sell__grid {
  grid-template-columns: minmax(0, 1fr);
}

body.home.ethos-detail-craft-ready .ethos-home-sell__valuation {
  border-bottom: 1px solid var(--ethos-detail-hairline);
  border-right: 0;
}

body.home.ethos-detail-craft-ready .ethos-home-sell__private {
  align-items: center;
  align-self: stretch;
  background: var(--ethos-detail-ink-2);
  border-bottom: 1px solid var(--ethos-detail-hairline);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: clamp(28px, 5vw, 82px);
  grid-template-columns: minmax(190px, 0.48fr) minmax(300px, 1fr) auto;
  min-height: 250px;
  overflow: hidden;
  padding: clamp(62px, 6.5vw, 96px) clamp(98px, 9vw, 148px) clamp(62px, 6.5vw, 96px) clamp(36px, 6vw, 96px);
  position: relative;
}

body.home.ethos-detail-craft-ready .ethos-home-sell__private h3,
body.home.ethos-detail-craft-ready .ethos-home-sell__private p,
body.home.ethos-detail-craft-ready .ethos-home-sell__private .ethos-home-text-link {
  margin: 0;
}

body.home.ethos-detail-craft-ready .ethos-home-sell__private p {
  max-width: 720px;
}

body.home.ethos-detail-craft-ready .ethos-home-sell__private .ethos-home-text-link {
  justify-self: end;
  white-space: nowrap;
}

body.home.ethos-detail-craft-ready .ethos-home-sell__private::before {
  border: 1px solid rgba(201, 169, 110, 0.78);
  border-radius: 50%;
  content: "";
  height: 13px;
  position: absolute;
  right: clamp(38px, 4.5vw, 72px);
  top: calc(50% - 10px);
  width: 13px;
}

body.home.ethos-detail-craft-ready .ethos-home-sell__private::after {
  background: linear-gradient(180deg, rgba(201, 169, 110, 0.9), rgba(201, 169, 110, 0.48));
  clip-path: polygon(34% 0, 66% 0, 100% 100%, 0 100%);
  content: "";
  height: 13px;
  position: absolute;
  right: calc(clamp(38px, 4.5vw, 72px) + 4px);
  top: calc(50% + 2px);
  width: 5px;
}

body.home.ethos-detail-craft-ready .ethos-home-sell__private:hover,
body.home.ethos-detail-craft-ready .ethos-home-sell__private:focus-within {
  background: #1b1b1b;
  border-bottom-color: rgba(201, 169, 110, 0.72);
  border-top-color: rgba(201, 169, 110, 0.72);
}

/* Advisor portraits and name hairlines. Headshot grading itself remains untouched. */
@media (hover: hover) and (pointer: fine) {
  body.home.ethos-detail-craft-ready .ethos-home-advisor:is(:hover, :focus-within) .ethos-home-advisor__portrait img {
    transform: scale(1.04);
  }
}

body.home.ethos-detail-craft-ready .ethos-home-advisor__details > a:first-child strong {
  display: inline-block;
  padding-bottom: 7px;
  position: relative;
}

body.home.ethos-detail-craft-ready .ethos-home-advisor__details > a:first-child strong::after {
  background: var(--ethos-detail-gold);
  bottom: 0;
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 420ms var(--ethos-detail-ease);
  width: 100%;
}

body.home.ethos-detail-craft-ready .ethos-home-advisor__portrait img {
  transition: transform 500ms var(--ethos-detail-ease);
}

body.home.ethos-detail-craft-ready .ethos-home-advisor:is(:hover, :focus-within) .ethos-home-advisor__details > a:first-child strong::after {
  transform: scaleX(1);
}

/* Journal category and arrow details share one deliberate hover beat. */
body.home.ethos-detail-craft-ready .ethos-home-journal-card__meta {
  transition: color 280ms ease, letter-spacing 420ms var(--ethos-detail-ease);
}

body.home.ethos-detail-craft-ready .ethos-home-journal-card .ethos-home-text-link b {
  display: inline-block;
  transition: transform 420ms var(--ethos-detail-ease);
}

body.home.ethos-detail-craft-ready .ethos-home-journal-card:is(:hover, :focus-within) .ethos-home-journal-card__meta {
  color: rgba(143, 108, 53, 0.96);
  letter-spacing: 0.135em;
}

body.home.ethos-detail-craft-ready .ethos-home-journal-card:is(:hover, :focus-within) .ethos-home-text-link b {
  transform: translateX(4px);
}

/* The valuation input receives a single gold focus sweep. */
body.home.ethos-detail-craft-ready .ethos-home-sell__form {
  position: relative;
}

body.home.ethos-detail-craft-ready .ethos-home-sell__form::after {
  background: var(--ethos-detail-gold);
  bottom: -1px;
  content: "";
  height: 1px;
  left: 0;
  pointer-events: none;
  position: absolute;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 200ms var(--ethos-detail-ease);
  width: 100%;
}

body.home.ethos-detail-craft-ready .ethos-home-sell__form:focus-within::after {
  transform: scaleX(1);
}

/* Footer mark enters once when the footer reaches the viewport. */
.has-js body.home.ethos-detail-craft-ready .site-footer__logo.ethos-detail-footer-logo {
  opacity: 0.4;
  transform: translateY(16px);
  transition: opacity 720ms var(--ethos-detail-ease), transform 820ms var(--ethos-detail-ease);
}

.has-js body.home.ethos-detail-craft-ready .site-footer__logo.ethos-detail-footer-logo.is-ethos-detail-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1024px), (hover: none), (pointer: coarse) {
  .ethos-detail-cursor {
    display: none !important;
  }

  body.home .ethos-detail-magnetic {
    --ethos-magnet-x: 0px !important;
    --ethos-magnet-y: 0px !important;
    transform: none !important;
  }
}

@media (max-width: 820px) {
  body.home.ethos-detail-craft-ready .ethos-home-sell__private {
    display: block;
    min-height: 0;
    padding: 76px 72px 76px 18px;
  }

  body.home.ethos-detail-craft-ready .ethos-home-sell__private p,
  body.home.ethos-detail-craft-ready .ethos-home-sell__private .ethos-home-text-link {
    margin-top: 22px;
  }

  body.home.ethos-detail-craft-ready .ethos-home-sell__private .ethos-home-text-link {
    justify-self: auto;
    white-space: normal;
  }

  body.home.ethos-detail-craft-ready .ethos-home-sell__private::before {
    right: 26px;
  }

  body.home.ethos-detail-craft-ready .ethos-home-sell__private::after {
    right: 30px;
  }

  body.home.ethos-detail-craft-ready .ethos-home-sell__form::after {
    display: none;
  }

  body.home.ethos-detail-craft-ready .ethos-home-sell__form input:focus {
    border-bottom-color: var(--ethos-detail-gold);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ethos-detail-cursor {
    display: none !important;
  }

  body.home .ethos-detail-magnetic {
    --ethos-magnet-x: 0px !important;
    --ethos-magnet-y: 0px !important;
    transform: none !important;
  }

  body.home.ethos-detail-craft-ready .ethos-home-text-link::after,
  body.home.ethos-detail-craft-ready .ethos-home-advisor__details > a:first-child strong::after,
  body.home.ethos-detail-craft-ready .ethos-home-journal-card__meta,
  body.home.ethos-detail-craft-ready .ethos-home-journal-card .ethos-home-text-link b,
  body.home.ethos-detail-craft-ready .ethos-home-sell__form::after,
  .has-js body.home.ethos-detail-craft-ready .site-footer__logo.ethos-detail-footer-logo {
    transition: none !important;
  }

  .has-js body.home.ethos-detail-craft-ready .site-footer__logo.ethos-detail-footer-logo {
    opacity: 1;
    transform: none;
  }
}
