/* ============================================================================
   Apex Home Manufacturers — public theme
   Dark-luxury design system (charcoal + gold + serif) with a light variant.
   Loaded only on public/auth pages (via ThemeStyles), so admin keeps Tailwind.
   ============================================================================ */

/* ---- Tokens: dark (default) ---- */
:root {
    --apex-black: #0a0a0a;
    --apex-bg: #141414;
    --apex-surface: #1e1e1e;
    --apex-surface-2: #282828;
    --apex-surface-3: #333333;

    --apex-gold: #c9a84c;
    --apex-gold-light: #e2c278;
    --apex-gold-pale: #f5e9c8;
    --apex-gold-dim: rgba(201, 168, 76, 0.12);

    --apex-text: #f8f4ee;
    --apex-text-mid: #aaaaaa;
    --apex-text-dim: #888888;
    --apex-heading: #f8f4ee;

    --apex-border: rgba(201, 168, 76, 0.15);
    --apex-border-hard: rgba(201, 168, 76, 0.35);
    --apex-border-soft: rgba(255, 255, 255, 0.08);

    --apex-glass: rgba(20, 20, 20, 0.55);
    --apex-glass-border: rgba(255, 255, 255, 0.12);

    --apex-hero-scrim-1: rgba(10, 10, 10, 0.35);
    --apex-hero-scrim-2: rgba(10, 10, 10, 0.9);

    --apex-shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35), 0 1px 4px rgba(0, 0, 0, 0.2);
    --apex-shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    --apex-shadow-gold: 0 0 40px rgba(201, 168, 76, 0.18);

    --apex-radius-sm: 6px;
    --apex-radius-md: 12px;
    --apex-radius-lg: 20px;
    --apex-radius-xl: 32px;

    --apex-font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --apex-font-body: 'DM Sans', system-ui, -apple-system, sans-serif;

    --apex-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --apex-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --apex-nav-h: 88px;
    --apex-max: 1240px;
}

/* ---- Tokens: light ---- */
:root[data-theme='light'] {
    --apex-black: #ffffff;
    --apex-bg: #f5f1ea;
    --apex-surface: #ffffff;
    --apex-surface-2: #faf7f1;
    --apex-surface-3: #efe9dd;

    --apex-gold: #a8842f;
    --apex-gold-light: #c19b3d;
    --apex-gold-pale: #7a5f1f;
    --apex-gold-dim: rgba(168, 132, 47, 0.1);

    --apex-text: #1a1a1a;
    --apex-text-mid: #5f5a52;
    --apex-text-dim: #837c70;
    --apex-heading: #171717;

    --apex-border: rgba(168, 132, 47, 0.2);
    --apex-border-hard: rgba(168, 132, 47, 0.4);
    --apex-border-soft: rgba(20, 20, 20, 0.08);

    --apex-glass: rgba(255, 255, 255, 0.7);
    --apex-glass-border: rgba(20, 20, 20, 0.1);

    --apex-hero-scrim-1: rgba(20, 16, 8, 0.25);
    --apex-hero-scrim-2: rgba(20, 16, 8, 0.72);

    --apex-shadow-card: 0 4px 24px rgba(60, 50, 25, 0.1), 0 1px 3px rgba(60, 50, 25, 0.08);
    --apex-shadow-hover: 0 18px 46px rgba(60, 50, 25, 0.16), 0 4px 12px rgba(60, 50, 25, 0.1);
    --apex-shadow-gold: 0 0 40px rgba(168, 132, 47, 0.16);
}

/* ---- Base ---- */
body {
    background: var(--apex-bg);
    color: var(--apex-text);
    transition: background-color 0.4s var(--apex-ease), color 0.4s var(--apex-ease);
}
/* Anchor typography on the wrapper so it wins over Tailwind's body.font-sans. */
.apex,
.apex-auth {
    background: var(--apex-bg);
    color: var(--apex-text);
    font-family: var(--apex-font-body);
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
}
.apex input,
.apex select,
.apex textarea,
.apex button {
    font-family: var(--apex-font-body);
}
.apex * {
    box-sizing: border-box;
}
.apex a {
    color: inherit;
    text-decoration: none;
}
.apex img {
    max-width: 100%;
    display: block;
}
.apex h1, .apex h2, .apex h3, .apex h4, .apex h5 {
    font-family: var(--apex-font-display);
    color: var(--apex-heading);
    font-weight: 500;
    line-height: 1.08;
    margin: 0;
    letter-spacing: -0.01em;
}
.apex p {
    margin: 0;
}
.apex ::selection {
    background: var(--apex-gold);
    color: var(--apex-black);
}

/* ---- Layout primitives ---- */
.apex-container {
    width: 100%;
    max-width: var(--apex-max);
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 56px);
}
.apex-section {
    padding: clamp(64px, 9vw, 130px) 0;
    position: relative;
}
.apex-section--tight {
    padding: clamp(48px, 6vw, 84px) 0;
}
.apex-section--alt {
    background: var(--apex-surface);
}
.apex-section--black {
    background: var(--apex-black);
}
.apex-grid {
    display: grid;
    gap: clamp(20px, 2.4vw, 34px);
}
.apex-grid-2 { grid-template-columns: repeat(2, 1fr); }
.apex-grid-3 { grid-template-columns: repeat(3, 1fr); }
.apex-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 991px) {
    .apex-grid-3, .apex-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .apex-grid-2, .apex-grid-3, .apex-grid-4 { grid-template-columns: 1fr; }
}

/* ---- Typography helpers ---- */
.apex-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--apex-font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--apex-gold);
}
.apex-eyebrow::before {
    content: '';
    width: 28px;
    height: 1px;
    background: var(--apex-gold);
    opacity: 0.7;
}
.apex-eyebrow--plain::before { display: none; }
.apex-display {
    font-family: var(--apex-font-display);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.015em;
    color: var(--apex-heading);
    font-size: clamp(2.4rem, 5vw, 4.6rem);
}
.apex-display--sm { font-size: clamp(2rem, 3.6vw, 3.1rem); }
.apex-italic {
    font-style: italic;
    color: var(--apex-gold);
    font-weight: 500;
}
.apex-lead {
    color: var(--apex-text-mid);
    font-size: clamp(1rem, 1.2vw, 1.18rem);
    line-height: 1.7;
    max-width: 62ch;
}
.apex-gold { color: var(--apex-gold); }
.apex-muted { color: var(--apex-text-mid); }

/* ---- Buttons ---- */
.apex-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-family: var(--apex-font-body);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.03em;
    padding: 15px 30px;
    border-radius: var(--apex-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--apex-transition);
    white-space: nowrap;
    line-height: 1;
}
.apex-btn--gold {
    background: var(--apex-gold);
    color: #141414;
    box-shadow: var(--apex-shadow-gold);
}
.apex-btn--gold:hover {
    background: var(--apex-gold-light);
    transform: translateY(-2px);
}
.apex-btn--outline {
    background: transparent;
    color: var(--apex-text);
    border-color: var(--apex-border-hard);
}
.apex-btn--outline:hover {
    border-color: var(--apex-gold);
    color: var(--apex-gold);
}
.apex-btn--ghost {
    background: var(--apex-surface-2);
    color: var(--apex-text);
    border-color: var(--apex-border-soft);
}
.apex-btn--ghost:hover { border-color: var(--apex-gold); color: var(--apex-gold); }
.apex-btn--lg { padding: 18px 38px; font-size: 15px; }
.apex-btn--sm { padding: 11px 20px; font-size: 13px; }
.apex-link-gold {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--apex-gold);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.03em;
    transition: var(--apex-transition);
}
.apex-link-gold:hover { gap: 13px; color: var(--apex-gold-light); }

/* ---- Header / nav ---- */
.apex-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    transition: var(--apex-transition);
    border-bottom: 1px solid transparent;
}
.apex-header.is-solid {
    background: color-mix(in srgb, var(--apex-bg) 88%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom-color: var(--apex-border);
}
.apex-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--apex-nav-h);
    gap: 24px;
}
.apex-logo {
    font-family: var(--apex-font-display);
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--apex-heading);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
}
.apex-logo .apex-logo__mark { color: var(--apex-gold); }
.apex-logo img { height: 40px; width: auto; }
.apex-nav__links {
    display: flex;
    align-items: center;
    gap: 34px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.apex-nav__link {
    position: relative;
    font-size: 15px;
    font-weight: 500;
    color: var(--apex-text-mid);
    padding: 4px 0;
    transition: var(--apex-transition);
}
.apex-nav__link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0;
    height: 1.5px;
    background: var(--apex-gold);
    transition: width 0.3s var(--apex-ease);
}
.apex-nav__link:hover,
.apex-nav__link.is-active { color: var(--apex-text); }
.apex-nav__link:hover::after,
.apex-nav__link.is-active::after { width: 100%; }
.apex-nav__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.apex-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--apex-border-hard);
    background: transparent;
    color: var(--apex-text);
    cursor: pointer;
    transition: var(--apex-transition);
}
.apex-theme-toggle:hover { color: var(--apex-gold); border-color: var(--apex-gold); transform: rotate(12deg); }

/* Language switcher */
.apex-lang {
    position: relative;
    display: inline-flex;
}
.apex-lang__btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--apex-border-hard);
    background: transparent;
    color: var(--apex-text);
    font-family: var(--apex-font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: var(--apex-transition);
}
.apex-lang__btn:hover { color: var(--apex-gold); border-color: var(--apex-gold); }
.apex-lang__code { line-height: 1; }
.apex-lang__menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    margin: 0;
    padding: 8px;
    list-style: none;
    background: var(--apex-surface);
    border: 1px solid var(--apex-border-soft);
    border-radius: var(--apex-radius-md);
    box-shadow: var(--apex-shadow-hover);
    z-index: 200;
}
.apex-lang__option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: var(--apex-radius-sm);
    background: transparent;
    color: var(--apex-text);
    font-family: var(--apex-font-body);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s var(--apex-ease), color 0.2s var(--apex-ease);
}
.apex-lang__option:hover { background: var(--apex-surface-2); }
.apex-lang__option.is-active { color: var(--apex-gold); }
.apex-lang__native { font-weight: 600; }
.apex-lang__label { color: var(--apex-text-dim); font-size: 12px; }
.apex-lang__check { margin-left: auto; color: var(--apex-gold); }
/* Right-align the menu content when the page is in RTL mode. */
[dir='rtl'] .apex-lang__menu { right: auto; left: 0; }
[dir='rtl'] .apex-lang__option { text-align: right; }
[dir='rtl'] .apex-lang__check { margin-left: 0; margin-right: auto; }
.apex-signin {
    font-size: 14px;
    font-weight: 500;
    color: var(--apex-text-mid);
    transition: var(--apex-transition);
}
.apex-signin:hover { color: var(--apex-text); }

/* Burger + mobile menu */
.apex-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--apex-border-hard);
    border-radius: 50%;
    cursor: pointer;
}
.apex-burger span {
    display: block;
    width: 17px;
    height: 1.5px;
    margin: 0 auto;
    background: var(--apex-text);
    transition: var(--apex-transition);
}
.apex-burger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.apex-burger.is-open span:nth-child(2) { opacity: 0; }
.apex-burger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.apex-mobile {
    overflow: hidden;
    max-height: 0;
    background: var(--apex-bg);
    border-bottom: 1px solid transparent;
    transition: max-height 0.4s var(--apex-ease);
}
.apex-mobile.is-open {
    max-height: 460px;
    border-bottom-color: var(--apex-border);
}
.apex-mobile ul { list-style: none; margin: 0; padding: 10px clamp(20px, 5vw, 56px) 26px; }
.apex-mobile a {
    display: block;
    padding: 14px 0;
    font-size: 17px;
    color: var(--apex-text-mid);
    border-bottom: 1px solid var(--apex-border-soft);
    transition: var(--apex-transition);
}
.apex-mobile a:hover, .apex-mobile a.is-active { color: var(--apex-gold); padding-left: 6px; }

@media (max-width: 991px) {
    .apex-nav__links, .apex-signin, .apex-nav__actions .apex-btn { display: none; }
    .apex-burger { display: flex; }
}

/* ---- Hero ---- */
.apex-hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: var(--apex-black);
}
.apex-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.apex-hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    position: absolute;
    inset: 0;
    transition: opacity 1.6s var(--apex-ease);
    animation: apex-kenburns 18s ease-out infinite alternate;
}
.apex-hero__bg img.is-active { opacity: 1; }
.apex-hero__scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(to top, var(--apex-hero-scrim-2) 4%, var(--apex-hero-scrim-1) 55%, transparent 100%),
        linear-gradient(to right, var(--apex-hero-scrim-2) 0%, transparent 60%);
}
.apex-hero__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    padding-top: calc(var(--apex-nav-h) + 40px);
    padding-bottom: clamp(32px, 5vw, 64px);
}
.apex-hero__watermark {
    position: absolute;
    right: 3%;
    top: 30%;
    font-family: var(--apex-font-display);
    font-size: clamp(4rem, 12vw, 12rem);
    font-weight: 500;
    letter-spacing: 0.08em;
    color: transparent;
    -webkit-text-stroke: 1px rgba(248, 244, 238, 0.08);
    text-transform: uppercase;
    writing-mode: vertical-rl;
    z-index: 1;
    pointer-events: none;
}
.apex-hero__title {
    font-size: clamp(3rem, 9vw, 8rem);
    line-height: 0.95;
    margin: 22px 0 0;
    color: #fff;
}
[data-theme='light'] .apex-hero__title { color: #fff; }
.apex-hero__sub {
    color: rgba(248, 244, 238, 0.82);
    font-size: clamp(1rem, 1.4vw, 1.22rem);
    max-width: 46ch;
    margin: 26px 0 0;
    line-height: 1.7;
}
.apex-hero__eyebrow { color: var(--apex-gold-light); }

/* Inline hero search */
.apex-search {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr auto;
    gap: 2px;
    margin-top: clamp(28px, 4vw, 46px);
    padding: 10px;
    background: var(--apex-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--apex-glass-border);
    border-radius: var(--apex-radius-md);
    max-width: 900px;
}
.apex-search__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 20px;
    text-align: left;
    border-right: 1px solid var(--apex-border-soft);
}
.apex-search__field:last-of-type { border-right: none; }
.apex-search__label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--apex-gold-light);
}
.apex-search__field input,
.apex-search__field select {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--apex-font-body);
    font-size: 15px;
    font-weight: 500;
    width: 100%;
    padding: 0;
    cursor: pointer;
}
.apex-search__field input::placeholder { color: rgba(255, 255, 255, 0.5); }
.apex-search__field select option { background: #1e1e1e; color: #fff; }
.apex-search__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: var(--apex-gold);
    color: #141414;
    border: none;
    border-radius: var(--apex-radius-sm);
    font-family: var(--apex-font-body);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.03em;
    padding: 0 34px;
    margin: 4px;
    cursor: pointer;
    transition: var(--apex-transition);
}
.apex-search__submit:hover { background: var(--apex-gold-light); }
.apex-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
}
.apex-chips__label { color: rgba(248, 244, 238, 0.6); font-size: 13px; margin-right: 4px; }
.apex-chip {
    font-size: 13px;
    font-weight: 500;
    color: rgba(248, 244, 238, 0.85);
    padding: 7px 16px;
    border: 1px solid rgba(248, 244, 238, 0.22);
    border-radius: 40px;
    transition: var(--apex-transition);
    cursor: pointer;
}
.apex-chip:hover { background: var(--apex-gold); color: #141414; border-color: var(--apex-gold); }
.apex-scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(248, 244, 238, 0.55);
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}
.apex-scroll-cue span { width: 1px; height: 40px; background: linear-gradient(var(--apex-gold), transparent); animation: apex-scrollpulse 2s ease-in-out infinite; }

@media (max-width: 767px) {
    .apex-search { grid-template-columns: 1fr; }
    .apex-search__field { border-right: none; border-bottom: 1px solid var(--apex-border-soft); }
    .apex-search__submit { margin: 6px 4px 4px; padding: 15px; }
    .apex-hero__watermark { display: none; }
}

/* ---- Stats band ---- */
.apex-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    background: var(--apex-border);
    border: 1px solid var(--apex-border);
    border-radius: var(--apex-radius-md);
    overflow: hidden;
}
.apex-stat {
    background: var(--apex-surface);
    padding: 34px 26px;
    text-align: center;
}
.apex-stat__value {
    font-family: var(--apex-font-display);
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    font-weight: 600;
    color: var(--apex-gold);
    line-height: 1;
}
.apex-stat__label {
    margin-top: 8px;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--apex-text-mid);
}

/* ---- Two-column split (about / why not both / deliver) ---- */
.apex-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(32px, 5vw, 80px);
    align-items: center;
}
.apex-split--wide-left { grid-template-columns: 1.1fr 0.9fr; }
@media (max-width: 900px) { .apex-split, .apex-split--wide-left { grid-template-columns: 1fr; } }
.apex-figure {
    position: relative;
    border-radius: var(--apex-radius-lg);
    overflow: hidden;
    box-shadow: var(--apex-shadow-card);
}
.apex-figure img { width: 100%; height: 100%; object-fit: cover; }
.apex-figure--tall { aspect-ratio: 4 / 5; }
.apex-quote {
    font-family: var(--apex-font-display);
    font-style: italic;
    font-size: clamp(1.4rem, 2.4vw, 2.1rem);
    line-height: 1.35;
    color: var(--apex-heading);
    border-left: 2px solid var(--apex-gold);
    padding-left: 26px;
    margin: 34px 0 0;
}
.apex-quote cite {
    display: block;
    font-family: var(--apex-font-body);
    font-style: normal;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--apex-gold);
    margin-top: 18px;
}

/* ---- Feature / value cards ---- */
.apex-feature {
    background: var(--apex-surface);
    border: 1px solid var(--apex-border);
    border-radius: var(--apex-radius-md);
    padding: 36px 30px;
    transition: var(--apex-transition);
    height: 100%;
}
.apex-feature:hover {
    border-color: var(--apex-border-hard);
    transform: translateY(-4px);
    box-shadow: var(--apex-shadow-hover);
}
.apex-feature__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--apex-gold-dim);
    color: var(--apex-gold);
    margin-bottom: 22px;
}
.apex-feature__title {
    font-size: 1.5rem;
    margin-bottom: 10px;
}
.apex-feature__body { color: var(--apex-text-mid); font-size: 15px; line-height: 1.65; }
.apex-feature__num {
    font-family: var(--apex-font-display);
    font-size: 2.4rem;
    font-weight: 500;
    color: var(--apex-border-hard);
    line-height: 1;
    margin-bottom: 18px;
    display: block;
}

/* ---- Checklist ---- */
.apex-check {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--apex-border-soft);
    font-size: 16px;
    color: var(--apex-text);
}
.apex-check svg { color: var(--apex-gold); flex-shrink: 0; margin-top: 2px; }

/* ---- Property card ---- */
.apex-pcard {
    position: relative;
    border-radius: var(--apex-radius-md);
    overflow: hidden;
    background: var(--apex-surface);
    box-shadow: var(--apex-shadow-card);
    transition: var(--apex-transition);
    height: 100%;
}
.apex-pcard:hover { transform: translateY(-6px); box-shadow: var(--apex-shadow-hover); }
.apex-pcard__media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}
.apex-pcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--apex-ease); }
.apex-pcard:hover .apex-pcard__media img { transform: scale(1.06); }
.apex-pcard__badge {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 6px 13px;
    border-radius: 40px;
    background: rgba(10, 10, 10, 0.7);
    color: var(--apex-gold-light);
    backdrop-filter: blur(6px);
    border: 1px solid var(--apex-border);
}
.apex-pcard__badge.is-sold { color: #e8b4b4; border-color: rgba(220, 120, 120, 0.4); }
.apex-pcard__fav { position: absolute; top: 12px; right: 12px; z-index: 3; }
.apex-pcard__body { padding: 24px 24px 26px; }
.apex-pcard__type {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--apex-gold);
}
.apex-pcard__title {
    font-size: 1.5rem;
    margin: 8px 0 6px;
    line-height: 1.15;
}
.apex-pcard__title a:hover { color: var(--apex-gold); }
.apex-pcard__loc {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--apex-text-mid);
    font-size: 14px;
}
.apex-pcard__loc svg { color: var(--apex-gold); flex-shrink: 0; }
.apex-pcard__foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--apex-border-soft);
}
.apex-pcard__price {
    font-family: var(--apex-font-display);
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--apex-heading);
    line-height: 1;
}
.apex-pcard__down { display: block; font-family: var(--apex-font-body); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--apex-gold); margin-top: 5px; }
.apex-pcard__specs { display: flex; gap: 14px; color: var(--apex-text-mid); font-size: 13px; }
.apex-pcard__specs span { display: inline-flex; align-items: center; gap: 5px; }
.apex-pcard__specs svg { color: var(--apex-gold); }

/* ---- Category card ---- */
.apex-cat {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 200px;
    padding: 28px;
    border-radius: var(--apex-radius-md);
    background: var(--apex-surface);
    border: 1px solid var(--apex-border);
    overflow: hidden;
    transition: var(--apex-transition);
}
.apex-cat:hover { border-color: var(--apex-border-hard); transform: translateY(-4px); box-shadow: var(--apex-shadow-hover); }
.apex-cat__icon { color: var(--apex-gold); margin-bottom: auto; }
.apex-cat__name { font-size: 1.55rem; margin-top: 18px; }
.apex-cat__count { color: var(--apex-text-mid); font-size: 13px; letter-spacing: 0.06em; }

/* ---- FAQ ---- */
.apex-faq__group-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--apex-gold);
    margin-bottom: 8px;
}
.apex-faq__item {
    border-bottom: 1px solid var(--apex-border-soft);
}
.apex-faq__q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 22px 0;
    font-family: var(--apex-font-display);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--apex-heading);
    transition: var(--apex-transition);
}
.apex-faq__q:hover { color: var(--apex-gold); }
.apex-faq__q svg { flex-shrink: 0; color: var(--apex-gold); transition: transform 0.3s var(--apex-ease); }
.apex-faq__item.is-open .apex-faq__q svg { transform: rotate(45deg); }
.apex-faq__a {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s var(--apex-ease);
}
.apex-faq__item.is-open .apex-faq__a { max-height: 320px; }
.apex-faq__a p { color: var(--apex-text-mid); font-size: 15px; line-height: 1.7; padding-bottom: 24px; max-width: 68ch; }

/* ---- CTA band ---- */
.apex-cta {
    position: relative;
    text-align: center;
    padding: clamp(72px, 10vw, 140px) 0;
    background: var(--apex-black);
    overflow: hidden;
}
.apex-cta__glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 120%, var(--apex-gold-dim), transparent 60%);
    pointer-events: none;
}

/* ---- Footer ---- */
.apex-footer {
    background: var(--apex-black);
    border-top: 1px solid var(--apex-border);
    padding: clamp(56px, 7vw, 90px) 0 34px;
}
.apex-footer__grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 40px;
}
@media (max-width: 900px) { .apex-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .apex-footer__grid { grid-template-columns: 1fr; } }
.apex-footer__blurb { color: var(--apex-text-mid); font-size: 15px; line-height: 1.7; margin: 20px 0 22px; max-width: 40ch; }
.apex-footer__col-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--apex-gold);
    margin-bottom: 18px;
}
.apex-footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.apex-footer__col a, .apex-footer__col li { color: var(--apex-text-mid); font-size: 15px; transition: var(--apex-transition); }
.apex-footer__col a:hover { color: var(--apex-gold); }
.apex-footer__social { display: flex; gap: 18px; }
.apex-footer__social a { color: var(--apex-text-mid); font-weight: 600; letter-spacing: 0.04em; }
.apex-footer__social a:hover { color: var(--apex-gold); }
.apex-footer__bar {
    margin-top: 48px;
    padding-top: 26px;
    border-top: 1px solid var(--apex-border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--apex-text-dim);
    font-size: 13px;
}

/* ---- Chat / WhatsApp float ---- */
.apex-chat {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 300;
}
.apex-chat__bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--apex-gold);
    color: #141414;
    border: none;
    cursor: pointer;
    box-shadow: var(--apex-shadow-gold), 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: var(--apex-transition);
}
.apex-chat__bubble:hover { transform: scale(1.06); background: var(--apex-gold-light); }
.apex-chat__panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: 300px;
    background: var(--apex-surface);
    border: 1px solid var(--apex-border);
    border-radius: var(--apex-radius-md);
    box-shadow: var(--apex-shadow-hover);
    padding: 22px;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: var(--apex-transition);
}
.apex-chat__panel.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* Left-anchored variant (floating email button) */
.apex-chat--left { right: auto; left: 22px; }
.apex-chat--left .apex-chat__panel { right: auto; left: 0; }

/* Property enquiry CTA stack (WhatsApp + email) */
.apex-enquire { display: flex; flex-direction: column; gap: 12px; }
.apex-chat__title { font-family: var(--apex-font-display); font-size: 1.35rem; color: var(--apex-heading); }
.apex-chat__meta { color: var(--apex-text-mid); font-size: 13px; margin: 4px 0 16px; }

/* ---- Forms / fields ---- */
.apex-field { margin-bottom: 18px; }
.apex-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--apex-text-mid);
    margin-bottom: 8px;
}
.apex-input, .apex-select, .apex-textarea {
    width: 100%;
    background: var(--apex-surface-2);
    border: 1px solid var(--apex-border-soft);
    border-radius: var(--apex-radius-sm);
    color: var(--apex-text);
    font-family: var(--apex-font-body);
    font-size: 15px;
    padding: 13px 16px;
    outline: none;
    transition: var(--apex-transition);
}
.apex-input:focus, .apex-select:focus, .apex-textarea:focus { border-color: var(--apex-gold); background: var(--apex-surface); }
.apex-input::placeholder, .apex-textarea::placeholder { color: var(--apex-text-dim); }
.apex-select option { background: var(--apex-surface); color: var(--apex-text); }
.apex-textarea { resize: vertical; min-height: 120px; }

/* ---- Page head (interior pages) ---- */
.apex-pagehead {
    position: relative;
    padding-top: calc(var(--apex-nav-h) + clamp(48px, 8vw, 110px));
    padding-bottom: clamp(48px, 7vw, 90px);
    overflow: hidden;
    background: var(--apex-black);
}
.apex-pagehead__bg { position: absolute; inset: 0; z-index: 0; opacity: 0.35; }
.apex-pagehead__bg img { width: 100%; height: 100%; object-fit: cover; }
.apex-pagehead__scrim { position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, var(--apex-bg), transparent), linear-gradient(to right, rgba(10,10,10,0.6), transparent 70%); }
.apex-pagehead__inner { position: relative; z-index: 2; }

/* ---- Listings ---- */
.apex-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    background: var(--apex-surface);
    border: 1px solid var(--apex-border);
    border-radius: var(--apex-radius-md);
    padding: 16px;
}
.apex-filters .apex-input, .apex-filters .apex-select { width: auto; flex: 1 1 150px; min-width: 130px; margin: 0; padding: 11px 14px; }
.apex-filters .apex-input--search { flex: 2 1 220px; }
.apex-listing-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

/* Featured-homes slider (scroll-snap track + arrow nav) */
.apex-featured__actions {
    display: flex;
    align-items: center;
    gap: 18px;
}
.apex-featured__nav {
    display: flex;
    gap: 8px;
}
.apex-featured__btn {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid var(--apex-border-hard);
    background: transparent;
    color: var(--apex-text);
    cursor: pointer;
    transition: var(--apex-transition);
}
.apex-featured__btn:hover {
    background: var(--apex-gold);
    color: #141414;
    border-color: var(--apex-gold);
}
.apex-featured__track {
    display: flex;
    gap: clamp(20px, 2.4vw, 34px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    scrollbar-width: none;
}
.apex-featured__track::-webkit-scrollbar { display: none; }
.apex-featured__item {
    flex: 0 0 calc((100% - 2 * clamp(20px, 2.4vw, 34px)) / 3);
    min-width: 0;
    scroll-snap-align: start;
}
@media (max-width: 991px) {
    .apex-featured__item { flex-basis: calc((100% - clamp(20px, 2.4vw, 34px)) / 2); }
}
@media (max-width: 640px) {
    .apex-featured__item { flex-basis: 85%; }
}
[dir='rtl'] .apex-featured__track { direction: rtl; }
.apex-toggle {
    display: inline-flex;
    border: 1px solid var(--apex-border);
    border-radius: 40px;
    overflow: hidden;
}
.apex-toggle button {
    background: transparent;
    border: none;
    color: var(--apex-text-mid);
    padding: 9px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--apex-transition);
}
.apex-toggle button.is-active { background: var(--apex-gold); color: #141414; }
.apex-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 48px; flex-wrap: wrap; }
.apex-pagination a, .apex-pagination span {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: var(--apex-radius-sm);
    border: 1px solid var(--apex-border);
    color: var(--apex-text-mid);
    font-size: 14px;
    transition: var(--apex-transition);
}
.apex-pagination a:hover { border-color: var(--apex-gold); color: var(--apex-gold); }
.apex-pagination .is-current { background: var(--apex-gold); color: #141414; border-color: var(--apex-gold); }
.apex-pagination .is-disabled { opacity: 0.35; }

/* ---- Show page ---- */
.apex-showhero {
    position: relative;
    min-height: 82vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: var(--apex-black);
}
.apex-showhero__bg { position: absolute; inset: 0; z-index: 0; }
.apex-showhero__bg img { width: 100%; height: 100%; object-fit: cover; }
.apex-showhero__scrim { position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(10,10,10,0.94), rgba(10,10,10,0.2) 60%, rgba(10,10,10,0.4)); }
.apex-showhero__inner { position: relative; z-index: 2; padding-bottom: clamp(36px, 5vw, 64px); padding-top: calc(var(--apex-nav-h) + 30px); }
.apex-spec-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1px;
    background: var(--apex-border);
    border-block: 1px solid var(--apex-border);
}
@media (max-width: 767px) { .apex-spec-strip { grid-template-columns: repeat(3, 1fr); } }
.apex-spec { background: var(--apex-bg); padding: 24px 18px; text-align: center; }
.apex-spec__label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--apex-text-dim); }
.apex-spec__value { font-family: var(--apex-font-display); font-size: 1.6rem; color: var(--apex-heading); margin-top: 4px; }
.apex-sidebar {
    position: sticky;
    top: calc(var(--apex-nav-h) + 20px);
    background: var(--apex-surface);
    border: 1px solid var(--apex-border);
    border-radius: var(--apex-radius-lg);
    padding: 30px;
    box-shadow: var(--apex-shadow-card);
}
.apex-amenity {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    color: var(--apex-text);
    font-size: 15px;
    border-bottom: 1px solid var(--apex-border-soft);
}
.apex-amenity svg { color: var(--apex-gold); }
.apex-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.apex-gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--apex-radius-sm); cursor: pointer; transition: var(--apex-transition); }
.apex-gallery img:hover { opacity: 0.85; }
@media (max-width: 640px) { .apex-gallery { grid-template-columns: repeat(2, 1fr); } }

/* Mobile gallery carousel (swipeable, scroll-snap) */
.apex-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    scrollbar-width: none;
}
.apex-carousel::-webkit-scrollbar { display: none; }
.apex-carousel img {
    flex: 0 0 85%;
    min-width: 0;
    scroll-snap-align: start;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--apex-radius-md);
}
.apex-sidebar--static { position: static; top: auto; }

/* Show-page mobile block vs desktop aside/gallery visibility */
.apex-show-mobile { display: none; }
@media (max-width: 900px) {
    .apex-show-mobile { display: block; margin-top: 28px; }
    .apex-show-aside { display: none; }
    .apex-gallery-block { display: none; }
}

/* ---- Auth split ---- */
.apex-auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
@media (max-width: 900px) { .apex-auth { grid-template-columns: 1fr; } }
.apex-auth__visual { position: relative; overflow: hidden; background: var(--apex-black); }
.apex-auth__visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
.apex-auth__visual-inner { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; background: linear-gradient(to top, rgba(10,10,10,0.85), transparent); }
@media (max-width: 900px) { .apex-auth__visual { display: none; } }
.apex-auth__form { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--apex-bg); }
.apex-auth__form-inner { width: 100%; max-width: 420px; }
.apex-auth__mobile-logo { display: none; }
@media (max-width: 900px) { .apex-auth__mobile-logo { display: block; } }
.apex-auth-title { font-family: var(--apex-font-display); font-size: clamp(2.2rem, 4vw, 2.9rem); font-weight: 500; color: var(--apex-heading); margin: 14px 0 8px; }
.apex-auth-sub { color: var(--apex-text-mid); font-size: 15px; margin-bottom: 30px; }
.apex-checkbox { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--apex-text-mid); cursor: pointer; }
.apex-checkbox input { accent-color: var(--apex-gold); width: 16px; height: 16px; }
.apex-err { margin: 6px 0 0; font-size: 12px; color: #e07a7a; }
.apex-link-underline { color: var(--apex-gold); font-weight: 500; }
.apex-link-underline:hover { color: var(--apex-gold-light); }

/* ---- Motion keyframes ---- */
@keyframes apex-kenburns {
    from { transform: scale(1.05); }
    to { transform: scale(1.16); }
}
@keyframes apex-scrollpulse {
    0%, 100% { transform: scaleY(1); opacity: 0.4; }
    50% { transform: scaleY(0.5); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .apex *, .apex *::before, .apex *::after { animation: none !important; }
    .apex-hero__bg img { animation: none; }
    .apex [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ---- Sold-homes slideshow ("Homes We've Placed") ---- */
.apex-sold__head {
    text-align: center;
    margin-bottom: clamp(32px, 4vw, 52px);
}
.apex-sold__head .apex-eyebrow { justify-content: center; }
.apex-sold {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}
.apex-sold__stage {
    position: relative;
    aspect-ratio: 3 / 2;
    border-radius: var(--apex-radius-lg);
    overflow: hidden;
    background: var(--apex-surface-2);
    box-shadow: var(--apex-shadow-card);
}
@media (max-width: 640px) {
    .apex-sold__stage { aspect-ratio: 4 / 5; }
}
.apex-sold__slide {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.04);
    transition: opacity 0.7s var(--apex-ease), transform 0.9s var(--apex-ease),
        visibility 0s linear 0.7s;
}
.apex-sold__slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: opacity 0.7s var(--apex-ease), transform 0.9s var(--apex-ease);
}
.apex-sold__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.apex-sold__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: clamp(24px, 4vw, 44px) clamp(24px, 4vw, 44px) clamp(20px, 3vw, 36px);
    background: linear-gradient(to top, rgba(10, 10, 10, 0.9) 8%, rgba(10, 10, 10, 0) 100%);
    color: #f8f4ee;
}
.apex-sold__tag {
    font-family: var(--apex-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #141414;
    background: var(--apex-gold);
    padding: 5px 12px;
    border-radius: 999px;
}
.apex-sold__location {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    color: #e9e2d6;
}
.apex-sold__amount {
    font-family: var(--apex-font-display);
    font-weight: 600;
    line-height: 1;
    font-size: clamp(2rem, 4vw, 3.2rem);
    color: #f8f4ee;
}
.apex-sold__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    font-size: 30px;
    line-height: 1;
    color: #f8f4ee;
    background: var(--apex-glass);
    border: 1px solid var(--apex-glass-border);
    border-radius: 999px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: var(--apex-transition);
    z-index: 2;
}
.apex-sold__nav:hover {
    background: var(--apex-gold);
    color: #141414;
    border-color: var(--apex-gold);
}
.apex-sold__nav--prev { left: clamp(12px, 2vw, 22px); }
.apex-sold__nav--next { right: clamp(12px, 2vw, 22px); }
.apex-sold__dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
}
.apex-sold__dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--apex-border-hard);
    cursor: pointer;
    transition: var(--apex-transition);
}
.apex-sold__dot.is-active {
    background: var(--apex-gold);
    width: 26px;
}
@media (max-width: 640px) {
    .apex-sold__nav { width: 42px; height: 42px; font-size: 24px; }
}
