/* ==========================================================================
   PAOLO MASSACCI — PORTFOLIO WEBSITE
   Domain: paolomassacci.com
   Aesthetic: Ultra-clean, Minimalist Industrial & Product Design Gallery
   Pure white background, uncropped media, smaller refined typography
   ========================================================================== */

:root {
  --bg-color: #ffffff;
  --text-primary: #0a0a0a;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border-light: rgba(0, 0, 0, 0.1);
  --border-dark: #000000;
  --accent-color: #000000;
  --nav-height: 58px;
  
  /* Typography: bold Arial Black for titles, clean sans-serif for body */
  --font-heading: "Arial Black", "Arial-BoldMT", Gadget, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Consolas", "Courier New", monospace;
  
  --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 13.5px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: #ffffff !important;
  background-image: none !important; /* Cross pattern background removed */
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   TOP NAVIGATION
   - Top Right: HOME
   - Top Left: ABOUT
   ========================================================================== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}

.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--border-light);
  background: #ffffff;
  position: relative;
  transition: all 0.2s ease;
  user-select: none;
}

.nav-button:hover,
.nav-button.active {
  border-color: var(--text-primary);
  background: #000000;
  color: #ffffff;
}

.nav-cad-cross {
  display: none !important;
}

.nav-center-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.nav-brand-title {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-brand-meta {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ==========================================================================
   HOMEPAGE LAYOUT (LAPTOP MODE — HORIZONTAL SCROLL)
   ========================================================================== */
.home-page {
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.horizontal-slider-wrapper {
  width: 100vw;
  height: 100vh;
  padding-top: var(--nav-height);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.slider-track {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 48px;
  padding: 0 40px;
  width: 100%;
  height: calc(100vh - var(--nav-height));
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

/* Project Card on Homepage: Smaller, No Frames, Uncropped */
.project-card {
  flex: 0 0 auto;
  width: 380px;
  max-width: 52vw;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
  cursor: pointer;
  transition: transform 0.25s var(--transition-smooth), opacity 0.2s ease;
}

.project-card:hover {
  transform: translateY(-4px);
}

/* Crucial: Child elements ignore pointer events so clicks reliably navigate */
.project-card * {
  pointer-events: none;
}

/* Frameless Media Box */
.card-media-box {
  width: 100%;
  height: 38vh;
  min-height: 240px;
  max-height: 380px;
  position: relative;
  background: #ffffff;
  border: none !important; /* Frames removed */
  box-shadow: none !important; /* Shadow frames removed */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-media-box::before,
.card-media-box::after {
  display: none !important; /* Frame cross marks removed */
}

/* Image/Video: Uncropped (contain) & Smaller */
.card-media-box img,
.card-media-box video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important; /* DO NOT CROP */
  display: block;
  background: #ffffff;
  transition: transform 0.35s var(--transition-smooth);
}

.project-card:hover .card-media-box img,
.project-card:hover .card-media-box video {
  transform: scale(1.02);
}

.video-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  padding: 3px 6px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 6;
  text-transform: uppercase;
}

/* Project Name: bold Arial Black, Smaller */
.card-info {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1.5px solid var(--text-primary);
  padding-top: 8px;
}

.card-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.1rem; /* Smaller Arial Black */
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-cad-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ==========================================================================
   HOMEPAGE NAVIGATION ARROWS
   ========================================================================== */
.slider-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  transition: all 0.2s ease;
  user-select: none;
}

.slider-arrow:hover {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

.slider-arrow-left {
  left: 20px;
}

.slider-arrow-right {
  right: 20px;
}

.arrow-icon-horiz {
  display: inline-block;
}

.arrow-icon-vert {
  display: none;
}

.bottom-cad-bar {
  display: none !important;
}

/* ==========================================================================
   PROJECT & ABOUT PAGES
   - Text at the top (smaller refined fonts)
   - Desktop Mode: Vertical scrolling image gallery under the text!
   - Button at the end bringing back to homepage
   ========================================================================== */
.page-container {
  max-width: 960px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 36px) 32px 80px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Project Header & Text Section at Top */
.project-header-section {
  max-width: 720px;
  margin: 0 auto 48px auto;
  width: 100%;
  position: relative;
}

.project-breadcrumbs {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem); /* Smaller title */
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.cad-rule {
  width: 100%;
  height: 1.5px;
  background: var(--text-primary);
  margin-bottom: 20px;
  position: relative;
}

.cad-rule::after {
  display: none !important;
}

/* Text Description from Notes File: Refined, Smaller */
.project-description-text {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #2b2b2b;
  font-weight: 400;
  white-space: pre-line;
}

.project-description-text p {
  margin-bottom: 1.2em;
}

.project-description-text p:last-child {
  margin-bottom: 0;
}

/* Project Metadata Block */
.project-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-light);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.meta-item-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}

.meta-item-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* ==========================================================================
   PROJECT PAGES: VERTICAL SCROLLING IMAGES IN DESKTOP MODE
   - Images scroll vertically under the text
   - No cropping (object-fit: contain)
   - Smaller & frameless
   ========================================================================== */
.gallery-section {
  width: 100%;
  max-width: 780px;
  margin: 0 auto 56px auto;
  position: relative;
}

.gallery-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.gallery-section-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Hide horizontal scroll buttons on desktop since images scroll vertically */
.gallery-controls,
.gallery-scroll-arrow {
  display: none !important;
}

/* Vertical scrolling track in Desktop mode */
.gallery-scroll-track {
  display: flex !important;
  flex-direction: column !important; /* VERTICAL SCROLL */
  align-items: center !important;
  gap: 36px !important;
  width: 100% !important;
  overflow: visible !important;
  padding: 0 !important;
}

/* Gallery Item: Frameless & Smaller */
.gallery-item {
  width: 100%;
  max-width: 680px;
  height: auto;
  max-height: 520px;
  background: #ffffff;
  border: none !important; /* Frames removed */
  box-shadow: none !important; /* Shadow frames removed */
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.gallery-item:hover {
  transform: translateY(-2px);
}

.gallery-item::before,
.gallery-item::after {
  display: none !important; /* Corner marks removed */
}

/* Gallery Images & Videos: Uncropped (contain) & Smaller */
.gallery-item img,
.gallery-item video {
  max-width: 100%;
  max-height: 520px;
  width: auto;
  height: auto;
  object-fit: contain !important; /* DO NOT CROP */
  display: block;
  margin: 0 auto;
  background: #ffffff;
}

/* Multi-column Grid Alternative */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.grid-item {
  background: #ffffff;
  border: none !important;
  box-shadow: none !important;
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 280px;
}

.grid-item img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain !important; /* DO NOT CROP */
  display: block;
}

/* ==========================================================================
   BUTTON AT END OF PAGE (BRINGS BACK TO HOMEPAGE)
   ========================================================================== */
.end-page-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 32px;
  padding: 36px 0;
  border-top: 1.5px solid var(--text-primary);
  position: relative;
  width: 100%;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.end-page-actions::before {
  display: none !important;
}

.back-home-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  background: #000000;
  padding: 12px 28px;
  text-decoration: none;
  border: 1px solid #000000;
  position: relative;
  transition: all 0.2s ease;
  user-select: none;
}

.back-home-button:hover {
  background: #ffffff;
  color: #000000;
  transform: translateY(-2px);
}

.project-nav-pagination {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.pagination-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.pagination-link:hover {
  border-color: var(--text-primary);
  background: #ffffff;
}

/* ==========================================================================
   ABOUT PAGE SPECIFIC STYLES
   ========================================================================== */
.about-hero-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 36px;
  align-items: flex-start;
  margin-bottom: 48px;
}

.about-portrait-card {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  background: #ffffff;
  border: none !important; /* Frames removed */
  box-shadow: none !important;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.about-portrait-card img {
  width: 100%;
  max-width: 260px;
  height: auto;
  max-height: 340px;
  object-fit: contain !important; /* DO NOT CROP */
  display: block;
  border: none !important;
}

.about-portrait-caption {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-align: center;
}

.about-section-heading {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin: 28px 0 12px 0;
  text-transform: uppercase;
  border-bottom: 1px solid var(--text-primary);
  padding-bottom: 4px;
}

.about-list {
  list-style: none;
  margin-bottom: 20px;
}

.about-list li {
  position: relative;
  padding-left: 14px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  line-height: 1.55;
}

.about-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.8rem;
  color: var(--text-primary);
}

.contact-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.contact-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  padding: 6px 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.contact-pill:hover {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

/* ==========================================================================
   LIGHTBOX MODAL (FOR FULL RES INSPECTION)
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lightbox-modal.active {
  display: flex;
  opacity: 1;
}

.lightbox-content-box {
  max-width: 90vw;
  max-height: 85vh;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-content-box img,
.lightbox-content-box video {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border: none !important;
  box-shadow: none !important;
}

.lightbox-close-btn {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: #000000;
  color: #ffffff;
  border: none;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  z-index: 2100;
}

.lightbox-close-btn:hover {
  transform: scale(1.06);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: #000000;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2100;
}

.lightbox-nav-btn:hover {
  background: #000000;
  color: #ffffff;
}

.lightbox-btn-prev {
  left: 20px;
}

.lightbox-btn-next {
  right: 20px;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (MOBILE MODE — VERTICAL SCROLL)
   ========================================================================== */
@media (max-width: 820px) {
  :root {
    --nav-height: 52px;
  }
  
  .top-nav {
    padding: 0 16px;
  }
  
  .nav-button {
    padding: 5px 10px;
    font-size: 0.68rem;
  }
  
  .nav-brand-title {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }
  
  .nav-brand-meta {
    font-size: 0.52rem;
  }
  
  /* HOMEPAGE MOBILE: VERTICAL SCROLLING */
  .home-page {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }
  
  .horizontal-slider-wrapper {
    height: auto;
    min-height: 100vh;
    padding-top: calc(var(--nav-height) + 16px);
    padding-bottom: 70px;
    overflow: visible;
  }
  
  .slider-track {
    flex-direction: column;
    align-items: center;
    gap: 36px;
    padding: 0 16px;
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
    scroll-snap-type: none;
  }
  
  .project-card {
    width: 100%;
    max-width: 100%;
    scroll-snap-align: none;
  }

  .project-card.clone-card {
    display: none !important;
  }
  
  .card-media-box {
    height: 44vh;
    min-height: 240px;
  }
  
  .card-title {
    font-size: 1.05rem;
  }
  
  /* Mobile Navigation Arrows: Vertical Floating Pill on Bottom Right */
  .slider-arrow {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    right: 16px;
    left: auto;
    transform: none;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  }
  
  .slider-arrow-left {
    top: auto;
    bottom: 64px; /* UP arrow */
  }
  
  .slider-arrow-right {
    top: auto;
    bottom: 16px; /* DOWN arrow */
  }
  
  .arrow-icon-horiz {
    display: none;
  }
  
  .arrow-icon-vert {
    display: inline-block;
  }
  
  /* PROJECT & ABOUT MOBILE */
  .page-container {
    padding: calc(var(--nav-height) + 20px) 16px 50px 16px;
  }
  
  .about-hero-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .about-portrait-card {
    position: static;
    max-width: 240px;
    margin: 0 auto 24px auto;
  }
  
  .gallery-item {
    max-width: 100%;
    max-height: 380px;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .back-home-button {
    padding: 12px 24px;
    font-size: 0.78rem;
    width: 100%;
    justify-content: center;
  }
  
  .lightbox-nav-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .lightbox-btn-prev {
    left: 8px;
  }
  
  .lightbox-btn-next {
    right: 8px;
  }
}
