@import url("https://fonts.googleapis.com/css2?family=Archivo+Black&family=Space+Grotesk:wght@300;400;500;600;700&display=swap");

@font-face {
  font-family: "ocean";
  src: url("fonts/Oceanside Typewriter.ttf");
}

@font-face {
  font-family: "rem";
  src: url("fonts/Remingtoned Type.ttf");
}

@font-face {
  font-family: "cursive";
  src: url("fonts/CassandraPersonalUseRegular-3BjG.ttf");
}

@font-face {
  font-family: "Special Elite";
  src: url("fonts/SpecialElite-Regular.ttf");
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --background: #fff;
  --foreground: #000;
  --card: #fff;
  --card-foreground: #000;
  --primary: #ffdb33;
  --primary-hover: #ffcc00;
  --primary-foreground: #000;
  --secondary: #000;
  --secondary-foreground: #fff;
  --muted: #aeaeae;
  --muted-foreground: #5a5a5a;
  --accent: #fae583;
  --accent-foreground: #000;
  --destructive: #e63946;
  --destructive-foreground: #fff;
  --border: #000;
}

body {
  background: #000000;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
}

.sky {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: blink infinite;
}

.star:nth-child(1n) {
  width: 2px;
  height: 2px;
  animation-duration: 2s;
  animation-delay: 0.1s;
}

.star:nth-child(2n) {
  width: 3px;
  height: 3px;
  animation-duration: 3s;
  animation-delay: 0.12s;
}

.star:nth-child(3n) {
  width: 1.5px;
  height: 1.5px;
  animation-duration: 1.5s;
  animation-delay: 0.14s;
}

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

#porty {
  position: absolute;
  color: rgb(255, 255, 255);
  letter-spacing: 0.5rem;
  text-align: center;
  top: 20px;
  left: 50%;
  font-weight: bold;
  transform: translateX(-50%);
  font-family: "rem", sans-serif;
  padding: 0.8rem 1.2rem;
  border: 2px solid hsl(0, 10%, 82%);
  box-shadow: -6px 6px 0px rgb(193, 189, 189);
  font-size: clamp(1.2rem, 3.5vw, 2.5rem);
  background-color: transparent;
  display: flex;
  cursor: default;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
  z-index: 10;
}

#porty span {
  display: inline-block;
  animation: wave 3.5s infinite ease-in-out;
}

@keyframes wave {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.shooting-star {
  position: absolute;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.8),
    rgba(255, 255, 255, 0)
  );
  width: 100px;
  height: 2px;
  transform: rotate(45deg);
  animation: shoot 1s ease-in-out forwards;
  opacity: 0;
  pointer-events: none;
}

@keyframes shoot {
  0% {
    transform: translateX(0) translateY(0) rotate(45deg);
    opacity: 0.8;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    transform: translateX(300px) translateY(300px) rotate(45deg);
    opacity: 0;
  }
}

.sentence {
  color: #e2e1da;
  position: absolute;
  left: 50%;
  top: 22%;
  font-size: clamp(1.4rem, 4vw, 3rem);
  font-family: "ocean", serif;
  transform: translate(-50%, -50%);
  cursor: default;
  white-space: nowrap;
  z-index: 10;
}

.last-word {
  border-right: 2px solid #fff;
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
  width: 0ch;
  vertical-align: bottom;
}

.button-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(15px, 3vw, 30px);
  position: absolute;
  left: 50%;
  top: 78%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: auto;
}

.btn,
.btn2 {
  font-family: "Special Elite", cursive;
  font-style: italic;
  font-size: clamp(16px, 2vw, 25px);
  color: white;
  background: transparent;
  border: 2px solid white;
  padding: 10px 24px;
  border-radius: 8px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 5px white, 0 0 10px rgba(255, 255, 255, 0.5);
}

.btn:hover {
  transform: scale(1.08);
  background-color: rgb(197, 197, 197);
  color: black;
  box-shadow: 0 0 10px white, 0 0 20px white, 0 0 30px #00f0ff;
}

.btn2 {
  border-radius: 50%;
  width: clamp(42px, 5vw, 50px);
  height: clamp(42px, 5vw, 50px);
  padding: 0;
  font-size: clamp(16px, 2vw, 18px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 5px white, 0 0 15px rgba(255, 255, 255, 0.5);
}

.btn2:hover {
  transform: rotate(10deg) scale(1.1);
  background-color: rgb(197, 197, 197);
  color: black;
  box-shadow: 0 0 15px white, 0 0 25px #00f0ff;
}

dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0;
  border: none;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

#main-dialog {
  background-color: black;
  color: white;
  border: 2px solid white;
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 0 15px white;
  font-family: "Courier New", monospace;
  width: 500px;
  max-width: 90vw;
  max-height: 85vh;
  animation: portfolioDialogEnter 0.4s ease forwards;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

#main-dialog[open] {
  display: flex;
}

#main-dialog.closing {
  animation: portfolioDialogExit 0.4s ease forwards;
}

#main-dialog #header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: black;
  padding: 8px 12px;
  border-bottom: 1px solid white;
  font-weight: bold;
  flex-shrink: 0;
  font-size: 1.25rem;
  box-shadow: 0 0 5px white;
  cursor: move;
}

#about-me {
  display: flex;
  align-items: center;
  gap: 5px;
}

#close-i-button {
  background: none;
  color: white;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  font-weight: bold;
  padding: 2px 8px;
  transition: 0.2s;
}

#close-i-button:hover {
  color: black;
  background-color: white;
  border-radius: 3px;
}

#content-dialog {
  padding: 18px;
  font-size: 1.1rem;
  line-height: 1.6rem;
  color: #eee;
  flex: 1;
  overflow-y: auto;
}

#content-dialog b {
  color: white;
  text-shadow: 0 0 5px white;
}

#skills-dialog {
  height: 550px;
  width: 600px;
  max-width: 95vw;
  max-height: 90vh;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    #000000 0%,
    #050505 20%,
    #05140a 45%,
    #08321a 60%,
    #000000 100%
  );
  border: 2px solid #2cff05;
  border-radius: 12px;
  padding: 0;
  color: white;
  font-family: "Special Elite", cursive;
  box-shadow: 0 0 10px white, 0 0 20px rgba(255, 255, 255, 0.5);
  animation: portfolioDialogEnter 0.4s ease forwards;
  display: none;
  flex-direction: column;
}

#skills-dialog[open] {
  display: flex;
}

#skills-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-bottom: 1px solid #2cff05;
  cursor: move;
}

#skills-title {
  font-size: 18px;
  letter-spacing: 1px;
}

#close-skills-button {
  background: transparent;
  color: #fff;
  border: none;
  font-family: monospace;
  font-size: 20px;
  cursor: pointer;
  padding: 2px 8px;
}

#close-skills-button:hover {
  color: #2cff05;
}

#skills-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  overflow: hidden;
}

#game-canvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  touch-action: none;
}

#options {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid white;
  border-radius: 12px;
  padding: 0;
  color: white;
  font-family: "Special Elite", cursive;
  box-shadow: 0 0 10px white, 0 0 20px rgba(255, 255, 255, 0.5);
  width: clamp(280px, 50vw, 550px);
  min-height: 160px;
  max-width: 90vw;
  animation: portfolioDialogEnter 0.4s ease forwards;
  display: none;
  flex-direction: column;
}

#options[open] {
  display: flex;
}

#options-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-bottom: 1px solid white;
  cursor: move;
}

#options-title {
  font-size: 18px;
  letter-spacing: 1px;
}

#options-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  padding: 20px;
  flex-wrap: wrap;
}

.optionss {
  font-family: "Special Elite", cursive;
  background: transparent;
  border: 2px solid white;
  border-radius: 6px;
  color: white;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 5px white;
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  padding: 10px 18px;
}

#main-dialog.closing,
#options.closing,
#skills-dialog.closing,
#text-dialog.closing,
#cert-dialog.closing,
#blogs-dialog.closing,
.first-impression-dialog.closing {
  animation: portfolioDialogExit 0.4s ease forwards;
  pointer-events: none;
}

#close-options-button {
  background: transparent;
  border: none;
  font-size: 18px;
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
}

#close-options-button:hover {
  transform: scale(1.2);
  color: #00f0ff;
}

#dottxt:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 8px white, 0 0 15px #ff3131;
}

#dotgame:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 8px white, 0 0 15px #2cff05;
}

#dotcert:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 8px white, 0 0 15px #00f0ff;
}

#text-dialog,
#cert-dialog,
#blogs-dialog {
  display: none;
  font-family: "Courier New", monospace;
  font-size: 1rem;
  border-radius: 10px;
  padding: 0;
  width: 420px;
  max-width: 90vw;
  max-height: 85vh;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: portfolioDialogEnter 0.4s ease forwards;
  flex-direction: column;
}

#text-dialog[open],
#cert-dialog[open],
#blogs-dialog[open] {
  display: flex;
}

#text-dialog {
  border: 2px solid #ff3131;
  box-shadow: 0 0 15px #ff3131;
  color: #ff3131;
  background: rgba(25, 10, 13, 0.95);
}

#cert-dialog {
  border: 2px solid #00f0ff;
  box-shadow: 0 0 15px #00f0ff;
  color: #0ff;
  background: rgba(10, 10, 25, 0.95);
}

#blogs-dialog {
  border: 2px solid #ffcc00;
  box-shadow: 0 0 15px #ffcc00;
  color: #ffcc00;
  background: rgba(25, 20, 10, 0.95);
}

#text-header,
#cert-header,
#blogs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-weight: bold;
  cursor: move;
}

#text-header {
  border-bottom: 1px solid #ff3131;
  background: rgba(25, 10, 13, 0.9);
}

#cert-header {
  border-bottom: 1px solid #0ff;
  background: rgba(0, 255, 255, 0.1);
}

#blogs-header {
  border-bottom: 1px solid #ffcc00;
  background: rgba(255, 204, 0, 0.1);
}

#close-text-button,
#close-cert-button,
#close-blogs-button {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
}

#close-text-button {
  color: #ff3131;
}

#close-cert-button {
  color: #0ff;
}

#close-blogs-button {
  color: #ffcc00;
}

#close-text-button:hover,
#close-cert-button:hover,
#close-blogs-button:hover {
  color: #fff;
}

#text-content,
#cert-content,
#blogs-content {
  padding: 15px 20px;
  overflow-y: auto;
}

#blogs-content {
  text-align: center;
  font-size: 1.1rem;
}

.blogs-subtext {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #ddd;
}

#text-list,
#cert-list {
  list-style: none;
  padding: 5px;
  margin: 0;
}

.txt-item,
.crt-item {
  padding: 6px 0;
  border-left: 2px solid currentColor;
  padding-left: 10px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.first-impression-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #3a3737;
  border: 1px solid #000;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
  height: min(75vh, 600px);
  width: min(75vh, 600px);
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 10px;
  cursor: default;
  background: linear-gradient(
    165deg,
    #555 0%,
    #333 8%,
    #111 50%,
    #222 92%,
    #444 100%
  );
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
}

.first-impression-dialog:not([open]) {
  display: none !important;
}

.first-impression-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  position: relative;
}

.image-container {
  position: relative;
  width: 100%;
  height: 25%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.first-impression-photo {
  max-height: 100%;
  max-width: 70%;
  object-fit: contain;
  transition: transform 0.8s ease-in-out, opacity 0.8s ease-out;
}

.side-div {
  position: relative;
  display: flex;
  font-size: 2.5rem;
  font-weight: 600;
  color: #fff;
  font-family: "cursive", sans-serif;
  z-index: 10;
  opacity: 0;
  transition: transform 0.8s ease-out, opacity 0.8s ease-out;
}

.side-div.in {
  transform: translateX(-300%);
}

.side-div.fy {
  transform: translateX(300%);
}

.image-container:hover .first-impression-photo {
  transform: scale(1.15);
  opacity: 0.3;
}

.image-container:hover .side-div.in {
  transform: translateX(-30%);
  opacity: 1;
}

.image-container:hover .side-div.fy {
  transform: translateX(30%);
  opacity: 1;
}

.paragraph-container {
  font-size: clamp(0.95rem, 2vw, 1.25rem);
  color: #fff;
  line-height: 1.5;
  font-family: "ocean", serif;
  text-align: center;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  overflow-y: auto;
}

.paragraph {
  text-align: center;
  width: 100%;
}

.intro-legend {
  list-style: none;
  margin-top: 0.8rem;
  text-align: center;
}

.intro-legend li {
  margin: 4px 0;
}

.ribbon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0.5rem;
  width: 100%;
  height: 40px;
}

.ribbon {
  height: 36px;
  width: auto;
  cursor: pointer;
  transition: filter 0.3s ease, transform 0.3s ease;
}

.ribbon:hover {
  filter: drop-shadow(0 0 5px white) drop-shadow(0 0 10px white);
  transform: scale(1.08);
}

.first-impression-dialog.first-load {
  animation: portfolioDialogEnter 0.6s ease forwards;
}

.first-impression-dialog.closing {
  animation: portfolioDialogExit 0.6s ease forwards;
}

@keyframes portfolioDialogEnter {
  from {
    transform: translate(-50%, -60%) scale(0.85);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes portfolioDialogExit {
  from {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(-50%, -60%) scale(0.85);
    opacity: 0;
  }
}

.comet {
  position: fixed;
  width: 6px;
  height: 6px;
  background: linear-gradient(90deg, white, #ccc, #666, black);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 3px rgba(255, 255, 255, 0.8), 0 0 5px rgba(255, 255, 255, 0.6);
  animation: tail 0.25s linear forwards;
  z-index: 9999;
}

@keyframes tail {
  0% {
    transform: scale(1) translateX(0px);
    opacity: 1;
  }
  100% {
    transform: scale(0.5) translateX(-8px);
    opacity: 0;
  }
}

#quote-container {
  font-family: "Courier New", monospace;
  font-size: clamp(0.9rem, 2.5vw, 1.8rem);
  color: white;
  display: flex;
  text-shadow: 0 0 10px white, 0 0 20px white;
  white-space: nowrap;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
}

#quote-text {
  display: block;
  white-space: nowrap;
}

.drop-in {
  animation: dropIn 0.6s ease forwards;
}

.drop-out {
  animation: dropOut 0.6s ease forwards;
}

@keyframes dropIn {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes dropOut {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(100%);
    opacity: 0;
  }
}

/* Clear Responsive Breakpoints */

/* Mobile Devices (<600px) */
@media (max-width: 600px) {
  #porty {
    font-size: 1.3rem;
    padding: 0.5rem 0.8rem;
    top: 15px;
    letter-spacing: 0.3rem;
  }

  .sentence {
    font-size: 1.2rem;
    top: 20%;
  }

  #quote-container {
    top: 45%;
    font-size: 0.9rem;
  }

  .button-container {
    flex-direction: column;
    gap: 12px;
    top: 80%;
    width: 80%;
  }

  .btn {
    width: 100%;
    text-align: center;
    padding: 10px 15px;
    font-size: 1rem;
  }

  .btn2 {
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }

  #skills-dialog {
    height: 450px;
    width: 95vw;
  }

  #options-content {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .optionss {
    width: 100%;
    text-align: center;
  }

  .first-impression-dialog {
    width: 92vw;
    height: 80vh;
    padding: 0;
  }

  .first-impression-container {
    padding: 1rem;
  }

  .image-container {
    height: 20%;
  }

  .paragraph-container {
    font-size: 0.85rem;
    line-height: 1.35;
    padding: 0.2rem;
  }

  .side-div {
    font-size: 1.5rem;
  }
}

/* Tablet Devices (600px to 1024px) */
@media (min-width: 601px) and (max-width: 1024px) {
  #porty {
    font-size: 1.8rem;
    top: 20px;
  }

  .sentence {
    font-size: 1.8rem;
    top: 22%;
  }

  .button-container {
    gap: 20px;
    top: 78%;
  }

  #skills-dialog {
    width: 85vw;
    height: 500px;
  }

  .first-impression-dialog {
    width: 80vw;
    height: 70vh;
  }
}
