/* ============================================================
   SHOAIB.DEV — game-inspired portfolio (Jaspr port)
   Hand-written CSS replacing the Tailwind utility classes used
   in the original game-inspired-portfolio.tsx.
   Breakpoints: sm = 640px, md = 768px, lg = 1024px
   ============================================================ */

:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;

  --emerald-300: #6ee7b7;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;

  --amber-200: #fde68a;
  --amber-300: #fcd34d;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--slate-950);
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.font-mono {
  font-family: var(--font-mono);
}

/* ---------- animations ---------- */

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ---------- page layout ---------- */

.page {
  min-height: 100vh;
  background-color: var(--slate-950);
  color: var(--slate-200);
  font-family: var(--font-sans);
  background-image: radial-gradient(ellipse at top, rgba(16, 185, 129, 0.08), transparent 60%);
}

.container {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 0 -1rem;
  border-bottom: 2px solid var(--slate-800);
  background: rgba(2, 6, 23, 0.95);
  padding: 0.75rem 1rem;
  backdrop-filter: blur(8px);
}

@media (min-width: 640px) {
  .nav {
    margin: 0 -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.nav-brand {
  font-size: 0.875rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--emerald-400);
}

.nav-brand-accent {
  color: var(--slate-500);
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
}

@media (min-width: 640px) {
  .nav-links {
    gap: 0.5rem;
  }
}

.nav-link {
  white-space: nowrap;
  border-radius: 0.25rem;
  padding: 0.375rem 0.625rem;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-400);
  transition: color 0.15s, background-color 0.15s;
}

.nav-link:hover {
  background: var(--slate-800);
  color: var(--emerald-300);
}

.nav-icon {
  margin-right: 0.25rem;
}

.nav-label {
  display: none;
}

@media (min-width: 640px) {
  .nav-label {
    display: inline;
  }
}

/* ---------- sections ---------- */

.section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-margin-top: 4.5rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.section-num {
  font-size: 0.75rem;
  font-weight: 900;
  color: rgba(16, 185, 129, 0.7);
}

.section-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(5, 150, 105, 0.4);
}

@media (min-width: 640px) {
  .section-title {
    font-size: 1.25rem;
  }
}

.section-sub {
  margin: 0 0 0 2rem;
  font-size: 0.75rem;
  color: var(--slate-500);
}

.section-rule {
  margin: 0.75rem 0 0 2rem;
  height: 2px;
  width: 6rem;
  background: linear-gradient(to right, var(--emerald-500), transparent);
}

/* ---------- intro (start screen) ---------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--slate-950);
  text-align: center;
}

.intro-coin {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5em;
  color: var(--emerald-400);
}

.intro-title {
  margin: 1.5rem 0 0;
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  color: #fff;
  text-shadow: 4px 4px 0 var(--emerald-600), 8px 8px 0 rgba(0, 0, 0, 0.5);
}

@media (min-width: 640px) {
  .intro-title {
    font-size: 3.75rem;
  }
}

.intro-sub {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: var(--slate-400);
}

.btn-start {
  margin-top: 2.5rem;
  border-radius: 0.375rem;
  border: 2px solid var(--emerald-400);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.75rem 2.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--emerald-300);
  transition: all 0.15s;
}

.btn-start:hover {
  background: var(--emerald-400);
  color: var(--slate-950);
  box-shadow: 0 0 30px rgba(52, 211, 153, 0.6);
}

.btn-start:active {
  transform: translateY(2px);
}

.intro-copy {
  margin: 1.5rem 0 0;
  font-size: 11px;
  color: var(--slate-600);
}

/* ---------- HUD ---------- */

.hud {
  border-radius: 0.5rem;
  border: 2px solid rgba(51, 65, 85, 0.8);
  background: rgba(15, 23, 42, 0.9);
  padding: 1rem;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.hud-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .hud-row {
    flex-direction: row;
    align-items: center;
  }
}

.hud-id {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hud-avatar {
  display: flex;
  height: 3rem;
  width: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  border: 2px solid rgba(251, 191, 36, 0.6);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(234, 88, 12, 0.3));
  font-size: 1.5rem;
}

.hud-name {
  font-size: 0.875rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
}

.hud-role {
  font-size: 11px;
  color: var(--emerald-400);
}

.hud-level {
  margin-left: 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid rgba(251, 191, 36, 0.5);
  background: rgba(245, 158, 11, 0.1);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--amber-300);
}

.hud-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

@media (min-width: 640px) {
  .hud-bars {
    padding-left: 1.5rem;
  }
}

.bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bar-label {
  width: 1.75rem;
  font-size: 10px;
  font-weight: 700;
  color: var(--slate-300);
}

.bar-track {
  position: relative;
  height: 0.875rem;
  flex: 1;
  overflow: hidden;
  border-radius: 2px;
  border: 2px solid rgba(2, 6, 23, 0.8);
  background: rgba(30, 41, 59, 0.8);
}

.bar-fill {
  height: 100%;
  transition: width 0.7s ease;
}

.bar-fill.hp {
  background: linear-gradient(to right, #e11d48, #f87171);
}

.bar-fill.mp {
  background: linear-gradient(to right, #2563eb, #22d3ee);
}

.bar-fill.xp {
  background: linear-gradient(to right, var(--emerald-600), #a3e635);
}

.bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.hud-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 11px;
  color: var(--slate-500);
}

.hud-meta-value {
  color: var(--slate-300);
}

/* ---------- stats ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  border-radius: 0.5rem;
  border: 2px solid var(--slate-700);
  background: rgba(30, 41, 59, 0.7);
  padding: 1rem;
  text-align: center;
  transition: border-color 0.15s;
}

.stat-card:hover {
  border-color: rgba(52, 211, 153, 0.6);
}

.stat-icon {
  font-size: 1.5rem;
}

.stat-value {
  margin-top: 0.25rem;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--emerald-300);
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-500);
}

/* ---------- inventory (skills) ---------- */

.inv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .inv-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .inv-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.inv-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 0.375rem;
  border: 2px solid var(--slate-700);
  background: rgba(30, 41, 59, 0.8);
  transition: all 0.2s;
}

.inv-slot:hover {
  transform: translateY(-4px);
  border-color: var(--slate-500);
  z-index: 30;
}

.inv-slot.active {
  transform: translateY(-4px);
  border-color: var(--amber-200);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  z-index: 30;
}

.inv-icon {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.inv-icon-img {
  width: 5rem;
  height: 5rem;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.inv-icon-text {
  font-size: 1.5rem;
  line-height: 1;
}

.inv-level {
  position: absolute;
  bottom: 4px;
  right: 4px;
  border-radius: 2px;
  background: rgba(2, 6, 23, 0.8);
  padding: 0 4px;
  font-size: 9px;
  font-weight: 900;
  color: var(--amber-300);
}

.inv-tooltip {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: 11rem;
  border-radius: 0.375rem;
  border: 2px solid rgba(251, 191, 36, 0.6);
  background: var(--slate-950);
  padding: 0.5rem;
  text-align: left;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.5);
}

/* Keep tooltips inside the grid/viewport on edge columns */
@media (max-width: 639px) {
  .inv-slot:nth-child(3n + 1) .inv-tooltip {
    left: 0;
    transform: none;
  }

  .inv-slot:nth-child(3n) .inv-tooltip {
    left: auto;
    right: 0;
    transform: none;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .inv-slot:nth-child(4n + 1) .inv-tooltip {
    left: 0;
    transform: none;
  }

  .inv-slot:nth-child(4n) .inv-tooltip {
    left: auto;
    right: 0;
    transform: none;
  }
}

@media (min-width: 1024px) {
  .inv-slot:nth-child(6n + 1) .inv-tooltip {
    left: 0;
    transform: none;
  }

  .inv-slot:nth-child(6n) .inv-tooltip {
    left: auto;
    right: 0;
    transform: none;
  }
}

.tt-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.tt-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7dd3fc;
}

.tt-bar {
  margin-top: 0.375rem;
  height: 0.375rem;
  overflow: hidden;
  border-radius: 9999px;
  background: var(--slate-800);
}

.tt-fill {
  height: 100%;
  background: linear-gradient(to right, var(--emerald-500), #a3e635);
}

.tt-mastery {
  margin-top: 0.25rem;
  font-size: 9px;
  color: var(--slate-400);
}

.inv-hint {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--slate-500);
}

/* ---------- quest log ---------- */

.quest-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .quest-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.quest-card {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  border: 2px solid var(--slate-700);
  background: rgba(30, 41, 59, 0.7);
  padding: 1rem;
  transition: all 0.15s;
}

.quest-card:hover {
  transform: translateY(-4px);
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.quest-accent {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: linear-gradient(to bottom, var(--amber-400), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.quest-card:hover .quest-accent {
  opacity: 1;
}

.quest-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.quest-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: #fff;
}

.rarity {
  border-radius: 9999px;
  border: 1px solid;
  padding: 2px 0.5rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.rarity.legendary {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--amber-400);
  color: var(--amber-300);
}

.rarity.epic {
  background: rgba(217, 70, 239, 0.2);
  border-color: #e879f9;
  color: #f0abfc;
}

.rarity.rare {
  background: rgba(14, 165, 233, 0.2);
  border-color: #38bdf8;
  color: #7dd3fc;
}

.quest-desc {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  line-height: 1.625;
  color: var(--slate-400);
}

.quest-rewards {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}

.reward-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-500);
}

.reward-chip {
  border-radius: 2px;
  border: 1px solid var(--slate-600);
  background: var(--slate-900);
  padding: 2px 0.375rem;
  font-size: 10px;
  color: var(--emerald-300);
}

.quest-status {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.quest-status.completed {
  color: var(--emerald-400);
}

.quest-status.active {
  color: var(--amber-400);
}

.quest-footer {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.quest-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.quest-title-link:hover {
  color: var(--amber-400);
}

.quest-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
  color: var(--amber-400);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: all 0.15s ease;
}

.quest-link:hover {
  background: var(--amber-400);
  color: var(--slate-950);
  border-color: var(--amber-400);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

/* ---------- achievements ---------- */

.ach-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .ach-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .ach-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.ach-card {
  border-radius: 0.5rem;
  border: 2px solid;
  padding: 0.75rem;
  text-align: center;
  transition: transform 0.15s;
}

.ach-card:hover {
  transform: translateY(-4px);
}

.ach-card.unlocked {
  border-color: rgba(251, 191, 36, 0.5);
  background: linear-gradient(to bottom, rgba(245, 158, 11, 0.1), transparent);
}

.ach-card.locked {
  border-color: var(--slate-700);
  background: rgba(30, 41, 59, 0.5);
}

.ach-icon {
  font-size: 1.5rem;
}

.icon-locked {
  opacity: 0.3;
  filter: grayscale(1);
}

.ach-name {
  margin-top: 0.25rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--amber-200);
}

.name-locked {
  color: var(--slate-600);
}

.ach-desc {
  margin-top: 2px;
  font-size: 9px;
  line-height: 1.25;
  color: var(--slate-500);
}

/* ---------- contact ---------- */

.contact-card {
  border-radius: 0.5rem;
  border: 2px solid rgba(16, 185, 129, 0.4);
  background: rgba(30, 41, 59, 0.7);
  padding: 1.5rem;
  text-align: center;
}

.contact-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  color: var(--emerald-400);
}

.contact-title {
  margin: 0.75rem 0 0;
  font-size: 1.25rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: #fff;
}

@media (min-width: 640px) {
  .contact-title {
    font-size: 1.5rem;
  }
}

.contact-desc {
  margin: 0.5rem auto 0;
  max-width: 28rem;
  font-size: 0.75rem;
  line-height: 1.625;
  color: var(--slate-400);
}

.contact-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.btn-primary {
  border-radius: 0.375rem;
  border: 2px solid var(--emerald-400);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--emerald-300);
  transition: all 0.15s;
}

.btn-primary:hover {
  background: var(--emerald-400);
  color: var(--slate-950);
  box-shadow: 0 0 25px rgba(52, 211, 153, 0.5);
}

.btn-ghost {
  border-radius: 0.375rem;
  border: 2px solid var(--slate-600);
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-300);
  transition: all 0.15s;
}

.btn-ghost:hover {
  border-color: var(--slate-300);
  color: #fff;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 2px solid var(--slate-800);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 11px;
  color: var(--slate-600);
}

.footer-btn-row {
  margin-top: 0.5rem;
}

.footer-btn {
  color: var(--slate-500);
  text-underline-offset: 4px;
}

.footer-btn:hover {
  color: var(--emerald-400);
  text-decoration: underline;
}

.footer-note {
  margin: 0.75rem 0 0;
}