/* ==========================================================================
   Legacy Wealth Advantage — Final
   Aesthetic: Warm Refined — light, premium, editorial with polish
   ========================================================================== */

/* --------------------------------------------------------------------------
   Variables
   -------------------------------------------------------------------------- */
:root {
    --c-primary: #0f172a;
    --c-primary-light: #1e293b;
    --c-gold: #b8860b;
    --c-gold-light: #d4a017;
    --c-gold-subtle: rgba(184, 134, 11, 0.1);
    --c-gold-glow: rgba(184, 134, 11, 0.06);

    --c-text: #1e293b;
    --c-text-body: #475569;
    --c-text-muted: #64748b;
    --c-text-light: #94a3b8;

    --c-bg: #ffffff;
    --c-bg-warm: #faf8f5;
    --c-bg-cream: #f5f0eb;
    --c-border: #e2e8f0;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --w-container: 1120px;
    --w-narrow: 720px;
    --w-form: 520px;

    --r-sm: 6px;
    --r-md: 12px;
    --r-lg: 20px;
    --r-xl: 28px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--c-text-body);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--c-gold-light); }
::selection { background: var(--c-gold-subtle); color: var(--c-primary); }
:focus-visible { outline: 2px solid var(--c-gold); outline-offset: 2px; }
ul { list-style: none; }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container { max-width: var(--w-container); margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: var(--w-narrow); }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 1rem 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    transition: background 0.3s, padding 0.3s, box-shadow 0.3s;
}
.header.scrolled {
    padding: 0.75rem 0;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 12px rgba(15, 23, 42, 0.06);
}
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
}
.logo-img { height: 36px; width: auto; }
.logo-text {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--c-primary);
    letter-spacing: -0.01em;
}
.header-cta {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--c-bg);
    background: var(--c-primary);
    padding: 0.5rem 1.25rem;
    border-radius: var(--r-sm);
    transition: all 0.2s var(--ease-out);
}
.header-cta:hover {
    background: var(--c-primary-light);
    color: var(--c-bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 5rem;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.88) 0%, rgba(255,255,255,0.7) 40%, rgba(255,255,255,0.5) 100%);
}

.hero-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}
@media (min-width: 768px) {
    .hero-layout {
        grid-template-columns: 1.3fr 1fr;
        gap: 4rem;
    }
}

.hero-content { text-align: center; }
@media (min-width: 768px) { .hero-content { text-align: left; } }

/* Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-gold);
    background: rgba(184, 134, 11, 0.08);
    border: 1px solid rgba(184, 134, 11, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    margin-bottom: 2rem;
}
.badge-dot {
    width: 6px; height: 6px;
    background: var(--c-gold);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Headline */
.hero-h1 {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 5.5vw, 3.75rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: var(--c-primary);
    margin-bottom: 1.25rem;
}
.hero-h1 .gold {
    color: var(--c-gold);
}

.hero-sub {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--c-text-muted);
    max-width: 440px;
    margin: 0 auto 2rem;
}
@media (min-width: 768px) { .hero-sub { margin: 0 0 2rem; } }

/* Hero CTA */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--c-bg);
    background: var(--c-primary);
    padding: 0.875rem 2rem;
    border-radius: var(--r-sm);
    transition: all 0.25s var(--ease-out);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.12);
}
.btn-primary:hover {
    color: var(--c-bg);
    background: var(--c-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}
.btn-primary svg { transition: transform 0.2s var(--ease-out); }
.btn-primary:hover svg { transform: translateX(3px); }

/* Headshot */
.hero-visual {
    display: flex;
    justify-content: center;
}
.headshot-container {
    position: relative;
    width: 240px; height: 240px;
}
@media (min-width: 768px) {
    .headshot-container { width: 300px; height: 300px; }
}
.headshot {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: var(--r-xl);
    position: relative;
    z-index: 2;
    box-shadow:
        0 20px 60px rgba(15, 23, 42, 0.12),
        0 4px 16px rgba(15, 23, 42, 0.06);
    background: linear-gradient(135deg, var(--c-bg-warm), var(--c-border));
}
.headshot-ring {
    position: absolute;
    inset: -10px;
    border-radius: calc(var(--r-xl) + 6px);
    border: 2px solid rgba(184, 134, 11, 0.2);
    z-index: 1;
    animation: ring-glow 3s ease-in-out infinite alternate;
}
@keyframes ring-glow {
    0% { border-color: rgba(184, 134, 11, 0.12); }
    100% { border-color: rgba(184, 134, 11, 0.3); }
}

/* --------------------------------------------------------------------------
   Story
   -------------------------------------------------------------------------- */
.story {
    padding: 5rem 0 4rem;
    background: var(--c-bg);
    position: relative;
}
.story::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--c-border), transparent);
}
.story-body { max-width: 600px; margin: 0 auto; }
.story-body p {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--c-text-body);
    margin-bottom: 1.25rem;
}
.story-lead {
    font-family: var(--font-display);
    font-size: 1.5rem !important;
    font-weight: 500;
    font-style: italic;
    color: var(--c-primary) !important;
    margin-bottom: 1.75rem !important;
    position: relative;
    padding-left: 1.5rem;
}
.story-lead::before {
    content: '';
    position: absolute;
    left: 0; top: 0.4rem;
    width: 3px; height: calc(100% - 0.8rem);
    background: linear-gradient(180deg, var(--c-gold) 0%, var(--c-gold-light) 100%);
    border-radius: 2px;
}
.story-bold {
    font-weight: 600;
    color: var(--c-primary) !important;
    margin-bottom: 0 !important;
}

/* --------------------------------------------------------------------------
   Expectations
   -------------------------------------------------------------------------- */
.expect {
    padding: 4rem 0 5rem;
    background: var(--c-bg-warm);
    position: relative;
}
.expect::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--c-border), transparent);
}
.section-heading {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--c-primary);
    text-align: center;
    margin-bottom: 2.5rem;
    letter-spacing: -0.02em;
}
.expect-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 600px) {
    .expect-grid { grid-template-columns: 1fr 1fr; }
}
.expect-card {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 1.75rem;
    transition: all 0.3s var(--ease-out);
}
.expect-card:hover {
    border-color: rgba(184, 134, 11, 0.3);
    box-shadow: 0 4px 24px rgba(184, 134, 11, 0.06);
    transform: translateY(-3px);
}
.expect-icon {
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-gold-subtle);
    color: var(--c-gold);
    border-radius: var(--r-sm);
    margin-bottom: 1rem;
}
.expect-card h3 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--c-primary);
    margin-bottom: 0.375rem;
}
.expect-card p {
    font-size: 0.875rem;
    color: var(--c-text-muted);
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */
.form-section {
    padding: 5rem 0 6rem;
    background: linear-gradient(180deg, var(--c-bg-warm) 0%, var(--c-bg) 100%);
    position: relative;
}
.form-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--c-border), transparent);
}
.form-card {
    max-width: var(--w-form);
    margin: 0 auto;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 40px rgba(15, 23, 42, 0.05);
    position: relative;
}
.form-card::before {
    content: '';
    position: absolute;
    top: -1px; left: 2rem; right: 2rem;
    height: 2px;
    background: linear-gradient(90deg, var(--c-gold), var(--c-gold-light), var(--c-gold));
    border-radius: 2px;
}
.form-header {
    text-align: center;
    margin-bottom: 2rem;
}
.form-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--c-primary);
    margin-bottom: 0.375rem;
    letter-spacing: -0.02em;
}
.form-sub {
    font-size: 0.9375rem;
    color: var(--c-text-muted);
}

/* Fields */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 480px) {
    .form-row { grid-template-columns: 1fr 1fr; }
}
.field { margin-bottom: 1rem; }
.field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--c-text);
    margin-bottom: 0.375rem;
}
.req { color: var(--c-gold); }
.opt { font-weight: 400; color: var(--c-text-light); }
.field input {
    width: 100%;
    padding: 0.75rem 0.875rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--c-text);
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder { color: var(--c-text-light); }
.field input:focus {
    outline: none;
    border-color: var(--c-gold);
    box-shadow: 0 0 0 3px var(--c-gold-subtle);
}
.field input.invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

/* Consent */
.consent-group {
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.check-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    position: relative;
}
.check-wrap input {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}
.checkmark {
    flex-shrink: 0;
    width: 18px; height: 18px;
    margin-top: 2px;
    border: 2px solid var(--c-border);
    border-radius: 4px;
    background: var(--c-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease-out);
}
.checkmark::after {
    content: '';
    width: 4px; height: 8px;
    border: solid var(--c-bg);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s var(--ease-spring);
}
.check-wrap input:checked + .checkmark {
    background: var(--c-gold);
    border-color: var(--c-gold);
}
.check-wrap input:checked + .checkmark::after {
    transform: rotate(45deg) scale(1);
}
.check-wrap input:focus-visible + .checkmark {
    box-shadow: 0 0 0 3px var(--c-gold-subtle);
}
.check-text {
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--c-text-muted);
}

/* Message frequency */
.msg-frequency {
    font-size: 0.75rem;
    color: var(--c-text-muted);
    text-align: center;
    margin-bottom: 0.5rem;
}

/* Legal */
.legal {
    font-size: 0.75rem;
    color: var(--c-text-muted);
    text-align: center;
    margin-bottom: 1.25rem;
}
.legal a { text-decoration: underline; text-underline-offset: 2px; }

/* Submit */
.btn-submit {
    width: 100%;
    padding: 0.875rem 2rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--c-bg);
    background: var(--c-primary);
    border: none;
    border-radius: var(--r-sm);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s var(--ease-out);
}
.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--c-gold) 0%, var(--c-gold-light) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}
.btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.15);
}
.btn-submit:hover:not(:disabled)::before { opacity: 1; }
.btn-submit:hover:not(:disabled) .btn-label { color: var(--c-primary); }
.btn-submit .btn-label {
    position: relative; z-index: 1;
    transition: color 0.3s;
}
.btn-submit:active:not(:disabled) { transform: translateY(0); }
.btn-submit:disabled { cursor: not-allowed; opacity: 0.6; }
.btn-spinner { display: none; }
.btn-submit.loading .btn-label { visibility: hidden; }
.btn-submit.loading .btn-spinner {
    display: block;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}
.btn-submit.loading .btn-spinner svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Success */
.success { text-align: center; padding: 2.5rem 0; }
.success[hidden] { display: none; }
.success-anim {
    margin: 0 auto 1.25rem;
    width: 56px; height: 56px;
    animation: pop-in 0.5s var(--ease-spring);
}
.success-path {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: draw-check 0.5s 0.3s ease-out forwards;
}
@keyframes pop-in {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes draw-check {
    to { stroke-dashoffset: 0; }
}
.success-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--c-primary);
    margin-bottom: 0.375rem;
}
.success-text { color: var(--c-text-muted); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
    background: var(--c-primary);
}
.footer-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 3.5rem 0 2.5rem;
}
@media (min-width: 640px) {
    .footer-top {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
}
.footer-heading {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--c-bg);
    margin-bottom: 1rem;
}
.footer-address {
    font-style: normal;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.footer-contact-link {
    font-size: 0.875rem;
    color: var(--c-text-light);
    text-decoration: none;
    transition: color 0.2s;
    line-height: 1.6;
}
a.footer-contact-link:hover { color: var(--c-bg); }
.footer-text {
    font-size: 0.875rem;
    color: var(--c-text-light);
    line-height: 1.6;
}
.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.footer-links a {
    font-size: 0.875rem;
    color: var(--c-text-light);
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--c-bg); }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5rem 0;
    text-align: center;
}
.copyright {
    font-size: 0.75rem;
    color: var(--c-text-light);
    opacity: 0.5;
}
.sep { color: var(--c-text-light); opacity: 0.4; }

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal {
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    background: var(--c-bg);
    border-radius: var(--r-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s var(--ease-out);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.15);
}
.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--c-border);
    flex-shrink: 0;
}
.modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--c-primary);
}
.modal-close {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-bg-warm);
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    font-size: 1.375rem;
    color: var(--c-text-muted);
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}
.modal-close:hover {
    background: var(--c-border);
    color: var(--c-primary);
}
.modal-body {
    padding: 2rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.modal-body .effective {
    font-size: 0.8125rem;
    color: var(--c-text-muted);
    margin-bottom: 2rem;
}
.modal-body h3 {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--c-primary);
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--c-border);
}
.modal-body h3:first-of-type { margin-top: 0; }
.modal-body h4 {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--c-text);
    margin: 1.5rem 0 0.5rem;
}
.modal-body p {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--c-text-body);
    margin-bottom: 0.75rem;
}
.modal-body strong { color: var(--c-text); }
.modal-body ul { margin: 0.5rem 0 1rem 1.25rem; list-style: disc; }
.modal-body li {
    font-size: 0.9375rem;
    color: var(--c-text-body);
    margin-bottom: 0.25rem;
    line-height: 1.6;
}
.modal-body a {
    color: var(--c-gold);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Reveal Animations
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
    .hero { min-height: auto; padding: 7rem 0 4rem; }
    .hero-layout { text-align: center; }
    .hero-sub { margin: 0 auto 2rem; }
    .headshot-container { width: 200px; height: 200px; }
    .form-card { padding: 2rem 1.5rem; }
}
@media (max-width: 479px) {
    .header-cta { display: none; }
    .hero-h1 { font-size: 2rem; }
    .form-card { padding: 1.75rem 1.25rem; }
    .modal-body { padding: 1.5rem; }
}

body.modal-open { overflow: hidden; }
