/* Small additions layered on top of the built portfolio: scroll progress, active nav, command palette. */
.sp-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #ff3b2f, #ff8a3d);
  z-index: 400;
  pointer-events: none;
  transition: transform 0.08s linear;
}

.nav-links a.is-active {
  color: #fff;
}

.nav-links a.is-active:after {
  transform: scaleX(1);
}

.nav-links a {
  position: relative;
}

.nav-links a:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--accent, #ff3b2f);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.28s ease;
}

.nav-links a:hover:after {
  transform: scaleX(1);
}

/* Floating palette trigger */
.sp-fab {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 320;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  min-height: 40px;
  border: 1px solid #ffffff1f;
  border-radius: 999px;
  background: #0e0e10e6;
  color: #a1a1aa;
  font-family: var(--font-geist-mono), ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease, border-color 0.2s ease;
}

.sp-fab.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.sp-fab:hover,
.sp-fab:focus-visible {
  color: #fff;
  border-color: #ffffff3d;
  outline: none;
}

.sp-fab svg {
  width: 13px;
  height: 13px;
}

.sp-fab kbd {
  font: inherit;
  border: 1px solid #ffffff26;
  border-radius: 5px;
  padding: 2px 5px;
  color: #d4d4d8;
  font-size: 9px;
  letter-spacing: 0.06em;
}

/* Palette */
.sp-palette {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: min(14vh, 120px) 16px 24px;
  background: #050506b8;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s;
}

.sp-palette.is-open {
  opacity: 1;
  visibility: visible;
}

.sp-palette-box {
  width: min(100%, 560px);
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #ffffff24;
  border-radius: 16px;
  background: #101012f7;
  box-shadow: 0 30px 80px #000000a6;
  transform: translateY(-10px) scale(0.985);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sp-palette.is-open .sp-palette-box {
  transform: none;
}

.sp-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #ffffff14;
}

.sp-search svg {
  width: 15px;
  height: 15px;
  color: #71717a;
  flex-shrink: 0;
}

.sp-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: #f4f4f5;
  font-family: var(--font-geist), system-ui, sans-serif;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.sp-search input::placeholder {
  color: #6b6b75;
}

.sp-search kbd {
  font-family: var(--font-geist-mono), monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #8b8b95;
  border: 1px solid #ffffff1f;
  border-radius: 5px;
  padding: 3px 6px;
}

.sp-results {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sp-result button {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: #d4d4d8;
  font-family: var(--font-geist), system-ui, sans-serif;
  font-size: 13.5px;
  transition: background 0.12s ease, color 0.12s ease;
}

.sp-result.is-active button,
.sp-result button:hover {
  background: #ffffff12;
  color: #fff;
}

.sp-tag {
  flex-shrink: 0;
  font-family: var(--font-geist-mono), monospace;
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8b8b95;
  border: 1px solid #ffffff1f;
  border-radius: 999px;
  padding: 3px 7px;
  min-width: 62px;
  text-align: center;
}

.sp-result.is-active .sp-tag {
  color: #ff8a80;
  border-color: #ff3b2f66;
}

.sp-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-go {
  flex-shrink: 0;
  font-size: 11px;
  color: #71717a;
}

.sp-empty {
  padding: 22px 16px 26px;
  text-align: center;
  color: #8b8b95;
  font-family: var(--font-geist), system-ui, sans-serif;
  font-size: 13px;
}

.sp-hint {
  display: flex;
  gap: 16px;
  padding: 10px 16px 12px;
  border-top: 1px solid #ffffff0f;
  color: #6b6b75;
  font-family: var(--font-geist-mono), monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html.sp-lock,
html.sp-lock body {
  overflow: hidden;
}

.sp-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 520;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  padding: 11px 16px;
  border: 1px solid #ffffff26;
  border-radius: 999px;
  background: #141416f2;
  color: #f4f4f5;
  font-family: var(--font-geist-mono), monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  transition: opacity 0.22s ease, transform 0.22s ease;
  box-shadow: 0 18px 44px #00000080;
}

.sp-toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 760px) {
  .sp-fab span,
  .sp-fab kbd {
    display: none;
  }
  .sp-fab {
    padding: 0;
    width: 42px;
    height: 42px;
    justify-content: center;
  }
  .sp-fab svg {
    width: 15px;
    height: 15px;
  }
  .sp-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sp-progress,
  .sp-fab,
  .sp-palette,
  .sp-palette-box,
  .nav-links a:after {
    transition: none !important;
  }
}

@media print {
  .sp-progress,
  .sp-fab,
  .sp-palette {
    display: none !important;
  }
}
