:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --panel: rgba(15, 23, 42, 0.9);
  --panel-alt: rgba(15, 23, 42, 0.72);
  --panel-strong: #020817;
  --primary: #f97316;
  --primary-soft: rgba(249, 115, 22, 0.14);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.18);
  --shadow: 0 30px 60px rgba(2, 8, 23, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(249, 115, 22, 0.08), transparent 35%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

.projects-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.projects-hero {
  padding: 72px 20px 28px;
  background: linear-gradient(
    180deg,
    rgba(2, 8, 23, 0.88),
    rgba(15, 23, 42, 0.72)
  );
  border-bottom: 1px solid var(--border);
}

.projects-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.projects-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.25);
  color: #fbbf24;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.projects-hero h1 {
  margin: 18px 0 12px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  color: #fff;
  line-height: 1.1;
}

.projects-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.hero-divider {
  width: 120px;
  height: 4px;
  margin-top: 26px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), rgba(249, 115, 22, 0.1));
}

.projects-shell {
  padding-top: 42px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  width: min(100%, 1200px);
  margin: 0 auto;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.82)
  );
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-6px);
  border-color: rgba(249, 115, 22, 0.5);
  box-shadow: 0 28px 50px rgba(2, 8, 23, 0.5);
}

.project-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 200px;
  background: linear-gradient(135deg, var(--preview-start), var(--preview-end));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0;
  overflow: hidden;
}

.project-preview::before {
  content: "";
  position: absolute;
  inset: 12px 18px auto auto;
  width: 140px;
  height: 140px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  filter: blur(14px);
}

.project-preview-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #020817;
  transform: scale(var(--preview-scale, 1));
  transform-origin: center center;
  pointer-events: auto;
}

.preview-label {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(2, 8, 23, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.preview-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(2, 8, 23, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 1.7rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  opacity: 0.4;
}

.project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px 22px 24px;
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.project-header h2 {
  margin: 0;
  font-size: 1.4rem;
  color: #fff;
}

.project-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: #a7f3d0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.project-body p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.96rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
}

.tech-tags li {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #dfeaf6;
  font-size: 0.72rem;
  font-weight: 700;
}

.project-actions {
  margin-top: auto;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #fb923c);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 18px 30px rgba(249, 115, 22, 0.22);
}

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

  .project-preview {
    min-height: 180px;
  }
}

@media (max-width: 640px) {
  html,
  body {
    overflow-x: hidden;
  }

  .projects-page,
  .projects-hero-inner,
  .projects-grid {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
  }

  .projects-page {
    padding: 0 12px 60px;
  }

  .projects-hero {
    padding: 56px 12px 28px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .project-preview {
    min-height: 170px;
  }

  .project-preview-frame {
    --preview-scale: 1 !important;
    transform: scale(var(--preview-scale, 1)) !important;
  }

  .project-body {
    padding: 18px;
  }

  .project-header {
    flex-wrap: wrap;
    align-items: flex-start;
    flex-direction: column;
  }

  .project-header h2 {
    font-size: 1.25rem;
  }
}

.primary-link:hover,
.primary-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 20px 35px rgba(249, 115, 22, 0.28);
}

.primary-link:focus-visible,
.nav-links a:focus-visible,
.menu-icon:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
