@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --bone: #f0ece4;
  --ivory: #faf8f4;
  --parchment: #e8e0d0;
  --steel: #2c4a6e;
  --steel-mid: #4a72a0;
  --steel-light: #d4e3f5;
  --rust: #b8542a;
  --rust-light: #f5e8e2;
  --ink: #1a1a2e;
  --muted: #6a7080;
  --cartilage: #7aab88;
  --cartilage-light: #e8f4ec;
  --white: #ffffff;
}

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

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--ivory);
  color: var(--ink);
  line-height: 1.7;
}

/* ── HERO ── */
.hero {
  background: var(--steel);
  min-height: 420px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='40' cy='40' r='30'/%3E%3Ccircle cx='40' cy='40' r='20'/%3E%3Ccircle cx='40' cy='40' r='10'/%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
}
.hero-left {
  padding: 70px 50px 70px 60px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.breadcrumb {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel-light);
  opacity: 0.75;
  margin-bottom: 22px;
}
.breadcrumb span { margin: 0 8px; opacity: 0.5; }
h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 20px;
}
h1 em { font-style: italic; color: var(--steel-light); }
.hero-desc {
  color: rgba(255,255,255,0.72);
  font-size: 1.05rem;
  font-weight: 300;
  max-width: 420px;
  line-height: 1.7;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}
.hero-tag {
  padding: 5px 14px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  font-size: 0.8rem;
  border-radius: 30px;
}
.hero-right {
  background: var(--bone);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
}
.joint-diagram {
  width: 100%;
  max-width: 300px;
}

/* ── NAV TABS ── */
.section-nav {
  background: var(--white);
  border-bottom: 1px solid var(--parchment);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(44,74,110,0.08);
}
.section-nav-inner {
  max-width: 1100px;
  margin: auto;
  padding: 0 50px;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.section-nav-inner::-webkit-scrollbar { display: none; }
.nav-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 15px 20px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}
.nav-tab .tab-icon { font-size: 1em; }
.nav-tab:hover { color: var(--steel); }
.nav-tab.active { color: var(--steel); border-bottom-color: var(--steel); }

/* ── LAYOUT ── */
.page-wrap {
  max-width: 1100px;
  margin: auto;
  padding: 60px 50px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 64px;
}
main { min-width: 0; }

/* ── SECTION ── */
.section {
  margin-bottom: 70px;
  animation: slideIn 0.5s ease both;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.section:nth-child(1) { animation-delay: 0.05s; }
.section:nth-child(2) { animation-delay: 0.12s; }
.section:nth-child(3) { animation-delay: 0.19s; }
.section:nth-child(4) { animation-delay: 0.26s; }
.section:nth-child(5) { animation-delay: 0.33s; }
.section:nth-child(6) { animation-delay: 0.40s; }

.section-header {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--parchment);
}
.section-num {
  font-family: 'DM Serif Display', serif;
  font-size: 3.5rem;
  color: var(--parchment);
  line-height: 1;
  font-weight: 400;
  min-width: 60px;
}
.section h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.75rem;
  color: var(--ink);
  line-height: 1.2;
}
.section p {
  font-size: 0.97rem;
  color: #3a4055;
  margin-bottom: 16px;
  line-height: 1.78;
}
.section p:last-child { margin-bottom: 0; }

/* ── JOINT TYPES CARDS ── */
.joint-types {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}
.joint-card {
  background: var(--white);
  border: 1px solid var(--parchment);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  transition: all 0.25s;
  cursor: default;
}
.joint-card:hover {
  border-color: var(--steel-mid);
  box-shadow: 0 8px 24px rgba(44,74,110,0.12);
  transform: translateY(-3px);
}
.joint-card .jc-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
  display: block;
}
.joint-card .jc-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1rem;
  color: var(--steel);
  margin-bottom: 6px;
}
.joint-card .jc-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}
.joint-card .jc-example {
  display: inline-block;
  margin-top: 10px;
  background: var(--steel-light);
  color: var(--steel);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── LAYERS LIST ── */
.layers-list {
  background: var(--white);
  border: 1px solid var(--parchment);
  border-radius: 10px;
  overflow: hidden;
  margin: 20px 0;
}
.layer-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--parchment);
}
.layer-item:last-child { border-bottom: none; }
.layer-num {
  height: 100%;
  background: var(--steel);
  color: white;
  font-family: 'DM Serif Display', serif;
  font-size: 1rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 0;
}
.layer-content { padding: 14px 20px; }
.layer-content strong {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 2px;
}
.layer-content span { font-size: 0.84rem; color: var(--muted); }

/* ── PATHOLOGY ACCORDION ── */
.accordion { margin: 20px 0; }
.acc-item {
  border: 1px solid var(--parchment);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.acc-item.open { box-shadow: 0 4px 16px rgba(44,74,110,0.1); }
.acc-btn {
  width: 100%;
  background: var(--white);
  border: none;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  transition: background 0.2s;
}
.acc-btn:hover { background: var(--bone); }
.acc-btn .acc-arrow {
  width: 22px;
  height: 22px;
  background: var(--steel);
  border-radius: 50%;
  color: white;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
  flex-shrink: 0;
}
.acc-item.open .acc-arrow { transform: rotate(180deg); }
.acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.acc-item.open .acc-body { max-height: 400px; }
.acc-inner {
  padding: 0 20px 18px;
  font-size: 0.88rem;
  color: #3a4055;
  line-height: 1.7;
  background: var(--white);
}
.acc-tag {
  display: inline-block;
  background: var(--rust-light);
  color: var(--rust);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 3px;
  margin-bottom: 8px;
}

/* ── MOVEMENTS TABLE ── */
.mov-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.88rem;
}
.mov-table th {
  background: var(--steel);
  color: white;
  padding: 11px 16px;
  font-weight: 600;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
}
.mov-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--parchment);
  color: #3a4055;
  vertical-align: top;
}
.mov-table tr:nth-child(even) td { background: var(--bone); }
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-green { background: var(--cartilage-light); color: var(--cartilage); }
.badge-blue  { background: var(--steel-light); color: var(--steel); }
.badge-rust  { background: var(--rust-light); color: var(--rust); }

/* ── SIDEBAR ── */
.sidebar { position: sticky; top: 70px; }
.widget {
  background: var(--white);
  border: 1px solid var(--parchment);
  border-radius: 10px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.widget-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--steel);
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--parchment);
  font-size: 0.86rem;
}
.stat-row:last-child { border-bottom: none; }
.stat-row .s-label { color: var(--muted); }
.stat-row .s-value { font-weight: 600; color: var(--steel); }

.joint-list-mini {
  list-style: none;
  font-size: 0.86rem;
}
.joint-list-mini li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--parchment);
  color: #3a4055;
}
.joint-list-mini li:last-child { border-bottom: none; }
.joint-list-mini li::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--steel-mid);
  flex-shrink: 0;
}

/* ── PREVENTION ── */
.tip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}
.tip-card {
  background: var(--cartilage-light);
  border: 1px solid #bce0c8;
  border-radius: 8px;
  padding: 16px;
}
.tip-card .tip-icon { font-size: 1.4rem; margin-bottom: 6px; }
.tip-card strong { display: block; font-size: 0.88rem; color: #2d6b3f; margin-bottom: 4px; }
.tip-card p { font-size: 0.8rem; color: #3d6b4a; margin: 0; }

/* ── FOOTER ── */
footer {
  background: var(--steel);
  color: rgba(255,255,255,0.55);
  text-align: center;
  padding: 28px 40px;
  font-size: 0.8rem;
}
footer strong { color: rgba(255,255,255,0.85); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-right { display: none; }
  .page-wrap { grid-template-columns: 1fr; padding: 30px 20px; }
  .sidebar { position: static; }
  .joint-types { grid-template-columns: 1fr 1fr; }
  .tip-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .joint-types { grid-template-columns: 1fr; }
  .hero-left { padding: 40px 24px; }
}
