/* =========================================================================
   MA Asset Intelligence — Editorial Noir (Mockup A)
   Dark ink palette, Cormorant Garamond + IBM Plex Mono.
   Layout/spacing live inline in the markup; this file holds tokens,
   animations, hover states, transitions and the responsive layer.
   ========================================================================= */

:root {
  --ink:  #0C0F12;
  --ink2: #13171B;
  --ink3: #0A0D10;
  --gold: #C9A86A;
  --gold2: #E7C98F;
  --gold-hover: #D9BD84;
  --cream: #E6E3DC;
  --cream2: #F2EFE8;
  --mut: #9CA09B;
  --mut2: #8C928D;
  --border-gold: rgba(231,201,143,.14);
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:  'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono:  'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* Legacy aliases kept so existing inline styles still resolve */
  --creme-page: #EDE7DD;
  --creme-card: #F5F1E9;
  --charcoal: #15191D;
  --charcoal-panel: #0F1317;
  --charcoal-footer: #0C0F12;
  --on-dark: #E6E3DC;
  --on-dark-muted: #99A0A4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.65;
}
img { max-width: 100%; display: block; }

/* Content container — mirrors mockup .x */
.x {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 clamp(28px, 5vw, 104px);
}

/* Section padding rhythm */
.sec { padding: clamp(64px, 8vw, 140px) 0; }

/* Eyebrow rule line */
.eyebrow-row { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.eyebrow-row::after { content: ""; flex: 1; height: 1px; background: var(--border-gold); }

/* Kicker label */
.kick {
  font-family: var(--mono);
  font-size: clamp(10px, .85vw, 12px);
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Dark card */
.card {
  background: var(--ink2);
  border: 1px solid var(--border-gold);
}

/* Accessibility skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink2); color: var(--cream);
  padding: 10px 16px; font-size: 12px;
}
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1);
}
.reveal.in { opacity: 1; transform: none; }

/* ---- Staggered group reveal (children cascade in sequence) ---- */
.reveal.stagger { transform: none; }            /* parent only fades; children move */
.reveal.stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1);
}
.reveal.stagger.in > * { opacity: 1; transform: none; }
.reveal.stagger.in > *:nth-child(1) { transition-delay: 0s; }
.reveal.stagger.in > *:nth-child(2) { transition-delay: .09s; }
.reveal.stagger.in > *:nth-child(3) { transition-delay: .18s; }
.reveal.stagger.in > *:nth-child(4) { transition-delay: .27s; }
.reveal.stagger.in > *:nth-child(5) { transition-delay: .36s; }
.reveal.stagger.in > *:nth-child(6) { transition-delay: .45s; }
.reveal.stagger.in > *:nth-child(7) { transition-delay: .54s; }
.reveal.stagger.in > *:nth-child(8) { transition-delay: .63s; }

/* ---- Hero entrance (staggered fade-up on load) ---- */
.hero-reveal > * { animation: heroUp .95s cubic-bezier(.2,.7,.2,1) both; }
.hero-reveal > *:nth-child(1) { animation-delay: .15s; }
.hero-reveal > *:nth-child(2) { animation-delay: .28s; }
.hero-reveal > *:nth-child(3) { animation-delay: .44s; }
.hero-reveal > *:nth-child(4) { animation-delay: .60s; }
@keyframes heroUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal.stagger > *,
  .reveal.stagger.in > * { transition: none; opacity: 1; transform: none; }
  .hero-reveal > * { animation: none; }
}

/* ---- Ken Burns hero ---- */
@keyframes kb {
  from { transform: scale(1.03) translate(0, 0); }
  to   { transform: scale(1.17) translate(-1.5%, -2.5%); }
}
.kb { animation: kb 24s ease-in-out infinite alternate; }

/* ---- Header ---- */
.hdr {
  transition: background .35s ease, box-shadow .35s ease, backdrop-filter .35s ease;
}
.hdr.scrolled {
  background: rgba(12, 15, 18, .94) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--border-gold);
}

/* Nav links (on transparent/dark header) */
.navlink {
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: #D8D9D4; text-decoration: none; transition: color .2s ease;
}
.navlink:hover { color: var(--gold2); }

.lang-switch a.lang { color: #8A9095; text-decoration: none; padding: 0 2px; font-weight: 400; transition: color .2s ease; }
.lang-switch a.lang.active { color: var(--cream2); font-weight: 700; }
.lang-switch a.lang:hover { color: var(--gold2); }

/* Buttons — mockup A style */
.btn-gold {
  display: inline-block;
  background: var(--gold); color: var(--ink); border: 1px solid var(--gold);
  padding: 17px 34px; font-family: var(--mono); font-size: 13px;
  letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
  transition: background .25s, border-color .25s, color .25s;
}
.btn-gold:hover { background: var(--gold2); border-color: var(--gold2); }

.btn-ghost {
  display: inline-block;
  background: none; color: var(--cream2); border: 1px solid rgba(237,231,221,.45);
  padding: 17px 34px; font-family: var(--mono); font-size: 13px;
  letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
  transition: background .25s, color .25s;
}
.btn-ghost:hover { background: var(--cream2); color: var(--ink); }

.btn-outline-gold {
  display: inline-block;
  background: none; color: var(--gold2); border: 1px solid var(--gold2);
  padding: 11px 22px; font-family: var(--mono); font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
  transition: background .2s, color .2s;
}
.btn-outline-gold:hover { background: var(--gold2); color: var(--ink); }

/* Legacy button classes */
.btn-dark { transition: background .2s ease; }
.btn-dark:hover { background: #2A3036 !important; }
.btn-outline-light { transition: background .2s ease; }
.btn-outline-light:hover { background: rgba(237,231,221,.18) !important; }

/* ---- Inputs ---- */
.cf-input {
  width: 100%;
  background: var(--ink);
  border: 1px solid rgba(231,201,143,.22);
  color: var(--cream);
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .25s ease;
}
.cf-input:focus { border-color: var(--gold2); }
.cf-input::placeholder, textarea::placeholder { color: #6E7479; }

/* ---- Lightbox ---- */
.lb {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 12, 15, .93);
  display: flex; align-items: center; justify-content: center;
  padding: 56px; cursor: zoom-out;
  transition: opacity .3s ease;
}
.lb[hidden] { display: none; }

/* ---- FAQ ---- */
.faq-body { overflow: hidden; transition: max-height .45s ease, opacity .35s ease; }
.faq-q .faq-icon { display: inline-block; }
.faq-item.open .faq-icon { transform: rotate(45deg); }

/* ---- Service cards ---- */
.svc-card {
  background: var(--ink2);
  border: 1px solid var(--border-gold);
  transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
}
.svc-card:hover {
  border-color: rgba(231,201,143,.45);
  box-shadow: 0 16px 44px rgba(0,0,0,.3);
  transform: translateY(-4px);
}

/* ---- Off-market tiles ---- */
.om-tile { transition: background .3s ease; }
.om-tile:hover { background: #1C2127; }

/* ---- Partner section ---- */
.net-cta { transition: color .2s ease; }
.net-cta:hover { color: var(--cream2); }

/* ---- Contact links ---- */
.mail-link:hover { color: var(--cream2); }
.wa-link { transition: background .2s ease, border-color .2s ease, color .2s ease; }
.wa-link:hover { border-color: var(--gold2); background: var(--gold2); color: var(--ink); }

/* ---- Footer links ---- */
.foot-link { color: var(--mut); text-decoration: none; transition: color .2s ease; }
.foot-link:hover { color: var(--gold2); }

/* ---- Stepper (dark theme) ---- */
.step-dot {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 13px;
  border: 1px solid rgba(231,201,143,.25);
  background: var(--ink2); color: var(--mut);
  transition: all .3s ease; position: relative; z-index: 1;
}
.step-label {
  font-size: 12.5px; letter-spacing: .04em; text-align: center;
  max-width: 150px; line-height: 1.4; color: var(--mut2);
  transition: color .3s ease;
}
.step-btn.done .step-dot { border-color: rgba(231,201,143,.5); background: var(--ink3); color: var(--gold); }
.step-btn.active .step-dot { border-color: var(--gold); background: var(--gold); color: var(--ink); }
.step-btn.active .step-label { color: var(--cream2); font-weight: 600; }

/* ---- Portfolio chips ---- */
.chip {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); border: 1px solid rgba(231,201,143,.4);
  padding: 5px 11px; cursor: pointer;
  background: none;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.chip:hover { border-color: var(--gold2); background: rgba(231,201,143,.08); }
.chip.active { border-color: var(--gold); background: var(--gold); color: var(--ink); }

/* ---- Portfolio grid ---- */
.pf-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.pf-card { background: var(--ink2); overflow: hidden; display: flex; flex-direction: column; }
.pf-card[hidden] { display: none; }
.pf-card-img { position: relative; overflow: hidden; }
.pf-card-img img { width: 100%; height: 220px; object-fit: cover; display: block; transition: transform .6s ease; }
.pf-card:hover .pf-card-img img { transform: scale(1.04); }
.pf-card-lock { position: absolute; inset: 0; background: linear-gradient(180deg,rgba(12,15,18,.35),rgba(12,15,18,.78)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.pf-card-body { padding: 22px 26px 28px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.pf-badge { display: inline-block; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; padding: 4px 10px; font-family: var(--mono); align-self: flex-start; }
.pf-badge--on    { color: var(--cream2); border: 1px solid rgba(231,201,143,.4); }
.pf-badge--proj  { color: var(--gold);   border: 1px solid rgba(201,168,106,.6); }
.pf-badge--vault { color: var(--ink);    background: var(--gold); }
.pf-card-title { font-family: 'Cormorant Garamond', serif; font-weight: 400; font-size: clamp(18px, 1.4vw, 24px); line-height: 1.15; color: #ECE9E2; margin: 0; }
.pf-card-desc { font-size: 13.5px; line-height: 1.65; color: #9CA09B; margin: 0; flex: 1; }
.pf-card-ref { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-top: 4px; }
.pf-vault-cta { background: var(--ink2); border: 1px solid rgba(231,201,143,.2); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; padding: 48px 36px; min-height: 360px; }
.pf-vault-cta h3 { font-family: 'Cormorant Garamond', serif; font-weight: 300; font-size: clamp(24px, 2vw, 34px); color: #F2EFE8; margin: 0; line-height: 1.1; }
.pf-vault-cta p { font-size: 13.5px; line-height: 1.65; color: #9CA09B; margin: 0; max-width: 22ch; }

/* ---- Locations ---- */
.city-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  text-align: left; width: 100%; padding: 18px 16px; cursor: pointer;
  background: none; border: none; border-left: 2px solid transparent;
  border-bottom: 1px solid var(--border-gold);
  color: #8A9195; transition: all .25s ease;
}
.city-btn:hover { color: #C8CACC; }
.city-btn.active { background: var(--ink3); border-left-color: var(--gold); color: var(--cream2); }
.loc-tag { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold2); border: 1px solid rgba(231,201,143,.4); padding: 7px 14px; font-family: var(--mono); }

/* =========================================================================
   Mobile navigation
   ========================================================================= */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  width: 40px; height: 40px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-toggle span { display: block; height: 2px; background: var(--cream); transition: transform .3s ease, opacity .3s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: sticky; top: 74px; z-index: 55;
  background: rgba(12,15,18,.97); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-gold);
  flex-direction: column; padding: 18px 28px 26px;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a {
  display: block; padding: 13px 0; text-decoration: none;
  font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--mut); border-bottom: 1px solid var(--border-gold);
}
.mobile-menu .mm-cta {
  margin-top: 16px; background: var(--gold); color: var(--ink);
  text-align: center; font-weight: 600; border: none;
}
.mobile-menu .mm-lang { margin-top: 16px; font-size: 12px; color: var(--mut2); }
.mobile-menu .mm-lang a { display: inline; padding: 0 4px; border: none; color: var(--mut2); }
.mobile-menu .mm-lang a.active { color: var(--cream2); font-weight: 700; }

/* =========================================================================
   Cookie banner
   ========================================================================= */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
  background: var(--ink2); color: var(--cream);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 20px 32px; border-top: 1px solid var(--border-gold);
  font-size: 13.5px; line-height: 1.6; flex-wrap: wrap;
}
.cookie-banner[hidden] { display: none; }
.cookie-text { max-width: 760px; color: var(--mut); }
.cookie-actions { display: flex; gap: 12px; flex-shrink: 0; }
.cookie-banner button {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  padding: 11px 22px; cursor: pointer; border: 1px solid rgba(231,201,143,.5);
  background: none; color: var(--cream); transition: all .2s ease;
}
.cookie-banner .cookie-accept { background: var(--gold); color: var(--ink); border-color: var(--gold); font-weight: 700; }
.cookie-banner .cookie-accept:hover { background: var(--gold2); }
.cookie-banner .cookie-decline:hover { border-color: var(--gold2); color: var(--gold2); }

/* =========================================================================
   Responsive — desktop-first, stack for tablet / mobile
   ========================================================================= */
@media (max-width: 1080px) {
  .hdr { padding: 16px 32px !important; }
  .about-grid, .contact-grid { grid-template-columns: 1fr !important; }
  .partner-split { grid-template-columns: 1fr !important; }
  .analyse-band-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .partner-split .partner-img { min-height: 360px !important; }
}

@media (max-width: 860px) {
  .nav-desktop { display: none !important; }
  .nav-toggle { display: flex; }
  h1[style] { font-size: 54px !important; }
  h2[style] { font-size: 36px !important; }
  .stats-grid { grid-template-columns: 1fr 1fr !important; }
  .stats-grid > div { border-right: none !important; padding: 28px 16px !important; }
  .om-grid, .services-grid, .testi-grid { grid-template-columns: 1fr !important; }
  .loc-grid { grid-template-columns: 1fr !important; }
  .pf-grid { grid-template-columns: 1fr !important; }
  .pf-vault-cta { min-height: 240px !important; padding: 36px 24px !important; }
  .step-panel { grid-template-columns: 1fr !important; gap: 16px !important; padding: 32px 28px !important; }
  .step-bignum { font-size: 72px !important; }
  .step-label { font-size: 10px !important; }
  .contact-form { grid-template-columns: 1fr !important; }
  section[style] { scroll-margin-top: 70px; }
  .analyse-features { grid-template-columns: 1fr !important; }
  .about-cred { grid-template-columns: 1fr !important; }
  .footer-top { flex-direction: column !important; }
}

@media (max-width: 520px) {
  .hdr { padding: 14px 20px !important; }
  h1[style] { font-size: 38px !important; }
  .cookie-banner { padding: 16px 20px; }
  .loc-name { font-size: 42px !important; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .kb { animation: none; }
}

/* ---- Mobile: swipe boxes sideways instead of stacking vertically ---- */
@media (max-width: 860px) {
  .services-grid, .testi-grid, .pf-grid, .stats-grid, .om-grid {
    display: flex !important;
    grid-template-columns: none !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 14px !important;
    padding: 4px 20px 18px !important;
    scroll-padding-left: 20px;
  }
  .services-grid > *, .testi-grid > *, .pf-grid > *,
  .stats-grid > *, .om-grid > * {
    flex: 0 0 80%;
    scroll-snap-align: start;
  }
  /* compact tiles show ~2 at once */
  .stats-grid > *, .om-grid > * { flex-basis: 46%; }
  .stats-grid > div { border-right: none !important; }
  /* the off-market grid uses a 1px hairline gap on desktop — drop it here */
  .om-grid { background: transparent !important; border: none !important; }
  .om-grid > * { border: 1px solid rgba(231, 201, 143, .16); }
  /* slim gold scroll indicator */
  .services-grid::-webkit-scrollbar, .testi-grid::-webkit-scrollbar,
  .pf-grid::-webkit-scrollbar, .stats-grid::-webkit-scrollbar,
  .om-grid::-webkit-scrollbar { height: 5px; }
  .services-grid::-webkit-scrollbar-thumb, .testi-grid::-webkit-scrollbar-thumb,
  .pf-grid::-webkit-scrollbar-thumb, .stats-grid::-webkit-scrollbar-thumb,
  .om-grid::-webkit-scrollbar-thumb { background: rgba(231, 201, 143, .35); border-radius: 3px; }
}
