/* ═══════════════════════════════════════════════════════════
   DOMICILE — GLOBAL DESIGN TOKENS & BASE STYLES
   Premium Residency Consultancy
   Version 2.0 · May 2026
   ═══════════════════════════════════════════════════════════ */

/* ── GOOGLE FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,600&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&family=JetBrains+Mono:wght@300;400;500&display=swap');

/* ── DESIGN TOKENS ── */
:root {

    /* ── PRIMARY PALETTE ── */
    --midnight: #0D1B2A;
    --navy: #162436;
    --gold: #C9A84C;
    --gold-light: #E2C97E;
    --gold-dim: #8A6E30;
    --ivory: #F5F0E8;
    --parchment: #EDE8DF;
    --warm-white: #FAF8F4;
    --charcoal: #2C3E50;
    --slate: #4A5568;
    --mist: #8896A7;
    --ink: #1A2535;

    /* ── COUNTRY ACCENTS ── */
    --spain: #8B1A1A;
    --portugal: #1A4D2E;
    --italy: #8B3A1A;
    --greece: #1A3A6B;
    --china: #C0392B;

    /* ── FUNCTIONAL ── */
    --success: #2D6A4F;
    --warning: #E9C46A;
    --error: #D62839;

    /* ── FONT FAMILIES ── */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* ── TYPE SCALE ── */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;
    --text-hero: clamp(3.5rem, 9vw, 7rem);

    /* ── SPACING (8px unit) ── */
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-6: 48px;
    --space-8: 64px;
    --space-12: 96px;
    --space-16: 128px;

    /* ── LAYOUT ── */
    --page-margin: 80px;
    --page-margin-t: 48px;
    --page-margin-m: 20px;
    --content-max: 1200px;
    --text-max: 680px;
    --grid-gap: 24px;
    --section-pad: 96px;
    --section-pad-m: 64px;
    --border-radius: 2px;

    /* ── Z-INDEX SCALE ── */
    --z-base: 1;
    --z-nav: 100;
    --z-overlay: 200;
    --z-modal: 300;
    --z-toast: 400;
}

/* ── CSS RESET ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    color: var(--charcoal);
    background-color: var(--warm-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ── TYPOGRAPHY ── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.2;
    color: var(--ink);
}

h1 {
    font-size: var(--text-hero);
}

h2 {
    font-size: var(--text-5xl);
}

h3 {
    font-size: var(--text-4xl);
}

h4 {
    font-size: var(--text-3xl);
}

h5 {
    font-size: var(--text-2xl);
}

h6 {
    font-size: var(--text-xl);
}

p {
    max-width: var(--text-max);
    margin-bottom: var(--space-2);
}

.lead {
    font-weight: 300;
    font-size: var(--text-lg);
    color: var(--slate);
}

/* ── EYEBROW LABELS ── */
.eyebrow {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: var(--space-2);
    display: block;
}

.eyebrow--spain {
    color: var(--spain);
}

.eyebrow--portugal {
    color: var(--portugal);
}

.eyebrow--italy {
    color: var(--italy);
}

.eyebrow--greece {
    color: var(--greece);
}

.eyebrow--china {
    color: var(--china);
}

/* ── MONO DATA ── */
.mono {
    font-family: var(--font-mono);
}

.mono--lg {
    font-family: var(--font-mono);
    font-size: var(--text-xl);
    font-weight: 500;
}

/* ── LAYOUT ── */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--page-margin);
}

@media (max-width: 1024px) {
    .container {
        padding: 0 var(--page-margin-t);
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 var(--page-margin-m);
    }
}

.section {
    padding: var(--section-pad) 0;
}

@media (max-width: 640px) {
    .section {
        padding: var(--section-pad-m) 0;
    }
}

/* ── GOLD RULE ── */
.gold-rule {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, var(--gold), transparent);
    border: none;
    margin: var(--space-4) 0;
}

.gold-rule--center {
    background: linear-gradient(to right, transparent, var(--gold), transparent);
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: 14px 32px;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.05em;
    border-radius: var(--border-radius);
    transition: all 0.25s ease;
    min-height: 48px;
    cursor: pointer;
}

.btn--primary {
    background: var(--gold);
    color: var(--midnight);
}

.btn--primary:hover {
    background: var(--gold-light);
}

.btn--ghost {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
}

.btn--ghost:hover {
    background: var(--gold);
    color: var(--midnight);
}

.btn--ghost--china {
    border-color: var(--china);
    color: var(--china);
}

.btn--ghost--china:hover {
    background: var(--china);
    color: var(--ivory);
}

.btn--ivory {
    background: var(--ivory);
    color: var(--midnight);
}

.btn--ivory:hover {
    background: var(--warm-white);
}

.btn--large {
    padding: 18px 40px;
    font-size: var(--text-base);
    min-height: 56px;
}

.btn--full {
    width: 100%;
}

/* ── TEXT LINKS ── */
.text-link {
    color: var(--gold);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.text-link:hover {
    border-bottom-color: var(--gold);
}

/* ── CARDS ── */
.card {
    background: var(--warm-white);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: var(--border-radius);
    padding: var(--space-4);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}

.card--dark {
    background: var(--navy);
    border-color: rgba(201, 168, 76, 0.1);
}

.card--dark:hover {
    border-color: var(--gold);
}

.card--parchment {
    background: var(--parchment);
}

/* ── GOLD LEFT BORDER ── */
.gold-border {
    border-left: 2px solid var(--gold);
    padding-left: var(--space-3);
}

/* ── GRID SYSTEMS ── */
.grid {
    display: grid;
    gap: var(--grid-gap);
}

.grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .grid--2,
    .grid--3,
    .grid--4 {
        grid-template-columns: 1fr;
    }
}

/* ── UTILITY CLASSES ── */
.text-center {
    text-align: center;
}

.text-ivory {
    color: var(--ivory);
}

.text-gold {
    color: var(--gold);
}

.text-mist {
    color: var(--mist);
}

.text-slate {
    color: var(--slate);
}

.bg-midnight {
    background-color: var(--midnight);
}

.bg-parchment {
    background-color: var(--parchment);
}

.bg-warm-white {
    background-color: var(--warm-white);
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

/* ── LOGO ── */
.logo {
    display: block;
    height: 36px;
    width: auto;
}

/* ── TRUST STRIP ── */
.trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: center;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--mist);
    margin-top: var(--space-4);
}

.trust-strip--light {
    color: rgba(245, 240, 232, 0.35);
}

/* ── FORM ELEMENTS ── */
.form-group {
    margin-bottom: var(--space-3);
}

.form-label {
    display: block;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--charcoal);
    margin-bottom: var(--space-1);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: var(--border-radius);
    background: var(--warm-white);
    color: var(--charcoal);
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--gold);
}

.form-input::placeholder {
    color: var(--mist);
}

/* ── SECTION BACKGROUNDS ── */
.section--dark {
    background-color: var(--midnight);
    color: var(--ivory);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
    color: var(--ivory);
}

.section--parchment {
    background-color: var(--parchment);
}

.section--warm-white {
    background-color: var(--warm-white);
}

/* ── COUNTRY FLAG EMOJI ── */
.flag {
    font-size: 2rem;
    line-height: 1;
}

/* ── BADGE ── */
.badge {
    display: inline-block;
    padding: 4px 12px;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--border-radius);
    background: var(--gold);
    color: var(--midnight);
}

/* ── TESTIMONIAL ── */
.testimonial {
    border-left: 2px solid var(--gold);
    padding-left: var(--space-3);
}

.testimonial__quote {
    font-family: var(--font-display);
    font-style: italic;
    font-size: var(--text-lg);
    color: var(--charcoal);
    margin-bottom: var(--space-2);
}

.testimonial__author {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--mist);
}

/* ── FAQ ACCORDION ── */
.faq-item {
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: var(--space-3) 0;
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 500;
    color: var(--charcoal);
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question:hover {
    color: var(--gold);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding-bottom: var(--space-3);
    color: var(--slate);
}

/* ── PRICING CARD ── */
.pricing-card {
    background: var(--warm-white);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: var(--border-radius);
    padding: var(--space-6) var(--space-4);
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.pricing-card:hover {
    border-color: var(--gold);
    transform: translateY(-4px);
}

.pricing-card--featured {
    border-color: var(--gold);
    border-width: 2px;
}

.pricing-card__badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: var(--midnight);
    padding: 4px 16px;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: var(--border-radius);
}

.pricing-card__name {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 500;
    margin-bottom: var(--space-2);
}

.pricing-card__price {
    font-family: var(--font-mono);
    font-size: var(--text-4xl);
    font-weight: 500;
    color: var(--gold);
    margin-bottom: var(--space-4);
}

.pricing-card__features {
    list-style: none;
    text-align: left;
    margin-bottom: var(--space-4);
}

.pricing-card__features li {
    padding: var(--space-1) 0;
    font-size: var(--text-sm);
    color: var(--slate);
    display: flex;
    align-items: flex-start;
    gap: var(--space-1);
}

.pricing-card__features li::before {
    content: '✓';
    color: var(--success);
    font-weight: 600;
    flex-shrink: 0;
}

.pricing-card__note {
    font-size: var(--text-xs);
    color: var(--mist);
    margin-top: var(--space-2);
}

/* ── COUNTRY CARD ── */
.country-card {
    background: var(--navy);
    border-left: 3px solid var(--gold);
    padding: var(--space-4);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    cursor: pointer;
}

.country-card:hover {
    border-left-color: var(--gold-light);
    transform: translateY(-2px);
}

.country-card--spain {
    border-left-color: var(--spain);
}

.country-card--portugal {
    border-left-color: var(--portugal);
}

.country-card--italy {
    border-left-color: var(--italy);
}

.country-card--greece {
    border-left-color: var(--greece);
}

.country-card--china {
    border-left-color: var(--china);
}

.country-card__flag {
    font-size: 2rem;
    margin-bottom: var(--space-2);
}

.country-card__name {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 500;
    color: var(--ivory);
    margin-bottom: var(--space-2);
}

.country-card__facts {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--mist);
    margin-bottom: var(--space-2);
}

.country-card__link {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--gold);
    letter-spacing: 0.05em;
}

/* ── PROGRESS BAR ── */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(201, 168, 76, 0.1);
    z-index: var(--z-nav);
}

.progress-bar__fill {
    height: 100%;
    background: var(--gold);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-bar__label {
    position: fixed;
    top: 8px;
    right: var(--page-margin);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--gold);
    z-index: var(--z-nav);
}

/* ── NAVIGATION ── */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-nav);
    padding: var(--space-2) 0;
    transition: all 0.3s ease;
}

.site-nav--transparent {
    background: transparent;
}

.site-nav--solid {
    background: var(--midnight);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(201, 168, 76, 0.15);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--page-margin);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    list-style: none;
}

.nav-link {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ivory);
    position: relative;
    padding: var(--space-1) 0;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--gold);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-cta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.nav-cta__text {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ivory);
    transition: color 0.2s ease;
}

.nav-cta__text:hover {
    color: var(--gold);
}

/* Mobile nav */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: var(--space-1);
    position: relative;
    z-index: 100;
}

.nav-hamburger span {
    width: 24px;
    height: 2px;
    background: var(--ivory);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.nav-hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav Overlay */
.nav-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--midnight);
    z-index: calc(var(--z-nav) - 1);
    display: flex;
    flex-direction: column;
    padding: 120px var(--page-margin-m) 40px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    overflow-y: auto;
}

.nav-mobile.active {
    opacity: 1;
    visibility: visible;
}

.nav-mobile__links {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    list-style: none;
    margin-bottom: var(--space-8);
}

.nav-mobile__link {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    color: var(--ivory);
    transition: color 0.3s ease;
}

.nav-mobile__link:hover {
    color: var(--gold);
}

.nav-mobile__cta {
    margin-top: auto;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-hamburger {
        display: flex;
    }

    .nav-cta {
        display: none;
    }
}

/* ── FOOTER ── */
.site-footer {
    background: var(--midnight);
    color: var(--ivory);
    padding: var(--section-pad) 0 var(--space-4);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-col__title {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--gold);
    margin-bottom: var(--space-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.footer-col__link {
    display: block;
    font-size: var(--text-sm);
    color: var(--mist);
    padding: var(--space-1) 0;
    transition: color 0.2s ease;
}

.footer-col__link:hover {
    color: var(--gold);
}

.footer-bottom {
    border-top: 1px solid rgba(201, 168, 76, 0.1);
    padding-top: var(--space-4);
    text-align: center;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--mist);
}

/* ── AMBIENT RINGS (Hero decoration) ── */
.ambient-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(201, 168, 76, 0.08);
    pointer-events: none;
}

/* ── INSET BORDER (Hero frame) ── */
.hero-frame {
    position: relative;
}

.hero-frame::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    bottom: 24px;
    border: 1px solid rgba(201, 168, 76, 0.08);
    pointer-events: none;
    z-index: 0;
}

/* ── COUNTRY SEARCH RESULTS ── */
.country-result-item {
    padding: 12px 16px;
    cursor: pointer;
    color: var(--ivory);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    border-bottom: 1px solid rgba(201, 168, 76, 0.1);
    transition: background 0.2s ease, color 0.2s ease;
}

.country-result-item:hover {
    background: rgba(201, 168, 76, 0.15);
    color: var(--gold);
}

.country-result-item:last-child {
    border-bottom: none;
}

/* ── NOISE TEXTURE ── */
.noise-overlay {
    position: relative;
}

.noise-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}