/* ============================================
   Claude Code Glossar – Anthropic-Style Design
   ============================================ */

:root {
  /* Anthropic / Claude palette */
  --bg: #FAFAF9;
  --bg-card: #FFFFFF;
  --bg-hover: #F5F5F4;
  --bg-kbd: #F0EFED;
  --border: #E7E5E4;
  --border-hover: #D6D3D1;
  --text: #1C1917;
  --text-secondary: #57534E;
  --text-muted: #A8A29E;
  --accent: #DA7756;
  --accent-light: #FEF0EB;
  --accent-dark: #C4603D;
  --code-bg: #F5F5F4;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #161514;
  --bg-card: #1E1D1C;
  --bg-hover: #272625;
  --bg-kbd: #2A2928;
  --border: #333231;
  --border-hover: #444342;
  --text: #FAF9F7;
  --text-secondary: #A8A29E;
  --text-muted: #6B6560;
  --accent: #E8956F;
  --accent-light: #2D2018;
  --accent-dark: #F0A888;
  --code-bg: #232221;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Header ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.logo-text {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.logo-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 99px;
}

.nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1;
}

.nav::-webkit-scrollbar { display: none; }

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all var(--transition);
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-light);
}

.theme-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ---- Hero ---- */
.hero {
  padding: 56px 24px 40px;
  text-align: center;
}

.hero-inner {
  max-width: 600px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.search-wrap {
  position: relative;
  max-width: 440px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  padding: 12px 44px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text);
  outline: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.search-wrap input::placeholder {
  color: var(--text-muted);
}

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  background: var(--bg-kbd);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  pointer-events: none;
  transition: opacity var(--transition);
}

.search-wrap input:focus + .search-hint,
.search-wrap input:not(:placeholder-shown) + .search-hint {
  opacity: 0;
}

/* ---- Main ---- */
.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.section {
  margin-bottom: 64px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
  padding-left: 44px;
}

.section-desc kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: var(--bg-kbd);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ---- Card Groups ---- */
.card-group {
  margin-bottom: 32px;
}

.group-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-left: 2px;
}

.group-title small {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

/* ---- Shortcut Grid ---- */
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.shortcut-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.shortcut-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.shortcut-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.shortcut-card .keys {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.shortcut-card .keys span {
  color: var(--text-muted);
  font-size: 12px;
}

.shortcut-card .keys small {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}

.shortcut-card .desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.shortcut-card .desc small {
  color: var(--text-muted);
  font-size: 11px;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-kbd);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 var(--border);
  white-space: nowrap;
}

/* ---- Command List ---- */
.command-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.command-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.command-row:last-child {
  border-bottom: none;
}

.command-row:hover {
  background: var(--bg-hover);
}

.command-row code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 160px;
}

.command-row span {
  font-size: 13px;
  color: var(--text-secondary);
}

.alias {
  color: var(--text-muted) !important;
  font-size: 11px !important;
  margin-left: 4px;
}

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
}

.footer p {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-note {
  margin-top: 8px;
  font-size: 12px !important;
}

.footer-note kbd {
  font-size: 10px;
  height: 20px;
  min-width: 20px;
  padding: 0 4px;
}

/* ---- Search Highlighting ---- */
.highlight {
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 1px;
}

.hidden {
  display: none !important;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 16px;
    gap: 12px;
  }

  .logo-text { display: none; }

  .nav-link {
    font-size: 12px;
    padding: 5px 8px;
  }

  .hero { padding: 40px 16px 28px; }
  .hero h1 { font-size: 26px; }
  .main { padding: 0 16px 60px; }

  .section-desc { padding-left: 0; }

  .shortcut-grid {
    grid-template-columns: 1fr;
  }

  .command-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .command-row code {
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 22px; }
  .search-wrap input { font-size: 16px; /* prevent zoom on iOS */ }
}

/* ---- Scroll Animation ---- */
.section {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeIn 0.5s ease forwards;
}

.section:nth-child(1) { animation-delay: 0.05s; }
.section:nth-child(2) { animation-delay: 0.1s; }
.section:nth-child(3) { animation-delay: 0.15s; }
.section:nth-child(4) { animation-delay: 0.2s; }
.section:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
