/* Typography & theme variables */
:root {
  --bg-color: #0a0e17;
  --text-color: #e0e0e0;
  --primary-color: #6ee7b7;
  --secondary-color: #1f2937;
  --accent-color: #f472b6;
  --cursor-color: #6ee7b7;
  --transition-speed: 0.3s;
  --animation-duration: 1s;
  --filter-transition-duration: 0.3s;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Fira Code", monospace;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.terminal {
  background: rgba(0, 0, 0, 0.8);
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.window-controls {
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  display: flex;
  gap: 6px;
}

.window-control {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.close {
  background-color: #ff5f56;
}
.minimize {
  background-color: #ffbd2e;
}
.maximize {
  background-color: #27c93f;
}

.terminal-content {
  margin-top: 1.5rem;
  padding-top: 1rem;
}

section {
  margin-bottom: 1.5rem;
}
section:last-of-type {
  margin-bottom: 0;
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
  text-align: center;
}

.profile-pic {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.1);
  transition: transform var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
  margin-bottom: 1.5rem;
}

.profile-pic:hover {
  transform: scale(1.05);
  border-color: var(--primary-color);
}

.profile-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-speed) ease;
}

.profile-pic:hover img {
  transform: scale(1.1);
}

.command-line {
  display: flex;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeIn calc(var(--animation-duration) * 0.3) ease forwards;
}

.prompt {
  color: var(--primary-color);
  margin-right: 10px;
}

.command {
  color: var(--text-color);
}

.output {
  margin-left: 0;
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-wrap: break-word;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeIn calc(var(--animation-duration) * 0.3) ease forwards;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.2em;
  background-color: var(--cursor-color);
  margin-left: 5px;
  animation: blink var(--animation-duration) infinite;
}

.highlight {
  color: var(--primary-color);
  font-weight: 500;
}

.contact-info {
  color: var(--accent-color);
  font-weight: 500;
}
.contact-link,
.output a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-speed),
    text-decoration var(--transition-speed);
}
.contact-link:hover,
.contact-link:focus-visible,
.output a:hover,
.output a:focus-visible {
  color: var(--accent-color);
  text-decoration: underline;
  outline: none;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.works-grid.visible {
  opacity: 1;
  transform: translateY(0);
}

.work-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: visible;
  cursor: pointer;
  position: relative;
  transition: opacity var(--filter-transition-duration) ease,
    transform var(--filter-transition-duration) ease,
    box-shadow var(--transition-speed) ease,
    background-color var(--transition-speed) ease;
  opacity: 0;
  transform: translateY(20px);
}

.works-grid.visible .work-item {
  opacity: 1;
  transform: translateY(0);
  &:nth-child(1) {
    transition-delay: 0.1s;
  }
  &:nth-child(2) {
    transition-delay: 0.15s;
  }
  &:nth-child(3) {
    transition-delay: 0.2s;
  }
  &:nth-child(4) {
    transition-delay: 0.25s;
  }
  &:nth-child(5) {
    transition-delay: 0.3s;
  }
  &:nth-child(6) {
    transition-delay: 0.35s;
  }
  &:nth-child(7) {
    transition-delay: 0.4s;
  }
  &:nth-child(8) {
    transition-delay: 0.45s;
  }
  &:nth-child(9) {
    transition-delay: 0.5s;
  }
  &:nth-child(10) {
    transition-delay: 0.55s;
  }
  &:nth-child(11) {
    transition-delay: 0.6s;
  }
  &:nth-child(12) {
    transition-delay: 0.65s;
  }
}

.work-item.filtered-out {
  opacity: 0 !important;
  transform: scale(0.9) translateY(10px);
  pointer-events: none;
  transition-delay: 0s !important;
}

.work-item:hover,
.work-item:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.07);
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  z-index: 5;
}

.work-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  border-radius: 8px 8px 0 0;
  transition: transform calc(var(--transition-speed) * 1.5) ease;
}

.work-item:hover .work-image,
.work-item:focus-visible .work-image {
  transform: scale(1.05);
}

.work-details {
  padding: 1rem;
}

.work-title {
  color: var(--primary-color);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.work-subtitle {
  color: var(--accent-color);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.work-company {
  color: var(--text-color);
  opacity: 0.8;
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.tag {
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}

.tag:hover {
  transform: translateY(-3px);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}

.tag::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left calc(var(--transition-speed) * 1.5);
}

.tag:hover::after {
  left: 100%;
}

.tag-automation {
  background: rgba(96, 165, 250, 0.2);
  color: #3b82f6;
  border-color: rgba(96, 165, 250, 0.3);
}
.tag-management {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}
.tag-verification {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}
.tag-moderation {
  background: rgba(236, 72, 153, 0.2);
  color: #ec4899;
  border-color: rgba(236, 72, 153, 0.3);
}
.tag-utility {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}
.tag-economy {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
  border-color: rgba(234, 179, 8, 0.3);
}
.tag-leveling {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.3);
}
.tag-music {
  background: rgba(37, 99, 235, 0.2);
  color: #3b82f6;
  border-color: rgba(37, 99, 235, 0.3);
}
.tag-fun {
  background: rgba(251, 113, 133, 0.2);
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.3);
}
.tag-games {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.3);
}

.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity var(--transition-speed) ease,
    backdrop-filter var(--transition-speed) ease;
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
}

.modal-content {
  position: relative;
  background: var(--secondary-color);
  padding: 2rem;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 10px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-speed) ease,
    opacity var(--transition-speed) ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
}
.modal-content:focus {
  outline: none;
}

.modal.active {
  opacity: 1;
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal .close-btn {
  position: absolute;
  right: 1rem;
  top: 1rem;
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  opacity: 0.7;
  background: none;
  border: none;
  padding: 0.2rem;
  z-index: 10;
}

.modal .close-btn:hover,
.modal .close-btn:focus-visible {
  opacity: 1;
  transform: scale(1.1) rotate(90deg);
  color: var(--primary-color);
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.work-modal-content {
  color: var(--text-color);
}

.work-modal-title {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  margin-right: 3rem;
}

.work-modal-year {
  font-size: 1rem;
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.work-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.work-modal-description {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.cta-section {
  margin-top: 3rem;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn calc(var(--animation-duration) * 0.6) ease forwards;
  animation-delay: calc(var(--animation-duration) * 2.5);
}

.cta-section .command-line {
  justify-content: center;
  margin-bottom: 1rem;
}

.cta-section .output {
  margin-bottom: 2rem;
}

.cta-button {
  display: inline-block;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  color: var(--bg-color);
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-speed) ease;
  border: none;
  cursor: pointer;
  font-family: "Fira Code", monospace;
  position: relative;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.cta-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.cta-button:hover::before,
.cta-button:focus-visible::before {
  left: 100%;
}

.cta-button:hover,
.cta-button:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn calc(var(--animation-duration) * 0.6) ease forwards;
  animation-delay: calc(var(--animation-duration) * 1.9);
  position: relative;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  font-family: "Fira Code", monospace;
  font-size: 0.8rem;
  position: relative;
  overflow: hidden;
}

.filter-btn:hover,
.filter-btn:focus-visible,
.filter-btn.active {
  background: var(--primary-color);
  color: var(--bg-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  outline: none;
}

.filter-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left calc(var(--transition-speed) * 1.5);
}

.filter-btn:hover::after,
.filter-btn:focus-visible::after {
  left: 100%;
}

.highlight-word {
  position: relative;
  display: inline;
  white-space: normal;
}

.highlight-word::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  opacity: 0;
  transition: width 0.6s ease, opacity 0.3s ease;
  pointer-events: none;
}

.highlight-word.active::after {
  width: 100%;
  opacity: 1;
}

.work-item.featured {
  background: linear-gradient(
    to right bottom,
    rgba(110, 231, 183, 0.1),
    rgba(247, 114, 182, 0.1)
  );
  border: 2px solid rgba(110, 231, 183, 0.5);
  box-shadow: 0 5px 15px rgba(110, 231, 183, 0.15);
  position: relative;
  animation: featuredPulse calc(var(--animation-duration) * 3) infinite
    alternate;
}

.work-item.featured:hover,
.work-item.featured:focus-visible {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 8px 25px rgba(110, 231, 183, 0.3);
  z-index: 10;
  outline-color: var(--accent-color);
}

.featured-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(
    135deg,
    rgba(110, 231, 183, 0.4),
    rgba(247, 114, 182, 0.3)
  );
  color: #ffffff;
  padding: 0.3rem 0.8rem;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  animation: badgePulse calc(var(--animation-duration) * 2) infinite alternate;
}

.easter-egg-output {
  background: rgba(110, 231, 183, 0.1);
  border-left: 3px solid var(--primary-color);
  margin-top: 1rem;
  position: relative;
  box-shadow: none;
  transition: box-shadow var(--transition-speed) ease;
}

.easter-egg-output::before {
  content: "🥚";
  position: absolute;
  top: -10px;
  right: 10px;
  font-size: 1.5rem;
  filter: drop-shadow(0 0 5px rgba(110, 231, 183, 0.5));
}

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

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

@keyframes featuredPulse {
  0% {
    box-shadow: 0 5px 15px rgba(110, 231, 183, 0.15);
    border-color: rgba(110, 231, 183, 0.5);
  }
  100% {
    box-shadow: 0 5px 20px rgba(110, 231, 183, 0.3);
    border-color: rgba(110, 231, 183, 0.7);
  }
}

@keyframes badgePulse {
  0% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }
  100% {
    transform: scale(1.05);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
  }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transition-delay: 0ms !important;
  }

  .featured-badge,
  .work-item.featured {
    animation: none;
  }
  .highlight-word::after {
    transition: none;
  }
  .highlight-word.active::after {
    width: 100%;
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem 0.5rem;
  }

  .terminal {
    padding: 1.5rem 1rem;
  }

  .works-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .profile-pic {
    width: 100px;
    height: 100px;
  }

  .category-filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0.5rem 0.5rem 0.5rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: relative;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding-left: 1rem;
  }

  .category-filters::-webkit-scrollbar {
    display: none;
  }

  .category-filters::before,
  .category-filters::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 25px;
    pointer-events: none;
    z-index: 2;
  }
  .category-filters::before {
    left: 0;
    background: linear-gradient(to left, transparent, var(--bg-color) 90%);
  }
  .category-filters::after {
    right: 0;
    background: linear-gradient(to right, transparent, var(--bg-color) 90%);
  }

  .filter-btn {
    flex: 0 0 auto;
    margin-right: 0.5rem;
    white-space: nowrap;
    padding: 0.4rem 0.8rem;
  }
  .filter-btn:last-child {
    margin-right: 1rem;
  }

  .highlight-word::after {
    height: 1px;
    bottom: 0px;
    opacity: 0.8;
  }

  .modal-content {
    padding: 1.5rem;
    max-height: 85vh;
  }
  .work-modal-title {
    font-size: 1.5rem;
    margin-right: 2.5rem;
  }
  .modal .close-btn {
    font-size: 24px;
    right: 0.8rem;
    top: 0.8rem;
  }
}

@media (hover: none) {
  .work-item:hover,
  .work-item.featured:hover,
  .tag:hover,
  .filter-btn:hover,
  .cta-button:hover,
  .modal .close-btn:hover {
    transform: none;
    box-shadow: none;
  }
  .work-item.featured:hover {
    transform: none;
    box-shadow: 0 5px 15px rgba(110, 231, 183, 0.15);
    z-index: 0;
    background: linear-gradient(
      to right bottom,
      rgba(110, 231, 183, 0.1),
      rgba(247, 114, 182, 0.1)
    );
  }
  .work-item:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .work-item:hover .work-image {
    transform: none;
  }

  .tag:hover::after,
  .filter-btn:hover::after,
  .cta-button:hover::before {
    left: -100%;
    transition: none;
  }
}