/* ═══════════════════════════════════════════════════
   MedSource360 — Global Styles
   ═══════════════════════════════════════════════════ */

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

:root {
  --black: #111111;
  --ink: #1a1a1a;
  --graphite: #2a2a2a;
  --stone: #8a8578;
  --warm-gray: #b5ad9e;
  --sand: #e8e2d8;
  --cream: #f5f2ec;
  --off-white: #faf8f5;
  --white: #ffffff;
  --copper: #c47a3a;
  --copper-light: #d4904e;
  --copper-glow: rgba(196,122,58,0.12);
  --teal-deep: #1a6b6e;
  --teal-muted: #2a8a8d;
  --serif: 'Instrument Serif', 'Georgia', serif;
  --sans: 'Outfit', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grain overlay */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 9999;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* ─── NAV ────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: all 0.4s ease;
}
.nav.scrolled {
  background: rgba(250,248,245,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.nav.nav-light { /* for pages with light hero */ }
.nav.nav-light.scrolled { }
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}
.nav-logo {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 20px;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.03em;
  transition: color 0.4s;
}
.nav.scrolled .nav-logo { color: var(--ink); }
.nav-logo span { font-weight: 300; color: var(--copper-light); }
.nav.scrolled .nav-logo span { color: var(--copper); }

/* For light-bg pages */
.nav.nav-dark .nav-logo { color: var(--ink); }
.nav.nav-dark .nav-logo span { color: var(--copper); }
.nav.nav-dark .nav-links a { color: var(--stone); }
.nav.nav-dark .nav-links a:hover { color: var(--ink); }
.nav.nav-dark .nav-toggle span { background: var(--ink); }

.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-links a {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color 0.3s;
  letter-spacing: 0.01em;
}
.nav.scrolled .nav-links a { color: var(--stone); }
.nav-links a:hover { color: var(--white); }
.nav.scrolled .nav-links a:hover { color: var(--ink); }
.nav-cta-link {
  background: var(--copper) !important;
  color: var(--white) !important;
  padding: 10px 24px !important;
  border-radius: 100px;
  font-weight: 500 !important;
  font-size: 13px !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase;
  transition: all 0.3s !important;
}
.nav-cta-link:hover { background: var(--copper-light) !important; transform: translateY(-1px); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--white); margin: 5px 0; transition: 0.3s; border-radius: 2px; }
.nav.scrolled .nav-toggle span { background: var(--ink); }

@media (max-width: 960px) {
  .nav-inner { padding: 0 24px; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none; flex-direction: column; position: absolute;
    top: 80px; left: 0; right: 0;
    background: var(--off-white);
    padding: 32px 24px; gap: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
  }
  .nav-links.active { display: flex; }
  .nav-links a { color: var(--stone) !important; }
  .nav-links a:hover { color: var(--ink) !important; }
}

/* ─── PAGE HERO (subpages) ───────────────────────── */
.page-hero {
  background: var(--black);
  padding: 160px 48px 80px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  pointer-events: none;
}
.page-hero.wound::before { background: #2a8a5a; }
.page-hero.aesthetics::before { background: #8a5aa0; }
.page-hero.devices::before { background: #4a7aaa; }
.page-hero.clawback::before { background: var(--copper); }
.page-hero.billing::before { background: var(--teal-deep); }
.page-hero.about::before { background: var(--copper); opacity: 0.08; }
.page-hero.contact::before { background: var(--teal-deep); opacity: 0.08; }

.page-hero-inner {
  max-width: 1400px;
  margin: 0 auto;
  position: relative; z-index: 1;
}
.page-hero .hero-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 24px;
  opacity: 0; animation: fadeSlideUp 0.8s 0.1s ease forwards;
}
.page-hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5.5vw, 64px);
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 700px;
  margin-bottom: 24px;
  opacity: 0; animation: fadeSlideUp 0.8s 0.25s ease forwards;
}
.page-hero p {
  font-size: 17px;
  font-weight: 300;
  color: rgba(255,255,255,0.5);
  max-width: 560px;
  line-height: 1.75;
  opacity: 0; animation: fadeSlideUp 0.8s 0.4s ease forwards;
}

@media (max-width: 700px) {
  .page-hero { padding: 130px 24px 60px; }
}

/* ─── SECTIONS ───────────────────────────────────── */
.section { padding: 120px 48px; }
.section-inner { max-width: 1400px; margin: 0 auto; }
.section-eyebrow {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--copper); margin-bottom: 20px;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 48px);
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.section-title.white { color: var(--white); }

@media (max-width: 700px) {
  .section { padding: 80px 24px; }
}

/* ─── CONTENT BLOCKS ─────────────────────────────── */
.content-layout {
  display: grid;
  grid-template-columns: 0.35fr 0.65fr;
  gap: 80px;
  align-items: start;
}
.content-layout.reverse { grid-template-columns: 0.65fr 0.35fr; }

.content-sticky {
  position: sticky; top: 120px;
}

.content-block { margin-bottom: 80px; }
.content-block:last-child { margin-bottom: 0; }
.content-block h3 {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 16px;
}
.content-block h4 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.content-block p {
  font-size: 15px;
  font-weight: 300;
  color: var(--stone);
  line-height: 1.8;
  margin-bottom: 16px;
}
.content-block p:last-child { margin-bottom: 0; }

.clinical-apps {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 20px;
}
.clinical-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--stone);
  background: var(--cream);
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--sand);
}

.content-divider {
  width: 40px; height: 1px;
  background: var(--sand);
  margin: 48px 0;
}

@media (max-width: 900px) {
  .content-layout { grid-template-columns: 1fr; gap: 40px; }
  .content-layout.reverse { grid-template-columns: 1fr; }
  .content-sticky { position: static; }
}

/* ─── DARK SECTION ───────────────────────────────── */
.section-dark {
  background: var(--ink);
}
.section-dark .section-title { color: var(--white); }
.section-dark .content-block h3 { color: var(--white); }
.section-dark .content-block p { color: rgba(255,255,255,0.45); }
.section-dark .clinical-tag {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
}

/* ─── CREAM SECTION ──────────────────────────────── */
.section-cream { background: var(--cream); }

/* ─── METRICS ROW ────────────────────────────────── */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 60px;
}
.metric-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 32px 28px;
  transition: border-color 0.3s;
}
.metric-card:hover { border-color: rgba(196,122,58,0.2); }
.metric-val {
  font-family: var(--serif);
  font-size: 40px;
  color: var(--white);
  line-height: 1;
  margin-bottom: 8px;
}
.metric-label {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,0.35);
  line-height: 1.5;
}

@media (max-width: 700px) {
  .metrics-row { grid-template-columns: 1fr 1fr; }
}

/* ─── CTA SECTION ────────────────────────────────── */
.cta-section {
  background: var(--off-white);
  text-align: center;
  padding-top: 140px;
  position: relative;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 1px; height: 80px;
  background: linear-gradient(to bottom, var(--sand), transparent);
}
.cta-section .section-title {
  max-width: 700px;
  margin: 0 auto 20px;
}
.cta-section p {
  font-size: 16px;
  font-weight: 300;
  color: var(--stone);
  max-width: 500px;
  margin: 0 auto 44px;
  line-height: 1.75;
}

/* ─── BUTTONS ────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--copper);
  color: var(--white);
  padding: 16px 36px;
  border-radius: 100px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: none; cursor: pointer;
}
.btn-primary:hover {
  background: var(--copper-light);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(196,122,58,0.25);
}
.btn-primary svg { width: 16px; height: 16px; transition: transform 0.3s; }
.btn-primary:hover svg { transform: translateX(3px); }

.btn-primary.dark { background: var(--ink); }
.btn-primary.dark:hover { background: var(--graphite); box-shadow: 0 12px 40px rgba(0,0,0,0.2); }

.btn-outline-light {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  padding: 14px 30px;
  border-radius: 100px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.3s;
}
.btn-outline-light:hover {
  border-color: var(--copper);
  color: var(--white);
  background: rgba(196,122,58,0.06);
}

/* ─── CONTACT FORM ───────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 0.4fr 0.6fr;
  gap: 80px;
}
.contact-info { }
.contact-info h3 {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--ink);
  margin-bottom: 20px;
}
.contact-info p {
  font-size: 15px;
  font-weight: 300;
  color: var(--stone);
  line-height: 1.8;
  margin-bottom: 32px;
}
.contact-detail {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 16px;
}
.contact-detail-icon {
  width: 40px; height: 40px;
  background: var(--cream);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-detail-icon svg { width: 18px; height: 18px; color: var(--copper); }
.contact-detail-text {
  font-size: 15px;
  color: var(--ink);
}
.contact-detail-text a {
  color: var(--copper);
  text-decoration: none;
}
.contact-detail-text a:hover { text-decoration: underline; }
.contact-detail-label {
  font-size: 12px;
  color: var(--stone);
  margin-top: 2px;
}

.contact-form { }
.form-row { margin-bottom: 20px; }
.form-row-half { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 8px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--sand);
  border-radius: 10px;
  padding: 14px 18px;
  transition: border-color 0.3s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--copper);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8578' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
.form-checkboxes {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.form-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ink);
  cursor: pointer;
}
.form-check input {
  width: 16px; height: 16px;
  accent-color: var(--copper);
}

.quick-links {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--sand);
}
.quick-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--copper);
  text-decoration: none;
  padding: 8px 18px;
  border: 1px solid var(--sand);
  border-radius: 100px;
  transition: all 0.3s;
}
.quick-link:hover {
  border-color: var(--copper);
  background: var(--copper-glow);
}

@media (max-width: 800px) {
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .form-row-half { grid-template-columns: 1fr; }
}

/* ─── FOOTER ─────────────────────────────────────── */
.footer {
  background: var(--black);
  padding: 80px 48px 40px;
}
.footer-inner { max-width: 1400px; margin: 0 auto; }
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 64px;
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.footer-brand .nav-logo { display: block; margin-bottom: 20px; }
.footer-brand p {
  font-size: 14px; font-weight: 300;
  color: rgba(255,255,255,0.3);
  line-height: 1.7; max-width: 280px;
}
.footer-col h4 {
  font-size: 11px; font-weight: 500;
  color: rgba(255,255,255,0.5);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.footer-col a {
  display: block; font-size: 14px; font-weight: 300;
  color: rgba(255,255,255,0.3);
  text-decoration: none; padding: 6px 0;
  transition: color 0.25s;
}
.footer-col a:hover { color: var(--copper-light); }
.footer-bottom {
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(255,255,255,0.2);
}
.footer-legal { display: flex; gap: 24px; }
.footer-legal a { color: rgba(255,255,255,0.2); text-decoration: none; transition: color 0.25s; }
.footer-legal a:hover { color: rgba(255,255,255,0.5); }

@media (max-width: 800px) {
  .footer { padding: 60px 24px 32px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* ─── ANIMATIONS ─────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0; transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.stagger > .reveal:nth-child(2) { transition-delay: 0.12s; }
.stagger > .reveal:nth-child(3) { transition-delay: 0.24s; }
.stagger > .reveal:nth-child(4) { transition-delay: 0.36s; }
.stagger > .reveal:nth-child(5) { transition-delay: 0.48s; }
.stagger > .reveal:nth-child(6) { transition-delay: 0.6s; }
