/* Font variables (Next.js injected these at runtime; here we map them to
   the Google-Fonts families loaded in index.php). */
:root {
  --font-geist-sans: 'Geist', 'Helvetica Neue', Arial, sans-serif;
  --font-geist-mono: 'Geist Mono', ui-monospace, monospace;
}

/* ========================================
   RESET & BASE
   ======================================== */

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html,
body {
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  background: #cecece;
  color: #000;
  font-family: var(--font-geist-sans), "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
  background: #000;
  color: #fff;
}
::-moz-selection {
  background: #000;
  color: #fff;
}

/* Links */
a {
  color: #000;
  text-decoration: underline;
}
a:hover {
  opacity: 0.7;
}

/* ========================================
   LOGO (fixed top-left)
   ======================================== */

.logo {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  font-family: var(--font-geist-sans), sans-serif;
  font-weight: 900;
  font-size: 24px;
  line-height: 1;
  color: #000;
  text-decoration: none;
  letter-spacing: 1px;
}
.logo:hover {
  opacity: 1;
}

/* ========================================
   BURGER MENU (fixed top-right)
   ======================================== */

.burger {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  width: 28px;
  height: 22px;
  cursor: pointer;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
}

.burger-line {
  display: block;
  width: 100%;
  height: 5px;
  background: #000;
  border-radius: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Burger open state - X shape (translateY = container/2 - line/2 = 11 - 2.5) */
.burger.open .burger-line:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
}
.burger.open .burger-line:nth-child(2) {
  opacity: 0;
}
.burger.open .burger-line:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
}

/* ========================================
   MOBILE MENU OVERLAY
   ======================================== */

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #cecece;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.menu-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.menu-content {
  width: 360px;
  text-align: center;
  font-size: 16px;
  line-height: 1.4;
  /* Avoid orphan words (e.g. a lone "smile.") at any device font size. */
  text-wrap: pretty;
}

.menu-content a:link,
.menu-content a:visited,
.menu-content a:hover,
.menu-content a:active {
  color: #000;
  text-decoration: underline;
  cursor: pointer;
}

.menu-mail3r-link,
.menu-doc3-link {
  color: #000;
  text-decoration: underline;
  cursor: pointer;
}

@media (min-width: 641px) and (max-width: 1280px) {
  .menu-content { font-size: 17px; width: 360px; }
}
@media (min-width: 1281px) and (max-width: 1899px) {
  .menu-content { font-size: 17px; width: 360px; }
}
@media (min-width: 1900px) and (max-width: 2999px) {
  .menu-content { font-size: 18px; width: 360px; }
}
@media (min-width: 3000px) {
  .menu-content { font-size: 19px; width: 360px; }
}

/* ========================================
   MAIN CONTAINER - Responsive widths
   ======================================== */

#container {
  width: 100%;
  margin: 0 auto;
  padding: 0 12px;
  padding-top: 60px;
  min-width: 360px;
}

/* 0 - 640px */
@media (max-width: 640px) {
  #container {
    max-width: 640px;
  }
}

/* 641 - 1280px */
@media (min-width: 641px) and (max-width: 1280px) {
  #container {
    max-width: 640px;
  }
}

/* 1281 - 1899px */
@media (min-width: 1281px) and (max-width: 1899px) {
  #container {
    max-width: 720px;
  }
}

/* 1900 - 2999px */
@media (min-width: 1900px) and (max-width: 2999px) {
  #container {
    max-width: 860px;
  }
}

/* 3000px+ */
@media (min-width: 3000px) {
  #container {
    max-width: 1080px;
  }
}

@media (min-width: 720px) {
  #container {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ========================================
   PROJECT CARD
   ======================================== */

.project-card {
  margin-top: 25%;
  /* Keep hash-scroll targets clear of the fixed logo/burger. */
  scroll-margin-top: 70px;
}

.project-card:first-child {
  margin-top: 100px;
}

/* Project header: name + description */
.project-header {
  margin-bottom: 8px;
}

.project-name {
  font-weight: 700;
  font-size: 18px;
}

.project-description {
  font-size: 18px;
}

.project-info-toggle {
  font-size: 17px;
  color: #000;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  margin-left: 4px;
}

.project-description2 {
  font-size: 17px;
  margin-top: 6px;
  line-height: 1.6;
  color: #333;
  width: 90%;
  text-wrap: pretty;
}

/* Spacer */
.project-spacer {
  height: 12px;
}

/* Info bar */
.project-info-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 16px;
  gap: 0;
}

.project-info-item {
  padding: 2px 10px;
  border-right: 1px solid #999;
  white-space: nowrap;
}

.project-info-item:first-child {
  padding-left: 0;
}

/* Last info-item (a span); :last-of-type keeps it border-less even though the
   link button follows it in the bar. */
.project-info-item:last-of-type {
  border-right: none;
}

.project-info-item a {
  font-size: 16px;
}

/* Small "ARCHIVED" tag rendered after a project's link. */
.project-archived {
  margin-left: 6px;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: #999;
  vertical-align: middle;
}

/* Right-aligned copy-link button */
.project-link-btn {
  margin-left: auto;
  padding: 0 0 0 10px;
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.project-link-btn:hover {
  opacity: 1;
}

.project-link-btn img {
  width: 16px;
  height: 16px;
  display: block;
  position: relative;
  top: 3px;
}

/* Hero image — fixed 2:1 box on desktop, image cropped to fill. The
   aspect-ratio reserves the height before the image loads (no layout shift);
   the background shows while loading, behind the spinner. */
.project-hero {
  position: relative;
  width: 100%;
  margin-top: 12px;
  aspect-ratio: 2 / 1;
  background: #c4c4c4;
}

/* Per-project loading spinner, centered on the hero; hidden once the project's
   images have loaded. */
.project-hero-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid rgba(0, 0, 0, 0.18);
  border-top-color: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  animation: hero-spin 0.8s linear infinite;
  z-index: 4;
  pointer-events: none;
}

.project-hero-spinner.hidden {
  display: none;
}

@keyframes hero-spin {
  to {
    transform: rotate(360deg);
  }
}

/* "Project Link Copied" overlay, centered on the hero image */
.project-link-copied {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}

.project-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Mobile: force a 16:9 hero box and center the image within it. */
@media (max-width: 719px) {
  .project-hero {
    aspect-ratio: 16 / 9;
  }
}

/* ========================================
   IMAGE CAROUSEL
   ======================================== */

.carousel-wrapper {
  position: relative;
  margin-top: 5px;
  width: 100%;
}

/* --- Mobile: horizontal scroll --- */
@media (max-width: 719px) {
  .carousel-track {
    display: flex;
    gap: 5px;
    /* Reserve the row height up front so the page doesn't jump as media loads. */
    min-height: 160px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .carousel-track::-webkit-scrollbar {
    display: none;
  }

  .carousel-track img {
    flex-shrink: 0;
    height: 160px;
    width: auto;
    scroll-snap-align: start;
    display: block;
  }

  .carousel-arrow {
    display: none;
  }
}

/* --- Desktop: arrows + overflow hidden --- */
@media (min-width: 720px) {
  .carousel-track {
    display: flex;
    gap: 5px;
    height: 160px;
    overflow: hidden;
    scroll-behavior: smooth;
  }

  .carousel-track img {
    flex-shrink: 0;
    height: 160px;
    width: auto;
    display: block;
  }

  .carousel-arrow {
    position: absolute;
    top: 0;
    height: 160px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    transition: background 0.2s ease;
    user-select: none;
  }

  .carousel-arrow img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    pointer-events: none;
  }

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

  .carousel-arrow.left {
    left: 0;
    border-radius: 0;
  }

  .carousel-arrow.right {
    right: 0;
    border-radius: 0;
  }

  .carousel-arrow.hidden {
    display: none;
  }
}

/* --- Custom scroll indicator --- */
/* Shown on both desktop and mobile (desktop also has arrows). A pure-div
   pill so it renders identically across Chrome, Safari, Firefox, and Edge. */
.carousel-scrollbar {
  display: block;
  position: relative;
  width: 48px;
  height: 3px;
  margin: 8px auto 0;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.carousel-scrollbar-thumb {
  position: absolute;
  top: 0;
  height: 100%;
  min-width: 8px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
}

/* --- Video / GIF thumbnails in carousel --- */

.carousel-video-thumb,
.carousel-gif-thumb {
  position: relative;
  flex-shrink: 0;
  height: 160px;
  cursor: pointer;
  scroll-snap-align: start;
  display: block;
}

/* GIF thumb: static first-frame image with a play overlay; the animated gif
   plays in the lightbox on click. */
.carousel-gif-thumb > img {
  height: 100%;
  width: auto;
  display: block;
  pointer-events: none;
}

/* Vertical hero video: box the skinny thumbnail in a dark grey square so it
   reads as a larger, more obvious click target. */
.carousel-video-thumb--square {
  width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2e2e2e;
}

.carousel-video-thumb--square > video,
.carousel-video-thumb--square > img {
  width: auto;
  height: 100%;
}

.carousel-video-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.carousel-video-thumb > video,
.carousel-video-thumb > img {
  height: 100%;
  width: auto;
  display: block;
  pointer-events: none;
}

/* Small play icon in the top-right corner (mp4 + gif) — keeps the thumbnail
   visible instead of a large centered overlay. */
.carousel-play-corner {
  position: absolute;
  top: 6px;
  right: 6px;
  pointer-events: none;
  z-index: 1;
}

.carousel-play-corner img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* MP4 duration, bottom-center. */
.carousel-video-duration {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  z-index: 1;
  pointer-events: none;
  font-family: monospace;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* ========================================
   IMAGE LIGHTBOX
   ======================================== */

.image-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.image-lightbox-img {
  display: block;
  cursor: default;
  object-fit: contain;
}

/* Mobile: fill 96% of the width, height follows the aspect ratio. */
@media (max-width: 719px) {
  .image-lightbox-img {
    width: 96%;
    height: auto;
  }
}

/* Desktop: scale up until the limiting edge (set by screen vs. image
   aspect ratio) reaches 90% of the viewport. object-fit keeps the aspect
   ratio while allowing the image to grow past its intrinsic size. */
@media (min-width: 720px) {
  .image-lightbox-img {
    width: 90vw;
    height: 90vh;
    object-fit: contain;
  }
}

/* Absolute caps on the long edge, by media type, at any viewport size.
   object-fit: contain keeps the aspect ratio when a cap binds. */
.image-lightbox-img--image {
  max-width: 960px;
  max-height: 960px;
}
.image-lightbox-img--gif {
  max-width: 640px;
  max-height: 640px;
}
/* Video: the long edge is forced to 800px via an inline width/height set in
   JS (see fitVideo), so the element matches the video's aspect ratio exactly.
   These rules are the pre-metadata fallback and viewport guard. */
.image-lightbox-img--video {
  width: auto;
  height: auto;
  max-width: 96vw;
  max-height: 90vh;
  object-fit: contain;
}

/* ========================================
   ROLES / TAGS
   ======================================== */

.project-roles {
  margin-top: 12px;
  font-size: 16px;
  color: #555;
  line-height: 1.6;
}

/* ========================================
   VIDEO MODAL
   ======================================== */

.video-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.video-modal-content {
  width: 90%;
  max-width: 800px;
  cursor: default;
}

.video-modal-content video {
  width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   SITE FOOTER
   ======================================== */

.site-footer {
  margin-top: 150px;
  margin-bottom: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: #555;
}

.site-footer-heart {
  width: 9px;
  height: auto;
  display: block;
}


/* ---- Export-only rules (replace React conditional rendering) ---- */
.project-info-extra { display: none; }
.project-info-extra.open { display: block; }
.project-link-copied { display: block; }
