/* ─────────────────────────────────────────
   Base & Reset
───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:           #090d1a;
  --bg-card:      #0e1529;
  --border:       #2a4a8a;
  --border-glow:  #4a80d4;
  --accent:       #5b9cf6;
  --accent-dim:   #3a6db5;
  --text:         #c8d8f8;
  --text-dim:     #7a9acc;
  --heading:      #a8c8ff;
  --glow-color:   rgba(74, 128, 212, 0.35);
  --font:         'Press Start 2P', monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.8;
  /* Subtle scanline overlay */
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
}

/* ─────────────────────────────────────────
   Layout
───────────────────────────────────────── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

/* ─────────────────────────────────────────
   Header
───────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.cursor {
  font-size: 1.4rem;
  color: var(--accent);
  animation: blink 1.1s step-end infinite;
}

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

.name {
  font-size: clamp(1.4rem, 5vw, 2rem);
  color: #ffffff;
  letter-spacing: 0.05em;
  text-shadow:
    0 0 8px var(--accent),
    0 0 24px rgba(91, 156, 246, 0.4);
}

.tagline {
  font-size: 0.75rem;
  color: #ffffff;
  margin-bottom: 48px;
  letter-spacing: 0.08em;
}

/* ─────────────────────────────────────────
   Sections
───────────────────────────────────────── */
.section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 0.9rem;
  color: #ffffff;
  letter-spacing: 0.12em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.diamond {
  display: inline-block;
  color: var(--accent-dim);
  vertical-align: middle;
  animation: twinkle 4s steps(5) infinite;
}

@keyframes twinkle {
  0%   { opacity: 1;   transform: scale(1);   color: var(--accent-dim); }
  40%  { opacity: 0.1; transform: scale(0.6); color: var(--accent-dim); }
  60%  { opacity: 1;   transform: scale(1.3); color: #ffffff; }
  80%  { opacity: 0.2; transform: scale(0.7); color: var(--accent-dim); }
  100% { opacity: 1;   transform: scale(1);   color: var(--accent-dim); }
}

/* ─────────────────────────────────────────
   Grids
───────────────────────────────────────── */
.grid {
  display: grid;
  gap: 12px;
}

.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

/* ─────────────────────────────────────────
   Buttons
───────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 22px;
  background-color: rgb(23 37 84);
  border: 2px solid #93c5fd;
  border-radius: 8px;
  color: rgb(219 234 254);
  text-decoration: none;
  font-family: var(--font);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 4px 4px #93c5fd;
  transition: box-shadow 0.2s, transform 0.2s, filter 0.2s;
  position: relative;
  overflow: hidden;
}

.btn:hover,
.btn:focus-visible {
  outline: none;
  transform: translateY(-3px);
  box-shadow: 4px 7px #93c5fd;
  filter: brightness(1.15);
}

/* Suppress hover while button is being pressed */
.btn.is-pressing,
.btn.is-pressing:hover {
  transform: translate(4px, 4px);
  box-shadow: 0px 0px #93c5fd;
  filter: none;
  transition: none;
}

/* Snap to rest after release before re-enabling hover */
.btn.no-hover,
.btn.no-hover:hover {
  transform: none;
  box-shadow: 4px 4px #93c5fd;
  filter: none;
  transition: none;
}

.btn:active {
  box-shadow: 0px 0px #93c5fd;
  transform: translate(4px, 4px);
  transition: none;
}

.btn-wide {
  justify-content: flex-start;
  padding-left: 28px;
}

.btn-icon {
  font-size: 1.1rem;
  min-width: 20px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(219 234 254);
}

/* ─────────────────────────────────────────
   Card (About)
───────────────────────────────────────── */
.card {
  background-color: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.body-text {
  font-size: 0.65rem;
  color: #ffffff;
  line-height: 2.2;
  letter-spacing: 0.04em;
}

/* ─────────────────────────────────────────
   Skills Ticker
───────────────────────────────────────── */
.skills-ticker {
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.skills-track {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: ticker-scroll 30s steps(60) infinite;
}

.skills-ticker:hover .skills-track {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.skill-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  background-color: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 0.6rem;
  color: #ffffff;
  letter-spacing: 0.06em;
  text-align: center;
  flex-shrink: 0;
  width: 130px;
  min-width: 130px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.skill-badge img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.skill-badge:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 12px var(--glow-color);
}

.tech-stack-ticker .skills-track {
  gap: 16px;
}

.tech-stack-badge {
  width: 180px;
  min-width: 180px;
  min-height: 158px;
  gap: 6px;
}

.tech-stack-badge .tech-name {
  font-size: 0.58rem;
  color: #ffffff;
  line-height: 1.4;
}

.tech-stack-badge .tech-role {
  font-size: 0.5rem;
  color: var(--text-dim);
  line-height: 1.35;
}

/* ─────────────────────────────────────────
   Experience
───────────────────────────────────────── */
.exp-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.exp-card {
  background-color: var(--bg-card);
  border: 2px solid var(--border);
  border-bottom: none;
  padding: 20px 24px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.exp-card:first-child {
  border-radius: 6px 6px 0 0;
}

.exp-card:last-child {
  border-bottom: 2px solid var(--border);
  border-radius: 0 0 6px 6px;
}

.exp-card:only-child {
  border-radius: 6px;
  border-bottom: 2px solid var(--border);
}

/* Left accent bar */
.exp-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--border);
  transition: background 0.2s;
}

.exp-card:hover::before {
  background: var(--accent);
}

.exp-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 16px var(--glow-color);
}

.exp-card:last-child:hover {
  border-bottom-color: var(--border-glow);
}

.exp-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 0;
}

.exp-header > div:nth-child(2) {
  flex: 1;
}

.exp-toggle {
  cursor: pointer;
  user-select: none;
}

.exp-chevron {
  color: var(--accent);
  font-size: 0.7rem;
  padding-top: 2px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.exp-meta {
  margin-left: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-shrink: 0;
  text-align: right;
}

.exp-card.is-open .exp-chevron {
  transform: rotate(180deg);
}

/* Accordion body */
.exp-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease, padding 0.35s ease;
  padding-top: 0;
  overflow: hidden;
}

.exp-body > * {
  overflow: hidden;
}

.exp-card.is-open .exp-body {
  grid-template-rows: 1fr;
  padding-top: 14px;
}

.exp-icon {
  color: var(--accent);
  font-size: 0.9rem;
  margin-top: 3px;
  min-width: 18px;
  text-align: center;
}

.exp-role {
  font-size: 0.7rem;
  color: #ffffff;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}

.exp-company {
  font-size: 0.58rem;
  color: #93c5fd;
  letter-spacing: 0.06em;
}

.exp-date {
  font-size: 0.54rem;
  color: #ffffff;
  letter-spacing: 0.05em;
  white-space: nowrap;
  padding-top: 2px;
}

.exp-desc {
  font-size: 0.5rem;
  color: var(--text-dim);
  line-height: 2.1;
  letter-spacing: 0.03em;
  padding-left: 32px;
}

.exp-bullets {
  list-style: none;
  padding-left: 32px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exp-bullets li {
  font-size: 0.6rem;
  color: #ffffff;
  line-height: 2.1;
  letter-spacing: 0.03em;
  padding-left: 14px;
  position: relative;
}

.exp-bullets li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--accent-dim);
}

.exp-bullets li strong {
  color: #ffffff;
  font-style: normal;
}

.card .exp-bullets {
  padding-left: 2px;
}

.card .exp-bullets li {
  padding-left: 24px;
}

.cert-body .cert-btn {
  margin: 16px 4px 4px 0;
  padding: 14px 18px;
  font-size: 0.6rem;
  justify-content: center;
}

/* ─────────────────────────────────────────
   Project Image Container
───────────────────────────────────────── */
.project-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background-color: var(--bg-card);
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-image[src=""] {
  display: none;
}

.project-image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--border);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
}

.project-image-placeholder i {
  font-size: 2.5rem;
  color: var(--border);
}

/* Hide placeholder when image is loaded */
.project-image-container:has(.project-image[src]:not([src=""])) .project-image-placeholder {
  display: none;
}

@media (max-width: 768px) {
  .exp-card {
    padding: 18px 14px;
  }

  .exp-header {
    display: grid;
    grid-template-columns: 18px 1fr auto;
    align-items: flex-start;
    column-gap: 10px;
  }

  .exp-header > div:nth-child(2) {
    min-width: 0;
  }

  .exp-meta {
    margin-left: 0;
    gap: 0;
  }

  .exp-date {
    display: none;
  }

  .exp-company {
    line-height: 1.7;
  }
}

/* ─────────────────────────────────────────
   Footer
───────────────────────────────────────── */
.footer {
  margin-top: 56px;
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.footer-sprite {
  display: block;
  margin: 0 auto 12px;
  height: 80px;
  width: auto;
  image-rendering: pixelated;
}

/* ─────────────────────────────────────────
   Scrollbar
───────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-glow);
  border-radius: 3px;
}
