@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap');

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

:root, [data-theme="light"] {
  --bg:        #F5F5F7;
  --bg2:       #FFFFFF;
  --surface:   #FFFFFF;
  --surface2:  #FAFAFA;
  --border:    #E5E5EA;
  --border2:   #D1D1D6;
  --text:      #1D1D1F;
  --text2:     #424245;
  --muted:     #86868B;
  --accent:    #F5A623;
  --accent2:   #E09810;
  --blue:      #0071E3;
  --blue2:     #0077ED;
  --success:   #34C759;
  --muscle:    #AF52DE;
  --red:       #FF3B30;
  --radius:    12px;
  --radius-lg: 20px;
  --max-w:     1120px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --nav-bg:    rgba(245,245,247,0.72);
  --agents-bg: var(--agents-bg);
  --code-bg:   #1D1D1F;
  --code-text: #F5F5F7;
}

[data-theme="dark"] {
  --bg:        #000000;
  --bg2:       #0a0a0a;
  --surface:   #141414;
  --surface2:  #1a1a1a;
  --border:    rgba(255,255,255,0.08);
  --border2:   rgba(255,255,255,0.12);
  --text:      #F5F5F7;
  --text2:     #D1D1D6;
  --muted:     #86868B;
  --accent:    #F5A623;
  --accent2:   #f7b84d;
  --blue:      #2997FF;
  --blue2:     #40a9ff;
  --success:   #30D158;
  --muscle:    #BF5AF2;
  --red:       #FF453A;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  --nav-bg:    rgba(0,0,0,0.72);
  --agents-bg: #0a0a0a;
  --code-bg:   #1a1a1a;
  --code-text: #e8e8e8;
}

/* Dark mode overrides for elements using hardcoded colors */
[data-theme="dark"] .nav-cta { background: var(--accent); color: #000; }
[data-theme="dark"] .nav-cta:hover { background: var(--accent2); color: #000; }
[data-theme="dark"] .btn-primary { background: #fff; color: #000; }
[data-theme="dark"] .btn-primary:hover { background: #e8e8e8; color: #000; box-shadow: 0 8px 24px rgba(255,255,255,0.1); }
[data-theme="dark"] .btn-outline { border-color: rgba(255,255,255,0.2); }
[data-theme="dark"] .btn-outline:hover { border-color: var(--accent); }
[data-theme="dark"] .hero { background: var(--bg); }
[data-theme="dark"] .step-content code { background: #111; color: var(--accent); }
[data-theme="dark"] .store-section { background: var(--bg2); }
[data-theme="dark"] .footer { background: var(--bg); }
[data-theme="dark"] .highlight-section { background: var(--surface); }
[data-theme="dark"] .compare-result { background: rgba(48,209,88,0.12); }
[data-theme="dark"] .feature-icon { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .theme-toggle { border-color: rgba(255,255,255,0.12); }
[data-theme="dark"] .lang-switch { border-color: rgba(255,255,255,0.12); }
[data-theme="dark"] .agents-section { background: var(--agents-bg); }

html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--blue); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent2); }

::selection { background: rgba(245,166,35,0.2); }

/* ══════════════════════════════
   Nav
══════════════════════════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 48px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(20px, calc((100% - var(--max-w))/2));
  font-size: 13px;
}

.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--text);
  text-decoration: none;
}
.nav-logo img { width: 22px; height: 22px; }
.nav-logo .brand { color: var(--accent); }

.nav-center {
  display: flex; gap: 24px; list-style: none;
  position: absolute; left: 50%; transform: translateX(-50%);
}
.nav-center a { color: var(--muted); font-weight: 500; transition: color 0.2s; }
.nav-center a:hover { color: var(--text); }

.nav-right { display: flex; align-items: center; gap: 14px; }

.nav-link { color: var(--muted); font-weight: 500; }
.nav-link:hover { color: var(--text); }

.nav-cta {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 14px; border-radius: 980px;
  background: var(--text); color: #fff;
  font-size: 12px; font-weight: 600;
  transition: all 0.2s; text-decoration: none;
}
.nav-cta:hover { background: #000; color: #fff; }

/* ══════════════════════════════
   Hero
══════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 120px 24px 100px;
  background: var(--bg2);
  position: relative; overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute; top: -300px; left: 50%; transform: translateX(-50%);
  width: 1000px; height: 1000px;
  background: radial-gradient(
    ellipse at center,
    rgba(245,166,35,0.07) 0%,
    rgba(175,82,222,0.04) 35%,
    transparent 65%
  );
  pointer-events: none;
}

.hero-icon {
  width: 80px; height: 80px; margin-bottom: 28px;
  filter: drop-shadow(0 4px 24px rgba(245,166,35,0.25));
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 980px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted); font-size: 12px; font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px rgba(52,199,89,0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 800; line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
  max-width: 760px;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--muscle) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 20px; color: var(--text2);
  max-width: 580px; margin-bottom: 12px;
  line-height: 1.6; font-weight: 400;
}

.hero-desc {
  font-size: 15px; color: var(--muted);
  max-width: 500px; margin-bottom: 40px;
  line-height: 1.7;
}

.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: 980px;
  font-size: 15px; font-weight: 600; font-family: inherit;
  border: none; cursor: pointer; transition: all 0.25s;
  text-decoration: none;
}

.btn-primary {
  background: var(--text); color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: #000; color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-outline {
  background: var(--bg2); color: var(--text);
  border: 1.5px solid var(--border2);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent2); transform: translateY(-1px); }

/* ══════════════════════════════
   Agents Marquee
══════════════════════════════ */
.agents-section {
  padding: 48px 0;
  background: var(--agents-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.agents-label {
  text-align: center;
  font-size: 11px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 32px;
  font-weight: 600;
}

.agents-track-wrapper {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right,
    transparent 0, black 120px, black calc(100% - 120px), transparent 100%
  );
  mask-image: linear-gradient(to right,
    transparent 0, black 120px, black calc(100% - 120px), transparent 100%
  );
}

.agents-track {
  display: flex;
  width: max-content;
  gap: 44px;
  padding: 0 32px;
  animation: agents-scroll 45s linear infinite;
}
.agents-track:hover { animation-play-state: paused; }

@keyframes agents-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.agent-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 72px;
  text-decoration: none;
}

.agent-item img {
  width: 52px; height: 52px;
  object-fit: contain;
  opacity: 0.5;
  transition: all 0.3s ease-out;
}
.agent-item:hover img { opacity: 1; transform: scale(1.1); }

.agent-item span {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 10px; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  transition: color 0.3s;
}
.agent-item:hover span { color: var(--text); }

/* ══════════════════════════════
   Section
══════════════════════════════ */
.section {
  padding: 120px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-label {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); margin-bottom: 12px;
}

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700; line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
  max-width: 600px;
}

.section-desc {
  color: var(--muted); font-size: 17px;
  margin-bottom: 56px; max-width: 520px;
  line-height: 1.7;
}

.section-center { text-align: center; }
.section-center .section-title,
.section-center .section-desc { margin-left: auto; margin-right: auto; }

/* ══════════════════════════════
   Features Grid
══════════════════════════════ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.feature-card {
  background: var(--bg2);
  padding: 40px 32px;
  transition: background 0.3s;
  text-align: center;
}
.feature-card:hover { background: var(--surface2); }

.feature-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 0 auto 20px;
}

.feature-title {
  font-size: 17px; font-weight: 700;
  margin-bottom: 8px; color: var(--text);
}

.feature-desc {
  font-size: 14px; color: var(--muted); line-height: 1.7;
}

/* ══════════════════════════════
   Highlight (Muscle Memory)
══════════════════════════════ */
.highlight-section {
  padding: 120px 24px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.highlight-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px; align-items: center;
}

.highlight-text p {
  color: var(--muted); font-size: 15px;
  line-height: 1.8; margin-bottom: 20px;
}

.highlight-visual {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}

.compare-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.compare-row:last-child { border-bottom: none; }

.compare-label { color: var(--muted); font-size: 13px; }
.compare-value { font-weight: 700; font-size: 15px; }
.compare-value.bad { color: var(--red); }
.compare-value.good { color: var(--success); }

.compare-head { font-weight: 700; color: var(--text); font-size: 13px; }

.compare-result {
  margin-top: 20px;
  padding: 14px 20px;
  background: rgba(52,199,89,0.08);
  border: 1px solid rgba(52,199,89,0.15);
  border-radius: 10px;
  text-align: center;
  font-size: 18px; font-weight: 800;
  color: var(--success);
  letter-spacing: -0.01em;
}

/* ══════════════════════════════
   Architecture
══════════════════════════════ */
.arch-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-sm);
}

.arch-flow {
  display: flex; flex-direction: column;
  align-items: center; gap: 0;
}

.arch-node {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 360px; justify-content: center;
  font-size: 14px;
}
.arch-node-label { font-weight: 700; color: var(--text); }
.arch-node-sub { color: var(--muted); font-size: 12px; }

.arch-arrow {
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 0; color: var(--muted); font-size: 12px; gap: 2px;
}
.arch-arrow-line { width: 1px; height: 14px; background: var(--border2); }
.arch-arrow-proto {
  color: var(--accent); font-weight: 600; font-size: 11px;
  letter-spacing: 0.02em;
}

/* ══════════════════════════════
   Steps
══════════════════════════════ */
.steps { display: flex; flex-direction: column; gap: 0; }

.step {
  display: flex; gap: 24px; align-items: flex-start;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: none; }

.step-num {
  flex-shrink: 0;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(245,166,35,0.08);
  border: 1px solid rgba(245,166,35,0.2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--accent); font-size: 18px;
}

.step-content h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.step-content p { color: var(--muted); font-size: 15px; line-height: 1.7; }

.step-content code {
  display: block; margin-top: 12px;
  background: var(--code-bg); color: var(--code-text);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px; overflow-x: auto;
}

/* ══════════════════════════════
   Use Cases
══════════════════════════════ */
.usecases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.usecase-card {
  padding: 28px 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
.usecase-card:hover { border-color: var(--border2); box-shadow: var(--shadow-md); }

.usecase-icon { font-size: 28px; margin-bottom: 14px; }
.usecase-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.usecase-desc { font-size: 13px; color: var(--muted); line-height: 1.7; }

/* ══════════════════════════════
   Muscle Store
══════════════════════════════ */
.store-section {
  padding: 100px 24px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  text-align: center;
}

.store-preview {
  max-width: 800px; margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

.store-pill {
  display: inline-block;
  padding: 4px 12px; border-radius: 980px;
  background: rgba(175,82,222,0.08);
  border: 1px solid rgba(175,82,222,0.15);
  color: var(--muscle); font-size: 12px; font-weight: 700;
  margin-bottom: 8px;
}

.store-coming { font-size: 14px; color: var(--muted); margin-top: 20px; }

/* ══════════════════════════════
   Footer
══════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  padding: 48px 24px 32px;
}

.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 40px;
  margin-bottom: 32px;
}

.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-brand img { width: 20px; height: 20px; }
.footer-brand span { font-weight: 700; font-size: 15px; }

.footer-tagline {
  color: var(--muted); font-size: 13px;
  margin-top: 8px; max-width: 260px; line-height: 1.6;
}

.footer-cols { display: flex; gap: 56px; }

.footer-col h4 {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 12px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--text2); font-size: 13px; font-weight: 500; }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
}

.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--accent); }

/* ══════════════════════════════
   Legal Pages (Privacy / Terms)
══════════════════════════════ */
.legal-page {
  max-width: 720px; margin: 0 auto;
  padding: 100px 24px 80px;
}

.legal-page .back-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--muted); font-size: 13px; font-weight: 500;
  margin-bottom: 28px;
}
.legal-page .back-link:hover { color: var(--text); }

.legal-page h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.legal-page .updated { color: var(--muted); font-size: 13px; margin-bottom: 40px; }

.legal-page h2 {
  font-size: 20px; font-weight: 700;
  margin: 40px 0 12px; letter-spacing: -0.01em;
}

.legal-page p,
.legal-page li {
  color: var(--text2); font-size: 15px; line-height: 1.8; margin-bottom: 12px;
}

.legal-page ul { padding-left: 20px; margin: 8px 0 16px; }
.legal-page li { margin-bottom: 6px; }

.legal-page strong { color: var(--text); font-weight: 600; }

.legal-page a { color: var(--blue); }
.legal-page a:hover { color: var(--accent); }

.legal-page table {
  width: 100%; border-collapse: collapse; margin: 16px 0;
  font-size: 14px;
}
.legal-page th,
.legal-page td {
  text-align: left; padding: 10px 14px;
  border: 1px solid var(--border);
}
.legal-page th { background: var(--bg); color: var(--text); font-weight: 600; font-size: 13px; }
.legal-page td { color: var(--text2); }

.legal-page code {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
}

/* ══════════════════════════════
   Theme Toggle
══════════════════════════════ */
.theme-toggle {
  background: none; border: 1px solid var(--border);
  border-radius: 980px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted);
  font-size: 14px; transition: all 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border2); }

/* ══════════════════════════════
   News Page (compact list)
══════════════════════════════ */
.news-page {
  max-width: var(--max-w); margin: 0 auto;
  padding: 100px 24px 80px;
}

.news-list {
  margin-top: 32px;
  border-top: 1px solid var(--border);
}

.news-item {
  display: flex; align-items: baseline; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
  transition: background 0.15s;
}
.news-item:hover { background: var(--surface2); }

.news-item-date {
  flex-shrink: 0; width: 80px;
  font-size: 12px; color: var(--muted); font-weight: 500;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.news-item-tag {
  flex-shrink: 0;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent);
  width: 100px;
}

.news-item-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  flex: 1; line-height: 1.4;
}
.news-item:hover .news-item-title { color: var(--accent); }


/* ══════════════════════════════
   Tutorial Page
══════════════════════════════ */
.tutorial-page {
  max-width: var(--max-w); margin: 0 auto;
  padding: 100px 24px 80px;
}

.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.tutorial-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-decoration: none; color: inherit;
  display: block;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
.tutorial-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); color: inherit; }

.tutorial-card-icon { font-size: 28px; margin-bottom: 14px; }

.tutorial-card-tag {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 4px;
  background: rgba(245,166,35,0.08);
  color: var(--accent);
  margin-bottom: 10px;
}

.tutorial-card h3 {
  font-size: 16px; font-weight: 700; color: var(--text);
  margin-bottom: 8px; line-height: 1.4;
}

.tutorial-card p {
  font-size: 13px; color: var(--muted); line-height: 1.7;
}

.tutorial-card-meta {
  display: flex; gap: 12px; margin-top: 12px;
  font-size: 11px; color: var(--muted); font-weight: 500;
}

/* ══════════════════════════════
   Tools Directory Page
══════════════════════════════ */
.tools-page {
  max-width: var(--max-w); margin: 0 auto;
  padding: 100px 24px 80px;
}

.tools-category {
  margin-bottom: 48px;
}

.tools-category-title {
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.tools-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.tool-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
.tool-item:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }

.tool-item-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

.tool-item-name {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin-bottom: 2px;
}

.tool-item-desc {
  font-size: 12px; color: var(--muted); line-height: 1.4;
}

/* ══════════════════════════════
   Language Switcher
══════════════════════════════ */
.lang-dropdown { position: relative; }

.lang-switch {
  background: none; border: 1px solid var(--border);
  border-radius: 980px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  transition: all 0.2s;
}
.lang-switch:hover { border-color: var(--border2); }

.lang-menu {
  position: absolute; top: 40px; right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 200;
  max-height: 360px;
  overflow-y: auto;
}

.lang-option {
  display: block; width: 100%;
  padding: 8px 12px;
  background: none; border: none;
  font-size: 13px; font-family: inherit;
  color: var(--text2);
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.lang-option:hover { background: var(--surface2); color: var(--text); }

.hidden { display: none !important; }

/* ══════════════════════════════
   Muscle Library Page
══════════════════════════════ */
.muscle-page {
  max-width: var(--max-w); margin: 0 auto;
  padding: 100px 24px 80px;
}

.muscle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.muscle-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.muscle-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }

.muscle-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}

.muscle-card-name {
  font-size: 16px; font-weight: 700; color: var(--text);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.muscle-card-badge {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 8px; border-radius: 4px;
}
.muscle-card-badge.high { background: rgba(52,199,89,0.1); color: var(--success); }
.muscle-card-badge.medium { background: rgba(245,166,35,0.1); color: var(--accent); }
.muscle-card-badge.low { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

.muscle-card-platform {
  font-size: 13px; color: var(--muted); margin-bottom: 8px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.muscle-card-desc {
  font-size: 14px; color: var(--text2); line-height: 1.6;
  margin-bottom: 16px;
}

.muscle-card-meta {
  display: flex; gap: 16px; align-items: center;
  font-size: 12px; color: var(--muted);
  margin-bottom: 16px;
}

.muscle-card-actions {
  display: flex; gap: 8px;
}

.muscle-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600; font-family: inherit;
  border: none; cursor: pointer; transition: all 0.2s;
  text-decoration: none;
}

.muscle-btn-download {
  background: var(--text); color: var(--bg);
}
.muscle-btn-download:hover { opacity: 0.85; }

[data-theme="dark"] .muscle-btn-download {
  background: #fff; color: #000;
}

.muscle-btn-preview {
  background: none; color: var(--muted);
  border: 1px solid var(--border);
}
.muscle-btn-preview:hover { border-color: var(--accent); color: var(--accent); }

/* Muscle preview modal */
.muscle-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  align-items: center; justify-content: center;
}
.muscle-modal-overlay.open { display: flex; }

.muscle-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 600px; width: 90%;
  max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.muscle-modal h3 {
  font-size: 18px; font-weight: 700; margin-bottom: 16px;
}

.muscle-modal pre {
  background: var(--code-bg); color: var(--code-text);
  padding: 16px; border-radius: 8px;
  font-size: 12px; line-height: 1.5;
  overflow-x: auto;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.muscle-modal-close {
  float: right; background: none; border: none;
  font-size: 20px; color: var(--muted); cursor: pointer;
}
.muscle-modal-close:hover { color: var(--text); }

/* ══════════════════════════════
   Mobile Menu Button
══════════════════════════════ */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
  background: none; border: none;
  cursor: pointer; padding: 6px;
}

.mobile-menu-btn span {
  display: block;
  width: 100%; height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all 0.25s;
}

.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ══════════════════════════════
   Mobile Dropdown (independent element behind nav)
══════════════════════════════ */
.mobile-dropdown {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  padding-top: 48px;
  background: rgba(245,245,247,0.95);
  backdrop-filter: saturate(200%) blur(40px);
  -webkit-backdrop-filter: saturate(200%) blur(40px);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-direction: column;
}

[data-theme="dark"] .mobile-dropdown {
  background: rgba(0,0,0,0.92);
}

.mobile-dropdown a {
  display: block;
  padding: 14px 24px;
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.mobile-dropdown a:last-child { border-bottom: none; }
.mobile-dropdown a:hover { color: var(--accent); }

.mobile-dropdown.open {
  transform: translateY(0);
}

/* ══════════════════════════════
   Responsive
══════════════════════════════ */
@media (max-width: 768px) {
  .nav { padding: 0 16px; }
  .nav-link { display: none; }

  .mobile-menu-btn { display: flex; }
  .mobile-dropdown { display: flex; }
  .nav-center { display: none; }

  .hero { padding: 110px 20px 80px; }
  .hero-sub { font-size: 17px; }
  .section { padding: 80px 20px; }
  .features-grid { grid-template-columns: 1fr; }
  .highlight-inner { grid-template-columns: 1fr; gap: 40px; }
  .footer-inner { flex-direction: column; }
  .footer-cols { flex-direction: column; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .arch-node { min-width: auto; flex-direction: column; gap: 4px; }
  .store-preview > div { grid-template-columns: 1fr !important; }
}
