/* CSS Variables / Design Tokens */
:root {
  --purple: #bfa2ff;
  --yellow: #ffe195;
  --blue: #cff4ff;
  --green: #bdf6b1;
  --text: #111111;
  --background: #bed4ff;
  --background-paper: #bfa2ff;
  --radius-lg: 20px;
  --radius-sm: 16px;
  --border: 3px solid #111111;
  --shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
  --shadow-light: 0 4px 0 rgba(0, 0, 0, 0.15);
  --shadow-hover: 0 8px 0 rgba(0, 0, 0, 0.25);
  --shadow-subtle: 0 3px 0 rgba(0, 0, 0, 0.2);
  --linkedin-blue: #0077b5;
  --linkedin-blue-hover: #005885;

  /* Game sizing variables (1.2× increase from original 100px) */
  --game-button-size: calc(100px * 1.2);
  --game-icon-size: calc(100px * 1.2);

  /* Info Bar CSS variables for individual skinning */
  --bar-bg-one: #FFE195;
  --bar-accent-one: #111;
  --bar-fill-one: 100%; /* Controls how much of bar 1 is filled */
  
  /* Tech bars colors */
  --bar-bg-unity: #FF6B6B;
  --bar-accent-unity: #111;
  --bar-fill-unity: 100%;
  --bar-bg-csharp: #4ECDC4;
  --bar-accent-csharp: #111;
  --bar-fill-csharp: 100%;
  --bar-bg-shader: #45B7D1;
  --bar-accent-shader: #111;
  --bar-fill-shader: 100%;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--background);
  background-image: repeating-linear-gradient(
          45deg,
          transparent,
          transparent 20px,
          rgba(0, 0, 0, 0.02) 20px,
          rgba(0, 0, 0, 0.02) 21px
  );
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Main Container */
.portfolio-container {
  min-height: 100vh;
  padding: 40px 16px;
}

.content-wrapper {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Profile Section */
.profile-section {
  margin-bottom: 1px;
}

.profile-photo {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-sm);
  border: var(--border);
  box-shadow: var(--shadow);
  object-fit: cover;
  display: block;
}

/* Connector Lines */
.connector-line {
  width: 3px;
  height: 50px;
  background-color: var(--text);
  margin: 0;
}

/* Welcome Card */
.welcome-section {
  margin: px 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.welcome-card {
  background-color: var(--purple);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 10px 48px;
  text-align: center;
  width: 50%;
  max-width: 600px;
}

.welcome-card h1 {
  font-size: 1.5rem;
  font-weight: 30;
  color: var(--text);
  margin: 0;
}

/* Preface Section */
.preface-section {
  margin: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.preface-card {
  background-color: var(--green);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-light);
  padding: 20px 32px;
  text-align: center;
  width: 70%;
  max-width: 700px;
}

.preface-card p {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  margin: 0;
  line-height: 1.5;
}

/* Info Bars Section */
.info-bars-section {
  margin: px 0;
  width: 80%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-bar {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-light);
  transition: all 0.2s ease;
  position: relative;
  justify-content: center;
}

.info-bar:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.info-bar--one {
  background:
          repeating-linear-gradient(135deg, rgba(0,0,0,.03) 0 12px, rgba(0,0,0,.06) 12px 24px),
          linear-gradient(to right, var(--bar-bg-one) 0%, var(--bar-bg-one) var(--bar-fill-one), transparent var(--bar-fill-one), transparent 100%);
  color: var(--bar-accent-one);
}

/* Tech bars row layout */
.tech-bars-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
}

.tech-bars-row .info-bar {
  flex: 1;
  min-width: 0;
  padding: 16px 20px;
}

.tech-bars-row .info-bar__text {
  font-size: 1.2rem;
  text-align: center;
}

.info-bar--unity {
  background:
          repeating-linear-gradient(135deg, rgba(0,0,0,.03) 0 12px, rgba(0,0,0,.06) 12px 24px),
          linear-gradient(to right, var(--bar-bg-unity) 0%, var(--bar-bg-unity) var(--bar-fill-unity), transparent var(--bar-fill-unity), transparent 100%);
  color: var(--bar-accent-unity);
}

.info-bar--csharp {
  background:
          repeating-linear-gradient(45deg, rgba(0,0,0,.02) 0 10px, rgba(0,0,0,.05) 10px 20px),
          linear-gradient(to right, var(--bar-bg-csharp) 0%, var(--bar-bg-csharp) var(--bar-fill-csharp), transparent var(--bar-fill-csharp), transparent 100%);
  color: var(--bar-accent-csharp);
}

.info-bar--shader {
  background:
          repeating-linear-gradient(-45deg, rgba(0,0,0,.04) 0 8px, rgba(0,0,0,.07) 8px 16px),
          linear-gradient(to right, var(--bar-bg-shader) 0%, var(--bar-bg-shader) var(--bar-fill-shader), transparent var(--bar-fill-shader), transparent 100%);
  color: var(--bar-accent-shader);
}

.info-bar__text {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text);
}

.info-bar__icon {
  width: 24px;
  height: 24px;
  color: var(--text);
  flex-shrink: 0;
}

/* Connector Trunk System */
.connector-trunk-wrapper {
  position: relative;
  width: 100%;
}

/* Main vertical trunk from Info Bars */
.connector-trunk-wrapper::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: calc(var(--game-button-size) + 73px);
  width: 2px;
  background: #111;
  opacity: 0.8;
  z-index: 0;
}

.connector-trunk-wrapper-after {
  position: relative;
  width: 100%;
}

/* Main vertical trunk from Info Bars */
.connector-trunk-wrapper-after::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 23px;
  /* bottom: calc(var(--game-button-size) + 73px); */
  height: 40px;
  width: 2px;
  background: #111;
  opacity: 0.8;
  z-index: -1;
}


/* Games Section */
.games-section {
  margin: 50px 0;
  position: relative;
}

/* Single horizontal connector line at bottom of games section */
.games-section::after {
  content: "";
  position: absolute;
  left: 16.5%;
  right: 16.5%;
  bottom: -25px;
  height: 2px;
  background: #111;
  opacity: 0.8;
  z-index: 0;
}

/* Horizontal bus above the games */
.games-section::before {
  content: "";
  position: absolute;
  left: 16.5%;
  right: 16.5%;
  top: -24.4px;
  height: 2px;
  background: #111;
  opacity: 0.8;
  z-index: 0;
}

.games-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  justify-items: center;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

/* Top connector lines for each game - positioned to align with game centers */
.games-row::before {
  content: "";
  position: absolute;
  top: -25px;
  left: 0;
  right: 0;
  height: 50px;
  background:
          linear-gradient(to right, transparent 0%, transparent calc(12.5% - 1px), #111 calc(12.5% - 1px), #111 calc(12.5% + 1px), transparent calc(12.5% + 1px), transparent calc(37.5% - 1px), #111 calc(37.5% - 1px), #111 calc(37.5% + 1px), transparent calc(37.5% + 1px), transparent calc(62.5% - 1px), #111 calc(62.5% - 1px), #111 calc(62.5% + 1px), transparent calc(62.5% + 1px), transparent calc(87.5% - 1px), #111 calc(87.5% - 1px), #111 calc(87.5% + 1px), transparent calc(87.5% + 1px), transparent 100%);
  opacity: 0.8;
  z-index: -1;
}

/* Bottom connector lines for each game - positioned to align with game centers */
.games-row::after {
  content: "";
  position: absolute;
  bottom: -25px;
  left: 0;
  right: 0;
  height: 50px;
  background:
          linear-gradient(to right, transparent 0%, transparent calc(12.5% - 1px), #111 calc(12.5% - 1px), #111 calc(12.5% + 1px), transparent calc(12.5% + 1px), transparent calc(37.5% - 1px), #111 calc(37.5% - 1px), #111 calc(37.5% + 1px), transparent calc(37.5% + 1px), transparent calc(62.5% - 1px), #111 calc(62.5% - 1px), #111 calc(62.5% + 1px), transparent calc(62.5% + 1px), transparent calc(87.5% - 1px), #111 calc(87.5% - 1px), #111 calc(87.5% + 1px), transparent calc(87.5% + 1px), transparent 100%);
  opacity: 0.8;
  z-index: -1;
}

.game-button {
  width: var(--game-button-size);
  height: var(--game-button-size);
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-light);
  background-color: var(--background-paper);
  padding: 0;
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* Remove connector lines from game buttons - they'll be added to games-row instead */

.game-button:hover,
.game-button:focus-visible {
  transform: translateY(-2px) scale(1.03);
  box-shadow: var(--shadow-hover);
  outline: none;
}

.game-button:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.game-button img {
  width: var(--game-icon-size);
  height: var(--game-icon-size);
  object-fit: cover;
  display: block;
}

/* Social Section */
.social-section {
  margin-top: -10px;
}
.email {
  margin-top: 10px;
}
.linkedin-button {
  width: 80px;
  height: 80px;
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-light);
  background-color: var(--linkedin-blue);
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.linkedin-button:hover,
.linkedin-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  background-color: var(--linkedin-blue-hover);
  outline: none;
}

.linkedin-button:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

/* Floating Preview */
.preview-card {
  position: fixed;
  background-color: var(--background-paper);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 30px;
  width: 240px;
  text-align: center;
  z-index: 1000;
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  visibility: hidden;
}

.preview-card.is-visible {
  opacity: 1;
  transform: scale(1);
  visibility: visible;
}

.preview-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 2px solid var(--text);
  display: block;
}

.preview-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.preview-cta {
  background-color: #ffffff;
  border: 2px solid var(--text);
  border-radius: 12px;
  padding: 8px 16px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  pointer-events: auto;
}

.preview-cta:hover,
.preview-cta:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--shadow-subtle);
  outline: none;
}

.preview-cta:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Mobile Styles */
@media (max-width: 768px) {
  :root {
    --game-button-size: calc(80px * 1.2); /* 96px */
    --game-icon-size: calc(80px * 1.2);   /* 96px */
  }

  .portfolio-container {
    padding: 32px 16px;
  }

  .welcome-card {
    padding: 24px 32px;
  }

  .welcome-card h1 {
    font-size: 1.75rem;
  }

  .info-bar {
    padding: 16px 20px;
  }

  .info-bar__text {
    font-size: 1rem;
  }

  .tech-bars-row {
    flex-direction: column;
    gap: 8px;
  }

  .tech-bars-row .info-bar__text {
    font-size: 0.9rem;
  }

  .games-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .games-section::before {
    left: 5%;
    right: 5%;
  }

  /* Adjust connector lines for mobile layout - 2x2 grid */
  .games-row::before {
    top: -40px;
    height: 40px;
    background:
            linear-gradient(to right, transparent 0%, transparent calc(25% - 1px), #111 calc(25% - 1px), #111 calc(25% + 1px), transparent calc(25% + 1px), transparent calc(75% - 1px), #111 calc(75% - 1px), #111 calc(75% + 1px), transparent calc(75% + 1px), transparent 100%);
  }

  .games-row::after {
    bottom: -40px;
    height: 40px;
    background:
            linear-gradient(to right, transparent 0%, transparent calc(25% - 1px), #111 calc(25% - 1px), #111 calc(25% + 1px), transparent calc(25% + 1px), transparent calc(75% - 1px), #111 calc(75% - 1px), #111 calc(75% + 1px), transparent calc(75% + 1px), transparent 100%);
  }

  .linkedin-button {
    width: 70px;
    height: 70px;
  }

  .linkedin-button svg {
    width: 28px;
    height: 28px;
  }

  .preview-card {
    width: 260px;
    padding: 16px;
  }

  .preview-image {
    height: 140px;
  }
}

@media (max-width: 480px) {
  .games-row {
    gap: 16px;
  }

  .preview-card {
    width: 240px;
    left: 50% !important;
    transform: translateX(-50%) scale(0.96);
  }

  .preview-card.is-visible {
    transform: translateX(-50%) scale(1);
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .game-button:hover,
  .game-button:focus-visible {
    transform: none;
  }

  .info-bar:hover {
    transform: none;
  }

  .linkedin-button:hover,
  .linkedin-button:focus-visible {
    transform: none;
  }

  .preview-cta:hover,
  .preview-cta:focus-visible {
    transform: none;
  }

  .preview-card {
    transition: opacity 0.01ms ease, visibility 0.01ms ease;
  }

  .preview-card.is-visible {
    transform: scale(1);
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --border: 4px solid #000000;
    --shadow: 0 8px 0 rgba(0, 0, 0, 0.5);
    --shadow-light: 0 6px 0 rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 10px 0 rgba(0, 0, 0, 0.5);
  }
}