@font-face {
  font-family: 'connection';
  src: url('ConnectionIi-2wj8.otf');
}

@media (prefers-reduced-motion) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ====== NEW: layout sanity ====== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  display: block;
  width: 100%;
  overflow-x: hidden;
}

/* ====== MOVED GLOBAL: blink so it works everywhere ====== */
@keyframes blink {
  0% { opacity: 0; }
  50% { opacity: 0.7; }
  100% { opacity: 0; }
}

body {
  background: black;
  color: white;
  font-size: calc(10px + 2vmin);
}

/* @media (min-width: 800px) {
  body {
    font-size: calc(10px + 2vmin);
  }
} */

h1, h2, h3, h4, h5, h6 {
  font-family: connection;
}

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

.gone {
  display: none;
}

.project-gone {
  display: none;
}

.hidden {
  visibility: hidden;
}

.emptyButton {
  background: inherit;
  border: none;
  color: inherit;
  padding: 0;
  margin: 0;
  font-size: inherit;
}

.centered {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.floatingButton {
  position: fixed;
  height: 45px;
  width: 45px;
  right: 30px;
  bottom: 30px;
  background: white;
  border-radius: 50%;
  color: white;
}

.floatingButton:hover {
  animation: blink 1.25s linear infinite;
}

/* ====== UPDATED: main width to prevent mobile overflow ====== */
main {
  width: min(900px, calc(100% - 2rem));
  margin: 0 auto;
  text-align: center;
}

#intro {
  overflow: hidden;
}

.introMenu {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 5px solid white;
  padding: 1rem 3rem;
  border-radius: 5px;
}

.introMenu i {
  padding-right: 0.5rem;
  animation: blink 1s linear infinite ;
}

.start,
.quit {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  width: 90vw;
  margin: 0 auto;
}

.home h1,
.home a {
  font-family: "connection";
  padding: .5rem;
}

@media (min-width: 741px) {
  .home {
    flex-direction: row;
  }

  .home a {
    font-size: 120%;
  }

  .home h1,
  .home a:hover {
    background: white;
    color: black;  
    animation: blink 1.25s linear infinite;
  }
  
  .home a:hover:after {
    content: "?";
  }

  /* keep your intent but prevent ultra-wide weirdness */
  main {
    width: min(900px, 50vw);
  }
}

.box {
  border: 2px solid white;
  border-radius: 10px;
  padding: 1rem;

  /* ====== UPDATED: margin that won't cause horizontal overflow ====== */
  margin: 1rem 0;
}

.box h2 {
  margin: 0 auto;
  overflow: hidden;
  animation: typing 3.5s steps(30, end);
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

.aboutDivider {
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (min-width: 741px) {
  .aboutDivider {
    flex-direction: row;
  }
}

.aboutText {
  padding: 1rem;
}

.aboutPic {
  height: 200px;
  width: 200px;
  background-image: url(./img/pixel-portrait.png);
  background-size: contain;
  filter: grayscale(100%);
  transition: 1s;
}

.aboutPic:hover {
  background-image: url(./img/portrait.jpg);
  filter: grayscale(0%);
}

.aboutImage {
  filter: grayscale(100%);
  transition: 1s;
}

.aboutImage:hover {
  filter: grayscale(0%);
}

.skillOptions {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

.skillOptions button, .project-list button {
  background: inherit;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.skillOptions button:hover, .project-list button:hover {
  cursor: pointer;
  background: white;
  color: black;
  animation: blink 1s linear infinite;
}

.skillOptions button:hover:after, .project-list button:hover::after {
  content: "?";
}

@media (min-width: 741px) {
  .skillOptions {
    flex-direction: row;
  }
}

.skillSection details>summary {
  list-style-type: none;
  cursor: pointer;
}

.skillSection details>summary::before {
  font-family: 'Font Awesome 5 Free';
  content: "\f02d  ";
  font-weight: 900
}

.skillSection details[open]>summary::before {
  font-family: 'Font Awesome 5 Free';
  content: "\f518  ";
  font-weight: 900  
}

.skillSection details>summary::after {
  font-family: 'Font Awesome 5 Free';
  content: " \f02d";
  font-weight: 900
}

.skillSection details[open]>summary::after {
  font-family: 'Font Awesome 5 Free';
  content: " \f518";
  font-weight: 900  
}

.skillSection ul {
  list-style: none;
}

.skillSection li {
  padding: 0.5rem;
  margin: 0.5rem;
}

.skillSection details p {
  padding: 1rem;
  /* border: 2px solid white; */
  border-radius: 5px;
  background: white;
  color: black;
}

.project {
  max-width: 100%;
  overflow: auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.project h4 {
  overflow-wrap: break-word;
  word-break: break-word;
}

.project p {
  overflow-wrap: break-word;
  word-break: break-word;
}

.project-list-container {
  display: flex;
}

.project-list {
  flex: 0 0 30%;
  list-style-type: none;
}

.project-details {
  flex: 1;
}

.project ul {
  list-style-type: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0;
}

.project ul li {
  margin: 1rem;
  background-color: white;
  color: black;
  padding: .5rem;
  border-radius: 10px;
}

.project h5 {
  margin-bottom: 0;
}

.project h5, .project ul {
  border-bottom: 1px solid white;
}

.pixelated-icon {
  font-size: 50px;
  color: #0077b5;
  image-rendering: pixelated;
  display: inline-block;
}

footer {
  text-align: center;
}

@media (max-width: 768px) {
  .project-list {
    display: none;
  }

  .project-gone {
    display: block !important;
  }

  .project {
    max-width: 100%;
    overflow: auto;
    word-wrap: break-word;
  }

  /* ====== UPDATED: tighten chip spacing only on mobile ====== */
  .project ul li {
    font-size: .75rem;
    margin: .25rem;
    background-color: white;
    color: black;
    padding: .5rem;
    border-radius: 10px;
  }
}

@media (max-width: 360px) {
  .project-list {
    display: none;
  }

  .project-gone {
    display: block !important;
  }

  .project ul li {
    font-size: .65rem;
    margin: .1rem;
    background-color: white;
    color: black;
    padding: .5rem;
    border-radius: 10px;
  }
}
