/* ============================================
   Alex Rivera Portfolio — Dark Minimal
   ============================================ */

:root {
  --bg: #050505;
  --bg-elevated: #0c0c0c;
  --bg-card: #111111;
  --text: #f5f5f5;
  --text-muted: #8a8a8a;
  --text-dim: #555555;
  --accent: #00f5d4;
  --accent-dim: rgba(0, 245, 212, 0.15);
  --border: #1a1a1a;
  --border-hover: #2a2a2a;
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Bebas Neue', system-ui, sans-serif;
  
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 7rem;
  --space-3xl: 10rem;
  
  --radius: 4px;
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ========== Header ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.header.scrolled {
  border-bottom-color: var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.logo {
  display: flex;
  align-items: center;
  height: 40px;
  transition: opacity var(--transition);
}

.logo:hover {
  opacity: 0.85;
}

.logo-img {
  height: 36px;
  width: auto;
  max-width: 260px;
  display: block;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 450;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-cta {
  color: var(--accent) !important;
  border: 1px solid var(--accent);
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
}

.nav-cta:hover {
  background: var(--accent);
  color: var(--bg) !important;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: var(--transition);
}

/* ========== Hero ========== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem var(--space-md) 4rem;
  position: relative;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  /* Static fallback so iOS never shows a blank page if video fails */
  background-color: #050505;
  background-image: linear-gradient(rgba(5,5,5,0.55), rgba(5,5,5,0.85));
}

.hero-bg video,
.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  /* Helps iOS rendering */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(5, 5, 5, 0.55) 0%,
    rgba(5, 5, 5, 0.72) 40%,
    rgba(5, 5, 5, 0.88) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-scroll {
  z-index: 2;
}


.hero-content {
  max-width: 900px;
}

.hero-label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(4rem, 13vw, 9rem);
  line-height: 0.85;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  letter-spacing: 0.02em;
}

.hero-desc {
  max-width: 480px;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover {
  background: #00d4b8;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-hover);
}

.btn-ghost:hover {
  border-color: var(--text-muted);
  background: var(--bg-elevated);
}

.hero-scroll {
  position: absolute;
  bottom: 3rem;
  left: var(--space-md);
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scroll-line {
  width: 40px;
  height: 1px;
  background: var(--text-dim);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 50%;
  background: var(--accent);
  animation: scrollPulse 1.8s ease-in-out infinite;
}

@keyframes scrollPulse {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* ========== About ========== */
.about {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 4rem;
  align-items: start;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.about-heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  max-width: 540px;
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding-top: 2.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-number {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.75rem;
  letter-spacing: -0.03em;
  color: var(--text);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ========== Work ========== */
.work {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--border);
}

.section-header {
  margin-bottom: 4rem;
}

.section-intro {
  color: var(--text-muted);
  max-width: 480px;
  margin-top: 0.75rem;
}

.work-category {
  margin-bottom: 6rem;
}

.work-category:last-child {
  margin-bottom: 0;
}

.category-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.category-header h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.category-count {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.work-item {
  group: true;
  cursor: pointer;
}

.work-image {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  aspect-ratio: 4 / 5;
  margin-bottom: 1rem;
}

.video-grid .work-image {
  aspect-ratio: 16 / 9;
}

.work-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.work-item:hover .work-image img {
  transform: scale(1.04);
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: all var(--transition);
  opacity: 0.9;
}

.work-item:hover .play-btn {
  background: var(--accent);
  color: #000;
  transform: translate(-50%, -50%) scale(1.08);
}

.work-meta h4 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  transition: color var(--transition);
}

.work-item:hover .work-meta h4 {
  color: var(--accent);
}

.work-meta p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========== Process ========== */
.process {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: -0.02em;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 3.5rem;
}

.process-step {
  padding: 1.75rem;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: border-color var(--transition);
}

.process-step:hover {
  border-color: var(--accent);
}

.step-number {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.process-step h4 {
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.process-step p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ========== Testimonials ========== */
.testimonials {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--border);
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3.5rem;
}

.testimonial {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
  transition: border-color var(--transition);
}

.testimonial:hover {
  border-color: var(--border-hover);
}

.testimonial p {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 2rem;
}

.testimonial footer {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.testimonial cite {
  font-style: normal;
  font-weight: 500;
  font-size: 0.95rem;
}

.testimonial span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========== Contact ========== */
.contact {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--border);
}

.contact-content {
  max-width: 640px;
}

.contact-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.contact-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.contact-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}

.contact-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}

.contact-links a:hover {
  color: var(--accent);
}

.contact-links a:hover::after {
  width: 100%;
}

/* ========== Footer ========== */
.footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-note {
  color: var(--text-muted);
}

/* ========== Video Modal ========== */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: pointer;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 960px;
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: -48px;
  right: 0;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--accent);
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .testimonials-grid {
    grid-template-columns: 1fr;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .about-stats {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2.5rem;
    padding-top: 0;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
  }
  
  .nav-links.open {
    display: flex;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .hero {
    padding-top: 7rem;
  }
  
  .work-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .process-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-actions,
  .contact-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
  
  .footer .container {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --space-3xl: 5rem;
  }
  
  .hero-title {
    font-size: 3.25rem;
  }
}

/* ========== Image Lightbox ========== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: color 0.25s ease;
}

.lightbox-close:hover {
  color: var(--accent);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ========== Awards ========== */
.awards {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--border);
}

.awards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.award-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color var(--transition), transform var(--transition);
  min-height: 160px;
}

.award-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.award-year {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.award-place {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  width: fit-content;
  margin-bottom: 0.15rem;
}

.award-card h4 {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  margin: 0;
}

.award-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
  margin-top: auto;
}

@media (max-width: 1024px) {
  .awards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .awards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .awards-grid {
    grid-template-columns: 1fr;
  }
  .award-card {
    min-height: auto;
  }
}
