/* =============================================
   Netflix-Style Portfolio — Styles
   ============================================= */

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

html {
  scroll-behavior: smooth;
}

body {
  background: #141414;
  color: #fff;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 0 4%;
  transition: background 0.3s ease;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
}

.nav.scrolled {
  background: #000;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 100%;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-logo {
  font-size: 1.75rem;
  font-weight: 900;
  color: #e50914;
  text-decoration: none;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  transform: perspective(300px) rotateX(-3deg);
  transform-origin: center bottom;
}

.nav-logo:hover {
  color: #f40612;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  color: #b3b3b3;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  transition: color 0.2s;
}

.nav-link:hover {
  color: #fff;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-icon-link {
  color: #b3b3b3;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.nav-icon-link:hover {
  color: #fff;
}

.nav-resume-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 7px 16px;
  border: 1px solid #e50914;
  border-radius: 4px;
  transition: background 0.2s, border-color 0.2s;
}

.nav-resume-btn:hover {
  background: rgba(229, 9, 20, 0.15);
  border-color: #f40612;
}

.nav-resume-btn svg {
  flex-shrink: 0;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.2s ease;
  transform-origin: center;
}

.nav-hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav overlay */
.nav-mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.95);
  padding: 24px 5%;
  flex-direction: column;
  gap: 0;
  z-index: 99;
  transform: translateY(-10px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-mobile-menu.active {
  transform: translateY(0);
  opacity: 1;
}

.nav-mobile-menu a {
  color: #e5e5e5;
  text-decoration: none;
  font-size: 1.1rem;
  padding: 14px 0;
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-mobile-menu a:last-child {
  border-bottom: none;
}

.nav-mobile-menu a:hover {
  color: #fff;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 600px;
  height: auto;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 120px 0 120px;
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(20, 20, 20, 1.0) 0%,
    rgba(20, 20, 20, 0.85) 40%,
    rgba(20, 20, 20, 0.6) 70%,
    rgba(20, 20, 20, 0.35) 100%
  );
  z-index: 1;
}

.hero-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: linear-gradient(to top, #141414, transparent);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 15;
  padding: 0 4%;
  max-width: 650px;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-shadow: 2px 4px 12px rgba(0, 0, 0, 0.8);
  margin-bottom: 12px;
  white-space: nowrap;
}

.hero-description {
  font-size: clamp(0.9rem, 1.5vw, 1.15rem);
  color: #b3b3b3;
  line-height: 1.5;
  max-width: 500px;
  text-shadow: 1px 2px 6px rgba(0, 0, 0, 0.5);
  margin-bottom: 28px;
}

.hero-cta {
  display: inline-block;
  text-decoration: none;
  background: #e50914;
  color: #fff;
  border: none;
  padding: 12px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 10;
  margin-bottom: 40px;
}

.hero-cta:hover {
  background: #f40612;
}

/* --- Rows Container --- */
.rows-container {
  position: relative;
  z-index: 4;
  padding: 0 0 80px;
  margin-top: -100px;
}

/* --- Row --- */
.row {
  margin-bottom: 24px;
  scroll-margin-top: 80px;
  position: relative;
  z-index: 1;
}

.row-header {
  padding: 0 4%;
  margin-bottom: 12px;
}

.row-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #e5e5e5;
  letter-spacing: -0.01em;
}

.row-title .row-period {
  font-size: 0.85rem;
  font-weight: 400;
  color: #808080;
  margin-left: 12px;
}

/* --- Slider (horizontal scroll) --- */
.row-slider-wrapper {
  position: relative;
  overflow: visible;
}

.row-slider {
  display: flex;
  gap: 8px;
  padding: 50px 4% 120px;
  margin-top: -50px;
  margin-bottom: -70px;
  overflow-x: auto;
  overflow-y: visible;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

/* --- Slider Arrows --- */
.slider-arrow {
  position: absolute;
  top: 80px; /* half of 160px card height; cards start at y=0 in wrapper */
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.85);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

.slider-arrow.is-visible:not(:disabled) {
  opacity: 1;
}

.slider-arrow:hover {
  background: rgba(55, 55, 55, 0.95);
}

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

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

.slider-arrow:disabled {
  opacity: 0 !important;
  cursor: default;
  pointer-events: none;
}

/* --- Cards --- */
.card {
  flex: 0 0 284px;
  height: 160px;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s 0.3s, overflow 0s 0.3s;
}

.card:hover {
  transform: scale(1.5);
  z-index: 20;
  overflow: visible;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s 0s, overflow 0s 0s;
}

.card--edge-left:hover {
  transform-origin: left center;
}

.card--edge-right:hover {
  transform-origin: right center;
}

.card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.15);
  letter-spacing: 0.05em;
  border-radius: 4px;
}

.card:hover .card-bg {
  border-radius: 4px 4px 0 0;
}

.card-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
}

.card:hover .card-bg-image {
  border-radius: 4px 4px 0 0;
}

.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  transition: opacity 0.2s ease;
}

.card:hover .card-overlay {
  opacity: 1;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2px;
}

.card-subtitle {
  font-size: 0.875rem;
  color: #aaa;
  font-weight: 400;
}

/* Card hover info panel — overlaid at card bottom */
.card-hover-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(20, 20, 20, 0.95);
  padding: 8px 10px;
  border-radius: 0 0 4px 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover .card-hover-info {
  opacity: 1;
}


.card-hover-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2px;
}

.card-hover-subtitle {
  font-size: 0.8rem;
  color: #aaa;
  margin-bottom: 6px;
}

.card-hover-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.card-hover-tag {
  font-size: 0.75rem;
  color: #46d369;
  border: 1px solid #46d369;
  padding: 2px 6px;
  border-radius: 2px;
  white-space: nowrap;
}

/* --- Connect Cards (special style) --- */

.card--connect .card-bg {
  font-size: 2.5rem;
}

.card--connect .card-icon {
  font-size: 3rem;
  opacity: 0.9;
}

/* --- Modal --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.modal.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0s 0s;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}

.modal-content {
  position: relative;
  background: #181818;
  border-radius: 8px;
  width: 90%;
  max-width: 850px;
  max-height: 85vh;
  overflow-y: auto;
  margin: auto 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6),
              0 0 20px rgba(255, 255, 255, 0.4),
              0 0 40px rgba(255, 255, 255, 0.25),
              0 16px 60px rgba(0, 0, 0, 0.8);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #181818;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7),
              0 0 12px rgba(255, 255, 255, 0.5),
              0 0 24px rgba(255, 255, 255, 0.3);
}

.modal-close:hover {
  background: #333;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9),
              0 0 16px rgba(255, 255, 255, 0.7),
              0 0 32px rgba(255, 255, 255, 0.4);
}

.modal-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.modal-preview-text {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  padding: 20px;
  z-index: 1;
}

.modal-preview-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(to top, #181818, transparent);
}

.modal-body {
  padding: 24px 40px 40px;
}

.modal-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.2;
}

.modal-meta {
  font-size: 0.95rem;
  color: #46d369;
  margin-bottom: 16px;
  font-weight: 500;
}

.modal-description {
  font-size: 1rem;
  color: #d2d2d2;
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-tag {
  font-size: 0.8rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: 4px;
}

/* --- Responsive --- */

/* Large screens */
@media (min-width: 1400px) {
  .card {
    flex: 0 0 355px;
    height: 200px;
  }

  .slider-arrow {
    top: 100px; /* half of 200px card height */
  }
}

/* Tablets */
@media (max-width: 1024px) {
  .card {
    flex: 0 0 267px;
    height: 150px;
  }

  .row-title {
    font-size: 1.2rem;
  }

  .slider-arrow {
    display: none;
  }

  .hero {
    align-items: flex-end;
    padding-bottom: 120px;
  }

  .row-slider {
    padding: 20px 4% 40px;
    margin-top: -20px;
    margin-bottom: -40px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-icon-link,
  .nav-resume-btn {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-mobile-menu {
    display: flex;
  }

  .hero {
    min-height: 600px;
    align-items: flex-end;
    padding-bottom: 100px;
  }

  .hero-content {
    padding: 0 5%;
  }

  .hero-cta {
    padding: 10px 24px;
    font-size: 1rem;
  }

  .rows-container {
    margin-top: -60px;
  }

  .row {
    margin-bottom: 32px;
  }

  .row-title {
    font-size: 1.05rem;
  }

  .row-title .row-period {
    display: block;
    margin-left: 0;
    margin-top: 2px;
  }

  .card {
    flex: 0 0 220px;
    height: 124px;
  }

  .card:hover {
    transform: scale(1.05);
  }

  .card-hover-info {
    display: none;
  }

  .row-slider {
    gap: 6px;
    padding: 10px 5%;
    margin-top: -10px;
    margin-bottom: -10px;
  }

  .slider-arrow {
    display: none;
  }

  .modal-content {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .modal {
    padding-top: 0;
    align-items: flex-start;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-title {
    font-size: 1.4rem;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .hero-title {
    font-size: 2.2rem;
  }
}
