/* Locomorph - Robotics & Locomotion Research Hub */
/* CSS Prefix: lm- */

:root {
  --lm-primary: #0f2027;
  --lm-primary-light: #1a3a4a;
  --lm-accent: #2cb67d;
  --lm-accent-hover: #24a06d;
  --lm-secondary: #7f5af0;
  --lm-bg: #fffffe;
  --lm-bg-alt: #f0f4f8;
  --lm-text: #2d3436;
  --lm-text-light: #636e72;
  --lm-text-inv: #f0f4f8;
  --lm-border: #dfe6e9;
  --lm-shadow: 0 2px 16px rgba(15, 32, 39, 0.08);
  --lm-shadow-lg: 0 8px 32px rgba(15, 32, 39, 0.12);
  --lm-radius: 8px;
  --lm-radius-lg: 16px;
  --lm-max-width: 1180px;
  --lm-font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --lm-font-heading: 'Outfit', system-ui, -apple-system, sans-serif;
  --lm-transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--lm-font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--lm-text);
  background: var(--lm-bg);
}

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

a {
  color: var(--lm-accent);
  text-decoration: none;
  transition: color var(--lm-transition);
}

a:hover {
  color: var(--lm-accent-hover);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--lm-font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--lm-primary);
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 1.85rem; margin-bottom: 0.85rem; }
h3 { font-size: 1.4rem; margin-bottom: 0.7rem; }
h4 { font-size: 1.15rem; margin-bottom: 0.6rem; }

p { margin-bottom: 1.2rem; }

/* ===== HEADER / NAV ===== */
.lm-header {
  background: var(--lm-primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.lm-nav {
  max-width: var(--lm-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.lm-logo img {
  height: 30px;
  width: auto;
}

.lm-nav-links {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.lm-nav-links > li > a {
  color: var(--lm-text-inv);
  padding: 0.5rem 1rem;
  border-radius: var(--lm-radius);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background var(--lm-transition);
}

.lm-nav-links > li > a:hover,
.lm-nav-links > li > a.lm-active {
  background: rgba(255,255,255,0.1);
  color: var(--lm-accent);
}

/* Dropdown */
.lm-dropdown {
  position: relative;
}

.lm-dropdown-menu {
  list-style: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--lm-bg);
  border-radius: var(--lm-radius);
  box-shadow: var(--lm-shadow-lg);
  min-width: 220px;
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--lm-transition);
  z-index: 100;
}

.lm-dropdown:hover .lm-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lm-dropdown-menu li a {
  display: block;
  padding: 0.5rem 1.25rem;
  color: var(--lm-text);
  font-size: 0.9rem;
}

.lm-dropdown-menu li a:hover {
  background: var(--lm-bg-alt);
  color: var(--lm-accent);
}

/* Mobile nav toggle */
.lm-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.lm-nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--lm-text-inv);
  border-radius: 2px;
  transition: all var(--lm-transition);
}

/* ===== HERO ===== */
.lm-hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--lm-primary);
}

.lm-hero-bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  opacity: 0.35;
}

.lm-hero-content {
  position: relative;
  max-width: var(--lm-max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem;
  color: var(--lm-text-inv);
  z-index: 2;
}

.lm-hero h1 {
  color: #fff;
  font-size: 3rem;
  max-width: 680px;
}

.lm-hero p {
  font-size: 1.15rem;
  max-width: 560px;
  opacity: 0.9;
}

.lm-btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: var(--lm-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--lm-radius);
  transition: background var(--lm-transition), transform var(--lm-transition);
}

.lm-btn:hover {
  background: var(--lm-accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

.lm-btn-outline {
  background: transparent;
  border: 2px solid var(--lm-accent);
  color: var(--lm-accent);
}

.lm-btn-outline:hover {
  background: var(--lm-accent);
  color: #fff;
}

/* ===== SECTIONS ===== */
.lm-section {
  padding: 4.5rem 1.5rem;
}

.lm-section-alt {
  background: var(--lm-bg-alt);
}

.lm-container {
  max-width: var(--lm-max-width);
  margin: 0 auto;
}

.lm-section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.lm-section-header p {
  color: var(--lm-text-light);
  max-width: 600px;
  margin: 0.5rem auto 0;
}

.lm-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lm-accent);
  margin-bottom: 0.5rem;
}

/* ===== CARD GRID ===== */
.lm-grid {
  display: grid;
  gap: 2rem;
}

.lm-grid-2 { grid-template-columns: repeat(2, 1fr); }
.lm-grid-3 { grid-template-columns: repeat(3, 1fr); }
.lm-grid-4 { grid-template-columns: repeat(4, 1fr); }

.lm-card {
  background: var(--lm-bg);
  border-radius: var(--lm-radius-lg);
  overflow: hidden;
  box-shadow: var(--lm-shadow);
  transition: transform var(--lm-transition), box-shadow var(--lm-transition);
}

.lm-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--lm-shadow-lg);
}

.lm-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.lm-card-body {
  padding: 1.5rem;
}

.lm-card-body h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.lm-card-body h3 a {
  color: var(--lm-primary);
}

.lm-card-body h3 a:hover {
  color: var(--lm-accent);
}

.lm-card-body p {
  color: var(--lm-text-light);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.lm-card-meta {
  font-size: 0.82rem;
  color: var(--lm-text-light);
}

/* ===== ARTICLE LAYOUT ===== */
.lm-article {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.lm-article-header {
  margin-bottom: 2.5rem;
}

.lm-article-header h1 {
  font-size: 2.3rem;
  line-height: 1.2;
}

.lm-article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--lm-text-light);
}

.lm-article-meta img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.lm-article-hero {
  width: 100%;
  border-radius: var(--lm-radius-lg);
  margin-bottom: 2rem;
}

.lm-article h2 {
  margin-top: 2.5rem;
}

.lm-article h3 {
  margin-top: 2rem;
}

.lm-article ul, .lm-article ol {
  margin: 0.5rem 0 1.5rem 1.5rem;
}

.lm-article li {
  margin-bottom: 0.4rem;
}

.lm-article blockquote {
  border-left: 4px solid var(--lm-accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--lm-bg-alt);
  border-radius: 0 var(--lm-radius) var(--lm-radius) 0;
  font-style: italic;
  color: var(--lm-text-light);
}

/* ===== BREADCRUMB ===== */
.lm-breadcrumb {
  max-width: var(--lm-max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  font-size: 0.85rem;
  color: var(--lm-text-light);
}

.lm-breadcrumb a {
  color: var(--lm-text-light);
}

.lm-breadcrumb a:hover {
  color: var(--lm-accent);
}

.lm-breadcrumb span {
  margin: 0 0.4rem;
}

.lm-breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.lm-breadcrumb li {
  display: flex;
  align-items: center;
}

.lm-breadcrumb li + li::before {
  content: '/';
  margin: 0 0.5rem;
  color: var(--lm-border);
}

/* ===== FAQ ===== */
.lm-faq {
  margin-top: 3rem;
  border-top: 2px solid var(--lm-border);
  padding-top: 2rem;
}

.lm-faq-item {
  border-bottom: 1px solid var(--lm-border);
}

.lm-faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1.15rem 2.5rem 1.15rem 0;
  font-family: var(--lm-font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--lm-primary);
  cursor: pointer;
  position: relative;
  line-height: 1.4;
}

.lm-faq-q::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--lm-accent);
  transition: transform var(--lm-transition);
}

.lm-faq-item.lm-open .lm-faq-q::after {
  content: '-';
}

.lm-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.lm-faq-a-inner {
  padding: 0 0 1.25rem;
  color: var(--lm-text-light);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ===== ABOUT / FEATURE BLOCKS ===== */
.lm-feature-row {
  display: flex;
  gap: 3rem;
  align-items: center;
  margin-bottom: 3.5rem;
}

.lm-feature-row:nth-child(even) {
  flex-direction: row-reverse;
}

.lm-feature-img {
  flex: 0 0 45%;
  border-radius: var(--lm-radius-lg);
  overflow: hidden;
}

.lm-feature-img img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.lm-feature-text {
  flex: 1;
}

/* ===== NEWS LIST ===== */
.lm-news-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--lm-border);
}

.lm-news-item:first-child {
  padding-top: 0;
}

.lm-news-img {
  flex: 0 0 200px;
  height: 140px;
  border-radius: var(--lm-radius);
  overflow: hidden;
}

.lm-news-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lm-news-body h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.lm-news-body p {
  font-size: 0.92rem;
  color: var(--lm-text-light);
}

.lm-news-date {
  font-size: 0.82rem;
  color: var(--lm-text-light);
  margin-bottom: 0.3rem;
}

/* ===== LEGAL PAGES ===== */
.lm-legal {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.lm-legal h1 {
  margin-bottom: 1.5rem;
}

.lm-legal h2 {
  margin-top: 2rem;
  font-size: 1.4rem;
}

.lm-legal ul {
  margin: 0.5rem 0 1.5rem 1.5rem;
}

.lm-legal li {
  margin-bottom: 0.35rem;
}

/* ===== 404 ===== */
.lm-404 {
  text-align: center;
  padding: 6rem 1.5rem;
}

.lm-404 h1 {
  font-size: 5rem;
  color: var(--lm-accent);
  margin-bottom: 0.5rem;
}

.lm-404 p {
  font-size: 1.15rem;
  color: var(--lm-text-light);
  margin-bottom: 2rem;
}

/* ===== FOOTER ===== */
.lm-footer {
  background: var(--lm-primary);
  color: var(--lm-text-inv);
  padding: 3.5rem 1.5rem 0;
}

.lm-footer-inner {
  max-width: var(--lm-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}

.lm-footer-col p {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-top: 1rem;
}

.lm-footer-col h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lm-footer-col ul {
  list-style: none;
}

.lm-footer-col ul li {
  margin-bottom: 0.5rem;
}

.lm-footer-col ul a {
  color: var(--lm-text-inv);
  opacity: 0.7;
  font-size: 0.9rem;
}

.lm-footer-col ul a:hover {
  opacity: 1;
  color: var(--lm-accent);
}

.lm-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.25rem 0;
  text-align: center;
  max-width: var(--lm-max-width);
  margin: 0 auto;
}

.lm-footer-bottom p {
  font-size: 0.85rem;
  opacity: 0.6;
  margin: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 968px) {
  .lm-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .lm-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .lm-footer-inner { grid-template-columns: repeat(2, 1fr); }
  .lm-feature-row, .lm-feature-row:nth-child(even) {
    flex-direction: column;
  }
  .lm-feature-img { flex: none; width: 100%; }
  h1 { font-size: 2rem; }
  .lm-hero h1 { font-size: 2.3rem; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }

  .lm-nav-toggle { display: flex; }

  .lm-nav-links {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--lm-primary);
    flex-direction: column;
    padding: 2rem 1.5rem;
    gap: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .lm-nav-links.lm-open {
    transform: translateX(0);
  }

  .lm-nav-links > li > a {
    display: block;
    padding: 0.85rem 0;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    border-radius: 0;
  }

  .lm-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: transparent;
    padding: 0 0 0 1.25rem;
  }

  .lm-dropdown-menu li a {
    color: var(--lm-text-inv);
    opacity: 0.75;
    padding: 0.5rem 0;
  }

  .lm-grid-2, .lm-grid-3, .lm-grid-4 {
    grid-template-columns: 1fr;
  }

  .lm-footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }

  .lm-hero { min-height: 360px; }
  .lm-hero h1 { font-size: 1.85rem; }
  .lm-section { padding: 3rem 1.5rem; }

  .lm-news-item { flex-direction: column; }
  .lm-news-img { flex: none; width: 100%; height: 180px; }

  .lm-article-header h1 { font-size: 1.75rem; }
}
