/* CM Legal — Cauchi Meachen Legal & Mediation */
:root {
  --deep: #2b1d25;
  --plum: #3e2a35;
  --mauve: #7b5e6e;
  --gold: #b8955f;
  --gold-soft: #c9a873;
  --gold-pale: #d9bf92;
  --gold-ink: #8a6a3a;
  --cream: #f6f0ea;
  --sand: #e9ddd1;
  --paper: #ede3dc;
  --muted: #6f5d67;
  --body: #5b4852;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: Jost, 'Helvetica Neue', Helvetica, sans-serif;
  --gx: clamp(20px, 5vw, 72px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

html, body { margin: 0; padding: 0; background: var(--cream); color: var(--plum); -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }
body { font-family: var(--sans); font-weight: 300; overflow-x: clip; }
a { color: var(--plum); text-decoration: none; }
a:hover { color: var(--mauve); }
::selection { background: var(--mauve); color: #fff; }
input, select, textarea, button { font: inherit; }
img { max-width: none; }

.serif { font-family: var(--serif); font-weight: 400; }
.italic { font-style: italic; }
.wrap { position: relative; max-width: 1320px; margin: 0 auto; }
.px { padding-left: var(--gx); padding-right: var(--gx); }
.deco { position: absolute; pointer-events: none; }

.eyebrow { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-ink); font-weight: 500; }
.eyebrow--light { color: var(--gold-pale); font-weight: 400; }
.eyebrow--mauve { color: var(--mauve); }
.label { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

/* ---------- Fixed chrome ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: var(--gold); transform-origin: left; transform: scaleX(0); z-index: 80; pointer-events: none; }
.grain { position: fixed; inset: -50px; z-index: 90; pointer-events: none; opacity: .07; }

.site-header {
  --ink: var(--cream);
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  padding: 26px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid rgba(246, 240, 234, .12);
  transition: background .5s ease, padding .5s ease, border-color .5s ease;
}
.site-header.is-solid {
  --ink: var(--plum);
  padding-top: 14px; padding-bottom: 14px;
  background: rgba(246, 240, 234, .88);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom-color: rgba(184, 149, 95, .5);
}
.header-row { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { position: relative; display: block; width: clamp(190px, 20vw, 268px); aspect-ratio: 809.79 / 103.05; }
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .5s; }
.logo .logo-dark { opacity: 0; }
.is-solid .logo .logo-light { opacity: 0; }
.is-solid .logo .logo-dark { opacity: 1; }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 36px); }
.nav-item { position: relative; }
.nav-link { position: relative; display: flex; align-items: center; color: var(--ink); font-size: 14px; letter-spacing: .06em; font-weight: 400; padding: 8px 0; transition: color .4s; }
.nav-link:hover { color: var(--gold); }
.nav-link .chev { display: block; width: 5px; height: 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); margin: -2px 0 0 9px; }
.nav-link .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold); transform-origin: left; transform: scaleX(0); transition: transform .6s var(--ease-out); display: block; }
.nav-item.is-active .bar, .nav-item:hover .bar { transform: scaleX(1); }
.dropdown { position: absolute; top: 100%; left: -24px; padding-top: 16px; min-width: 320px; display: none; }
.nav-item:hover .dropdown, .nav-item:focus-within .dropdown { display: block; }
.dropdown-panel { background: linear-gradient(160deg, rgba(246, 240, 234, .84), rgba(233, 221, 209, .74)); border: 1px solid rgba(255, 255, 255, .5); border-top: 2px solid var(--gold); box-shadow: 0 18px 44px rgba(43, 29, 37, .2), inset 0 1px 0 rgba(255, 255, 255, .6); padding: 10px 0; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.dropdown-panel a { display: block; padding: 13px 28px; font-size: 14px; letter-spacing: .02em; color: var(--plum); font-weight: 400; transition: background .3s, color .3s; }
.dropdown-panel a:hover { background: rgba(62, 42, 53, .07); color: var(--mauve); }
.nav-cta { display: flex; align-items: center; gap: 12px; background: var(--gold); color: var(--deep); padding: 14px 24px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 500; transition: background .4s; }
.nav-cta:hover { background: #cfae78; color: var(--deep); }

.menu-btn { display: none; background: none; border: 0; cursor: pointer; align-items: center; gap: 12px; padding: 10px 0; color: var(--ink); font-size: 11px; letter-spacing: .14em; white-space: nowrap; text-transform: uppercase; font-weight: 400; }
.menu-btn .lines { display: flex; flex-direction: column; gap: 6px; width: 22px; }
.menu-btn .lines span { height: 1px; background: var(--ink); display: block; }
.menu-btn .lines span + span { width: 70%; margin-left: auto; }

.mmenu { position: fixed; inset: 0; z-index: 55; background: linear-gradient(150deg, #2b1d25, #3e2a35 50%, #6a4f5e); padding: 120px 28px 40px; display: none; flex-direction: column; justify-content: space-between; overflow: auto; }
body.menu-open .mmenu { display: flex; }
.mmenu nav { display: flex; flex-direction: column; }
.mm-item { border-bottom: 1px solid rgba(184, 149, 95, .3); }
.mm-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mm-link { flex: 1; font-family: var(--serif); font-weight: 500; font-size: 28px; color: var(--cream); padding: 16px 0; }
.mm-item.is-active .mm-link { color: var(--gold-soft); }
.mm-toggle { background: none; border: 0; color: var(--gold-soft); font-size: 28px; font-weight: 300; width: 44px; height: 44px; cursor: pointer; line-height: 1; }
.mm-kids { display: none; flex-direction: column; padding: 0 0 16px 4px; }
.mm-item.is-open .mm-kids { display: flex; }
.mm-kids a { font-size: 16px; color: #d9ccd3; padding: 10px 0 10px 16px; border-left: 1px solid rgba(184, 149, 95, .5); font-weight: 300; }
.mm-contact { font-family: var(--serif); font-size: 28px; color: var(--gold-soft); padding: 16px 0; border-bottom: 1px solid rgba(184, 149, 95, .3); }
.mm-foot { display: flex; flex-direction: column; gap: 6px; color: #d9ccd3; font-size: 15px; padding-top: 32px; }

@media (max-width: 999.98px) {
  .nav { display: none; }
  .menu-btn { display: flex; }
}

/* ---------- Buttons ---------- */
.btn { display: flex; width: max-content; max-width: 100%; align-items: center; gap: 14px; padding: 17px clamp(18px, 5vw, 30px); font-size: 12px; letter-spacing: .14em; white-space: nowrap; text-transform: uppercase; font-weight: 400; transition: background .4s, color .4s, border-color .4s; }
.btn .arr { font-size: 15px; }
.btn--gold { background: var(--gold); color: var(--deep); font-weight: 500; }
.btn--gold:hover { background: #d1b07a; color: var(--deep); }
.btn--ghost { border: 1px solid rgba(246, 240, 234, .45); color: var(--cream); }
.btn--ghost:hover { background: rgba(246, 240, 234, .08); border-color: var(--cream); color: var(--cream); }
.btn--outline-gold { border: 1px solid var(--gold); color: var(--gold-pale); }
.btn--outline-gold:hover { background: rgba(201, 168, 115, .14); border-color: var(--gold-pale); color: #ecd7ae; }
.btn--cream { background: var(--cream); color: var(--plum); font-weight: 500; }
.btn--cream:hover { background: #e9d9b8; color: var(--plum); }
.btn--plum { background: var(--plum); color: var(--cream); font-weight: 500; }
.btn--plum:hover { background: var(--mauve); color: var(--cream); }

/* ---------- Sections shared ---------- */
.dark-hero { position: relative; overflow: hidden; background: linear-gradient(120deg, #2b1d25 0%, #3e2a35 35%, #6a4f5e 75%, #4a3340 100%); background-size: 220% 220%; color: var(--cream); padding: clamp(124px, 12vw, 156px) var(--gx) clamp(48px, 5vw, 76px); border-bottom: 3px solid var(--gold); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: #d2c3cb; }
.crumbs a { color: var(--cream); white-space: nowrap; }
.crumbs a:hover { color: var(--gold-soft); }
.crumbs .sep { color: var(--gold-soft); }
.page-title { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5.4vw, 76px); line-height: 1.04; margin: 0; max-width: 1100px; }
.lede { margin: 0; font-size: clamp(17px, 1.3vw, 19px); line-height: 1.65; color: #e9dee3; max-width: 760px; text-wrap: pretty; }
.h2 { font-family: var(--serif); font-weight: 400; line-height: 1.05; margin: 0; }
.p { margin: 0; font-size: 17px; line-height: 1.7; color: var(--body); text-wrap: pretty; }
.gold-line { height: 1px; background: var(--gold); width: 100%; }
.pill { border: 1px solid rgba(246, 240, 234, .28); padding: 7px 14px; border-radius: 999px; font-size: 13px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(62, 42, 53, .2); padding-top: 18px; font-size: 12px; letter-spacing: .14em; white-space: nowrap; text-transform: uppercase; font-weight: 500; }

/* Home audience cards */
.aud-card { position: relative; overflow: hidden; min-height: 440px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding: clamp(32px, 4vw, 56px); color: var(--cream); border-top: 3px solid var(--gold); transition: transform .7s var(--ease-out), box-shadow .7s; }
.aud-card:hover { box-shadow: 0 30px 70px rgba(62, 42, 53, .24); color: var(--cream); }

/* Areas track */
.svc-card { flex-shrink: 0; scroll-snap-align: start; width: clamp(280px, 29vw, 430px); height: clamp(400px, 56vh, 540px); gap: 20px; padding: clamp(28px, 2.6vw, 40px); border-left: 1px solid rgba(138, 106, 58, .45); display: flex; flex-direction: column; justify-content: space-between; color: var(--plum); transition: background .6s; }
.svc-card:hover { background: rgba(62, 42, 53, .04); color: var(--plum); }

/* Residence routes */
.route { display: grid; grid-template-columns: 30px 1fr 20px; gap: 14px; align-items: baseline; padding: 22px 0; border-top: 1px solid rgba(217, 191, 146, .3); color: var(--cream); transition: padding .5s var(--ease-out), color .4s; }
.route:hover { padding-left: 14px; color: #e9d9b8; }

/* Inner pages */
.inner-body { max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(36px, 6vw, 96px); align-items: start; }
.inner-aside { display: none; flex-direction: column; gap: 32px; position: sticky; top: 110px; align-self: start; }
.toc { display: flex; flex-direction: column; border-left: 1px solid rgba(62, 42, 53, .18); }
.toc a { margin-left: -1px; padding: 11px 0 11px 20px; font-size: 15px; line-height: 1.4; color: var(--muted); font-weight: 300; border-left: 2px solid transparent; transition: color .4s, border-color .4s; }
.toc a:hover { color: var(--mauve); }
.toc a.is-on { color: var(--plum); font-weight: 400; border-left-color: var(--gold); }
.underline-link { align-self: flex-start; display: flex; gap: 14px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--plum); font-size: 12px; letter-spacing: .14em; white-space: nowrap; text-transform: uppercase; font-weight: 500; }
.sec-tab { position: sticky; top: 58px; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px var(--gx); background: rgba(246, 240, 234, .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(184, 149, 95, .45); color: var(--plum); }
.sec-tab:hover { color: var(--plum); }
.inner-sec { display: flex; flex-direction: column; gap: 22px; padding: 0 0 clamp(36px, 5vw, 60px); margin-bottom: clamp(36px, 5vw, 60px); border-bottom: 1px solid rgba(62, 42, 53, .16); scroll-margin-top: 110px; }
.rel-card { display: flex; flex-direction: column; justify-content: space-between; gap: 36px; min-height: 300px; padding: clamp(22px, 5vw, 38px); background: var(--paper); border: 1px solid rgba(62, 42, 53, .1); border-top: 2px solid var(--gold); color: var(--plum); transition: transform .6s var(--ease-out), box-shadow .6s; }
.rel-card:hover { box-shadow: 0 22px 50px rgba(62, 42, 53, .12); color: var(--plum); }

@media (min-width: 1000px) {
  .inner-body { grid-template-columns: 300px minmax(0, 1fr); }
  .inner-aside { display: flex; }
  .sec-tab { display: none; }
}

/* Contact */
.wa-card { display: flex; align-items: center; gap: 18px; max-width: 480px; padding: 18px 22px; background: var(--plum); border-top: 2px solid var(--gold); color: var(--cream); transition: background .4s; }
.wa-card:hover { background: #4f3a46; color: var(--cream); }
.socials { display: flex; gap: 12px; flex-wrap: wrap; }
.socials a { display: block; width: 44px; height: 44px; }
.socials img { width: 100%; height: 100%; display: block; }
.form { background: var(--paper); border-top: 3px solid var(--gold); padding: clamp(22px, 5vw, 52px); display: flex; flex-direction: column; gap: 22px; box-shadow: 0 40px 90px rgba(62, 42, 53, .10); }
.form label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; }
.form input, .form select, .form textarea { padding: 14px 16px; border: 1px solid rgba(62, 42, 53, .22); background: #fffdfb; font-size: 16px; font-weight: 400; color: var(--plum); border-radius: 0; outline: none; transition: border-color .3s, box-shadow .3s; color-scheme: light; }
.form input[type=date] { padding: 13px 16px; }
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--mauve); box-shadow: 0 0 0 3px rgba(123, 94, 110, .15); }
.form-divider { display: flex; align-items: center; gap: 14px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--mauve); font-weight: 500; padding-top: 6px; }
.form-divider::after { content: ''; flex: 1; height: 1px; background: rgba(62, 42, 53, .18); display: block; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 18px; }
.submit { display: flex; align-items: center; gap: 22px; background: var(--plum); color: var(--cream); border: 0; padding: 19px 30px; font-size: 12px; letter-spacing: .14em; text-align: left; text-transform: uppercase; font-weight: 500; cursor: pointer; transition: background .4s; max-width: 100%; }
.submit:hover { background: var(--mauve); }
.sent-note { font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.3; color: var(--mauve); display: none; max-width: 100%; }
.form.is-sent .sent-note, .form.is-sending .sent-note, .form.is-error .sent-note { display: inline; }
.form.is-error .sent-note { color: #9b3b3b; }
.submit:disabled { opacity: .6; cursor: wait; }

/* CTA band */
body.page-contact .cta-band { display: none; }

/* Footer */
.footer { position: relative; overflow: hidden; background: linear-gradient(140deg, #21161c 0%, #2b1d25 45%, #3e2a35 100%); background-size: 200% 200%; color: #e4d8de; padding: clamp(64px, 7vw, 100px) var(--gx) 36px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 44px 48px; }
@media (min-width: 1000px) { .foot-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); } }
.foot-col { display: flex; flex-direction: column; gap: 14px; font-size: 18px; }
.foot-col a { color: #e4d8de; }
.foot-col a:hover { color: var(--gold-soft); }
.foot-head { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-soft); font-weight: 500; padding-bottom: 6px; }

/* Floating buttons */
.wa-fab { position: fixed; right: clamp(16px, 2.5vw, 32px); bottom: clamp(16px, 2.5vw, 32px); z-index: 70; display: flex; align-items: center; gap: 12px; padding: 8px; background: var(--plum); border: 1px solid var(--gold); border-radius: 999px; color: var(--cream); box-shadow: 0 14px 40px rgba(43, 29, 37, .3); transition: background .4s, border-color .4s; }
.wa-fab:hover { background: #4f3a46; border-color: var(--gold-pale); color: var(--cream); }
.wa-fab img { width: 40px; height: 40px; display: block; }
.wa-fab span { display: none; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; white-space: nowrap; }
@media (min-width: 1000px) { .wa-fab { padding-right: 22px; } .wa-fab span { display: inline; } }
.to-top { position: fixed; right: clamp(16px, 2.5vw, 32px); bottom: calc(clamp(16px, 2.5vw, 32px) + 70px); z-index: 70; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--plum); color: var(--cream); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 14px 40px rgba(43, 29, 37, .3); opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.to-top.is-visible { opacity: 1; pointer-events: auto; }
.to-top svg { position: absolute; inset: 0; transform: rotate(-90deg); }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
