/* =========================
   RESET & BASE
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: auto;
  font-family: "Darker Grotesque", sans-serif;
}

body {
  background-color: #141416;
  color: #EFEFEF;
  overflow: hidden; /* intentional: custom scroll */
}

/* =========================
   TYPOGRAPHY
========================= */
h3 {
  font-size: 24px;
  font-weight: 700;
}

h4 {
  font-size: 20px;
  font-weight: 700;
}

a {
  font-size: 20px;
  font-weight: 600;
  line-height: 130%;
  text-decoration: none;
  color: #EFEFEF;
}

/* =========================
   FLOATING BOTTOM NAV
========================= */
.floating-nav {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);

  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;

  background: #313131;
  backdrop-filter: blur(10px);
  border-radius: 999px;
  filter: drop-shadow(0px 0px 4px #0000007f);

  z-index: 999;
}

.floating-nav .nav-item {
  width: 40px;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #E3E3E6;
  transition: all 0.25s ease;
}

/* Divider */
.nav-divider {
  width: 1px;
  height: 20px;
  margin: 0 6px;
  background: rgba(255, 255, 255, 0.15);
}

/* =========================
   MATERIAL SYMBOLS
========================= */
.material-symbols-outlined, .material-symbols {
  font-size: 20px;
  line-height: 1;
  color: #656565;
  display: inline-block;

  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;

  transition: font-variation-settings 0.25s ease, transform 0.25s ease;
}

/* Active = filled */
.floating-nav .nav-item.active .material-symbols-outlined {
  color: #E3E3E6;
  font-variation-settings:
    'FILL' 1,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;

  transform: scale(1.05);
}

/* OPTIONAL hover preview (non-conflicting) */
.floating-nav .nav-item:not(.active):hover .material-symbols-outlined {
  color: #E3E3E6;
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
  transition: all 0.4s ease;
}

.material-symbols:hover{
  color: #E3E3E6;
  transition: all 0.4s ease;
}

/* Pause / Play button cursor */
#pause-toggle {
  cursor: pointer;
}

/* Optional: also apply to all nav items for consistency */
.floating-nav .nav-item {
  cursor: pointer;
}

/* =========================
   TOOLTIP (DELAYED)
========================= */
.floating-nav .nav-item {
  position: relative;
}

/* Tooltip bubble */
.floating-nav .nav-item::after {
  content: attr(data-tooltip);

  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);

  padding: 8px 16px;
  font-size: 16px;
  font-weight: 600;
  font-family: "Darker Grotesque", sans-serif;
  white-space: nowrap;

  color: #E3E3E6;
  background: #313131;
  border-radius: 8px;

  opacity: 0;
  pointer-events: none;

  transition: 
    opacity 0.2s ease,
    transform 0.2s ease;
}


/* ⏱ Delay appears ONLY on hover */
.floating-nav .nav-item:hover::after,
.floating-nav .nav-item:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);

  transition-delay: 0.6s; /* 👈 adjust delay here */
}

/* Remove delay when leaving */
.floating-nav .nav-item::after,
.floating-nav .nav-item::before {
  transition-delay: 0s;
}


/* =========================
   PROJECTS / SCROLL AREA
========================= */
#scroll-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
}

.inner-scroll {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

/* Grid */
.row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-bottom: 8px;
  transition:all .35s ease;
}

/* =========================
   PROJECT CARD
========================= */
.project-card {
  position: relative;
  background: #141416;
  overflow: hidden;   
}

.project-card a {
  display: block;
}

.project-card img,
.project-card video {
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.project-card img.loaded,
.project-card video.loaded {
  opacity: 1;
}

.project-card {
  position: relative;
  overflow: hidden;
  display: block;
}

.project-card img,
.project-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease, filter 0.45s ease;
}

/* zoom + darken */
.project-card:hover img,
.project-card:hover video {
  transform: scale(1.08);
  filter: brightness(0.4);
}


/* =========================
   MODAL
========================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;

  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-container {
  width: 912px;
  height: 450px;
  max-width: 90%;
  background: #252525;
  border: solid 6px #252525;
  border-radius: 12px;
  overflow: hidden;

  transform-origin: top left;
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1);
}

.modal.active {
  display: flex;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-image {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.modal-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 445px;
}

.modal-title {
  font-size: 28px;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.tag {
  border: 2px solid;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

.modal-buttons {
  display: flex;
  justify-content: end;
  gap: 8px;
  padding: 16px 0px;
}

.media-wrapper {
  width: 100%;
  /* height: 100%; */
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
}

.media-wrapper img,
.media-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
}


/* =========================
   BUTTONS
========================= */
  .btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #E3E3E6;
    font-size: 16px;
    color: #141416;
    border-radius: 20px;
    padding: 4px 16px;
    min-width: 100px;
    font-weight: 700;
  }

  .btn-secondary{
    background: transparent;
    font-size: 16px;
    color: #E3E3E6;
    border-radius: 20px;
    border: solid 2px #E3E3E6;
    padding: 4px 8px;
    min-width: 100px; 
    font-weight: 700;
  }

  .btn-secondary:hover {
    cursor: pointer;
  }

  .modal-close {
    display: flex;
    justify-content: end;
    background: transparent;
    width: 100%;
    border-style: none;
  }

  .modal-close:hover {
    cursor: pointer;
  }
  

/* =========================
   DISABLE PAGE
========================= */
.nav-item.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.nav-item.disabled:hover {
  transform: none;
}

/* =========================
   CHAT
========================= */
#about-chat{
  position: fixed;
  right: 16px;
  bottom: 24px;

  display:flex;
  flex-direction:column;
  gap:8px;
  z-index:200;
}

.chat-message{
  background:#313131;
  color:white;

  box-shadow: 0 4px 16px #09090940;

  opacity:0;
  transform:translateY(10px);

  transition:all .35s ease-in-out;
  max-width: 400px;
}

#chat-messages{
  display:flex;
  flex-direction:column;
  gap:8px;
}

/* user message (right side) */
.chat-message.user{
  align-self:flex-end;
  background:#ffffff;
  color:#141416;
}

/* bot message (left side) */
.chat-message.bot{
  align-self:flex-end;
}

.chat-message.show{
  opacity:1;
  transform:translateY(0);
}

.chat-actions{
  display:flex;
  gap:4px;

  margin-top:12px;
}

.chat-options{
  display:flex;
  flex-direction:column;
  gap:4px;

  align-items:flex-end; /* prevents full-width stretching */

  opacity:0;
  transform:translateY(10px);
  transition:all .35s ease;
}

.chat-options.show{
  opacity:1;
  transform:translateY(0);
}

.chat-option{
  display:inline-flex; /* size based on content */
  align-items:center;
  justify-content:space-between;

  background:#ffffff;
  cursor:pointer;
  box-shadow: 0 2px 16px #09090940;
  border:none;
  opacity: 0.8;
  
  transition: 
    opacity .25s ease,
    transform .3s ease;
}

.chat-option:hover{
  opacity:1;
}

.chat-option.hide{
  opacity:0;
  transform:translateX(20px);
  pointer-events:none;
  transition:all .25s ease;
}

.chat-option.selected{
  opacity: 1;
  background:#ffffff;
  color:#141416;
}

.chat-message, .chat-option {
  font-family: "Inter", sans-serif;
  line-height: 160%;
  font-weight: 500;
  font-size: 14px;

  padding: 10px 16px 8px 16px;
  border-radius: 18px;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1000px) {
  .modal-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .modal-container {
    height: auto;
  }

  .modal-close {
    display: none;
  }

  .modal-content br {
    display: none;
  }

  .modal-title {
    font-size: 20px;
  }

  .modal-tags {
    margin: 12px 0 12px 0;
  }

  .tag {
    font-size: 10px;
    padding: padding: 4px 8px 4px 8px;
  }

  #modal-description {
    font-size: 14px;
  }

  .modal-content {
    padding: 8px;
    gap: 0;
    height: 330px;
  }

  .modal-buttons {
    padding: 4px 0 4px 0;
    justify-content: space-evenly;
  }

  .btn-primary {
    padding: 4px 26px;
  }

  .modal-buttons button {
    width: 50%;
  }

  #about-chat{
    position: fixed;
    right: 0px;
    bottom: 100px;
    padding: 0 16px 0 16px;

    width: 100vw;
  }

  .chat-message.bot{
    align-self:flex-start;
}

}

@media (max-width: 768px) {
  .row {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-layout {
    margin: 0 8px 0px 8px;
  }

}

@media (max-width: 480px) {
  .row {
    grid-template-columns: 1fr;
  }
}

/* =========================
   MOBILE NATIVE SCROLL FIX
   (Must be LAST)
========================= */
@media (pointer: coarse) {

  /* Allow native scrolling */
  #scroll-container {
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
  }

  /* Disable transform-based scrolling on mobile */
  .inner-scroll {
    position: static;
    transform: none !important;
    will-change: auto;
  }
}
