/* === GLOBAL RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-wrap: pretty;
  overflow-x: hidden;
}

body {
  font-family: 'Playfair Display', Georgia, serif;
  background: radial-gradient(50% 50% at 50% 50%, #2F2F2F 0%, #020202 100%);;
  color: white;
}

html, body {
  min-height: 100%;
}

/* === CANVAS BACKGROUND === */
canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

/* === UNIVERSAL ACTION BUTTONS === */
.close-button,
.hamburger-button,
#scrollTop {
  position: fixed;
  width: 40px;
  height: 40px;
  color: #ccc;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  z-index: 12;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.close-button svg,
.hamburger-button svg {
  width: 20px;
  height: 20px;
}

#scrollTop svg {
  width: 32px;
  height: 32px;
}

.close-button {
  top: 32px;
  right: 32px;
}

.hamburger-button {
  top: 32px;
  left: 32px;
  display: none;
}

#scrollTop {
  bottom: 32px;
  right: 32px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  transition-behavior: allow-discrete;
}

#scrollTop.visible {
  opacity: 1;
  visibility: visible;
}

/* === MAIN CONTENT === */
.content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1024px;
  margin: 320px auto 0 auto;
  padding: 0 40px 150px 40px;
  box-sizing: border-box;
  text-align: center;
}

/* === TYPOGRAPHY === */
h1 {
  font-size: 80px;
  margin-bottom: 64px;
  text-wrap: pretty;
}

.index-title {
  margin-top: 60px;
  font-size: 120px;
  text-align: center;
  padding-inline: 16px;
}

p.description {
  font-size: 28px;
  color: #ccc;
  margin-bottom: 64px;
  text-wrap: pretty;
}

/* === CHAT MESSAGES === */
.chat {
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(10px);
  padding: 12px 16px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  font-size: 28px;
  color: #ccc;
  font-family: inherit;
  line-height: 1.5;
  max-width: 75%;
  width: fit-content;
  word-break: break-word;
  text-wrap: pretty;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.message.visible {
  opacity: 1;
  transform: translateY(0);
}

.message.user {
  background: rgba(0, 119, 255, 0.3);
  color: white;
  text-align: right;
  margin-left: auto;
  backdrop-filter: blur(10px);
}

/* === TOOLTIP (INDEX PAGE) === */
#popup {
  position: absolute;
  padding: 10px 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  color: white;
  border-radius: 12px;
  font-size: 32px;
  pointer-events: none;
  transform: translate(-50%, -100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
  text-wrap: pretty;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

#popup.visible {
  opacity: 1;
}

/* === SIDEBAR MENU === */
#menu {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  max-width: 200px;
  width: fit-content;
  padding: 20px;
  margin-left: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 20;
  color: white;
}

#menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#menu li {
  margin-bottom: 16px;
  cursor: pointer;
  font-size: 18px;
  color: #ccc;
  transition: color 0.2s;
  text-wrap: pretty;
}

#menu li.active {
  cursor: initial;
  color: white;
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.6),
    0 0 8px rgba(255, 255, 255, 0.4);
}

.menu-header {
  margin-bottom: 16px;
  font-size: 21px;
  font-weight: 700;
  color: #ccc;
  text-wrap: pretty;
}

/* === INDEX PAGE CENTERED CANVAS === */
body.index-page canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 100vh;
  max-height: none;
  pointer-events: auto;
  z-index: 0;
}

/* === RESPONSIVE BREAKPOINTS === */

@media (max-width: 1440px) {
  .content {
    max-width: 820px;
  }
}

@media (max-width: 1200px) {
  .index-title {
    font-size: 80px;
  }

  #menu {
    display: none;

    position: fixed;
    top: 80px;
    left: 32px;
    width: fit-content;
    max-width: 200px;
    padding: 20px;
    margin: 0;
    opacity: 0;
    z-index: 10;
    transform: none;
    transition: display 0.3s ease, opacity 0.3s ease;
    transition-behavior: allow-discrete;
  }

  #menu.active {
    display: block;
    opacity: 1;

    @starting-style {
      opacity: 0;
    }
  }

  .hamburger-button {
    display: flex;
  }

  h1 {
    font-size: 56px;
    margin-bottom: 48px;
  }

  p.description {
    font-size: 22px;
    margin-bottom: 48px;
  }

  .message {
    font-size: 22px;
  }
}

@media (max-width: 768px) {
  .index-title {
    font-size: 64px;
  }

  .content {
    padding: 0 16px 150px 16px;
  }

  h1 {
    font-size: 32px;
    margin-bottom: 24px;
  }

  p.description {
    font-size: 16px;
    margin-bottom: 32px;
  }

  .message {
    font-size: 16px;
  }

  #popup {
    font-size: 24px;
  }

  #menu {
    left: 16px;
  }

  .close-button {
    top: 32px;
    right: 16px;
  }

  .hamburger-button {
    top: 32px;
    left: 16px;
  }

  #scrollTop {
    bottom: 32px;
    right: 16px;
  }
}

/* === HOVER EFFECTS FOR POINTER DEVICES ONLY === */
@media (any-hover: hover) {
  .close-button:hover,
  .hamburger-button:hover,
  #scrollTop:hover,
  #menu li:hover {
    color: #ffffff;
    text-shadow:
    0 0 4px rgba(255, 255, 255, 0.6),
    0 0 8px rgba(255, 255, 255, 0.4);
  }
}
