/* -----------------------------
   DESIGN SYSTEM (HIGH CONTRAST)
------------------------------ */
:root {
  --bg: #f6f6f6;
  --text: #111111;
  --muted: #666666;
  --nav-bg: rgba(246, 246, 246, 0.9);
}

body.dark {
  --bg: #0e0e0e;
  --text: #ffffff;
  --muted: #aaaaaa;
  --nav-bg: rgba(14, 14, 14, 0.9);
}

/* -----------------------------
   GLOBAL
------------------------------ */
body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

/* Update your Nav background to use the variable */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000000 !important; /* Extremely high to beat everything else */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg); 
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto !important;
}

#themeToggle {
  margin-left: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 1.4rem;
  padding: 5px;
}

#themeToggle:active {
  transform: scale(0.9); /* Visual feedback when clicked */
}

.section-alt {
  background: color-mix(in srgb, var(--bg) 95%, var(--text)); 
}

#themeToggle, 
.carousel-prev, 
.carousel-next, 
.cat-item, 
.nav a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}


/* -----------------------------
   NAVIGATION
------------------------------ */

.nav a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .nav {
    background: var(--nav-bg);
    padding: 1rem;
    z-index: 1000000 !important; /* MUST match the desktop z-index */
    height: auto; 
    position: sticky;
    top: 0;
  }

  /* Force the banner out of the way of the nav links */
  .category-banner-wrapper {
    top: 80px; /* Nudge it down so it doesn't sit over the sticky nav */
    z-index: 100; 
  }
}

/* -----------------------------
   HERO
------------------------------ */
.hero.hero-image {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  background-image: url("images/innofire.jpg");
  background-size: cover;
  background-position: center;
  display: flex;
}

.hero-overlay {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Pushes the two divs apart */
  align-items: center;

  /* THIS CREATES THE OVAL WINDOW */
  /* The transparent '0% to 20%' is the mountain hole */
  /* The '70% to 100%' is the dark area for your text */
  background: radial-gradient(
    ellipse at center, 
    transparent 0%, 
    rgba(0, 0, 0, 0) 20%, 
    rgba(0, 0, 0, 0.4) 60%, 
    rgba(0, 0, 0, 0.9) 100%
  );
}

.hero-content {
  width: 100%;
  text-align: center;
  /* Reduced the bottom padding specifically to pull the text up */
  padding: 8vh 2rem; 
}

/* THE OVERLAY BOX */
.p-box {
  display: block; /* Shrinks the box to fit the text width */
  background: rgba(0, 0, 0, 0.6); /* Dark semi-transparent background */
  backdrop-filter: blur(8px); /* Optional: Adds a glass effect */
  padding: 1.5rem 2rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 15vh; /* This "lifts" the box higher up */
  
}

.p-box p {
  color: #ffffff !important;
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  margin: 0; /* Remove margin so it doesn't mess up the box padding */
  line-height: 1.6;
  text-shadow: none; /* No shadow needed inside a dark box */
}

.hero-content h1 {
  color: #ffffff !important;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  max-width: 25ch;
  /* Added 'auto' to the sides to force horizontal centering */
  margin: 0 auto; 
  text-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.hero-content p {
  color: #ffffff !important;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  max-width: 50ch;
  /* Increased the bottom margin here to nudge it up even more if needed */
  margin: 0 auto; 
  line-height: 1.6;
}


/* -----------------------------
   EDITORIAL SECTIONS
------------------------------ */
.editorial {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 4rem;
  padding: 6rem 2rem;
}

.editorial.alt {
  background-color: color-mix(in srgb, var(--bg), var(--text) 5%) !important;
  transition: background-color 0.3s ease;
}

@media (max-width: 900px) {
  .editorial {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

/* -----------------------------
   SUBTLE ALTERNATION
------------------------------ */
/* This works for both themes by mixing 5% of the text color into the background */
.section-alt, 
.editorial.section-alt,
.editorial.alt {
  background-color: color-mix(in srgb, var(--bg), var(--text) 5%) !important;
  transition: background-color 0.3s ease;
}

/* Ensure all text inside these sections stays readable */
.section-alt h2, 
.section-alt p, 
.section-alt dt {
  color: var(--text);
}
/* -----------------------------
   WORK SECTION
------------------------------ */

.work-section {
  padding: 6rem 2rem;
}

.work-header {
  max-width: 900px;
  margin-bottom: 4rem;
}

.carousel-container {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
}

.work-strip {
  display: flex;
  flex-wrap: nowrap;
  transition: transform 0.5s ease;
}

.work-item {
  flex: 0 0 calc(100vw / 3);
  position: relative;
  display: flex;
  flex-direction: column;
  background: #000;
}

.work-image {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 360px;          /* keep fixed height */
}

.work-item img {
  width: 100%;
  height: 100%;           /* changed: fill container height fully */
  object-fit: cover;
  filter: grayscale(100%);
  
  /* Start slightly zoomed in → no black edges visible */
  transform: scale(1.03);
  transition: transform 0.4s ease, filter 0.4s ease;
}

.overlay {
  position: absolute;
  inset: 0;                 /* cleaner than top/left/width/height */
  background: rgba(0, 0, 0, 0.35);  /* slightly stronger default overlay */
  transition: opacity 0.4s ease;
  pointer-events: none;     /* optional: prevents overlay interference */
}

.work-item:hover .overlay {
  opacity: 0;
}

.work-item:hover img {
  transform: scale(1.08);   /* increased zoom range for more noticeable effect */
  filter: grayscale(0%);
}

.work-item:hover img {
  transform: scale(1.05);
  filter: grayscale(0%);
}

.work-meta {
  padding: 1.5rem;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 0.5rem; /* Consistent spacing between title, span, and p */
}

.work-meta strong {
  display: block;
  font-weight: 500;
}

/* CHANGE THIS: Target only the project photo, not the flag */
.work-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  transform: scale(1.03);
  transition: transform 0.4s ease, filter 0.4s ease;
}

.flag-icon {
    width: 16px !important;  /* Adding !important just to be safe */
    height: 16px !important;
    min-width: 16px;         /* Prevents squishing */
    object-fit: cover;
    border-radius: 50%; 
    display: inline-block;
    filter: saturate(0.8);
}

.work-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0; /* Let the parent gap handle spacing */
}

.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-size: 1.5rem;
  z-index: 10;
  transition: background 0.3s ease;
}

.carousel-prev:hover,
.carousel-next:hover {
  background: rgba(0, 0, 0, 0.7);
}

.carousel-prev {
  left: 0;
}

.carousel-next {
  right: 0;
}

.work-links {
    display: flex;
    gap: 16px; /* slightly wider for touch/click ease */
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(128, 128, 128, 0.2); /* Works on light or dark */
}

.work-links a {
    /* If your background is DARK, use rgba(255,255,255,0.6) */
    /* If your background is LIGHT, use rgba(0,0,0,0.6) */
    color: #888; 
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.work-links a:hover {
    color: #000; /* Or #fff if on a dark theme */
    transform: translateY(-2px);
}

.work-links svg {
    display: block;
    stroke: currentColor; /* This forces the SVG to use the 'a' tag color */
    fill: none;
}

.category-banner-wrapper {
  position: absolute;
  top: 20px; /* Give it some breathing room from the top nav */
  left: 0;
  right: 0;
  z-index: 999; /* Higher than your nav's 9999 */
  display: flex;
  justify-content: center;
  pointer-events: none; /* Keep this: allows clicks to pass through to items below if needed */
}

.category-banner {
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 10px 24px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 15px;
  pointer-events: auto; /* Enable clicking on the banner itself */
  cursor: default;
}

.cat-item {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 700;
  transition: color 0.4s ease;
  cursor: pointer;
  
  /* ADD THIS: larger tap target */
  padding: 15px 10px; 
  margin: -10px 0; 
  display: inline-block;
}

.cat-item.active {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.cat-separator {
  color: rgba(255, 255, 255, 0.1);
  font-weight: 300;
}

.cat-item, .carousel-prev, .carousel-next {
  -webkit-tap-highlight-color: transparent;
}

/* -----------------------------
   TEAM SECTION
------------------------------ */

.team-members {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.team-member,
.advisor {
  flex: 1;
  text-align: center;
}

.profile-bubble {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Media query for smaller screens */
@media (max-width: 1024px) {
  .work-item {
    flex: 0 0 50%; /* 2 items visible */
  }
  .team-members {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .work-item {
    flex: 0 0 100%; /* 1 item visible */
  }
  .carousel-prev,
  .carousel-next {
    padding: 0.8rem 1rem; /* Slightly smaller for mobile */
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.7); /* Darker so they are visible over images */
  }
  .carousel-prev { left: 10px; }
  .carousel-next { right: 10px; }
}

/* -----------------------------
   TYPOGRAPHY
------------------------------ */
.editorial small {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.editorial h2 {
  font-size: 2.2rem;
  font-weight: 400;
  margin-bottom: 2rem;
}

.editorial .lead {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 1.5rem;
  max-width: 60ch;
}

.editorial p {
  max-width: 60ch;
}

/* -----------------------------
   SIDE COLUMN
------------------------------ */
.block {
  margin-bottom: 3rem;
}

dl {
  margin: 0;
}

dt {
  font-weight: 500;
  margin-top: 1.5rem;
}

dd {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

/* -----------------------------
   CONTACT
------------------------------ */
.contact {
  border-top: 1px solid var(--border);
  padding-top: 8rem;
}

.contact a {
  color: var(--text);
  text-decoration: none;
}

/* -----------------------------
   FOOTER
------------------------------ */
footer {
  padding: 2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* LOGO STYLING */
.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 42px;           /* Adjust this size to your liking */
  width: auto;
  max-width: 180px;
  transition: transform 0.3s ease;
}

.logo-img:hover {
  transform: scale(1.05);
}

/* Optional: If you want to keep the text "INNOFIRE" next to the image */
.logo-text {
  margin-left: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 1.4rem;
}