/* main.css */

/* Add this at the top of your CSS */
:root {
  --scrollbar-width: calc(100vw - 100%);
}

/* Basic resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: #fffeea;
  height: 100vh;
  width: 100vw;
  position: relative;
}

.container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  padding-top: 5vh; /* Space for fixed header */
}

/* Example paragraph styling */
.container p {
  font-family: "antarctican-mono", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: clamp(1rem, 2.5vw, 2.5rem);
}

/* Nav header with 11 columns */
.header {
  display: flex;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5vh;
  z-index: 999;
  background-color: #fffeea;
}

.header-content {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  grid-auto-rows: 1fr;
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-content a li {
  height: 100%;
  width: 100%;
}

/* Place 'Home' in col 3, 'Projects' in col 6, 'About Us' in col 9 */
.header-item.home {
  grid-column: 3;
}
.header-item.projects {
  grid-column: 6;
}
.header-item.about {
  grid-column: 9;
}

.header-content a {
  text-decoration: none;
  color: #f4481a;
  font-family: "antarctican-mono", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: clamp(0.5rem, 0.8vw, 0.8rem);
  overflow: hidden;
  justify-content: center;
  align-items: center;
  display: flex;
  border-right: 1px dashed #f4481a;
  border-bottom: 1px dashed #f4481a;
}

/* Each column cell in the header */
.header-item {
  border-right: 1px dashed #f4481a;
  border-bottom: 1px dashed #f4481a;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

/* Hover effect for the 3 real nav items */
.header-content a:hover {
  transition: background-color 0.3s ease;
  background-color: #f4481a;
  color: #fffeea;
}

/* Herogrid: 11 columns, rows auto */
.herogrid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  grid-auto-rows: minmax(min-content, 1fr);
  width: 100%;
  min-height: 95vh;
  position: relative;
  margin: 0;
  padding: 0;
  overflow-y: hidden;
}

/* 1) 9 columns at <= 1400px */
@media (max-width: 1400px) {
  .herogrid,
  .header-content {
    grid-template-columns: repeat(9, 1fr);
    width: 100%;
  }
  #header-item-1 {
    display: none;
  }
  #header-item-10 {
    display: none;
  }
  .header-item.home {
    grid-column: 3 / span 1 !important;
  }

  .header-item.projects {
    grid-column: 5 / span 1 !important;
  }
  .header-item.about {
    grid-column: 9 / span 1 !important;
  }
  #gif1 {
    grid-column: 3 / span 2 !important; /* effectively remove col 1 & 11 */
    grid-row: 2 / span 3 !important;
  }
  #gif2 {
    grid-column: 6 / span 2 !important;
    grid-row: 2 / span 3 !important;
  }

  .herogrid div[data-cell-number="47"] {
    display: none !important;
  }

  /* reposition .m-showcase items that were in col 1 or col 11 */
}

/* 2) 7 columns at <= 1000px */
@media (max-width: 1000px) {
  .herogrid,
  .header-content {
    grid-template-columns: repeat(7, 1fr);
    width: 100%;
  }
  #header-item-1 {
    display: none;
  }
  #header-item-4 {
    display: none;
  }
  #header-item-7 {
    display: none;
  }
  #header-item-10 {
    display: none;
  }

  .header-item.home {
    grid-column: 2 / span 1 !important;
  }

  .header-item.projects {
    grid-column: 5 / span 1 !important;
  }
  .header-item.about {
    grid-column: 6 / span 1 !important;
  }
  #gif1 {
    grid-column: 2 / span 2 !important;
    grid-row: 2 / span 3 !important;
  }
  #gif2 {
    grid-column: 5 / span 2 !important;
    grid-row: 2 / span 3 !important;
  }
  /* etc. */
}

/* 3) 5 columns at <= 800px */
@media (max-width: 800px) {
  .herogrid,
  .header-content {
    grid-template-columns: repeat(5, 1fr);
    width: 100%;
  }
  #header-item-1 {
    display: none;
  }
  #header-item-2 {
    display: none;
  }
  #header-item-4 {
    display: none;
  }
  #header-item-7 {
    display: none;
  }
  #header-item-10 {
    display: none;
  }
  #header-item-11 {
    display: none;
  }

  .header-item.home {
    grid-column: 1 / span 1 !important;
  }

  .header-item.projects {
    grid-column: 3 / span 1 !important;
  }
  .header-item.about {
    grid-column: 5 / span 1 !important;
  }

  #gif1 {
    grid-column: 2 / span 1 !important;
    grid-row: 2 / span 3 !important;
  }
  #gif2 {
    grid-column: 4 / span 1 !important; /* watch for overlap if only 5 columns, 
                                might do col 3 / span 2 instead. */
  }
  #gif2 img {
    width: 100% !important;
  }
  /* etc. */
}

/* 4) 3 columns at <= 600px (mobile) */
@media (max-width: 600px) {
  .herogrid,
  .header-content {
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    overflow-y: auto;
  }
  .header-item.about {
    grid-column: 3 / span 1 !important;
  }
  .header-item:empty {
    display: none;
  }
  .header-item.projects {
    grid-column: 3 / span 1 !important;
  }
  .header-item.home {
    grid-column: 1 / span 1 !important;
  }
  #gif1 {
    grid-column: 1 / span 1 !important; /* col 1 */
    grid-row: 2 / span 2 !important;
  }
  #gif2 {
    grid-column: 3 / span 1 !important; /* col 3 */
    grid-row: 2 / span 2 !important;
  }

  /* reposition .m-showcase so they fit 3 columns. 
     e.g. .m-showcase-1 => grid-column: 2 / span 1; grid-row: 5 / span 1; etc. */
}
/* Each cell in the herogrid (some are links, some are divs) */
.herogrid > div,
.herogrid a {
  border-right: 1px dashed #f4481a;
  border-bottom: 1px dashed #f4481a;
  aspect-ratio: 1/1;
  overflow: hidden;
  position: relative;
  background-color: #fffeea;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.herogrid > div::before {
  content: attr(data-cell-number);
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 10px;
  color: #f4481a;
  font-family: "antarctican-mono", sans-serif;
}

/* Example: your #gif1, #gif2 cells */
#gif1,
#gif2 {
  height: 100%;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

#gif2 {
  grid-column: 7 / span 2;
  grid-row: 2 / span 3;
}
#gif1 {
  grid-column: 4 / span 2;
  grid-row: 2 / span 3;
}
#gif1 img,
#gif2 img {
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
}
#gif1 img {
  height: 90%;
}

#gif2 img {
  height: 100%;
  object-fit: cover; /* changed from contain to cover */
  object-position: center; /* centers the image */
  width: 60%; /* this will make it slimmer */
  display: block;
  margin: 0; /* centers the slimmer image in its container */
}

#gif1 img:hover,
#gif2 img:hover {
  transform: scale(1.1);
}

/* .m-showcase hidden by default; shown via JS on #gif1 hover + pixelation */
.m-showcase {
  position: relative;
  width: 100%;
  height: 100%;
  opacity: 0; /* hidden by default */
  pointer-events: none; /* no interactions when hidden */

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  overflow: hidden;
}

.m-showcase img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* We'll do pixelation in JS */
}

.m-showcase p {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px;
  margin: 0;
  color: #f4481a;
  font-size: clamp(0.6rem, 1.5vw, 1.5rem);
  max-height: 100%;
  pointer-events: none;
  overflow: hidden;
  display: none;
}

#p5grid {
  position: relative;
  width: 100vw;
  height: 95vh;
  margin-top: 5vh;
}

.p5Canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
}

/* "Book a meeting" section */
.book {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  background-color: #fffb14;
  color: #64946a;
  font-family: "futura-pt", sans-serif;
  font-weight: 400;
  font-style: normal;
  overflow: hidden;
}
.book h1 {
  font-size: 18rem;
  line-height: 0.9;
}

/* Example for cell 47 usage, if you want a multiply blend:
  [data-cell-number="47"] img {
    mix-blend-mode: multiply;
  }
  */

/* Basic link styles in #blue or #orange if used
  #blue a, #orange a {
    text-decoration: none;
    color: inherit;
  }
  #blue a:hover, #orange a:hover {
    text-decoration: none;
  }
  */

/* Mouse follower text */
.mouse-follower {
  padding: 5px;
  height: auto;
  position: fixed;
  pointer-events: none;
  font-family: "antarctican-mono", sans-serif;
  font-size: 1rem;
  color: #fffeea;
  transform: translate(-50%, -50%);
  z-index: 1000;
  opacity: 0;
  font-weight: 400;
  /* background-color: rgba(100, 148, 106, 0.2); */

  transition: opacity 0.3s ease;

  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.5);

  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transform: translate(-50%, -50%);

  white-space: pre-line;
  text-align: right;
}

/* Style for [CLICK] text */
.mouse-follower .click-text {
  color: #fffb14; /* Orange color */
  font-size: 0.85em; /* Slightly smaller */
  font-weight: 700; /* Bolder */
  opacity: 0.9; /* Slightly transparent */
}

.floating-window {
  position: fixed;
  width: min(400px, 90vw);
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transform: translate(-50%, -50%);
  cursor: none;
}

.floating-window h1 {
  font-family: "antarctican-mono", sans-serif;
  font-size: 1rem;
  color: #111;
  margin: 0;
  padding: 0 5% 0 5%;
  text-align: left;
}

.floating-content {
  font-size: 14px;
  line-height: 1.4;
  color: #111;
  font-family: "antarctican-mono", sans-serif;
  max-height: 70vh;
  overflow-y: auto;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Custom scrollbar styling */
.floating-content::-webkit-scrollbar {
  width: 6px;
}

.floating-content::-webkit-scrollbar-track {
  background: transparent;
}

.floating-content::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.floating-image {
  float: left;
  width: 100%;
  object-fit: cover;
  padding: 0 5% 0 5%;
  border-radius: 8px;
}

.floating-text {
  overflow: hidden;
  padding: 2% 5% 5% 5%;
  text-align: justify;
}

@media (max-width: 768px) {
  .floating-window {
    font-size: 12px;
    padding: 15px;
  }

  .floating-image {
    width: 80px;
    height: 80px;
    margin: 0 10px 8px 0;
  }
}

.hover-window {
  position: fixed;
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fffb14;
  font-family: "antarctican-mono", sans-serif;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  z-index: 1000;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
}

/* Toggle Switch Styles */
.toggle-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  height: 100%;
  overflow: hidden;
  justify-content: space-between;
}

.toggle-icon {
  height: 16px; /* Adjust size as needed */
  width: auto;
  vertical-align: middle;
}

.toggle-icon-left {
  margin-left: 10px;
}

.toggle-icon-right {
  margin-right: 10px;
}

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 40px; /* Adjust width as needed */
  height: 20px; /* Adjust height as needed */
  border: 1px solid #f4481a;
  border-radius: 20px;
  transition: background-color 0.3s;
}

.toggle-slider:before {
  content: "";
  position: absolute;
  height: 16px; /* Slightly smaller than parent */
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: #f4481a;
  border-radius: 50%;
  transition: transform 0.3s;
}

#resolutionToggle {
  display: none; /* Hide the checkbox */
}

#resolutionToggle:checked + .toggle-slider {
  background-color: transparent; /* Or your preferred color */
}

#resolutionToggle:checked + .toggle-slider:before {
  transform: translateX(20px); /* Adjust based on slider width */
}
