/* =========================================================
   MADINA PROPERTIES — Design tokens
   Palette: near-black ground, ivory type, brand burgundy, aged brass accent
   Type: Fraunces (display) + Inter (body/UI)
   ========================================================= */
:root {
    --ink:        #0b0b0c;
    --ink-2:      #141210;
    --panel:      #171513;
    --burgundy:   #5c1220;
    --burgundy-2: #3c0c15;
    --brass:      #b4915b;
    --brass-soft: #8a7455;
    --ivory:      #efe9dd;
    --ivory-dim:  #a89f8f;
    --hair:       rgba(239,233,221,0.14);

    --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
    --sans:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --container: 1240px;
    --gutter: clamp(20px, 5vw, 64px);
    --section-y: clamp(72px, 10vw, 160px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
    margin: 0;
    background: var(--ink);
    color: var(--ivory);
    font-family: var(--sans);
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.site-noise {
    position: fixed; inset: 0; pointer-events: none; z-index: 1;
    opacity: 0.035; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Type scale ---------- */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.6rem, 7vw, 5.4rem); line-height: 1.02; font-weight: 400; }
h2 { font-size: clamp(1.9rem, 4.4vw, 3.2rem); line-height: 1.1; }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
p { margin: 0 0 1em; color: var(--ivory-dim); }
.eyebrow {
    font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.32em;
    text-transform: uppercase; color: var(--brass); font-weight: 600;
}
.lede { font-size: clamp(1rem, 1.4vw, 1.2rem); color: var(--ivory-dim); max-width: 62ch; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section-y) 0; position: relative; }
.section--tight { padding: clamp(48px, 6vw, 90px) 0; }
.section--burgundy { background: linear-gradient(180deg, var(--burgundy-2), var(--burgundy) 45%, var(--burgundy-2)); }
.section--panel { background: var(--panel); }
.section--divider { border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }

.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.22em; text-transform: uppercase;
    font-weight: 600; padding: 16px 34px; border: 1px solid var(--brass);
    color: var(--ivory); background: transparent; cursor: pointer;
    transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}
.btn:hover { background: var(--brass); color: var(--ink); border-color: var(--brass); }
.btn--solid { background: var(--brass); color: var(--ink); }
.btn--solid:hover { background: var(--ivory); border-color: var(--ivory); }
.btn--light { border-color: rgba(239,233,221,0.5); }

/* ---------- Header / Nav ---------- */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: transparent;
    transition: background 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
    padding: 26px 0;
}
.site-header.is-scrolled {
    background: rgba(11,11,12,0.86);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 var(--hair);
    padding: 14px 0;
}
.header-inner {
    max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter);
    display: flex; align-items: center; justify-content: space-between;
}
.brand-mark {
    font-family: var(--serif); font-size: 1.5rem; letter-spacing: 0.06em; color: var(--ivory);
}
.brand-mark span { font-size: 0.85em; letter-spacing: 0.18em; }

.site-nav ul { list-style: none; display: flex; gap: clamp(18px, 2.6vw, 40px); margin: 0; padding: 0; }
.site-nav a {
    font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--ivory-dim); position: relative; padding-bottom: 6px;
}
.site-nav a::after {
    content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
    background: var(--brass); transition: width 0.3s ease;
}
.site-nav a:hover, .site-nav a.is-active { color: var(--ivory); }
.site-nav a:hover::after, .site-nav a.is-active::after { width: 100%; }

.nav-toggle {
    display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; z-index: 110; padding: 8px;
}
.nav-toggle span { width: 24px; height: 1px; background: var(--ivory); transition: transform 0.3s ease, opacity 0.3s ease; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
    min-height: 100svh; display: flex; align-items: center; justify-content: center;
    position: relative; text-align: center; overflow: hidden;
    background: var(--ink);
}
.hero-media {
    position: absolute; inset: 0; z-index: 0;
    background: radial-gradient(ellipse at center, #23201c 0%, #0b0b0c 78%);
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; animation: kenburns 26s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.09); } }
.hero::after {
    content: ''; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(180deg, rgba(11,11,12,0.35) 0%, rgba(11,11,12,0.15) 40%, rgba(11,11,12,0.92) 100%);
}
.hero-content { position: relative; z-index: 2; padding: 0 var(--gutter); }
.hero-content .brand-mark-xl {
    font-family: var(--serif); font-weight: 400; letter-spacing: 0.14em;
    font-size: clamp(3.2rem, 11vw, 8rem); color: var(--ivory);
    opacity: 0; animation: revealUp 1.2s ease 0.15s forwards;
}
.hero-locations {
    font-size: 0.78rem; letter-spacing: 0.4em; text-transform: uppercase; color: var(--brass); margin-top: 18px;
    opacity: 0; animation: revealUp 1.2s ease 0.45s forwards;
}
.hero-scroll {
    position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); z-index: 2;
    font-size: 0.68rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ivory-dim);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    opacity: 0; animation: revealUp 1.2s ease 0.9s forwards;
}
.hero-scroll .line { width: 1px; height: 40px; background: linear-gradient(var(--brass), transparent); animation: scrollLine 2.4s ease infinite; }
@keyframes scrollLine { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

@keyframes revealUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ---------- Intro statement ---------- */
.statement { text-align: center; max-width: 900px; margin: 0 auto; }
.statement h2 { margin: 18px 0 22px; }

/* ---------- Seal / signature marker ---------- */
.seal {
    width: 74px; height: 74px; margin: 0 auto 22px; position: relative;
    display: flex; align-items: center; justify-content: center;
}
.seal svg { width: 100%; height: 100%; }
.seal circle { fill: none; stroke: var(--brass); stroke-width: 1; }
.seal .seal-inner { stroke-dasharray: 2 6; }
.seal text { font-family: var(--serif); font-size: 34px; fill: var(--brass); }
.seal.is-spinning .seal-inner { animation: spin 40s linear infinite; transform-origin: 60px 60px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Locations strip ---------- */
.locations-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(24px, 6vw, 72px); margin-top: 50px; }
.location-item { text-align: center; position: relative; padding-top: 26px; }
.location-item::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 6px; height: 6px; border-radius: 50%; background: var(--brass);
    box-shadow: 0 0 0 6px rgba(180,145,91,0.15);
}
.location-item h4 { font-size: 1.1rem; }
.location-item span { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ivory-dim); }

/* ---------- Process (genuine sequence → roman numerals) ---------- */
.process { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hair); margin-top: 56px; }
.process-step { background: var(--ink); padding: 44px 36px; position: relative; }
.process-step .numeral { font-family: var(--serif); font-size: 3rem; color: var(--brass); opacity: 0.55; display: block; margin-bottom: 18px; }
.process-step h3 { margin-bottom: 12px; }
.process-step p { margin-bottom: 0; font-size: 0.94rem; }

/* ---------- Statement banner w/ CTA ---------- */
.banner {
    display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap;
}
.banner h2 { max-width: 640px; }
.banner-meta { display: flex; flex-direction: column; gap: 14px; min-width: 220px; }
.banner-meta .label { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass); }

/* ---------- Team grid ---------- */
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-top: 54px; background: var(--hair); }
.team-card { background: var(--ink); position: relative; overflow: hidden; aspect-ratio: 3/4; }
.team-card img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: transform 0.8s ease, filter 0.5s ease; }
.team-card:hover img { transform: scale(1.06); filter: grayscale(0.2) contrast(1.05); }
.team-card .team-caption {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 22px;
    background: linear-gradient(0deg, rgba(11,11,12,0.92), transparent);
    transform: translateY(8px); opacity: 0.92;
}
.team-caption .name { font-family: var(--serif); font-size: 1.05rem; }
.team-caption .role { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); }

/* ---------- Placeholder media block (until real images are dropped in) ---------- */
.ph {
    position: relative; background: linear-gradient(135deg, #201d19, #14120f);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.ph::before {
    content: ''; position: absolute; inset: 0;
    background-image: repeating-linear-gradient(45deg, rgba(180,145,91,0.05) 0 2px, transparent 2px 14px);
}
.ph-label {
    position: relative; z-index: 1; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--brass-soft); text-align: center; padding: 10px 16px; border: 1px dashed rgba(180,145,91,0.4);
}

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin-top: 54px; }
.gallery .ph { aspect-ratio: 3/4; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Pillars ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; margin-top: 56px; text-align: center; }
.pillar-word { font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.2rem); }

/* ---------- Difference band ---------- */
.difference-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.difference-quote { font-family: var(--serif); font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.35; }
.difference-media { aspect-ratio: 4/5; }

/* ---------- Signature division ---------- */
.signature-inner { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: center; }
.signature-media { aspect-ratio: 16/10; }
.signature-tag { font-style: italic; font-family: var(--serif); color: var(--ivory-dim); margin-top: 18px; }

/* ---------- Coming soon ---------- */
.coming-soon { text-align: center; padding: var(--section-y) 0; position: relative; }
.coming-soon .ph { aspect-ratio: 21/9; margin-top: 40px; }
.coming-soon h2 { letter-spacing: 0.06em; }

/* ---------- Developments / listing cards ---------- */
.dev-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; margin-top: 54px; }
.dev-card { background: var(--panel); border: 1px solid var(--hair); }
.dev-card .ph { aspect-ratio: 16/10; }
.dev-card-body { padding: 26px 28px 30px; }
.dev-card-body .tag { font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass); }
.dev-card-body h3 { margin: 10px 0 8px; }

/* ---------- Sales page ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: 56px; text-align: center; }
.stat-num { font-family: var(--serif); font-size: clamp(2rem, 4vw, 3rem); color: var(--brass); }
.stat-label { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ivory-dim); }

/* ---------- Contact page ---------- */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: start; }
.form-row { display: grid; gap: 22px; }
.field { position: relative; }
.field label {
    display: block; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ivory-dim); margin-bottom: 8px;
}
.field input, .field textarea {
    width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--hair);
    color: var(--ivory); font-family: var(--sans); font-size: 1rem; padding: 10px 2px;
    transition: border-color 0.3s ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brass); }
.field textarea { resize: vertical; min-height: 120px; }
.contact-info-list { display: grid; gap: 26px; margin-top: 30px; }
.contact-info-list .label { font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass); margin-bottom: 4px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-2); padding: var(--section-y) 0 40px; text-align: center; position: relative; border-top: 1px solid var(--hair); }
.footer-seal { display: flex; justify-content: center; margin-bottom: 20px; }
.seal-ring circle { fill: none; stroke: var(--brass); stroke-width: 1; }
.seal-ring text { font-family: var(--serif); font-size: 40px; fill: var(--brass); text-anchor: middle; }
.footer-hello { margin-bottom: 44px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; max-width: 900px; margin: 0 auto; text-align: left; }
.footer-label { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); margin-bottom: 6px; }
.footer-grid a:hover { color: var(--brass); }
.footer-note { max-width: 620px; margin: 40px auto 0; font-style: italic; font-family: var(--serif); color: var(--ivory-dim); }
.footer-bottom {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px;
    max-width: var(--container); margin: 60px auto 0; padding: 26px var(--gutter) 0; border-top: 1px solid var(--hair);
}
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; }
.footer-links a:hover { color: var(--brass); }
.footer-brand { font-family: var(--serif); font-size: 1.3rem; }
.footer-brand span { display: block; font-family: var(--sans); font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ivory-dim); margin-top: 4px; }
.footer-copy { font-size: 0.72rem; color: var(--ivory-dim); margin-top: 30px; padding: 0 var(--gutter); }

.back-to-top {
    position: fixed; right: 24px; bottom: 24px; z-index: 90;
    width: 44px; height: 44px; border: 1px solid var(--brass); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: var(--brass);
    background: rgba(11,11,12,0.7); backdrop-filter: blur(6px);
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease, transform 0.3s ease;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-4px); }

/* ---------- Page hero (interior pages) ---------- */
.page-hero {
    position: relative; padding: 200px 0 90px; overflow: hidden;
}
.page-hero .ph { position: absolute; inset: 0; z-index: 0; }
.page-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,11,12,0.4), var(--ink) 92%); z-index: 1; }
.page-hero-content { position: relative; z-index: 2; }
.page-hero h1 { font-size: clamp(2.2rem, 5.4vw, 3.6rem); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px) {
    .team-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery { grid-template-columns: repeat(2, 1fr); }
    .process { grid-template-columns: 1fr; }
    .pillars { grid-template-columns: 1fr; gap: 34px; }
    .difference-inner, .signature-inner, .contact-layout, .dev-grid { grid-template-columns: 1fr; }
    .difference-media, .signature-media { order: -1; }
    .stat-row { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    .nav-toggle { display: flex; }
    .site-nav {
        position: fixed; inset: 0; top: 0; z-index: 105;
        background: rgba(11,11,12,0.98); backdrop-filter: blur(12px);
        display: flex; align-items: center; justify-content: center;
        transform: translateY(-100%); transition: transform 0.45s ease;
    }
    .site-nav.is-open { transform: translateY(0); }
    .site-nav ul { flex-direction: column; text-align: center; gap: 28px; }
    .site-nav a { font-size: 1rem; }

    .banner { flex-direction: column; align-items: flex-start; }
    .team-grid, .gallery { grid-template-columns: repeat(2, 1fr); }
    .locations-strip { gap: 28px; }
    .stat-row { grid-template-columns: 1fr 1fr; gap: 20px; }
    .footer-bottom { flex-direction: column; text-align: center; justify-content: center; }
    .footer-links { justify-content: center; }
}

@media (max-width: 480px) {
    .team-grid, .gallery { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
}
