/* ============================================================
   HOME — homepage-specific styles.
   Loads after base.css; assumes all CSS variables and shared
   components (nav, preloader, scroll-hint, .btn, .btn-outline,
   footer.site-footer) are already defined there.
   ============================================================ */

/* ---------- SHOWREEL HERO ---------- */
#showreel {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#showreel .reel-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #2a2a2a 0%, #0a0a0a 60%);
}

/* object-fit: cover fills the section edge-to-edge regardless of the
   video's native aspect ratio vs. the viewport's.
   pointer-events: none prevents the video from swallowing wheel/touch
   scroll events — without it, scrolling over the video does nothing. */
#showreel .reel-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  pointer-events: none;
}

#showreel .reel-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

#showreel .reel-title {
  font-size: clamp(56px, 11vw, 150px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 0.95;
  text-shadow:
    0 0 40px rgba(244, 244, 240, 0.7),
    0 0 100px rgba(244, 244, 240, 0.3),
    0 6px 32px rgba(0, 0, 0, 0.9);
}

#showreel .reel-sub {
  margin-top: 20px;
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

#showreel .mute-toggle {
  position: absolute;
  z-index: 2;
  bottom: 32px;
  left: 32px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--fg-faint);
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.4);
  backdrop-filter: blur(8px);
  color: var(--fg);
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

#showreel .mute-toggle:hover {
  background: rgba(10, 10, 10, 0.65);
  border-color: var(--fg-muted);
}

#showreel .mute-toggle svg {
  width: 20px;
  height: 20px;
}

#showreel .mute-toggle .icon-unmuted {
  display: none;
}

#showreel .mute-toggle.is-muted .icon-muted {
  display: block;
}

#showreel .mute-toggle.is-muted .icon-unmuted {
  display: none;
}

#showreel .mute-toggle:not(.is-muted) .icon-muted {
  display: none;
}

#showreel .mute-toggle:not(.is-muted) .icon-unmuted {
  display: block;
}

/* ---------- ABOUT SECTION ---------- */
#about {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#about .about-inner {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 64px;
  align-items: center;
  width: min(1100px, 90vw);
}

#about .about-photo-wrap {
  position: relative;
  width: 360px;
  height: 440px;
  border-radius: 12px;
  overflow: visible;
}

#about .about-photo {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  background: linear-gradient(160deg, #3a3a3a, #161616);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.skill-icon {
  position: absolute;
  width: 56px;
  height: 56px;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}

.skill-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
}

.skill-icon:active { cursor: grabbing; }

#about .about-eyebrow {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 244, 240, 0.5);
  margin-bottom: 18px;
}

#about .about-line {
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.5;
  font-weight: 500;
  overflow: hidden;
}

#about .about-line span { display: inline-block; }

/* ---------- EXPLORE / WINDOW MANAGER ---------- */

/* tall enough to comfortably fit heading + menu + canvas together.
   left/right: 0 rather than width: 100% through flex keeps horizontal
   bounds consistent when GSAP wraps this in a pin-spacer. */
#explore {
  position: relative;
  width: 100%;
  padding: 0 0 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* z-index: while pinned, this becomes position:fixed with content
   taller than most viewports (heading + menu + canvas + button), so
   its bottom edge (the button) can sit right where #explore-exit's
   pin-spacer begins. Both are z-index:auto positioned elements, so
   without this, #explore-exit — later in the DOM — paints on top and
   silently swallows clicks on the button while still pinned. */
#explore-intro {
  position: relative;
  left: 0;
  right: 0;
  min-height: 75vh;
  width: 100%;
  z-index: 2;
}

#explore-intro-fade {
  width: 100%;
  padding: 140px 0 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  box-sizing: border-box;
}

#explore .explore-heading {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 244, 240, 0.5);
}

#category-menu {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  z-index: 5;
}

/* the bounded canvas that contains all draggable windows */
#window-canvas {
  position: relative;
  width: min(1100px, 92vw);
  height: 540px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background:
    linear-gradient(rgba(244, 244, 240, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 244, 240, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  overflow: hidden;
}

#window-canvas .canvas-empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* dedicated, fixed-height pin target for explore's exit fade —
   avoids pinning a parent whose height depends on a nested pinned
   child, which causes empty-gap / miscalculated-height bugs. */
#explore-exit {
  position: relative;
  left: 0;
  right: 0;
  height: 60vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- DRAGGABLE WINDOW CHROME ---------- */
.win {
  position: absolute;
  background: #1c1c1c;
  border: 1px solid rgba(244, 244, 240, 0.15);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: default;
}

.win-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 8px 12px;
  background: #262626;
  border-bottom: 1px solid rgba(244, 244, 240, 0.1);
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}

.win-titlebar:active { cursor: grabbing; }

.win-title {
  font-size: 11px;
  letter-spacing: 0.05em;
  color: rgba(244, 244, 240, 0.65);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win-close {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #555;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 10px;
  transition: background 0.15s;
}

.win-close:hover { background: #d9534f; }

.win-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.win-body img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* ---------- HOMEPAGE FOOTER OVERRIDE ---------- */
/* base.css footer.site-footer is min-height: 60vh with padding.
   The homepage footer is a full-screen closing beat instead. */
footer.site-footer {
  height: 100vh;
  padding: 0;
}

footer.site-footer .big { font-size: clamp(36px, 6vw, 72px); }

/* ---------- MOBILE ---------- */
@media (max-width: 768px) {
  #about {
    height: auto;
    padding: 72px 0 64px;
    align-items: flex-start;
  }

  #about .about-inner {
    grid-template-columns: 1fr;
    gap: 36px;
    width: 88vw;
  }

  #about .about-photo-wrap {
    width: 100%;
    height: 240px;
  }

  .skill-icon {
    width: 44px;
    height: 44px;
  }

  #explore-intro-fade {
    padding: 100px 0 36px;
    gap: 20px;
  }

  #window-canvas {
    height: 320px;
  }
}
