/* ═══════════════════════════════════════════════════════════════════════
   Gruvppuccin shared stylesheet
   Used by both index.html (IntelliJ landing) and dotfiles.html (TUI gallery)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── FOUC prevention ─────────────────────────────────────────────── */
body {
  opacity: 0;
  transition: opacity 0.4s ease;
}
body.loaded {
  opacity: 1;
}

/* ── Scroll fade-in ──────────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}
.fade-in.in-view {
  opacity: 1;
  transform: translateY(0);
}
.fade-in-d1 {
  transition-delay: 0.1s;
}
.fade-in-d2 {
  transition-delay: 0.2s;
}

/* ── Dot grid pattern ────────────────────────────────────────────── */
.dot-grid {
  background-image: radial-gradient(circle, #413c39 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ── Code scrollbar ──────────────────────────────────────────────── */
pre::-webkit-scrollbar {
  height: 6px;
}
pre::-webkit-scrollbar-track {
  background: transparent;
}
pre::-webkit-scrollbar-thumb {
  background: #5a524c;
  border-radius: 3px;
}
pre {
  scrollbar-width: thin;
  scrollbar-color: #5a524c transparent;
}

/* ── Accent picker (homepage customization section) ──────────────── */
.accent-pick {
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.accent-pick:hover {
  transform: scale(1.15);
}

/* ── Variant card scroll (homepage variants section) ─────────────── */
.variant-scroll::-webkit-scrollbar {
  height: 6px;
}
.variant-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.variant-scroll::-webkit-scrollbar-thumb {
  background: #413c39;
  border-radius: 3px;
}

/* ═══════════════════════════════════════════════════════════════════
   Dotfiles page additions
   ═══════════════════════════════════════════════════════════════════ */

/* ── Theme card (glass) ──────────────────────────────────────────── */
.theme-card {
  background: rgba(212, 190, 152, 0.03);
  border: 1px solid rgba(212, 190, 152, 0.08);
  border-radius: 0.75rem;
  backdrop-filter: blur(12px);
  transition:
    border-color 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
  cursor: pointer;
}
.theme-card:hover {
  border-color: rgba(231, 138, 78, 0.22);
  box-shadow: 0 0 32px rgba(231, 138, 78, 0.05);
  transform: translateY(-1px);
}
.theme-card.expanded {
  grid-column: 1 / -1;
  cursor: default;
  border-color: rgba(231, 138, 78, 0.3);
  background: rgba(212, 190, 152, 0.04);
  transform: none;
}
.theme-card.expanded:hover {
  transform: none;
  box-shadow: 0 0 32px rgba(231, 138, 78, 0.06);
}

/* ── Palette swatch ──────────────────────────────────────────────── */
.swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(212, 190, 152, 0.12);
  flex-shrink: 0;
  transition: transform 0.15s;
}
.swatch.lg {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.swatch:hover {
  transform: scale(1.08);
}

/* ── Mock shell (terminal chrome around all tool previews) ───────── */
.mock-shell {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(212, 190, 152, 0.1);
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.55;
}
.mock-shell .mock-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(212, 190, 152, 0.06);
}
.mock-shell .mock-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}
.mock-shell .mock-dot.r {
  background: #ea6962;
}
.mock-shell .mock-dot.y {
  background: #d8a657;
}
.mock-shell .mock-dot.g {
  background: #a9b665;
}
.mock-shell .mock-title {
  margin-left: 8px;
  font-size: 11px;
  color: #7c7269;
  letter-spacing: 0.02em;
}
.mock-shell .mock-body {
  padding: 14px 16px;
  white-space: pre;
  overflow-x: auto;
}

/* ── Tool tab strip (mirrors homepage .tab-btn pattern) ──────────── */
.tool-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #a69a8a;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 0.15s,
    background-color 0.15s,
    border-color 0.15s;
}
.tool-tab:hover {
  color: #d4be98;
  background: rgba(212, 190, 152, 0.04);
}
.tool-tab.active {
  color: #d4be98;
  background: rgba(231, 138, 78, 0.1);
  border-color: rgba(231, 138, 78, 0.25);
}

/* ── Tool chip (hero strip) ──────────────────────────────────────── */
.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: #bfb3a2;
  background: rgba(212, 190, 152, 0.04);
  border: 1px solid rgba(212, 190, 152, 0.08);
}

/* ── Sidebar theme list item ─────────────────────────────────────── */
.theme-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
  flex-shrink: 0;
  transition:
    background-color 0.12s,
    border-color 0.12s;
  min-width: 0;
}
@media (max-width: 1023px) {
  .theme-item {
    min-width: 220px;
  }
}
.theme-item:hover {
  background: rgba(212, 190, 152, 0.04);
}
.theme-item.active {
  background: rgba(231, 138, 78, 0.1);
  border-color: rgba(231, 138, 78, 0.3);
}
.theme-item-swatches {
  display: inline-flex;
  gap: 1.5px;
  flex-shrink: 0;
}
.theme-item-swatches > span {
  width: 11px;
  height: 22px;
  border-radius: 3px;
}
.theme-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.theme-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #d4be98;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.theme-item.active .theme-item-name {
  color: #e78a4e;
}
.theme-item-parents {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9.5px;
  color: #7c7269;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Copy button feedback ────────────────────────────────────────── */
.copy-btn {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(212, 190, 152, 0.06);
  border: 1px solid rgba(212, 190, 152, 0.1);
  color: #a69a8a;
  cursor: pointer;
  transition:
    background-color 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.copy-btn:hover {
  color: #d4be98;
  background: rgba(231, 138, 78, 0.12);
  border-color: rgba(231, 138, 78, 0.3);
}
.copy-btn.copied {
  color: #a9b665;
  background: rgba(169, 182, 101, 0.12);
  border-color: rgba(169, 182, 101, 0.3);
}

/* ── Reduced motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .fade-in {
    opacity: 1;
    transform: none;
  }
}
