.side {
  grid-column: span 4;
}
/* Unified card and grid styles for all cards and games */
/* Center and constrain the about/side group */
.grid {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap, 2rem);
}

/* Stretch sidebar cards to 200% width of their grid column */
@media (max-width: 1100px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
.card {
  background: linear-gradient(
    180deg,
    var(--surface-2),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid var(--border-1);
  border-radius: 14px;
  padding: 1.2rem 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0 0 1rem 0;
}

.games {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin: 2rem 0;
}
@media (max-width: 900px) {
  .games {
    grid-template-columns: 1fr;
  }
}
.game {
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  margin: 0;
}
.game .stage {
  background: linear-gradient(
    135deg,
    rgba(110, 86, 207, 0.18),
    rgba(14, 165, 233, 0.12)
  );
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: #0b0b12;
  font-weight: 800;
  overflow: hidden;
}

.game .content {
  padding: 1.2rem 1.2rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1 auto;
}
/* Skills section title */
.skills-title {
  margin: 0 0 0.4rem;
}
/* Experience description paragraph */
.exp-desc {
  margin: 0.4rem 0 0;
}
/* Certificates section title */
.cert-title {
  margin: 0 0 0.4rem;
}
.cert-list {
  margin: 0 0 0.3rem 1rem;
}
/* Achievements section title */
.ach-title {
  margin: 0 0 0.4rem;
}
.ach-list {
  margin: 0 0 0.3rem 1rem;
}
/* Hobbies section title */
.hobbies-title {
  margin: 0 0 0.4rem;
}
.hobbies-list {
  margin: 0 0 0.3rem 1rem;
}
/* Experience/education list spacing */
.exp-list {
  margin: 0.4rem 0 0 1rem;
}
/* Contact section title */
.contact-title {
  margin: 0 0 0.4rem;
}
.highlights-title {
  margin: 0 0 0.4rem;
}
/* Margin bottom for inline field */
.mb-half {
  margin-bottom: 0.5rem;
}
/* Contact actions (email/call buttons) */
.contact-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}
/* Highlights list spacing */
.highlights-list {
  margin: 0 0 0.3rem 1rem;
}
/* Skill bar fill widths */
/* Skill bar fill widths and colors */
/* Skill bar fill widths and colors */
.fill-js {
  width: 85%;
  background: linear-gradient(90deg, #f7e018, #ffd700);
}
.fill-html {
  width: 90%;
  background: linear-gradient(90deg, #e44d26, #f16529);
}
.fill-python {
  width: 75%;
  background: linear-gradient(90deg, #3572a5, #4b8bbe);
}
.fill-sql {
  width: 72%;
  background: linear-gradient(90deg, #336791, #00758f);
}
.fill-ux {
  width: 68%;
  background: linear-gradient(90deg, #8e44ad, #6c3483);
}
/* Skill bar fill colors */
/* Project section title and description spacing */
.project-title {
  margin: 0;
}
.project-desc {
  margin: 0.2rem 0 0.4rem;
}
/* Project actions (project card buttons) */
.project-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
/* Phone actions (call/text) */
.phone-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
/* Modal actions (modal header) */
.modal-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
/* Only keep one .side definition to avoid duplicate/conflicting rules */
/* Responsive grid for timeline and side */
.timeline {
  grid-column: span 8;
}

@media (max-width: 1100px) {
  .timeline {
    grid-column: span 12;
  }
  .side {
    grid-column: span 12;
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 700px) {
  .side {
    grid-template-columns: 1fr;
  }
}
/* Ensure intro and avatar cards are the same height */
.intro.card,
.avatar-wrap.card {
  min-height: 375px;
}
/* Avatar photo circle style */
.avatar-photo {
  width: 350px;
  height: 350px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}
/* Game thumbnails */

/* ===== Design Tokens ===== */
:root {
  --bg: #0b1020;
  --text: #e7e8ee;
  --muted: #b7b9c8;
  --accent: #8b7dff;
  --accent-2: #61dafb;
  --surface-1: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border-weak: rgba(255, 255, 255, 0.1);
  --border-1: rgba(255, 255, 255, 0.12);
  --border-2: rgba(255, 255, 255, 0.14);
  --ring: 0 0 0 2px rgba(139, 125, 255, 0.45),
    0 10px 30px -10px rgba(97, 218, 251, 0.35);
  --radius: 16px;
  --shadow-lg: 0 20px 60px -20px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --grid-gap: 1rem;
  --badge-bg: rgba(139, 125, 255, 0.12);
  --badge-border: rgba(139, 125, 255, 0.35);
  --badge-text: #d9d5ff;
  --chip-bg: rgba(255, 255, 255, 0.06);
  --chip-border: var(--border-2);
  --chip-text: var(--muted);
  --tag-bg: rgba(255, 255, 255, 0.04);
  --tag-border: var(--border-2);
  --tag-text: var(--muted);
  --pill-bg: var(--surface-1);
  --pill-border: var(--border-1);
  --pill-text: var(--text);
}
.theme-light {
  --bg: #f7f7fb;
  --text: #1a1b22;
  --muted: #535667;
  --accent: #6e56cf;
  --accent-2: #0ea5e9;
  --surface-1: rgba(0, 0, 0, 0.04);
  --surface-2: rgba(0, 0, 0, 0.06);
  --border-weak: rgba(0, 0, 0, 0.1);
  --border-1: rgba(0, 0, 0, 0.12);
  --border-2: rgba(0, 0, 0, 0.14);
  --ring: 0 0 0 2px rgba(110, 86, 207, 0.35),
    0 10px 30px -10px rgba(14, 165, 233, 0.25);
  --badge-bg: rgba(110, 86, 207, 0.16);
  --badge-border: rgba(110, 86, 207, 0.4);
  --badge-text: #2b2460;
  --chip-bg: rgba(0, 0, 0, 0.04);
  --chip-text: #2f3140;
  --tag-bg: rgba(0, 0, 0, 0.035);
  --tag-text: #2f3140;
  --pill-bg: rgba(0, 0, 0, 0.045);
}

/* ===== Base ===== */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji",
    "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
  color: var(--text);
  background: radial-gradient(
      1200px 450px at 80% -10%,
      rgba(139, 125, 255, 0.25),
      transparent 60%
    ),
    radial-gradient(
      800px 500px at -10% 20%,
      rgba(97, 218, 251, 0.18),
      transparent 55%
    ),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.6;
}
a {
  color: inherit;
  text-decoration: none;
}
.underline {
  text-decoration: underline;
}
img {
  max-width: 100%;
  display: block;
}
.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 0;
  top: -40px;
  background: #111;
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}
.skip-link:focus {
  top: 0.5rem;
  left: 0.5rem;
  z-index: 999;
}

header {
  position: sticky;
  top: 0;
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0));
  z-index: 50;
  border-bottom: 1px solid var(--border-1);
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0;
}
.brand {
  font-weight: 700;
  letter-spacing: 0.3px;
}
.nav-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.nav-links a {
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  color: var(--muted);
}
.nav-links a:hover {
  color: var(--text);
  background: var(--surface-1);
}
.nav-links a[aria-current="page"] {
  background: var(--surface-2);
  color: var(--text);
}
.actions {
  display: flex;
  justify-content: end;
  gap: 0.5rem;
  align-items: center;
}
.btn {
  appearance: none;
  border: 1px solid var(--border-1);
  background: var(--surface-1);
  color: var(--text);
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: var(--shadow-lg);
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-accent {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0b12;
  font-weight: 700;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-1);
}
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-1);
}
.hamburger {
  display: none;
}

@media (max-width: 860px) {
  .nav {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand actions" "links links";
    row-gap: 0.4rem;
  }
  .brand {
    grid-area: brand;
  }
  .actions {
    grid-area: actions;
  }
  .nav-links {
    grid-area: links;
    display: none;
    justify-content: start;
  }
  .nav-links.open {
    display: flex;
  }
  .hamburger {
    display: inline-flex;
  }
}

.hero {
  padding: clamp(2rem, 5vw, 4rem) 0 2rem;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
}
/* Card styling unified below */
.hero .intro h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  margin: 0 0 0.5rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
  box-shadow: var(--ring);
  font-weight: 600;
  font-size: 0.85rem;
}
.theme-light .badge {
  box-shadow: 0 0 0 1px rgba(110, 86, 207, 0.25), var(--ring);
}
.subtitle {
  color: var(--muted);
  margin-top: 0.4rem;
}
.hero-cta {
  margin-top: 1.1rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.avatar-wrap {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(
      700px 120px at 30% 0%,
      rgba(139, 125, 255, 0.35),
      transparent 60%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.2));
}
.avatar {
  width: 74%;
  max-width: 280px;
  border-radius: 50%;
  box-shadow: 0 18px 55px -22px rgba(0, 0, 0, 0.6),
    0 0 0 6px rgba(255, 255, 255, 0.06);
  background: linear-gradient(
    135deg,
    rgba(139, 125, 255, 0.5),
    rgba(97, 218, 251, 0.5)
  );
  display: grid;
  place-items: center;
  aspect-ratio: 1/1;
  color: #0b0b12;
  font-weight: 800;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
}

section {
  scroll-margin-top: 90px;
}
.section {
  padding: 1rem 0 2rem;
}
.section h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  margin: 0 0 0.6rem;
  letter-spacing: 0.3px;
}
.section .grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
}

.kpi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gap);
  margin-top: 0.6rem;
}
.pill {
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  display: grid;
  gap: 0.25rem;
  color: var(--pill-text);
}
.pill small {
  color: var(--muted);
}
.pill strong {
  font-size: 1.2rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1rem;
  border-radius: 14px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
}
.dotline {
  width: 18px;
  display: grid;
  justify-items: center;
  gap: 0.4rem;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--ring);
}
.line {
  width: 2px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.15),
    rgba(255, 255, 255, 0.02)
  );
  flex: 1;
}
.meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--muted);
}
/* Card thumbnail area styling */
.stage {
  width: 540px;
  height: 180px;
  overflow: hidden;
  border-radius: 12px;
  background: #222;
  position: relative;
  display: grid;
  place-items: center;
  margin-bottom: 0.5rem;
}

.stage span {
  position: relative;
  z-index: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  width: 100%;
  text-align: center;
  padding: 0.3em 0;
  font-weight: bold;
  border-radius: 0 0 12px 12px;
}

.side .card {
  padding: 1rem;
}

.skill {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.skill .bar {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-1);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-weak);
}
.skill .fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px -8px var(--accent);
  border-radius: 999px;
  transition: width 1.2s cubic-bezier(0.2, 0.65, 0.25, 1);
}

.projects {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  /* Unified grid for projects and games */
  .projects,
  .games {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 2rem 0;
  }
  @media (max-width: 900px) {
    .projects,
    .games {
      grid-template-columns: 1fr;
    }
  }

  /* Unified card style for project/game */
  .project,
  .game {
    background: var(--surface-1);
    border: 1px solid var(--border-1);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 260px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    margin: 0 auto;
    width: 100%;
    max-width: 420px;
  }
  .project .thumb,
  .game .game-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    border-radius: 12px 12px 0 0;
    margin: 0;
  }
  .game .stage {
    background: linear-gradient(
      135deg,
      rgba(110, 86, 207, 0.18),
      rgba(14, 165, 233, 0.12)
    );
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    color: #0b0b12;
    font-weight: 800;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    padding: 0;
  }
  .project .content,
  .game .content {
    padding: 1.2rem 1.2rem 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1 1 auto;
  }
  .project .links,
  .game .links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--chip-text);
}

/* Games grid */

@media (max-width: 800px) {
  .game {
    grid-column: span 12;
    grid-template-rows: 180px 1fr;
  }
}

.game .stage span {
  background: rgba(255, 255, 255, 0.75);
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.game .links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Play modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  z-index: 1000;
}
.modal.open {
  display: flex;
}
.modal-card {
  width: min(1400px, 98vw);
  height: min(94vh, 900px);
  background: var(--bg);
  border: 1px solid var(--border-1);
  border-radius: 16px;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-1);
}
.modal-head .title {
  font-weight: 700;
}
.modal-body {
  position: relative;
}
.modal-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #111;
  display: block;
}
.body-lock {
  overflow: hidden;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
}
.contact-card {
  grid-column: span 6;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 14px;
  padding: 1rem;
}
@media (max-width: 800px) {
  .contact-card {
    grid-column: span 12;
  }
}
.inline-field {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  margin-bottom: 0.5rem;
}
.inline-field input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.3em 0.6em;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  width: 100%;
  outline: none;
  font-size: 0.95rem;
}
.inline-field svg {
  flex: 0 0 auto;
  margin-right: 0.2rem;
  color: #aaa;
}
.muted {
  color: var(--muted);
}

footer {
  color: var(--muted);
  padding: 2rem 0;
  text-align: center;
}

@media (max-width: 1100px) {
  .timeline {
    grid-column: span 12;
  }
  .side {
    grid-column: span 12;
    grid-template-columns: repeat(2, 1fr);
  }
  @media (max-width: 700px) {
    .side {
      grid-template-columns: 1fr;
    }
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media print {
  body {
    background: #fff !important;
  }
  header,
  .hero-cta .btn-ghost,
  .theme-toggle,
  .hamburger,
  .nav-links,
  .modal,
  .side-nav {
    display: none !important;
  }
  .card,
  .pill,
  .timeline-item,
  .project,
  .contact-card,
  .game {
    box-shadow: none !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
  }
  .avatar {
    box-shadow: none !important;
  }
  a {
    color: #000 !important;
    text-decoration: underline;
  }
  .chip,
  .tag,
  .badge {
    border-color: #999 !important;
    color: #000 !important;
    background: #f7f7f7 !important;
  }
  .skill .bar {
    background: #e5e7eb !important;
  }
  .btn {
    display: none !important;
  }
  .container {
    width: 100% !important;
  }
  .project .thumb,
  .game .stage {
    display: none;
  }
  .project,
  .game {
    grid-template-rows: auto;
  }
  @page {
    margin: 14mm;
  }
}

/* Sidebar (left) */
.side-nav {
  display: flex;
  opacity: 0;
  transform: translateX(-100%);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: fixed;
  top: 0;
  left: 0;
  width: 210px;
  height: 100vh;
  background: var(--surface-1);
  border-right: 2px solid var(--border-1);
  border-radius: 0;
  padding: 1.2rem 0.6rem 1.2rem 1.2rem;
  box-shadow: none;
  margin: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-width: 180px;
  z-index: 100;
}
body.side-visible .side-nav {
  opacity: 1;
  transform: none;
}
.side-brand {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: 0.3px;
}
.side-nav .links {
  display: grid;
  gap: 0.25rem;
}
.side-nav .links a {
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  color: var(--muted);
}
.side-nav .links a:hover {
  color: var(--text);
  background: var(--surface-2);
}
.side-nav .links a[aria-current="page"] {
  background: var(--surface-2);
  color: var(--text);
}
body.side-visible header {
  transform: translateY(-110%);
  opacity: 0;
}

@media (max-width: 860px) {
  .side-nav {
    display: none;
  }
  body.side-visible header {
    transform: none;
    opacity: 1;
  }
}

/* Screen reader only */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
  body.side-visible header {
    opacity: 0;
  } /* keep fade only */
}
