/* ============================================================
   Projects Launcher — shared FAB + modal styles
   Paired with /assets/projects-launcher.js
   Theme-aware via CSS custom properties (--accent / --accent-1).
   ============================================================ */

:root {
  --pl-accent: #7c6aef;
  --pl-on-accent: #0b0b10;
  --pl-bg: rgba(12, 12, 16, 0.72);
  --pl-card-bg: rgba(255, 255, 255, 0.04);
  --pl-card-border: rgba(255, 255, 255, 0.08);
  --pl-text: #f5f5f7;
  --pl-text-dim: #a1a1aa;
}

/* ---------- Floating launcher button (bottom-right) ---------- */
.pl-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 9000;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(20, 20, 26, 0.55);
  color: #f5f5f7;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0.55;
  transition: opacity 0.25s ease, transform 0.25s ease,
    box-shadow 0.25s ease, border-color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.pl-fab:hover,
.pl-fab:focus-visible {
  opacity: 1;
  transform: translateY(-2px);
  border-color: var(--pl-accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35),
    0 0 0 3px color-mix(in srgb, var(--pl-accent) 18%, transparent);
  outline: none;
}

.pl-fab svg {
  width: 18px;
  height: 18px;
  display: block;
}

.pl-fab__hint {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font: 500 11px/1 'Inter', system-ui, sans-serif;
  padding: 6px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.pl-fab__hint kbd {
  font: inherit;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 5px;
  border-radius: 3px;
  margin: 0 1px;
}

.pl-fab:hover .pl-fab__hint,
.pl-fab:focus-visible .pl-fab__hint {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

@media (max-width: 640px) {
  .pl-fab { right: 1rem; bottom: 1rem; width: 40px; height: 40px; }
  .pl-fab__hint { display: none; }
}

/* ---------- Modal ---------- */
.pl-modal {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--pl-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.pl-modal.is-open {
  display: flex;
  opacity: 1;
}

.pl-modal__panel {
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  overflow-y: auto;
  background: #111114;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  transform: translateY(8px) scale(0.985);
  transition: transform 0.25s ease;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--pl-text);
}

.pl-modal.is-open .pl-modal__panel { transform: translateY(0) scale(1); }

.pl-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.pl-modal__title {
  font: 700 1.25rem/1.2 'Space Grotesk', 'Inter', system-ui, sans-serif;
  margin: 0 0 4px;
}

.pl-modal__subtitle {
  font-size: 0.875rem;
  color: var(--pl-text-dim);
  margin: 0;
}

.pl-modal__close {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--pl-text);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.pl-modal__close:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.pl-modal__close svg { width: 14px; height: 14px; }

.pl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.pl-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: var(--pl-card-bg);
  border: 1px solid var(--pl-card-border);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease,
    background 0.2s ease;
}

.pl-card:hover,
.pl-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--pl-accent);
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.pl-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: color-mix(in srgb, var(--pl-accent) 18%, transparent);
  color: var(--pl-accent);
  margin-bottom: 4px;
}

.pl-card__title {
  font-weight: 600;
  font-size: 0.98rem;
  margin: 0;
}

.pl-card__desc {
  font-size: 0.82rem;
  color: var(--pl-text-dim);
  margin: 0;
  line-height: 1.45;
}

.pl-modal__foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
  color: var(--pl-text-dim);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pl-modal__foot kbd {
  font: inherit;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  margin: 0 2px;
}

@media (prefers-reduced-motion: reduce) {
  .pl-fab, .pl-modal, .pl-modal__panel, .pl-card { transition: none; }
}

/* ---------- View swap (grid ↔ confirm) ---------- */
.pl-view {
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.pl-view--confirm {
  display: none;
  opacity: 0;
  transform: translateY(6px);
}
.pl-modal.is-confirming .pl-view--grid {
  display: none;
}
.pl-modal.is-confirming .pl-view--confirm {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Confirmation panel ---------- */
.pl-confirm {
  text-align: center;
  padding: 6px 4px 2px;
}

.pl-confirm__ring {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 6px auto 18px;
}
.pl-confirm__ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.pl-ring__track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 6;
}
.pl-ring__bar {
  fill: none;
  stroke: var(--pl-accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 213.63; /* 2π·34 — overridden in JS */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.95s linear;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--pl-accent) 50%, transparent));
}
.pl-confirm__count {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 1.8rem/1 'Space Grotesk', 'Inter', system-ui, sans-serif;
  color: var(--pl-text);
  font-variant-numeric: tabular-nums;
}

.pl-confirm__title {
  font: 700 1.15rem/1.3 'Space Grotesk', 'Inter', system-ui, sans-serif;
  margin: 0 0 8px;
  color: #ffffff;
}
.pl-confirm__title span {
  /* Keep project name in white for guaranteed legibility across themes;
     accent is used only on the underline of the URL and the ring. */
  color: #ffffff;
}

.pl-confirm__desc {
  color: #d4d4d8;
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 auto 22px;
  max-width: 480px;
  word-break: break-word;
}
.pl-confirm__desc strong { color: #ffffff; }
.pl-confirm__url {
  color: #ffffff;
  text-decoration: none;
  border-bottom: 1px dashed var(--pl-accent);
}
.pl-confirm__url:hover { opacity: 0.85; }

.pl-confirm__actions {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.pl-btn {
  font: 600 0.9rem/1 'Inter', system-ui, sans-serif;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease,
    border-color 0.2s ease, box-shadow 0.2s ease;
}
.pl-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pl-accent) 30%, transparent);
}
.pl-btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}
.pl-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}
.pl-btn--primary {
  background: var(--pl-accent);
  color: var(--pl-on-accent);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--pl-accent) 35%, transparent);
}
.pl-btn--primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.pl-confirm__hint {
  margin: 18px 0 0;
  font-size: 0.72rem;
  color: var(--pl-text-dim);
}
.pl-confirm__hint kbd {
  font: inherit;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  margin: 0 2px;
}

@media (prefers-reduced-motion: reduce) {
  .pl-view, .pl-ring__bar, .pl-btn { transition: none; }
}
