/* ============================================================
   MConnect Labs — main.css
   Brand: Maretron / Raymarine palette
   Navy #0a2240 | Orange #f47920 | White #fff | Gray #f5f6f8
   ============================================================ */

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

:root {
  --blue-900: #1b4c97;
  --blue-800: #1c7dcf;
  --blue-700: #1e88e5;
  --blue-600: #1990e4;
  --blue-500: #169df3;
  --blue-400: #24acf8;
  --blue-300: #45bbfb;
  --blue-200: #7bcefe;
  --blue-nancy: #7bcefe;
  --blue-100: #b0e1ff;
  --blue-50: #e0f4ff;
  --yellow-900: #f87300;
  --yellow-800: #f89200;
  --yellow-700: #f7a300;
  --yellow-600: #f7b500;
  --yellow-nancy: #f7b500;
  --yellow-500: #f7c700;
  --yellow-400: #f7c30b;
  --yellow-300: #f8d650;
  --yellow-200: #fae183;
  --yellow-100: #fbedb4;
  --yellow-50: #fdf8e1;
  --navy:        #0a2240;
  --navy-mid:    #0d2f58;
  --navy-light:  #163d6e;
  --raymaroon-gradient: linear-gradient(#8d003e 38.49%,#710032 100%,#8d003e);
  --maroon:     #800000;
  --white:       #ffffff;
  --gray-bg:     #f5f6f8;
  --gray-border: #dde1e7;
  --text:        #1c2b3a;
  --text-muted:  #5a6a7a;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 4px;
  --transition: 180ms ease;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Layout ---- */

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Header ---- */

.site-header {
  background: var(--navy);
  border-bottom: 3px solid var(--blue-nancy);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-maretron {
  color: var(--blue-nancy);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.brand-divider {
  color: var(--blue-nancy);
  font-weight: 300;
  font-size: 1.1rem;
}

.brand-product {
  color: var(--blue-nancy);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

a.brand-maretron,
a.brand-product {
  text-decoration: none;
}

a.brand-maretron:hover,
a.brand-product:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  /* transition: background var(--transition), color var(--transition), border-color var(--transition); */
  white-space: nowrap;
}

.btn-primary {
  background: var(--raymaroon-gradient);
  color: var(--white);
  border-color: var(--maroon);
}

.btn-primary:hover {
  background: #8d003e;
  border-color: #8d003e;
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.35);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.6);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
}

/* ---- Hero ---- */

.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, var(--navy-light) 100%);
  color: var(--white);
  padding: 80px 0 72px;
  flex: 1;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 64px;
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-nancy);
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 1.1rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.78);
  max-width: 520px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---- Instrument mockup ---- */

.hero-graphic {
  flex-shrink: 0;
}

.instrument-mockup {
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.instrument-ring {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 6px solid var(--blue-nancy);
  background: radial-gradient(circle at 40% 38%, #163d6e, #0a2240 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 3px rgba(244,121,32,0.2),
    0 8px 32px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

@keyframes radar-sweep {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.instrument-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    rgba(123, 206, 254, 0.75)  0deg,
    rgba(123, 206, 254, 0.35) 40deg,
    rgba(123, 206, 254, 0.07) 85deg,
    transparent              115deg,
    transparent              360deg
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 350ms ease;
}

.instrument-mockup.is-loading .instrument-sweep {
  opacity: 1;
  animation: radar-sweep 1.8s linear infinite;
}

.instrument-face {
  text-align: center;
}

.instrument-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 4px;
}

.instrument-value {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
  letter-spacing: -0.02em;
}

.instrument-unit {
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
  margin-left: 2px;
}

/* ---- Features ---- */

.features {
  background: var(--gray-bg);
  border-top: 1px solid var(--gray-border);
  padding: 56px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-top: 3px solid var(--blue-700);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.feature-icon {
  font-size: 0.55rem;
  color: var(--blue-700);
  margin-bottom: 14px;
}

.feature-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.feature-card p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ---- Footer ---- */

main {
  display: flex;
  flex: 1;
}

.site-footer {
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 24px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
}

.footer-note {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
}

/* ---- Demo list (rendered by app.js) ---- */

.demo-list {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.demo-item-btn {
  /* extends .btn .btn-primary */
}

/* ---- Loading state ---- */

.loading-demos {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--blue-nancy);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-graphic {
    display: none;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
