/* ==========================================================================
   PAOLO MASSACCI — PORTFOLIO WEBSITE
   Domain: paolomassacci.com
   Aesthetic: CAD Drawing / Technical Drafting Blueprint
   ========================================================================== */

:root {
  --bg-color: #ffffff;
  --cad-cross-color: rgba(0, 0, 0, 0.16);
  --cad-grid-size: 36px;
  --text-primary: #0a0a0a;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border-light: rgba(0, 0, 0, 0.12);
  --border-dark: #000000;
  --accent-color: #000000;
  --nav-height: 72px;
  
  /* Typography */
  --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: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-color);
  /* CAD drawing tiny transparent grey crosses */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cpath d='M15 18h6M18 15v6' stroke='%23000000' stroke-opacity='0.16' stroke-width='1' stroke-linecap='square'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-attachment: fixed;
  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 40px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.88);
  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: 8px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  padding: 8px 18px;
  border: 1.5px solid var(--border-light);
  background: #ffffff;
  position: relative;
  transition: all 0.2s ease;
  user-select: none;
}

.nav-button::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: 5px;
  height: 5px;
  border-top: 1.5px solid var(--text-primary);
  border-left: 1.5px solid var(--text-primary);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nav-button::after {
  content: "";
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 5px;
  height: 5px;
  border-bottom: 1.5px solid var(--text-primary);
  border-right: 1.5px solid var(--text-primary);
  opacity: 0;
  transition: opacity 0.2s ease;
}

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

.nav-button:hover::before,
.nav-button:hover::after,
.nav-button.active::before,
.nav-button.active::after {
  opacity: 1;
}

.nav-cad-cross {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  opacity: 0.6;
}

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

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

.nav-brand-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  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: 60px;
  padding: 0 10vw;
  width: 100%;
  height: calc(100vh - var(--nav-height));
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none; /* Firefox */
}

.slider-track::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Project Card on Homepage */
.project-card {
  flex: 0 0 auto;
  width: 580px;
  max-width: 72vw;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  scroll-snap-align: center;
  position: relative;
  transition: transform 0.3s var(--transition-smooth);
}

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

.card-media-box {
  width: 100%;
  height: 58vh;
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover .card-media-box {
  border-color: var(--text-primary);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.09);
}

/* CAD Technical Corner Crosses on Media Box */
.card-media-box::before,
.card-media-box::after {
  content: "+";
  position: absolute;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  color: rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 5;
}

.card-media-box::before {
  top: 10px;
  left: 10px;
}

.card-media-box::after {
  bottom: 10px;
  right: 10px;
}

.card-media-box img,
.card-media-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--transition-smooth);
}

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

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

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

.card-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  text-transform: none;
}

.card-cad-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* Navigation Arrows (Horizontal on Laptop) */
.slider-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid var(--border-light);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 500;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  user-select: none;
}

.slider-arrow:hover {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
}

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

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

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

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

/* Bottom Technical Coordinates Bar */
.bottom-cad-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 36px;
  background: rgba(255, 255, 255, 0.85);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  z-index: 100;
  pointer-events: none;
}

/* ==========================================================================
   PROJECT & ABOUT PAGES
   - Text at the top
   - Scrolling section with images under it
   - Button at the end bringing back to homepage
   ========================================================================== */
.page-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 48px) 32px 80px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Project Header & Text Section at Top */
.project-header-section {
  max-width: 900px;
  margin-bottom: 56px;
  position: relative;
}

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

.page-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: var(--text-primary);
}

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

.cad-rule::after {
  content: "┼";
  position: absolute;
  right: 0;
  top: -8px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-primary);
}

/* Text Description from Notes File */
.project-description-text {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #222222;
  font-weight: 400;
  white-space: pre-line;
}

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

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

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

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

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

/* ==========================================================================
   SCROLLING SECTION WITH IMAGES (PROJECT & ABOUT)
   ========================================================================== */
.gallery-section {
  width: 100%;
  margin-bottom: 64px;
  position: relative;
}

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

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

.gallery-controls {
  display: flex;
  gap: 10px;
}

.gallery-scroll-btn {
  width: 38px;
  height: 38px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.gallery-scroll-btn:hover {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

/* Horizontal Gallery Rail */
.gallery-scroll-track {
  display: flex;
  flex-direction: row;
  gap: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 24px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}

.gallery-scroll-track::-webkit-scrollbar {
  height: 6px;
}

.gallery-scroll-track::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

.gallery-item {
  flex: 0 0 auto;
  width: 480px;
  max-width: 85vw;
  height: 520px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  border-color: var(--text-primary);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Corner CAD Crosses on Gallery Items */
.gallery-item::before,
.gallery-item::after {
  content: "+";
  position: absolute;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1;
  color: rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 2;
}

.gallery-item::before {
  top: 8px;
  left: 8px;
}

.gallery-item::after {
  bottom: 8px;
  right: 8px;
}

/* Multi-column Grid Alternative for deep project exploration */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.grid-item {
  aspect-ratio: 4 / 3;
  background: #ffffff;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.grid-item:hover {
  transform: translateY(-3px);
  border-color: var(--text-primary);
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   BUTTON AT END OF PAGE (BRINGS BACK TO HOMEPAGE)
   ========================================================================== */
.end-page-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
  padding: 48px 0;
  border-top: 2px solid var(--text-primary);
  position: relative;
}

.end-page-actions::before {
  content: "┼";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-color);
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.back-home-button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  background: #000000;
  padding: 18px 40px;
  text-decoration: none;
  border: 2px solid #000000;
  position: relative;
  transition: all 0.25s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.back-home-button:hover {
  background: #ffffff;
  color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

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

.pagination-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  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 380px;
  gap: 48px;
  align-items: flex-start;
  margin-bottom: 56px;
}

.about-portrait-card {
  position: sticky;
  top: calc(var(--nav-height) + 32px);
  background: #ffffff;
  border: 1px solid var(--border-light);
  padding: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.05);
}

.about-portrait-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  border: 1px solid var(--border-light);
}

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

.about-section-heading {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin: 36px 0 16px 0;
  text-transform: uppercase;
  border-bottom: 1.5px solid var(--text-primary);
  padding-bottom: 6px;
}

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

.about-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  font-size: 1.05rem;
  line-height: 1.6;
}

.about-list li::before {
  content: "┼";
  position: absolute;
  left: 0;
  top: 1px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.contact-pill {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  padding: 8px 16px;
  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.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s 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;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-light);
}

.lightbox-close-btn {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 48px;
  height: 48px;
  background: #000000;
  color: #ffffff;
  border: none;
  font-size: 1.8rem;
  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.08);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  color: #000000;
  font-size: 1.4rem;
  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: 24px;
}

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

/* ==========================================================================
   MOBILE RESPONSIVENESS (MOBILE MODE — VERTICAL SCROLL)
   ========================================================================== */
@media (max-width: 820px) {
  :root {
    --nav-height: 64px;
  }
  
  .top-nav {
    padding: 0 16px;
  }
  
  .nav-button {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  
  .nav-brand-title {
    font-size: 0.9rem;
    letter-spacing: 0.08em;
  }
  
  .nav-brand-meta {
    font-size: 0.58rem;
  }
  
  /* 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) + 20px);
    padding-bottom: 80px;
    overflow: visible;
  }
  
  .slider-track {
    flex-direction: column;
    align-items: center;
    gap: 48px;
    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;
  }
  
  .card-media-box {
    height: 52vh;
    min-height: 320px;
  }
  
  .card-title {
    font-size: 1.3rem;
  }
  
  /* Mobile Navigation Arrows: Vertical Floating Pill on Bottom Right */
  .slider-arrow {
    width: 46px;
    height: 46px;
    font-size: 1.2rem;
    right: 18px;
    left: auto;
    transform: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  }
  
  .slider-arrow-left {
    top: auto;
    bottom: 74px; /* UP arrow */
  }
  
  .slider-arrow-right {
    top: auto;
    bottom: 20px; /* DOWN arrow */
  }
  
  .arrow-icon-horiz {
    display: none;
  }
  
  .arrow-icon-vert {
    display: inline-block;
  }
  
  .bottom-cad-bar {
    display: none;
  }
  
  /* PROJECT & ABOUT MOBILE */
  .page-container {
    padding: calc(var(--nav-height) + 24px) 16px 60px 16px;
  }
  
  .about-hero-layout {
    grid-template-columns: 1fr;
  }
  
  .about-portrait-card {
    position: static;
    max-width: 320px;
    margin: 0 auto 32px auto;
  }
  
  .gallery-item {
    width: 300px;
    height: 380px;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .back-home-button {
    padding: 16px 28px;
    font-size: 1rem;
    width: 100%;
    justify-content: center;
  }
  
  .lightbox-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  
  .lightbox-btn-prev {
    left: 10px;
  }
  
  .lightbox-btn-next {
    right: 10px;
  }
}
