/* =====================================================================
   HOME PAGE  (replaces skills.css and game-card.css)
   Shared things (menu, footer, font, links) still come from styles.css.
   All class names here are new, so they don't clash with the old
   home rules that are still inside styles.css.
   ===================================================================== */

body.home {
  --purple: #5000D2;
  --teal: #6DBFB3;
  --chip: #e4e4e4;
  font-weight: 400;
  text-align: left;
}

/* ---------- Banner ---------- */
.banner {
  width: 100%;
  height: clamp(150px, 23vw, 340px);
  margin-top: 30px;
  overflow: hidden;
}

.banner-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* ---------- Photo + name (the photo overlaps the banner) ---------- */
.profile {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 40px;
  align-items: end;
}

.profile-photo {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  margin-top: -36%;            /* % of the column width = 36% of the photo height */
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.profile-photo:hover {
  transform: scale(1.015);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.profile-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.profile-name {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 600;
  line-height: 1.1;
}

.profile-role {
  max-width: 350px;
  margin-top: 10px;
  font-size: clamp(1.3rem, 3.2vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
}

.profile-social {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-top: 25px;
}

.profile-social img {
  display: block;
  height: 30px;
  width: auto;
}

.profile-location {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 1.1rem;
}

.profile-location svg {
  flex: none;
}

.profile-location a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Education / Work / Hobby project ---------- */
.info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "edu   work"
    "hobby work";
  grid-template-rows: auto 1fr;
  column-gap: 40px;
  align-items: start;
  margin-top: 60px;
}

.info-education { grid-area: edu; }
.info-work      { grid-area: work; }
.info-hobby     { grid-area: hobby; margin-top: 45px; }

.info-title {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
}

.timeline {
  list-style: none;
  margin: 0 0 1.1em;
  padding: 0;
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  line-height: 1.3;
}

.timeline a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Game card ---------- */
.game-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 4px;
}

.game-card__art {
  flex: none;
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 14px;
  overflow: hidden;
  background: #ddd;
}

.game-card__art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.game-card__art:hover img,
.game-card__art:focus-visible img {
  transform: scale(1.05);
}

.game-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.game-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

.game-card__title:hover,
.game-card__title:focus-visible {
  color: var(--purple);
}

.game-card__tagline {
  font-size: 0.8rem;
  line-height: 1.3;
}

.game-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.game-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--chip);
  color: #000;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.game-card__btn:hover,
.game-card__btn:focus-visible {
  background: var(--purple);
  color: #fff;
}

.game-card__btn:active {
  transform: translateY(1px);
}

.game-card__btn svg {
  flex: none;
  width: 14px;
  height: 14px;
}

/* ---------- Skills ---------- */
.skills {
  margin-top: 90px;
}

.skills-title {
  margin: 0 0 24px;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: 600;
  line-height: 1.2;
}

.skills-subtitle {
  margin: 0 0 22px;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 400;
  line-height: 1.2;
  transition: font-weight 0.3s cubic-bezier(.42, 0, .44, 1.68);
}

.skills-subtitle:hover {
  font-weight: 500;
}

.skills-subtitle--abilities {
  margin-top: 70px;
}

/* software circles: 8 per row, spread over the full width */
.software-grid {
  --circle: clamp(60px, 9vw, 90px);
  display: grid;
  grid-template-columns: repeat(8, var(--circle));
  justify-content: space-between;
  row-gap: 30px;
}

.skill-item {
  position: relative;
  width: var(--circle);
  height: var(--circle);
  cursor: default;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.circle-wrapper {
  width: 100%;
  height: 100%;
}

.circle-wrapper .progress-text {
  font-size: calc(var(--circle) * 0.17);
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  color: #000;
}

/* the little name label above a circle */
.skill-tip {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 10;
  padding: 2px 8px;
  border-radius: 5px;
  background: #fff;
  color: var(--purple);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(calc(-50% - 15px + var(--tip-shift, 0px)), 30px) rotate(25deg);
  transition: 200ms cubic-bezier(.42, 0, .44, 1.68);
}

/* shown: hovering (mouse), keyboard focus, or tapped (class set by home.js, hides after 3 s) */
.skill-item.is-revealed .skill-tip,
.skill-item:focus-visible .skill-tip {
  opacity: 1;
  transform: translate(calc(-50% + var(--tip-shift, 0px)), calc(-100% - 4px)) rotate(0);
}

@media (hover: hover) {
  .skill-item:hover .skill-tip {
    opacity: 1;
    transform: translate(calc(-50% + var(--tip-shift, 0px)), calc(-100% - 4px)) rotate(0);
  }
}

/* ability bars */
.ability-list {
  width: 65%;
}

.ability-item {
  margin-bottom: 22px;
}

.ability-label {
  display: block;
  margin-bottom: 4px;
  font-size: 1.25rem;
  font-weight: 700;
  transition: font-weight 0.3s cubic-bezier(.42, 0, .44, 1.68);
}

.ability-label:hover {
  font-weight: 900;
}

.ability-bar {
  width: 100%;
}

.ability-bar svg {
  display: block;
  overflow: visible;
}

/* ---------- Phones / small screens ---------- */
@media (max-width: 720px) {
  .home-main {
    --photo: min(300px, 72vw);   /* width of the photo, also used to line up the text below it */
    padding: 0 16px;
  }

  .profile {
    grid-template-columns: 1fr;
    justify-items: center;
    row-gap: 20px;
    text-align: center;
  }

  .profile-photo {
    width: var(--photo);
    margin-top: calc(var(--photo) * -0.36);
  }

  .profile-text {
    align-items: center;
  }

  .profile-social {
    gap: 1.5rem;
    margin-top: 18px;
  }

  .info {
    grid-template-columns: 1fr;
    grid-template-areas:
      "edu"
      "work"
      "hobby";
    grid-template-rows: auto;
    margin-top: 40px;
    margin-left: calc((100% - var(--photo)) / 2);   /* left edge = left edge of the photo */
  }

  .info-hobby {
    margin-top: 10px;
    max-width: var(--photo);       /* right edge = right edge of the photo */
  }

  .game-card__art {
    width: 100px;
    height: 170px;
  }

  .game-card__btn {
    font-size: 0.82rem;
  }

  .skills {
    margin-top: 60px;
    /* skill set between the left and right edge of the photo
       (delete the next line to let it use the full page width again) */
    margin-left: calc((100% - var(--photo)) / 2);
    margin-right: calc((100% - var(--photo)) / 2);
  }

  .software-grid {
    --circle: min(64px, calc((var(--photo) - 24px) / 4));   /* 4 circles always fit in the photo's width */
    grid-template-columns: repeat(4, 1fr);
    justify-items: center;
    row-gap: 22px;
  }

  .skill-tip {
    font-size: 0.9rem;
  }

  .skills-subtitle--abilities {
    margin-top: 50px;
  }

  .ability-list {
    width: 100%;
  }

  .ability-label {
    font-size: 1.1rem;
  }
}
