/* ============================================
   MESHRA FINANCE GROUP — SHARED STYLES
   Used across all pages on meshrafg.com.au
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Visually hidden but available to search engines and screen readers (WCAG-compliant) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

:root {
  --ink: #0A0A0A;
  --ink-soft: #1a1a1a;
  --paper: #F5F2ED;
  --paper-warm: #EFEAE0;
  --stone: #A89F8E;
  --stone-light: #D4CCBE;
  --rule: rgba(10, 10, 10, 0.12);
  --rule-strong: rgba(10, 10, 10, 0.3);
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, sans-serif;
  --display: 'Inter', sans-serif; /* matches business card weight */
}

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--paper); }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(245, 242, 237, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--rule);
}

.nav-logo { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.nav-logo-img { height: 44px; width: auto; display: block; }
.mfg-mark { width: 36px; height: 36px; display: inline-flex; flex-shrink: 0; }
.mfg-mark svg { width: 100%; height: 100%; }
.nav-name { font-family: var(--sans); font-size: 11px; letter-spacing: 4px; text-transform: uppercase; font-weight: 600; }
.nav-name span { display: block; font-size: 9px; color: var(--stone); margin-top: 2px; letter-spacing: 3px; font-weight: 400; }
.nav-menu { display: flex; gap: 32px; list-style: none; }
.nav-menu a { color: var(--ink); text-decoration: none; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 400; transition: opacity 0.2s; }
.nav-menu a:hover, .nav-menu a.active { opacity: 0.5; }
.nav-secondary { font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-size: 15px; color: var(--ink-soft); text-decoration: none; transition: color 0.2s, opacity 0.2s; margin-right: 4px; padding-right: 20px; border-right: 1px solid var(--rule); padding-top: 2px; }
.nav-secondary:hover, .nav-secondary.active { color: var(--ink); opacity: 0.85; }
.nav-cta { padding: 12px 28px; background: var(--ink); color: var(--paper); text-decoration: none; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 500; transition: background 0.3s; }
.nav-cta:hover { background: var(--ink-soft); }

/* ============ COMMON ELEMENTS ============ */
.section-eyebrow { font-size: 11px; letter-spacing: 4px; text-transform: uppercase; color: var(--stone); margin-bottom: 24px; display: flex; align-items: center; gap: 12px; font-weight: 500; }
.section-eyebrow::before { content: ''; width: 40px; height: 1px; background: var(--stone); }
.section-title { font-family: var(--serif); font-size: clamp(38px, 5vw, 64px); font-weight: 300; line-height: 1; letter-spacing: -1.5px; max-width: 700px; }
.section-title em { font-style: italic; color: var(--stone); }

.btn-primary { padding: 18px 40px; background: var(--ink); color: var(--paper); text-decoration: none; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; font-weight: 500; display: inline-flex; align-items: center; gap: 12px; transition: gap 0.3s; border: none; cursor: pointer; font-family: var(--sans); }
.btn-primary:hover { gap: 20px; }
.btn-primary svg { width: 14px; transition: transform 0.3s; }
.btn-primary:hover svg { transform: translateX(4px); }
.btn-text { color: var(--ink); text-decoration: none; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; font-weight: 500; border-bottom: 1px solid var(--ink); padding-bottom: 4px; }

/* ============ FOOTER ============ */
footer { background: var(--ink); color: var(--paper); padding: 80px 48px 32px; }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 60px; padding-bottom: 60px; border-bottom: 1px solid rgba(245,242,237,0.1); max-width: 1400px; margin: 0 auto; }
.footer-brand h3 { font-family: var(--serif); font-size: 36px; font-weight: 300; letter-spacing: -1px; margin-bottom: 12px; }
.footer-brand h3 em { font-style: italic; color: var(--stone-light); }
.footer-logo-img { height: 56px; width: auto; display: block; margin-bottom: 8px; }
.footer-brand p { color: var(--stone-light); font-size: 14px; max-width: 380px; line-height: 1.6; margin-top: 20px; }
.footer-col h4 { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--stone); margin-bottom: 20px; font-weight: 500; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--paper); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.footer-col a:hover { color: var(--stone-light); }
.footer-col p { color: var(--paper); font-size: 14px; line-height: 1.6; }
.footer-bottom { padding-top: 32px; max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.footer-legal-links { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding-bottom: 24px; border-bottom: 1px solid rgba(245,242,237,0.12); }
.footer-legal-links a { font-size: 12px; color: var(--paper); text-decoration: none; letter-spacing: 0.5px; border-bottom: 1px solid transparent; padding-bottom: 2px; transition: border-color 0.2s; }
.footer-legal-links a:hover { border-bottom-color: var(--paper); }
.footer-legal-links span { color: var(--stone); font-size: 12px; }
.footer-disclaimer { font-size: 11px; color: var(--stone); line-height: 1.7; max-width: 1000px; }
.footer-copy { font-size: 11px; color: var(--stone); letter-spacing: 1px; padding-top: 12px; }

/* ============ MOBILE NAVIGATION ============ */
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; padding: 0; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; position: relative; z-index: 1001; }
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--ink); transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Backdrop behind the panel — tap to close */
.nav-backdrop { position: fixed; inset: 0; background: rgba(10, 10, 10, 0.45); z-index: 998; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.nav-backdrop.open { opacity: 1; visibility: visible; }

/* The slide-in panel — uses dynamic viewport height (dvh) and iOS safe areas */
.nav-mobile {
  position: fixed;
  top: 0;
  right: 0;
  width: 80%;
  max-width: 320px;
  height: 100vh;                    /* fallback */
  height: 100dvh;                   /* dynamic viewport — handles iOS toolbars */
  background: var(--paper);
  z-index: 1000;
  padding-top: calc(76px + env(safe-area-inset-top));
  padding-right: calc(28px + env(safe-area-inset-right));
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
  padding-left: 28px;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.12);
  visibility: hidden;
}
.nav-mobile.open { transform: translateX(0); visibility: visible; }
.nav-mobile-menu { list-style: none; padding: 0; margin: 0; }
.nav-mobile-menu li { border-bottom: 1px solid var(--rule); }
.nav-mobile-menu li:last-child { border-bottom: none; }
.nav-mobile-menu a { display: block; padding: 18px 4px; font-family: var(--sans); font-size: 16px; color: var(--ink); text-decoration: none; letter-spacing: 0.3px; font-weight: 400; }
.nav-mobile-menu a.active { font-weight: 600; color: var(--ink); }
.nav-mobile-cta { background: var(--ink) !important; color: var(--paper) !important; text-align: center; margin-top: 24px; padding: 18px !important; letter-spacing: 2px !important; font-size: 11px !important; text-transform: uppercase; font-weight: 500; }

/* When menu is open, lock body scroll */
body.menu-open { overflow: hidden; position: fixed; width: 100%; }

/* Sticky nav with safe-area top padding so logo isn't under the iPhone notch */
@media (max-width: 900px) {
  .nav { padding: 14px 24px; padding-top: calc(14px + env(safe-area-inset-top)); padding-right: calc(24px + env(safe-area-inset-right)); position: sticky; top: 0; background: var(--paper); z-index: 100; }
  .nav-menu, .nav-cta, .nav-secondary { display: none; }
  .nav-toggle { display: flex; }
  .nav-logo-img { height: 36px; }
  .footer-logo-img { height: 48px; }
  .footer-top { grid-template-columns: 1fr; gap: 40px; padding: 0 24px 60px; }
  .footer-bottom { padding: 32px 24px 0; }
  footer { padding: 60px 0 32px; }
}
@media (max-width: 600px) {
  .nav { padding: 12px 20px; padding-top: calc(12px + env(safe-area-inset-top)); padding-right: calc(20px + env(safe-area-inset-right)); }
  .nav-logo-img { height: 32px; }
  .footer-top { padding: 0 20px 40px; }
  .footer-bottom { padding: 24px 20px 0; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 32px; }
}
