/* OptiFI Marketing — static site, Azure-friendly */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --optifi-bg: #0a0e17;
  --optifi-bg-elevated: #111827;
  --optifi-green: #7cb342;
  --optifi-green-bright: #8bc34a;
  --optifi-text: rgba(255, 255, 255, 0.95);
  --optifi-text-muted: rgba(255, 255, 255, 0.6);
  --optifi-border: rgba(255, 255, 255, 0.08);
  --optifi-card: rgba(255, 255, 255, 0.04);
  --font-sans: 'Inter', -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--optifi-bg);
  color: var(--optifi-text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ----- Header ----- */
.mk-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0.75rem 2rem;
  transition: background .35s ease, box-shadow .35s ease, padding .35s ease;
}
.mk-header.scrolled {
  padding: 0.75rem 2rem;
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--optifi-border);
}
.mk-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  position: relative;
}
.mk-header.scrolled .mk-header-inner {
  justify-content: flex-start;
}
/* At top: nav and actions collapse so hero logo is the focus; on scroll: logo left, nav, actions right */
.mk-nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 0 0 0;
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: flex .4s ease, opacity .35s ease;
}
.mk-header.scrolled .mk-nav-left {
  flex: 0 0 auto;
  opacity: 1;
}
.mk-nav a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color .15s;
  white-space: nowrap;
}
.mk-nav a:hover { color: #fff; }
.mk-nav a.active { color: var(--optifi-green); }
.mk-logo-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  width: 0;
  min-width: 0;
  transition: opacity .35s ease, width .4s ease;
}
.mk-header.scrolled .mk-logo-link {
  opacity: 1;
  width: auto;
  min-width: auto;
}
.mk-logo {
  height: 32px;
  width: auto;
  display: block;
  object-fit: contain;
}
.mk-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 0;
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: flex .4s ease, opacity .35s ease;
}
.mk-header.scrolled .mk-header-actions {
  flex: 0 0 auto;
  opacity: 1;
  margin-left: auto;
}
.mk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
  font-family: inherit;
  cursor: pointer;
  border: none;
}
.mk-btn-primary {
  background: var(--optifi-green);
  color: #0a0e17;
}
.mk-btn-primary:hover {
  background: var(--optifi-green-bright);
  filter: brightness(1.05);
}
.mk-btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.mk-btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

/* ----- Main ----- */
.mk-main { padding-top: 56px; flex: 1; transition: padding-top .35s ease; }
body.mk-header-scrolled .mk-main { padding-top: 72px; }

/* ----- Sections ----- */
.mk-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 4rem 2rem;
}
.mk-headline {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--optifi-text);
}
.mk-subheadline {
  font-size: 1.1rem;
  color: var(--optifi-text-muted);
  max-width: 640px;
  margin-bottom: 1.5rem;
}
.mk-accent { color: var(--optifi-green); }

/* Hero */
.mk-hero {
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 2rem 5rem;
  position: relative;
  overflow: hidden;
}
.mk-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 179, 66, 0.08), transparent 50%),
              linear-gradient(180deg, transparent 0%, var(--optifi-bg) 70%);
  pointer-events: none;
}
.mk-hero-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
/* Hero logo: lives outside header, first thing in hero */
.mk-hero-logo {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 2rem;
  transition: opacity .4s ease;
}
body.mk-header-scrolled .mk-hero-logo {
  opacity: 0;
  pointer-events: none;
}
.mk-hero-logo-img {
  height: 112px;
  width: auto;
  display: block;
  object-fit: contain;
}
.mk-hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}
.mk-hero-headline {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: #fff;
  text-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
}
.mk-hero-line {
  display: block;
  opacity: 0;
  transform: translateY(28px);
  animation: mk-hero-line-in 0.7s ease-out forwards;
}
.mk-hero-line-2 {
  animation-delay: 0.25s;
}
@keyframes mk-hero-line-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.mk-hero-subheadline {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 640px;
  margin: 0 auto 2rem;
  opacity: 0;
  transform: translateY(20px);
  animation: mk-hero-line-in 0.6s ease-out 0.5s forwards;
}
.mk-hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.5rem;
  opacity: 0;
  transform: translateY(16px);
  animation: mk-hero-line-in 0.5s ease-out 0.75s forwards;
}

/* Cards / feature grid */
.mk-grid { display: grid; gap: 1.5rem; }
.mk-grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.mk-grid-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.mk-card {
  background: var(--optifi-card);
  border: 1px solid var(--optifi-border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color .2s, background .2s;
}
.mk-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}
.mk-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: #fff; }
.mk-card p { font-size: 0.9rem; color: var(--optifi-text-muted); }

/* Flow diagram placeholder */
.mk-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--optifi-card);
  border-radius: 12px;
  border: 1px solid var(--optifi-border);
}
.mk-flow span {
  padding: 0.5rem 1rem;
  background: var(--optifi-bg-elevated);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--optifi-text-muted);
}
.mk-flow .arrow { color: var(--optifi-green); font-size: 1.25rem; }

/* List with checkmarks */
.mk-list-check { list-style: none; }
.mk-list-check li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--optifi-text-muted);
  font-size: 0.95rem;
}
.mk-list-check li::before {
  content: '✓';
  color: var(--optifi-green);
  font-weight: 700;
  flex-shrink: 0;
}

/* Closing CTA */
.mk-cta-section {
  text-align: center;
  padding: 6rem 2rem;
  background: linear-gradient(180deg, transparent 0%, rgba(124, 179, 66, 0.06) 100%);
}
.mk-cta-section .mk-headline { margin-bottom: 0.75rem; }
.mk-cta-section .mk-subheadline { margin: 0 auto 2rem; }
.mk-cta-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Footer */
.mk-footer {
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--optifi-border);
  padding: 3rem 2rem 2rem;
  margin-top: auto;
}
.mk-footer-inner { max-width: 1200px; margin: 0 auto; }
.mk-footer-brand { margin-bottom: 2rem; }
.mk-footer-brand .mk-logo { height: 28px; opacity: 0.9; margin-bottom: 0.5rem; }
.mk-footer-brand p { color: var(--optifi-text-muted); font-size: 0.875rem; }
.mk-footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}
.mk-footer-links h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
}
.mk-footer-links a {
  display: block;
  color: var(--optifi-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}
.mk-footer-links a:hover { color: rgba(255, 255, 255, 0.9); }
.mk-footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--optifi-border);
}
.mk-footer-bottom p { color: rgba(255, 255, 255, 0.4); font-size: 0.8rem; }

/* Page title (for forums, support, viz-showcase) */
.mk-page-title { padding: 3rem 2rem 2rem; max-width: 1120px; margin: 0 auto; }
.mk-page-title h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.mk-page-title p { color: var(--optifi-text-muted); }

/* Viz Showcase grid */
.mk-viz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 0 2rem 4rem;
  max-width: 1120px;
  margin: 0 auto;
}
.mk-viz-card {
  background: var(--optifi-card);
  border: 1px solid var(--optifi-border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
}
.mk-viz-card:hover {
  border-color: rgba(124, 179, 66, 0.4);
  transform: translateY(-2px);
}
.mk-viz-card-thumb {
  aspect-ratio: 16/10;
  background: var(--optifi-bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--optifi-text-muted);
  font-size: 0.9rem;
}
.mk-viz-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mk-viz-card-body { padding: 1rem; }
.mk-viz-card-body h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.mk-viz-card-body p { font-size: 0.8rem; color: var(--optifi-text-muted); }

/* Modal for viz */
.mk-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.mk-modal {
  background: var(--optifi-bg-elevated);
  border: 1px solid var(--optifi-border);
  border-radius: 12px;
  width: 100%;
  max-width: 1200px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mk-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--optifi-border);
  flex-shrink: 0;
}
.mk-modal-header h3 { font-size: 1.1rem; }
.mk-modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.5rem;
  line-height: 1;
}
.mk-modal-close:hover { color: #fff; }
.mk-modal-body {
  flex: 1;
  min-height: 0;
  padding: 0;
}
.mk-modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Forums / Support content */
.mk-content { max-width: 800px; margin: 0 auto; padding: 0 2rem 4rem; }
.mk-content h2 { font-size: 1.35rem; margin: 2rem 0 0.75rem; color: #fff; }
.mk-content p { color: var(--optifi-text-muted); margin-bottom: 1rem; }
.mk-support-search {
  max-width: 480px;
  margin: 0 auto 2rem;
}
.mk-support-search input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--optifi-border);
  background: var(--optifi-bg-elevated);
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
}
.mk-support-search input::placeholder { color: var(--optifi-text-muted); }
.mk-support-search input:focus {
  outline: none;
  border-color: var(--optifi-green);
}

@media (max-width: 768px) {
  .mk-nav { display: none; }
  .mk-footer-links { grid-template-columns: 1fr; }
}
