/* shared.css — M PRO9 foundation tokens and reset
   Load order: shared.css (HEAD, first) → [page].css (HEAD, second) → global-overrides.css (deferred, last)
   NEVER link this to: index.html, Research.html (conflicting button/animation systems)
*/

:root {
  --primary: #173f64;
  --primary-light: #319dcf;
  --secondary: #0a1f3d;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --bg-light: #f8fafc;
  --radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: clip; /* clip (not hidden) — avoids breaking position:sticky children */
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  top: -120%;
  left: 16px;
  padding: 10px 22px;
  background: var(--secondary);
  color: #f1f5fa;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 0 0 10px 10px;
  z-index: 10000;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; outline: 3px solid var(--primary-light); outline-offset: 2px; }

/* ---- Typography ---- */
h1, h2, h3 {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  line-height: 1.15;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: clamp(1.05rem, 2vw, 1.25rem); }

a { color: var(--primary); text-decoration: none; }
.site-footer a { color: #d4e8ff; text-decoration: none; }

/* ---- Container ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}
@media (max-width: 1024px) { .container { padding: 0 32px; } }
@media (max-width: 768px)  { .container { padding: 0 20px; } }

/* ---- Section ---- */
.section { padding: 100px 0; }
@media (max-width: 1024px) { .section { padding: 80px 0; } }
@media (max-width: 768px)  { .section { padding: 64px 0; } }
@media (max-width: 430px)  { .section { padding: 48px 0; } }

/* ---- Section label ---- */
.section-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: 12px;
}

/* ---- Section title ---- */
.section-title { text-align: center; margin-bottom: 56px; }
.section-title h2 { color: var(--primary); margin-bottom: 10px; }
.section-title p  { color: var(--text-muted); font-size: 1.05rem; max-width: 520px; margin: 0 auto; }
@media (max-width: 768px) { .section-title { margin-bottom: 40px; } }
@media (max-width: 430px) { .section-title { margin-bottom: 28px; } }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ================================================================
   TIER 2 — Shared service-page components
   Used by: AI, web_development, Robotics, embedded, PCB, AR_VR,
            3D_printing, Explinary
   NOT for: index.html, Research.html
   ================================================================ */

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn-primary {
  background: var(--primary-light);
  color: #ffffff;
}
.btn-primary:hover {
  background: #2589ba;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(49,157,207,0.32);
}
.btn-ghost {
  background: transparent;
  color: #ffffff;
  border: 2px solid rgba(255,255,255,0.45);
}
.btn-ghost:hover {
  border-color: #ffffff;
  background: rgba(255,255,255,0.08);
}
@media (max-width: 768px) {
  .btn { min-height: 44px; padding: 12px 22px; font-size: 0.9rem; }
}

/* ---- Hero atoms ---- */
.hero-eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: 14px;
}

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

.hero-btns {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 768px) { .hero-sub { font-size: 1rem; } }
@media (max-width: 430px) {
  .hero-sub     { font-size: 0.94rem; margin-bottom: 28px; }
  .hero-eyebrow { font-size: 0.74rem; }
  .hero-btns    { gap: 12px; }
}

/* ---- Builds grid ---- */
.builds-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (max-width: 680px) { .builds-grid { grid-template-columns: 1fr; } }

.build-card {
  position: relative;
  padding: 36px 32px 32px;
  background: var(--bg-light);
  border-radius: var(--radius);
  border: 1px solid #e2eaf2;
  overflow: hidden;
}

.build-num {
  position: absolute;
  top: 16px;
  right: 20px;
  font-family: 'Lato', sans-serif;
  font-size: 4rem;
  font-weight: 900;
  color: var(--primary);
  opacity: 0.06;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 430px) { .build-card { padding: 24px 20px 20px; } }

.build-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(49,157,207,0.1);
  color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 18px;
}

.build-card h3 { color: var(--primary); margin-bottom: 10px; }
.build-card p  { color: var(--text-muted); font-size: 0.93rem; line-height: 1.72; }

/* ---- Approach grid ---- */
.approach-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
@media (max-width: 992px) { .approach-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; } }
@media (max-width: 560px)  { .approach-grid { grid-template-columns: 1fr; } }

.step-num {
  font-family: 'Lato', sans-serif;
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
  opacity: 0.14;
  line-height: 1;
  margin-bottom: 10px;
}

.approach-step h3 { color: var(--primary); font-size: 1.15rem; margin-bottom: 10px; }
.approach-step p  { color: var(--text-muted); font-size: 0.93rem; line-height: 1.72; }

/* ---- Why grid ---- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 680px) { .why-grid { grid-template-columns: 1fr; } }

.why-card {
  padding: 34px 30px;
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid #e2eaf2;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.why-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(23,63,100,0.09);
}

@media (max-width: 430px) { .why-card { padding: 24px 20px; } }

.why-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(49,157,207,0.1);
  color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 18px;
}

.why-card h3 { color: var(--primary); margin-bottom: 10px; }
.why-card p  { color: var(--text-muted); font-size: 0.93rem; line-height: 1.72; }

/* ---- CTA inner ---- */
.cta-inner {
  max-width: 540px;
  margin: 0 auto;
  text-align: center;
}
.cta-inner h2 { color: #ffffff; font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin-bottom: 14px; }
.cta-inner > p { color: rgba(255,255,255,0.68); font-size: 1.05rem; margin-bottom: 32px; }

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   TIER 3 — Page-differentiation patterns
   Service-page "Why M PRO9" replacements for .why-grid
   ============================================================ */

/* ---- Numbered proof list (AI page) ---- */
.proof-list { max-width: 860px; margin: 0 auto; list-style: none; padding: 0; }
.proof-item { display: grid; grid-template-columns: 52px 1fr; gap: 24px; align-items: start; padding: 32px 0; border-bottom: 1px solid #e2eaf2; }
.proof-item:last-child { border-bottom: none; }
.proof-num { font-family: 'Lato', sans-serif; font-weight: 900; font-size: 2rem; color: var(--primary-light); line-height: 1; padding-top: 3px; }
.proof-body h3 { color: var(--primary); margin-bottom: 8px; }
.proof-body p  { color: var(--text-muted); font-size: 0.93rem; line-height: 1.72; }
@media (max-width: 430px) {
  .proof-item { grid-template-columns: 40px 1fr; gap: 16px; padding: 24px 0; }
  .proof-num  { font-size: 1.6rem; }
}

/* ---- 2-column claim rows (Web Development page) ---- */
.claim-rows { max-width: 900px; margin: 0 auto; }
.claim-row { display: grid; grid-template-columns: 1fr 1.5fr; gap: 48px; align-items: baseline; padding: 28px 0; border-bottom: 1px solid #e2eaf2; }
.claim-row:last-child { border-bottom: none; }
.claim-principle { font-family: 'Lato', sans-serif; font-weight: 800; font-size: 1.05rem; color: var(--primary); line-height: 1.35; margin: 0; }
.claim-detail { font-size: 0.93rem; color: var(--text-muted); line-height: 1.72; margin: 0; }
@media (max-width: 680px) { .claim-row { grid-template-columns: 1fr; gap: 10px; } }
@media (max-width: 430px) { .claim-row { padding: 20px 0; } }

/* ---- Annotation list (Robotics / Embedded / PCB pages) ---- */
.annot-list { max-width: 860px; margin: 0 auto; list-style: none; padding: 0; }
.annot-item { position: relative; padding: 28px 0 28px 22px; border-bottom: 1px solid #e2eaf2; }
.annot-item::before { content: ''; position: absolute; left: 0; top: 36px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary-light); }
.annot-item:last-child { border-bottom: none; }
.annot-item h3 { color: var(--primary); margin-bottom: 8px; }
.annot-item p  { color: var(--text-muted); font-size: 0.93rem; line-height: 1.72; }
@media (max-width: 430px) {
  .annot-item         { padding: 20px 0 20px 18px; }
  .annot-item::before { top: 28px; }
}

/* ---- Proposition band (AR/VR page) ---- */
.prop-band { display: grid; grid-template-columns: repeat(2, 1fr); max-width: 900px; margin: 0 auto; }
.prop-point { padding: 36px 40px; }
.prop-point-icon { font-size: 1.3rem; color: var(--primary-light); margin-bottom: 14px; }
.prop-point h3 { color: var(--primary); font-size: 1.02rem; margin-bottom: 10px; }
.prop-point p  { color: var(--text-muted); font-size: 0.9rem; line-height: 1.72; }
@media (min-width: 681px) {
  .prop-point:nth-child(odd)  { border-right: 1px solid #e2eaf2; }
  .prop-point:nth-child(-n+2) { border-bottom: 1px solid #e2eaf2; }
}
@media (max-width: 680px) {
  .prop-band { grid-template-columns: 1fr; }
  .prop-point { padding: 28px 20px; border-bottom: 1px solid #e2eaf2; }
  .prop-point:last-child { border-bottom: none; }
}
@media (max-width: 390px) { .prop-point { padding: 22px 16px; } }

/* ---- Benefit strip (3D Printing page) ---- */
.benefit-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 48px; }
.benefit-item { display: flex; flex-direction: column; }
.benefit-icon { font-size: 1.2rem; color: var(--primary-light); margin-bottom: 14px; }
.benefit-item h3 { color: var(--primary); font-size: 0.97rem; margin-bottom: 8px; }
.benefit-item p  { color: var(--text-muted); font-size: 0.88rem; line-height: 1.72; }
@media (max-width: 900px) { .benefit-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .benefit-strip { grid-template-columns: 1fr; } }

/* ---- Pull-quote + support points (Explainer page) ---- */
.pull-quote { max-width: 680px; margin: 0 auto 52px; text-align: center; }
.pull-quote blockquote { font-family: 'Lato', sans-serif; font-weight: 800; font-size: clamp(1.3rem, 2.8vw, 1.85rem); color: var(--primary); line-height: 1.45; margin: 0; padding: 0; }
.support-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.support-point h3 { color: var(--primary); font-size: 1rem; margin-bottom: 10px; }
.support-point p  { color: var(--text-muted); font-size: 0.91rem; line-height: 1.72; }
@media (max-width: 768px) { .support-points { grid-template-columns: 1fr; gap: 28px; } }
