body {
  cursor: default !important;
}

.projects-viewer-page {
  padding-top: 120px;
  min-height: 100vh;
  background-color: #000;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  z-index: 10;
  position: relative;
  cursor: default !important;
}

.projects-viewer-page.results-mode {
  justify-content: center;
  padding-top: 0;
}

.projects-viewer-page.results-mode .container {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 100px 4% 40px 4%;
  max-width: 100%;
}

.terminal-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  position: relative;
}

.terminal-window {
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  filter: grayscale(100%);
}

.terminal-window.active {
  filter: grayscale(0%);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.15);
}

.terminal-header {
  background: #1a1a1a;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-header .buttons {
  display: flex;
  gap: 8px;
}

.btn {
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

.btn.red { background: #ff5f56; }
.btn.yellow { background: #ffbd2e; }
.btn.green { background: #27c93f; }

.terminal-header .title-text {
  color: #888;
  font-size: 14px;
  margin-left: 20px;
  font-family: 'Courier New', Courier, monospace;
}

.terminal-body {
  padding: 20px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
}

.command-line {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 18px;
}

.prompt {
  color: #27c93f;
}

.input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.placeholder-cmd {
  position: absolute;
  left: 0;
  color: rgba(255, 255, 255, 0.1);
  pointer-events: none;
  font-family: inherit;
  font-size: inherit;
}

#terminal-input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  width: 100%;
  font-family: inherit;
  font-size: inherit;
  caret-color: #27c93f;
  position: relative;
  z-index: 2;
}

.error-msg {
  color: #ff5f56;
  font-size: 15px;
  margin-top: 15px;
  font-family: 'Courier New', Courier, monospace;
  min-height: 24px;
}

.terminal-footer {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  padding-top: 30px;
}

#run-btn {
  background: transparent;
  color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 25px;
  border-radius: 6px;
  cursor: not-allowed;
  font-weight: bold;
  font-size: 16px;
  transition: all 0.3s ease;
}

#run-btn.active {
  color: #000;
  background: #fff;
  border-color: #fff;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.loader-container {
  margin-top: 50px;
  text-align: center;
}

.loading-content {
  font-size: 28px;
  font-family: 'Courier New', Courier, monospace;
  color: #fff;
}

.dots::after {
  content: '';
  animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
  0% { content: ''; }
  33% { content: '.'; }
  66% { content: '..'; }
  100% { content: '...'; }
}

.result-container {
  margin-top: 0;
  text-align: center;
  padding: 0;
  color: #fff;
  width: 100%;
}

.result-container.empty-state {
  margin-top: 30px;
  padding: 40px;
  font-size: 18px;
  font-family: 'Courier New', Courier, monospace;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(5px);
  width: auto;
  max-width: 800px;
}

.hidden {
  display: none !important;
}

/* Header Adjustments for Back Button */
header {
  border-bottom: none !important;
}

header .extra-nav {
  display: flex !important;
}

header .back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 5px 16px 5px 6px !important;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 999px !important;
  font-size: 14px !important;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

header .back-btn-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #050505;
  background: #fff;
  transition: transform 0.25s ease;
}

header .back-btn:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.48) !important;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4), 0 0 18px rgba(255, 255, 255, 0.08);
  transform: translateX(-3px);
}

header .back-btn:hover .back-btn-icon {
  transform: translateX(-2px);
}

header .back-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  width: 100%;
  padding: 20px 0;
}

.project-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.card-image {
  width: 100%;
  height: 160px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .card-image img {
  transform: scale(1.1);
}

.card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.card-content h3 {
  font-size: 20px;
  color: #fff;
  margin: 0;
}

.card-content p {
  font-size: 14px;
  color: #aaa;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tag {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.card-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.card-buttons a {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.btn-live {
  background: #fff;
  color: #000;
}

.btn-live:hover {
  background: #e0e0e0;
}

.btn-git {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-git:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.theme-stage {
  position: relative;
  width: 100%;
  min-height: 60vh;
  isolation: isolate;
}

.theme-stage::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.theme-web .theme-stage::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, #000 0%, transparent 72%);
}

.theme-mobile .theme-stage::before {
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.12), transparent 18%),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.08), transparent 16%),
    linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.05) 52%, transparent 100%);
}

.theme-data .theme-stage::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    repeating-linear-gradient(90deg, transparent 0 80px, rgba(255, 255, 255, 0.05) 80px 82px);
  background-size: 28px 28px, 28px 28px, 160px 100%;
}

.theme-cyber .theme-stage {
  font-family: "Courier New", Courier, monospace;
}

.theme-cyber .theme-stage::before {
  background:
    repeating-linear-gradient(0deg, rgba(39, 201, 63, 0.08) 0 1px, transparent 1px 6px),
    radial-gradient(circle at 20% 20%, rgba(39, 201, 63, 0.18), transparent 25%),
    radial-gradient(circle at 80% 65%, rgba(255, 95, 86, 0.12), transparent 25%);
}

.ascii-bg {
  position: absolute;
  inset: 10px 0 auto 0;
  color: rgba(39, 201, 63, 0.24);
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(16px, 4vw, 54px);
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1.1;
  overflow: hidden;
  pointer-events: none;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: -1;
}

.project-card-web {
  border-radius: 10px;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.browser-chrome {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  gap: 8px;
  padding: 11px 13px;
}

.browser-chrome span {
  border-radius: 50%;
  flex: 0 0 11px;
  height: 11px;
}

.browser-chrome span:nth-child(1) { background: #ff5f56; }
.browser-chrome span:nth-child(2) { background: #ffbd2e; }
.browser-chrome span:nth-child(3) { background: #27c93f; }

.browser-url {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.58);
  flex: 1;
  font-size: 11px;
  margin-left: 6px;
  overflow: hidden;
  padding: 6px 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-screen {
  height: 185px;
}

.project-card-mobile {
  align-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  padding-top: 18px;
}

.phone-shell {
  background: #050505;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 28px;
  box-shadow: inset 0 0 0 5px #111, 0 20px 45px rgba(0, 0, 0, 0.55);
  max-width: 210px;
  padding: 18px 12px 16px;
  width: 70%;
}

.phone-speaker {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  height: 4px;
  margin: 0 auto 12px;
  width: 44px;
}

.phone-screen {
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
}

.phone-screen img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.phone-home {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  height: 16px;
  margin: 12px auto 0;
  width: 16px;
}

.project-card-data {
  background: rgba(4, 12, 18, 0.86);
  border-color: rgba(99, 231, 255, 0.22);
}

.data-panel {
  border-bottom: 1px solid rgba(99, 231, 255, 0.14);
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  padding: 18px;
}

.data-chart {
  align-items: end;
  background:
    linear-gradient(rgba(99, 231, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 231, 255, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 1px solid rgba(99, 231, 255, 0.18);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  height: 135px;
  justify-content: center;
  padding: 18px;
}

.data-chart span {
  background: linear-gradient(180deg, #ffffff, rgba(99, 231, 255, 0.4));
  border-radius: 999px 999px 0 0;
  box-shadow: 0 0 18px rgba(99, 231, 255, 0.28);
  width: 22px;
}

.data-table {
  display: grid;
  gap: 6px;
}

.data-table div {
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.68);
  display: flex;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  justify-content: space-between;
  padding: 8px 10px;
}

.data-table strong {
  color: #fff;
  font-weight: 700;
}

.project-card-cyber {
  background: rgba(0, 10, 4, 0.86);
  border-color: rgba(39, 201, 63, 0.28);
  box-shadow: 0 0 0 1px rgba(39, 201, 63, 0.08), 0 25px 70px rgba(0, 0, 0, 0.65);
}

.project-card-cyber:hover {
  border-color: rgba(39, 201, 63, 0.65);
  box-shadow: 0 0 35px rgba(39, 201, 63, 0.16), 0 25px 70px rgba(0, 0, 0, 0.65);
}

.cyber-scan {
  display: grid;
  min-height: 210px;
  overflow: hidden;
  position: relative;
}

.cyber-scan::after {
  animation: cyberSweep 2.6s linear infinite;
  background: linear-gradient(180deg, transparent, rgba(39, 201, 63, 0.22), transparent);
  content: "";
  height: 60px;
  left: 0;
  position: absolute;
  right: 0;
  top: -60px;
}

.cyber-scan img {
  filter: grayscale(100%) contrast(1.35) brightness(0.76);
  grid-area: 1 / 1;
  height: 100%;
  object-fit: cover;
  opacity: 0.38;
  width: 100%;
}

.cyber-scan pre {
  align-self: center;
  color: rgba(39, 201, 63, 0.92);
  font-size: 13px;
  grid-area: 1 / 1;
  justify-self: center;
  line-height: 1.35;
  margin: 0;
  padding: 18px;
  text-align: left;
  text-shadow: 0 0 14px rgba(39, 201, 63, 0.45);
  z-index: 1;
}

.cyber-code {
  background: rgba(39, 201, 63, 0.08);
  border: 1px solid rgba(39, 201, 63, 0.18);
  border-radius: 8px;
  color: #27c93f;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
}

@keyframes cyberSweep {
  to {
    top: 100%;
  }
}

.theme-mobile .projects-grid {
  align-items: stretch;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1240px;
  margin: 0 auto;
}

.theme-cyber .projects-grid {
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
}

.theme-data .projects-grid,
.theme-web .projects-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media screen and (max-width: 1200px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 992px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 600px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .command-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .phone-shell {
    width: 82%;
  }

  .cyber-scan pre {
    font-size: 11px;
  }
}

/* Clean themed project views */
.theme-stage,
.theme-stage::before,
.theme-web .theme-stage::before,
.theme-mobile .theme-stage::before,
.theme-data .theme-stage::before,
.theme-cyber .theme-stage::before {
  background: none;
  inset: auto;
  isolation: auto;
  min-height: 0;
  position: relative;
  z-index: auto;
}

.theme-stage {
  width: 100%;
}

.theme-stage .projects-grid {
  align-items: stretch;
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  margin: 0 auto;
  max-width: 1280px;
  padding: 20px 0;
  position: relative;
  z-index: 1;
}

.theme-mobile .theme-stage .projects-grid {
  max-width: 900px;
}

.project-card {
  background: rgba(8, 8, 8, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  min-height: 0;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-5px);
}

.card-content {
  gap: 10px;
  padding: 16px;
}

.card-content h3 {
  font-size: 18px;
  line-height: 1.25;
}

.card-content p {
  -webkit-line-clamp: 4;
  font-size: 13px;
}

.browser-chrome {
  background: #151515;
  gap: 7px;
  padding: 10px 12px;
}

.browser-url {
  border-radius: 6px;
  font-size: 10px;
  padding: 5px 9px;
}

.browser-screen {
  height: 170px;
}

.project-card-mobile {
  align-items: center;
  background: transparent;
  border: none;
  box-shadow: none;
  justify-content: center;
  overflow: visible;
  padding: 8px 0;
}

.phone-shell {
  border-radius: 24px;
  max-width: 250px;
  padding: 16px 11px 13px;
  width: 100%;
}

.phone-card-shell {
  background:
    linear-gradient(145deg, #1b1b1b, #030303 45%, #151515);
  border: 2px solid rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 0 0 5px #0b0b0b,
    inset 0 0 0 6px rgba(255, 255, 255, 0.08),
    0 24px 55px rgba(0, 0, 0, 0.65);
}

.phone-screen {
  aspect-ratio: 9 / 14;
  background: #090909;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.phone-image {
  flex: 0 0 35%;
  overflow: hidden;
}

.phone-image img {
  display: block;
  filter: saturate(0.92) contrast(1.05);
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.phone-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  padding: 11px;
  text-align: left;
}

.phone-content h3 {
  color: #fff;
  font-size: 14px;
  line-height: 1.2;
  margin: 0;
}

.phone-content p {
  color: #bdbdbd;
  display: -webkit-box;
  font-size: 11px;
  line-height: 1.5;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.phone-content .tags {
  margin-top: 4px;
}

.phone-content .tag {
  font-size: 9px;
  padding: 3px 7px;
}

.phone-content .card-buttons {
  gap: 7px;
  margin-top: 4px;
}

.phone-content .card-buttons a {
  border-radius: 7px;
  font-size: 10px;
  padding: 6px;
}

.phone-home {
  height: 13px;
  margin-top: 10px;
  width: 13px;
}

.project-card-data {
  background: rgba(5, 10, 12, 0.94);
}

.data-panel {
  gap: 10px;
  padding: 14px;
}

.data-chart {
  height: 105px;
  padding: 14px;
}

.data-chart span {
  width: 18px;
}

.data-table div {
  font-size: 11px;
  padding: 7px 9px;
}

.theme-cyber .theme-stage {
  border: 1px solid rgba(39, 201, 63, 0.16);
  border-radius: 12px;
  padding: 18px;
}

.ascii-bg {
  background: rgba(39, 201, 63, 0.06);
  border: 1px solid rgba(39, 201, 63, 0.14);
  border-radius: 8px;
  color: rgba(39, 201, 63, 0.68);
  font-size: 13px;
  letter-spacing: 1px;
  margin-bottom: 14px;
  overflow: hidden;
  padding: 10px 12px;
  position: static;
  text-align: left;
  white-space: nowrap;
  z-index: auto;
}

.project-card-cyber {
  background: rgba(0, 8, 3, 0.94);
}

.cyber-scan {
  min-height: 170px;
}

.cyber-scan pre {
  font-size: 11px;
  padding: 12px;
}

.cyber-code {
  font-size: 11px;
  max-height: 90px;
}

@media screen and (max-width: 700px) {
  .theme-stage .projects-grid {
    grid-template-columns: 1fr;
    padding: 12px 0;
  }

  .theme-cyber .theme-stage {
    padding: 10px;
  }

  .ascii-bg {
    font-size: 11px;
  }

  .phone-shell {
    max-width: 290px;
    width: 92%;
  }

  .card-buttons {
    flex-direction: column;
  }
}

@media screen and (max-width: 1100px) {
  .theme-mobile .projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media screen and (max-width: 820px) {
  .theme-mobile .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 520px) {
  .theme-mobile .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* Data cards: project screenshot plus analytics-styled actions */
.data-image {
  background:
    linear-gradient(rgba(99, 231, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 231, 255, 0.08) 1px, transparent 1px),
    #05090c;
  background-size: 20px 20px;
  border: 1px solid rgba(99, 231, 255, 0.18);
  border-radius: 10px;
  height: 150px;
  overflow: hidden;
  padding: 8px;
  position: relative;
}

.data-image::after {
  border-bottom: 1px solid rgba(99, 231, 255, 0.22);
  border-top: 1px solid rgba(99, 231, 255, 0.22);
  content: "";
  inset: 8px;
  pointer-events: none;
  position: absolute;
}

.data-image img {
  border-radius: 7px;
  filter: saturate(0.85) contrast(1.08);
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.data-buttons a {
  border-radius: 10px;
  min-height: 42px;
  overflow: hidden;
  position: relative;
}

.data-buttons .btn-git {
  border-color: rgba(99, 231, 255, 0.28);
  padding-left: 34px;
}

.data-buttons .btn-git::before {
  background:
    conic-gradient(#fff 0deg 95deg, rgba(99, 231, 255, 0.25) 95deg 230deg, rgba(255, 255, 255, 0.1) 230deg 360deg);
  border-radius: 50%;
  content: "";
  height: 18px;
  left: 10px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
}

.data-buttons .btn-git::after {
  background: #05090c;
  border-radius: 50%;
  content: "";
  height: 8px;
  left: 15px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
}

.data-buttons .btn-live {
  padding-left: 34px;
}

.data-buttons .btn-live::before {
  background:
    linear-gradient(to top, #000 0 45%, transparent 45%),
    linear-gradient(to top, #000 0 70%, transparent 70%),
    linear-gradient(to top, #000 0 55%, transparent 55%);
  background-position: 0 0, 7px 0, 14px 0;
  background-repeat: no-repeat;
  background-size: 5px 18px;
  content: "";
  height: 18px;
  left: 12px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
}

/* 3D cards: render viewport treatment */
.theme-3d .theme-stage .projects-grid {
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  max-width: 1260px;
}

.project-card-3d {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.96) 42%),
    #060606;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.65),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform-style: preserve-3d;
}

.project-card-3d:hover {
  box-shadow:
    0 32px 85px rgba(0, 0, 0, 0.78),
    0 0 35px rgba(255, 255, 255, 0.1);
  transform: translateY(-7px) perspective(900px) rotateX(2deg);
}

.render-frame {
  background: #0d0d0d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px;
}

.render-toolbar {
  align-items: center;
  color: rgba(255, 255, 255, 0.68);
  display: flex;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  justify-content: space-between;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.render-toolbar strong {
  color: #fff;
  font-size: 13px;
}

.render-stage {
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.16), transparent 42%),
    #050505;
  background-size: 24px 24px, 24px 24px, 100% 100%, 100% 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.render-stage::before {
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.18) 50%, transparent 100%);
  content: "";
  height: 100%;
  left: -120%;
  position: absolute;
  top: 0;
  transform: skewX(-20deg);
  transition: left 0.7s ease;
  width: 60%;
  z-index: 2;
}

.project-card-3d:hover .render-stage::before {
  left: 125%;
}

.render-stage img {
  display: block;
  filter: contrast(1.08) saturate(0.96);
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.5s ease, filter 0.5s ease;
  width: 100%;
}

.project-card-3d:hover .render-stage img {
  filter: contrast(1.12) saturate(1.08);
  transform: scale(1.08);
}

.axis-widget {
  bottom: 10px;
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(2, 18px);
  position: absolute;
  right: 10px;
  z-index: 3;
}

.axis-widget span {
  align-items: center;
  border-radius: 50%;
  color: #000;
  display: flex;
  font-size: 10px;
  font-weight: 800;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.axis-x { background: #ff5f56; }
.axis-y { background: #27c93f; }
.axis-z { background: #59a6ff; }

.render-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.render-stats span {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 700;
  padding: 5px 8px;
  text-transform: uppercase;
}

.render-buttons .btn-git {
  border-color: rgba(255, 255, 255, 0.28);
}

/* Software cards: clean utility/tool surface */
.theme-software .theme-stage .projects-grid {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  max-width: 1240px;
}

.project-card-software {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(0, 0, 0, 0.9);
  border-color: rgba(255, 255, 255, 0.16);
}

.project-card-software .card-image {
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    #070707;
  background-size: 22px 22px;
  height: 175px;
  padding: 8px;
}

.project-card-software .card-image img {
  border-radius: 8px;
  filter: grayscale(100%) contrast(1.05);
}

.project-card-software:hover .card-image img {
  filter: grayscale(0%) contrast(1.08);
}

.project-card-software .card-content h3::before {
  color: rgba(255, 255, 255, 0.55);
  content: "./ ";
  font-family: "Courier New", Courier, monospace;
}

@media screen and (max-width: 700px) {
  .theme-3d .theme-stage .projects-grid {
    grid-template-columns: 1fr;
  }

  .render-frame {
    padding: 10px;
  }
}

/* Mobile service must show four project phones per row */
body[data-service="mobile"] .theme-mobile .theme-stage .projects-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  max-width: 1280px;
}

body[data-service="mobile"] .project-card-mobile {
  min-width: 0;
}

body[data-service="mobile"] .phone-shell {
  max-width: 230px;
  width: 100%;
}

@media screen and (max-width: 720px) {
  body[data-service="mobile"] .theme-mobile .theme-stage .projects-grid {
    gap: 10px;
  }

  body[data-service="mobile"] .phone-shell {
    padding: 12px 7px 9px;
  }

  body[data-service="mobile"] .phone-content {
    padding: 8px;
  }
}

/* Portfolio viewer polish */
.projects-page-heading {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 auto 34px;
  max-width: 780px;
  text-align: center;
}

.projects-kicker,
.projects-subtitle {
  text-align: center;
}

.projects-kicker {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.68);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0;
  padding: 8px 12px;
  text-transform: uppercase;
}

.projects-subtitle {
  color: rgba(255, 255, 255, 0.66);
  margin: 0;
  max-width: 620px;
}

#service-title-display {
  margin: 0;
}

.terminal-container {
  max-width: 980px;
  margin: 0 auto;
}

.projects-viewer-page.results-mode .terminal-container {
  max-width: 100%;
}

.terminal-window {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(5, 5, 5, 0.94);
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 10px;
}

.terminal-body {
  min-height: 210px;
}

#run-btn.active {
  border-radius: 6px;
}

.project-card {
  border-radius: 10px;
}

@media screen and (max-width: 700px) {
  .projects-subtitle {
    margin-top: 0;
  }

  .terminal-body {
    min-height: 230px;
  }
}

/* Anti-overlap layout fixes for project views */
.projects-viewer-page .container {
  width: 100%;
}

.projects-kicker,
.projects-subtitle,
#service-title-display {
  position: static;
}

.projects-subtitle {
  margin: 0;
}

.terminal-container,
.result-container,
.theme-stage,
.projects-grid,
.project-card,
.card-content,
.phone-content,
.data-table,
.card-buttons {
  min-width: 0;
}

.theme-stage .projects-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  align-items: stretch;
}

.project-card {
  height: auto;
  min-height: 100%;
}

.card-content,
.phone-content {
  overflow-wrap: anywhere;
  word-break: normal;
}

.card-content h3,
.phone-content h3 {
  line-height: 1.25;
}

.card-content p,
.phone-content p {
  line-height: 1.55;
}

.tags,
.card-buttons {
  align-items: stretch;
}

.card-buttons {
  flex-wrap: wrap;
}

.card-buttons a {
  min-width: 112px;
  white-space: nowrap;
}

body[data-service="mobile"] .theme-mobile .theme-stage .projects-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 18px;
}

body[data-service="mobile"] .phone-shell {
  max-width: 260px;
}

body[data-service="mobile"] .phone-screen {
  aspect-ratio: auto;
  min-height: 340px;
}

body[data-service="mobile"] .phone-image {
  flex-basis: 40%;
}

body[data-service="mobile"] .phone-content {
  flex: 1;
}

body[data-service="mobile"] .phone-content .card-buttons {
  margin-top: auto;
}

@media screen and (max-width: 900px) {
  body[data-service="mobile"] .theme-mobile .theme-stage .projects-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr)) !important;
  }
}

@media screen and (max-width: 560px) {
  .projects-viewer-page {
    padding-top: 96px;
  }

  .terminal-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .terminal-header .title-text {
    margin-left: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .command-line {
    font-size: 15px;
  }

  body[data-service="mobile"] .theme-mobile .theme-stage .projects-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-service="mobile"] .phone-shell {
    max-width: 310px;
    width: 100%;
  }

  .card-buttons a {
    min-width: 100%;
  }
}

/* Final responsive sizing pass for project views */
@media screen and (max-width: 1280px) {
  .projects-viewer-page.results-mode .container {
    padding-left: 3%;
    padding-right: 3%;
  }

  .theme-stage .projects-grid {
    max-width: 1120px;
  }
}

@media screen and (max-width: 1024px) {
  .projects-viewer-page {
    padding-top: 104px;
  }

  .projects-page-heading {
    margin-bottom: 26px;
    padding: 0 1rem;
  }

  .terminal-container {
    width: min(100%, 860px);
  }

  .theme-stage .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 18px;
  }

  body[data-service="mobile"] .phone-shell {
    max-width: 250px;
  }
}

@media screen and (max-width: 768px) {
  .projects-viewer-page .container,
  .projects-viewer-page.results-mode .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .projects-kicker {
    font-size: 0.7rem;
    max-width: 100%;
    white-space: normal;
  }

  #service-title-display {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
    line-height: 1.15;
  }

  .projects-subtitle {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .terminal-body {
    padding: 18px;
  }

  .terminal-footer {
    justify-content: stretch;
  }

  #run-btn {
    width: 100%;
  }

  .theme-stage .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 16px;
  }

  .card-content {
    padding: 14px;
  }

  .card-buttons a {
    min-height: 38px;
  }
}

@media screen and (max-width: 520px) {
  .projects-viewer-page .container,
  .projects-viewer-page.results-mode .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .projects-viewer-page.results-mode .container {
    padding-top: 88px;
  }

  .terminal-body {
    min-height: 210px;
    padding: 16px;
  }

  .input-wrapper {
    width: 100%;
  }

  #terminal-input,
  .placeholder-cmd {
    font-size: 15px;
  }

  .theme-stage .projects-grid,
  body[data-service="mobile"] .theme-mobile .theme-stage .projects-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .project-card {
    width: 100%;
  }

  body[data-service="mobile"] .phone-shell {
    max-width: 300px;
  }

  body[data-service="mobile"] .phone-screen {
    min-height: 330px;
  }

  .browser-url,
  .card-content h3,
  .card-content p,
  .tag {
    overflow-wrap: anywhere;
  }
}
