/* =====================================================
   BIOMAT STUDIO — SHARED STYLES
   Common design tokens, reset, nav, footer, mobile nav,
   effects. Loaded by all pages for caching benefit.
   ===================================================== */

/* Design Tokens */
:root {
  --cream: #F5F0E8;
  --sand: #E8DFD0;
  --wood-pale: #D8C8AA;
  --wood-mid: #A8845C;
  --wood-deep: #7A5C34;
  --accent: #926B3E;
  --accent-mid: #B89660;
  --accent-pale: #EDE2D0;
  --dark: #0E0C08;
  --text: #1E1A14;
  --muted: #6A6058;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --page-pad: clamp(20px, 4vw, 60px);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* Page transition */
body { animation: pageIn 0.4s ease; }
body.page-leaving { animation: pageOut 0.3s ease forwards; }
@keyframes pageIn { 0% { opacity: 0; transform: translateY(6px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes pageOut { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-6px); } }

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 9998;
  pointer-events: none; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* =====================================================
   NAVIGATION
   ===================================================== */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--page-pad);
  background: rgba(250, 246, 239, 0.78);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(196, 146, 106, 0.14);
  transition: background 0.3s, box-shadow 0.3s;
}
#nav.scrolled {
  background: rgba(250, 246, 239, 0.95);
  box-shadow: 0 2px 28px rgba(30,20,10,0.07);
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-serif); font-size: 1.35rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--dark); text-decoration: none;
}
.nav-brand img { height: 36px; width: auto; }
.nav-links {
  display: flex; align-items: center; gap: 8px;
  list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  font-size: 0.82rem; letter-spacing: 0.04em; color: var(--text); font-weight: 400;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
  padding: 8px 18px; border-radius: 100px;
  background: linear-gradient(135deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.3) 100%);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255,255,255,0.5);
  box-shadow: 0 2px 8px rgba(30,20,10,0.04), 0 0 0 1px rgba(255,255,255,0.25),
              inset 0 1px 0 rgba(255,255,255,0.65), inset 0 -1px 0 rgba(196,148,106,0.06);
  text-decoration: none;
}
.nav-links a:hover {
  color: var(--accent); background: rgba(255,255,255,0.80);
  border-color: rgba(154,123,91,0.22);
  box-shadow: 0 4px 16px rgba(30,20,10,0.08), inset 0 1px 0 rgba(255,255,255,0.6);
  transform: translateY(-1px);
}
.nav-btn {
  background: var(--accent) !important; color: #fff !important;
  padding: 10px 22px !important; border-radius: 100px;
  font-size: 0.82rem !important; font-weight: 500 !important; letter-spacing: 0.07em;
  border: 1px solid var(--accent) !important;
  box-shadow: 0 4px 14px rgba(154,123,91,0.25) !important;
  backdrop-filter: none !important;
}
.nav-btn:hover {
  background: #7A5C34 !important; border-color: #7A5C34 !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(154,123,91,0.35) !important;
}
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.3s; }
.nav-mobile-icons { display: none; align-items: center; gap: 14px; }

/* =====================================================
   MOBILE NAV DRAWER
   ===================================================== */
.mobile-overlay {
  position: fixed; inset: 0; z-index: 189;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}
.mobile-overlay.active { opacity: 1; visibility: visible; }

#mobile-nav {
  position: fixed; top: 0; right: -320px;
  width: 300px; max-width: 85vw; height: 100vh;
  background: rgba(245,240,232,0.97);
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  z-index: 190;
  display: flex; flex-direction: column;
  padding: 80px 36px 40px; gap: 6px;
  transition: right 0.4s cubic-bezier(0.22,1,0.36,1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.1);
}
#mobile-nav.open { right: 0; }
#mobile-nav a {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem; font-weight: 400; color: #1E1A14;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: color 0.2s; text-decoration: none;
}
#mobile-nav a:hover, #mobile-nav a:active { color: #926B3E; }
#mobile-nav .close-btn {
  position: absolute; top: 24px; right: 24px;
  background: none; border: none;
  font-size: 1.4rem; color: #6A6058;
  cursor: pointer; padding: 8px; transition: color 0.2s;
}
#mobile-nav .close-btn:hover { color: #1E1A14; }

/* =====================================================
   FOOTER
   ===================================================== */
footer {
  background: var(--dark); color: rgba(255,255,255,0.6);
  padding: 80px var(--page-pad) 40px; margin-top: 80px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.6fr;
  gap: 60px; max-width: 1320px; margin: 0 auto 56px;
}
.footer-brand {
  font-family: var(--font-serif); font-size: 1.4rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #fff; display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.footer-brand img { height: 38px; width: auto; margin-bottom: 14px; display: block; }
.footer-tagline { font-size: 0.82rem; color: rgba(255,255,255,0.50); line-height: 1.72; }
.footer-sub { font-size: 0.74rem; color: rgba(255,255,255,0.30); }
.footer-col h4 {
  font-family: var(--font-serif); font-size: 0.98rem; font-weight: 500;
  color: #fff; margin-bottom: 18px; letter-spacing: 0.07em;
}
.footer-col ul { display: flex; flex-direction: column; gap: 9px; list-style: none; }
.footer-col a { font-size: 0.82rem; color: rgba(255,255,255,0.50); transition: color 0.2s; }
.footer-col a:hover { color: rgba(255,255,255,0.90); }
.footer-contact p { font-size: 0.82rem; line-height: 2.1; }
.footer-contact a { color: var(--accent-mid); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07); padding-top: 28px;
  max-width: 1320px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.73rem; color: rgba(255,255,255,0.28);
}

/* =====================================================
   EFFECTS
   ===================================================== */
/* Cursor glow */
.cursor-glow {
  position: fixed; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,169,106,0.06) 0%, transparent 70%);
  pointer-events: none; z-index: 9999; transform: translate(-50%,-50%);
  transition: opacity 0.3s; opacity: 0; mix-blend-mode: screen;
}
.cursor-glow.active { opacity: 1; }

/* Gradient mesh */
.gradient-mesh { position: fixed; inset: 0; z-index: -10; pointer-events: none; overflow: hidden; }
.gradient-mesh .gm-blob { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.04; animation: gmDrift 25s ease-in-out infinite; }
.gm-blob-1 { width: 500px; height: 500px; background: #c9a96a; top: 10%; left: 15%; }
.gm-blob-2 { width: 400px; height: 400px; background: #a87bc0; top: 50%; right: 10%; animation-delay: -8s !important; animation-duration: 30s !important; }
.gm-blob-3 { width: 350px; height: 350px; background: #d4a574; bottom: 15%; left: 40%; animation-delay: -16s !important; animation-duration: 22s !important; }
@keyframes gmDrift { 0%{transform:translate(0,0) scale(1);} 25%{transform:translate(60px,-40px) scale(1.1);} 50%{transform:translate(-30px,50px) scale(0.95);} 75%{transform:translate(40px,20px) scale(1.05);} 100%{transform:translate(0,0) scale(1);} }

/* Scroll progress */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, #926B3E, #c9a96a, #926B3E);
  z-index: 9999; width: 0%; transition: width 0.05s linear;
}

/* Social proof toast */
.social-toast {
  position: fixed; bottom: 24px; left: 24px; z-index: 300;
  padding: 14px 20px; border-radius: 16px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(196,148,106,0.15);
  box-shadow: 0 8px 32px rgba(30,20,10,0.1);
  display: flex; align-items: center; gap: 12px; max-width: 340px;
  transform: translateX(-120%); opacity: 0;
  transition: all 0.5s cubic-bezier(0.25,0.46,0.45,0.94);
}
.social-toast.show { transform: translateX(0); opacity: 1; }
.social-toast .st-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #4CAF50;
  flex-shrink: 0; animation: stPulse 2s ease-in-out infinite;
}
@keyframes stPulse { 0%,100%{box-shadow:0 0 0 0 rgba(76,175,80,0.4)} 50%{box-shadow:0 0 0 6px rgba(76,175,80,0)} }
.social-toast .st-msg { font-size: 0.8rem; color: #1E1A14; line-height: 1.4; }
.social-toast .st-time { font-size: 0.68rem; color: #6A6058; margin-top: 2px; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-mobile-icons { display: flex; }
  .hamburger { display: flex; }
  .cursor-glow { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 36px; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
  footer { padding-top: 48px; }
}
@media (max-width: 600px) {
  .social-toast { bottom: 16px; left: 16px; right: 16px; max-width: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .cursor-glow, .gradient-mesh { display: none !important; }
  .scroll-progress { display: none; }
}

/* Focus indicators */
:focus-visible { outline: 2px solid #926B3E; outline-offset: 3px; border-radius: 8px; }
