/* ============================================================
   MediVisual Artist - Professional Dark Theme (styles.css)
   Primary: #A51C30 (Harvard Crimson)
   Background: #0f172a (Slate 900)
   Part of OPC Ecosystem by MoKangMedical
   ============================================================ */

/* ---- Design Variables (override) ---- */
:root {
  --primary: #A51C30;
  --primary-light: #C62840;
  --primary-dark: #8A1628;
  --primary-rgb: 165, 28, 48;
  --accent: #E8A838;
  --accent-rgb: 232, 168, 56;
  --purple: #7C3AED;
  --purple-rgb: 124, 58, 237;
  --bg: #0f172a;
  --bg2: #1e293b;
  --bg3: #334155;
  --bg4: #475569;
  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #64748b;
  --border: #1e293b;
  --border2: #334155;
  --gradient: linear-gradient(135deg, #A51C30, #E8A838);
  --gradient-primary: linear-gradient(135deg, #A51C30, #C62840);
  --glow: 0 0 40px rgba(165, 28, 48, .2);
  --glow-accent: 0 0 40px rgba(232, 168, 56, .15);
  --glow-purple: 0 0 40px rgba(124, 58, 237, .15);
  --radius: 12px;
  --transition: .3s cubic-bezier(.4,0,.2,1);
}

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

/* ---- Base ---- */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: #fff;
}

img {
  max-width: 100%;
  display: block;
}

/* ---- OPC Ecosystem Floating Nav ---- */
.opc-float-nav {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .4s ease, transform .4s ease;
  pointer-events: none;
}

.opc-float-nav.visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.opc-float-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(15, 23, 42, .92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

.opc-float-btn:hover {
  background: rgba(165, 28, 48, .15);
  border-color: var(--primary);
  color: #fff;
  transform: translateX(-4px);
}

.opc-float-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.opc-float-btn.active {
  background: rgba(165, 28, 48, .2);
  border-color: var(--primary);
  color: var(--primary-light);
}

/* ---- OPC Top Nav (inline bar) ---- */
.opc-topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, .95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: 12px;
}

.opc-topnav a {
  color: var(--text2);
  text-decoration: none;
  transition: var(--transition);
}

.opc-topnav a:hover {
  color: var(--primary-light);
}

.opc-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

.opc-logo span {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.opc-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* ---- Main Navigation ---- */
.main-nav,
nav:not(.opc-topnav):not(.opc-float-nav) {
  position: fixed;
  top: 40px;
  left: 0;
  right: 0;
  z-index: 9998;
  background: rgba(15, 23, 42, .92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.main-nav.scrolled,
nav.scrolled {
  background: rgba(15, 23, 42, .98);
  box-shadow: 0 4px 30px rgba(0,0,0,.4);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
}

.logo,
.nav-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo span,
.nav-brand span {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text2);
  font-size: .9rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width .3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  background: var(--primary) !important;
  color: #fff !important;
  padding: 8px 20px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: .85rem !important;
  -webkit-text-fill-color: #fff !important;
  transition: var(--transition);
}

.nav-cta::after {
  display: none !important;
}

.nav-cta:hover {
  background: var(--primary-light) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(165, 28, 48, .4);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ---- Container ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Hero ---- */
.hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 140px;
  padding-bottom: 60px;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(165, 28, 48, .08), transparent 50%),
    radial-gradient(ellipse at 70% 50%, rgba(232, 168, 56, .06), transparent 50%);
  animation: heroPulse 8s ease-in-out infinite;
}

@keyframes heroPulse {
  0%, 100% { opacity: .6; }
  50% { opacity: 1; }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero h1 {
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -.02em;
}

.hero h1 span {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text2);
  max-width: 600px;
  line-height: 1.8;
}

/* ---- Sections ---- */
section {
  padding: 100px 0;
}

.section-label {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--primary-light);
  margin-bottom: 12px;
  padding: 4px 12px;
  background: rgba(165, 28, 48, .1);
  border-radius: 4px;
}

.section-title {
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 16px;
}

.section-desc {
  color: var(--text2);
  max-width: 600px;
  font-size: 1.05rem;
  line-height: 1.8;
}

/* ---- Cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.card {
  padding: 40px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--glow);
}

.card .icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(165, 28, 48, .1);
  border-radius: 16px;
  margin-bottom: 20px;
}

.card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.card p {
  color: var(--text2);
  font-size: .95rem;
  line-height: 1.8;
}

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--primary-light);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(165, 28, 48, .4);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 10px;
  font-weight: 500;
  font-size: 1rem;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

/* ---- Tags ---- */
.tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(165, 28, 48, .1);
  border: 1px solid rgba(165, 28, 48, .2);
  border-radius: 100px;
  font-size: .75rem;
  color: var(--primary-light);
  font-weight: 500;
}

.tag-accent {
  background: rgba(232, 168, 56, .1);
  border-color: rgba(232, 168, 56, .3);
  color: var(--accent);
}

/* ---- CTA ---- */
.cta {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 80px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(165, 28, 48, .1), transparent 70%);
  border-radius: 50%;
}

.cta h2 {
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 16px;
}

.cta p {
  color: var(--text2);
  max-width: 500px;
  margin: 0 auto 32px;
  font-size: 1rem;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

/* ---- Footer ---- */
footer {
  padding: 60px 0 32px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand .logo {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.footer-brand p {
  color: var(--text2);
  font-size: .85rem;
  line-height: 1.7;
  max-width: 300px;
}

.footer-col h4 {
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.footer-col a {
  display: block;
  color: var(--text2);
  font-size: .85rem;
  padding: 4px 0;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--primary-light);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--text3);
}

.footer-bottom a {
  color: var(--primary-light);
}

/* ---- Back to Top ---- */
.back-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 999;
  color: var(--text2);
}

.back-top.show,
.back-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-top:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

/* ---- Reveal Animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- Form Elements ---- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: .9rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: .95rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(165, 28, 48, .15);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .opc-float-nav {
    top: auto;
    bottom: 80px;
    right: 12px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .opc-float-btn span:not(.opc-float-icon) {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-links.show {
    display: flex;
    position: fixed;
    top: 104px;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, .98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }
  .mobile-toggle {
    display: block;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  .cta {
    padding: 60px 30px;
  }
  .hero {
    min-height: auto;
    padding-top: 120px;
    padding-bottom: 40px;
  }
  .opc-float-nav {
    display: none;
  }
}
