:root {
  --stm-canvas: #f4f7f9;
  --stm-surface: #ffffff;
  --stm-surface-alt: #eaf0f6;
  --stm-ink: #0d1b2a;
  --stm-ink-secondary: #334e68;
  --stm-ink-muted: #627d98;
  --stm-emerald: #0d9488;
  --stm-emerald-dark: #0f766e;
  --stm-cyan: #0284c7;
  --stm-amber: #d97706;
  --stm-border: #d9e2ec;
  --stm-font-heading: "Space Grotesk", "Trebuchet MS", "Segoe UI", sans-serif;
  --stm-font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --stm-font-mono: "JetBrains Mono", Consolas, monospace;
  --stm-radius-sm: 6px;
  --stm-radius-md: 12px;
  --stm-radius-lg: 18px;
  --stm-shadow-card: 0 8px 24px -4px rgba(13, 27, 42, 0.07);
  --stm-shadow-float: 0 18px 38px -8px rgba(13, 27, 42, 0.14);
}

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

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

body.stm-body {
  font-family: var(--stm-font-body);
  background-color: var(--stm-canvas);
  color: var(--stm-ink);
  line-height: 1.68;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--stm-emerald-dark);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

a:hover {
  color: var(--stm-cyan);
}

.stm-wrap {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.stm-wrap-narrow {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Top Telemetry Strip */
.stm-topbar {
  background: var(--stm-ink);
  color: #cbd5e1;
  font-size: 0.82rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stm-topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stm-topbar-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #5eead4;
  font-weight: 600;
}

/* Masthead Navigation */
.stm-masthead {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stm-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.stm-masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}

.stm-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.stm-identity-mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.stm-identity-title {
  display: block;
  font-family: var(--stm-font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--stm-ink);
  line-height: 1.1;
}

.stm-identity-sub {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--stm-emerald);
  font-weight: 700;
}

.stm-nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.stm-nav-item {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--stm-ink-secondary);
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.stm-nav-item:hover,
.stm-nav-item.is-current {
  color: var(--stm-emerald-dark);
  border-bottom-color: var(--stm-emerald);
}

.stm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.35rem;
  border-radius: var(--stm-radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.stm-btn-emerald {
  background: var(--stm-emerald);
  color: #ffffff;
}

.stm-btn-emerald:hover {
  background: var(--stm-emerald-dark);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.25);
}

.stm-btn-ghost {
  background: var(--stm-surface);
  color: var(--stm-ink);
  border-color: var(--stm-border);
}

.stm-btn-ghost:hover {
  border-color: var(--stm-emerald);
  color: var(--stm-emerald-dark);
}

.stm-burger-btn {
  display: none;
  background: var(--stm-surface-alt);
  border: 1px solid var(--stm-border);
  border-radius: var(--stm-radius-sm);
  padding: 0.55rem 0.75rem;
  font-size: 1.1rem;
  color: var(--stm-ink);
  cursor: pointer;
}

.stm-drawer-menu {
  display: none;
  background: var(--stm-surface);
  border-bottom: 1px solid var(--stm-border);
  padding: 1rem 1.5rem 1.5rem;
  flex-direction: column;
  gap: 0.75rem;
}

.stm-drawer-menu.is-expanded {
  display: flex;
}

/* Hero Stage */
.stm-hero {
  background: linear-gradient(135deg, #0d1b2a 0%, #132a42 60%, #0f3f49 100%);
  color: #f8fafc;
  padding: 4.5rem 0;
  position: relative;
  overflow: hidden;
}

.stm-hero-layout {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 3rem;
  align-items: center;
}

.stm-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(16, 185, 129, 0.16);
  color: #5eead4;
  border: 1px solid rgba(94, 234, 212, 0.3);
  margin-bottom: 1.15rem;
}

.stm-hero-title {
  font-family: var(--stm-font-heading);
  font-size: 2.85rem;
  line-height: 1.16;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 1.25rem;
}

.stm-hero-lead {
  font-size: 1.12rem;
  color: #cbd5e1;
  margin-bottom: 2rem;
  max-width: 620px;
}

.stm-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.stm-hero-visual-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--stm-radius-lg);
  padding: 1.25rem;
  box-shadow: var(--stm-shadow-float);
}

.stm-hero-visual-box img {
  border-radius: var(--stm-radius-md);
  margin-bottom: 1rem;
}

.stm-telemetry-mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.stm-telemetry-cell {
  background: rgba(13, 27, 42, 0.72);
  padding: 0.75rem;
  border-radius: var(--stm-radius-sm);
  border-left: 3px solid #10b981;
}

.stm-telemetry-cell strong {
  display: block;
  font-family: var(--stm-font-mono);
  font-size: 1.15rem;
  color: #ffffff;
}

.stm-telemetry-cell span {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Metrics Bar */
.stm-kpi-band {
  background: var(--stm-surface);
  border-bottom: 1px solid var(--stm-border);
  padding: 2rem 0;
}

.stm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.stm-kpi-item {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.stm-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--stm-surface-alt);
  color: var(--stm-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.stm-kpi-item h4 {
  font-size: 0.98rem;
  margin-bottom: 0.2rem;
  color: var(--stm-ink);
}

.stm-kpi-item p {
  font-size: 0.84rem;
  color: var(--stm-ink-muted);
}

/* Generic Section Spacing */
.stm-section {
  padding: 4.5rem 0;
}

.stm-section-alt {
  background: var(--stm-surface-alt);
}

.stm-heading-block {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
}

.stm-heading-block h2 {
  font-family: var(--stm-font-heading);
  font-size: 2.2rem;
  color: var(--stm-ink);
  margin-bottom: 0.85rem;
}

.stm-heading-block p {
  color: var(--stm-ink-secondary);
  font-size: 1.05rem;
}

/* 3-Column Feature Cards */
.stm-trio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.85rem;
}

.stm-study-card {
  background: var(--stm-surface);
  border: 1px solid var(--stm-border);
  border-radius: var(--stm-radius-md);
  overflow: hidden;
  box-shadow: var(--stm-shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.stm-study-card:hover {
  transform: translateY(-4px);
}

.stm-study-thumb {
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.stm-study-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.stm-study-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--stm-emerald-dark);
  margin-bottom: 0.65rem;
}

.stm-study-title {
  font-family: var(--stm-font-heading);
  font-size: 1.28rem;
  color: var(--stm-ink);
  margin-bottom: 0.75rem;
}

.stm-study-excerpt {
  font-size: 0.93rem;
  color: var(--stm-ink-secondary);
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

/* Interactive Stride & Pace Biomechanics Engine */
.stm-engine-shell {
  background: var(--stm-surface);
  border: 1px solid var(--stm-border);
  border-radius: var(--stm-radius-lg);
  padding: 2.5rem;
  box-shadow: var(--stm-shadow-card);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  align-items: stretch;
}

.stm-field-row {
  margin-bottom: 1.25rem;
}

.stm-field-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.45rem;
  color: var(--stm-ink);
}

.stm-input,
.stm-select,
.stm-textarea {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--stm-border);
  border-radius: var(--stm-radius-sm);
  font-family: var(--stm-font-body);
  font-size: 0.95rem;
  color: var(--stm-ink);
  background: var(--stm-canvas);
}

.stm-input:focus,
.stm-select:focus,
.stm-textarea:focus {
  outline: none;
  border-color: var(--stm-emerald);
  background: #ffffff;
}

.stm-telemetry-output {
  background: linear-gradient(145deg, #0d1b2a 0%, #16324f 100%);
  color: #f8fafc;
  border-radius: var(--stm-radius-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stm-output-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.25rem 0;
}

.stm-output-tile {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1rem;
  border-radius: var(--stm-radius-sm);
}

.stm-output-tile span {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}

.stm-output-tile strong {
  font-family: var(--stm-font-mono);
  font-size: 1.45rem;
  color: #5eead4;
}

/* FAQ Accordion */
.stm-faq-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stm-faq-box {
  background: var(--stm-surface);
  border: 1px solid var(--stm-border);
  border-radius: var(--stm-radius-md);
  overflow: hidden;
}

.stm-faq-btn {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--stm-font-heading);
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--stm-ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.stm-faq-panel {
  display: none;
  padding: 0 1.5rem 1.35rem;
  color: var(--stm-ink-secondary);
  font-size: 0.95rem;
  border-top: 1px solid var(--stm-surface-alt);
}

.stm-faq-box.is-open .stm-faq-panel {
  display: block;
}

/* Legal & Tables */
.stm-doc-box {
  background: var(--stm-surface);
  border: 1px solid var(--stm-border);
  border-radius: var(--stm-radius-lg);
  padding: 3rem;
  margin: 3rem 0;
  box-shadow: var(--stm-shadow-card);
}

.stm-doc-box h1 {
  font-family: var(--stm-font-heading);
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
}

.stm-doc-box h2 {
  font-family: var(--stm-font-heading);
  font-size: 1.35rem;
  margin: 1.85rem 0 0.75rem;
  color: var(--stm-ink);
}

.stm-doc-box p,
.stm-doc-box ul {
  margin-bottom: 1rem;
  color: var(--stm-ink-secondary);
}

.stm-doc-box ul {
  padding-left: 1.35rem;
}

.stm-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}

.stm-table th,
.stm-table td {
  border: 1px solid var(--stm-border);
  padding: 0.85rem 1rem;
  text-align: left;
}

.stm-table th {
  background: var(--stm-surface-alt);
  color: var(--stm-ink);
  font-weight: 700;
}

/* Alerts */
.stm-status-msg {
  display: none;
  padding: 1rem 1.25rem;
  border-radius: var(--stm-radius-sm);
  margin-bottom: 1.25rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.stm-status-ok {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #34d399;
}

.stm-status-fail {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
}

/* Footer */
.stm-footer {
  background: #09131f;
  color: #94a3b8;
  padding: 4rem 0 2rem;
  margin-top: auto;
}

.stm-footer-columns {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.stm-footer h3,
.stm-footer h4 {
  color: #ffffff;
  font-family: var(--stm-font-heading);
  margin-bottom: 1rem;
}

.stm-footer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.stm-footer-list a {
  color: #94a3b8;
  font-size: 0.9rem;
}

.stm-footer-list a:hover {
  color: #5eead4;
}

.stm-footer-note {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.75rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.84rem;
}

/* Cookie Consent Bar */
.stm-cookie-bar {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  right: 1.25rem;
  max-width: 620px;
  background: #0d1b2a;
  color: #f8fafc;
  padding: 1.35rem 1.5rem;
  border-radius: var(--stm-radius-md);
  border: 1px solid rgba(94, 234, 212, 0.35);
  box-shadow: var(--stm-shadow-float);
  z-index: 999;
  display: none;
}

.stm-cookie-bar.is-visible {
  display: block;
}

.stm-cookie-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (max-width: 960px) {
  .stm-hero-layout,
  .stm-engine-shell,
  .stm-trio-grid,
  .stm-kpi-grid,
  .stm-footer-columns {
    grid-template-columns: 1fr;
  }
  .stm-nav-links {
    display: none;
  }
  .stm-burger-btn {
    display: inline-flex;
  }
  .stm-hero-title {
    font-size: 2.15rem;
  }
}
