/*
Theme Name: Motion 3D Portfolio
Theme URI: https://example.com/motion3d
Author: Custom
Author URI: https://example.com
Description: A cinematic dark portfolio theme for 3D motion designers, featuring an image gallery with lightbox/zoom and video showcase sections.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: motion3d
Tags: portfolio, dark, full-width-template, custom-colors, custom-menu, featured-images, post-thumbnails, theme-options
*/

/* ============================================================
   CSS VARIABLES
============================================================ */
:root {
  --bg:         #080A0F;
  --bg2:        #0E1118;
  --bg3:        #141820;
  --surface:    #1A1F2B;
  --border:     rgba(255,255,255,0.07);
  --accent:     #C8FF00;
  --accent2:    #00D4FF;
  --text:       #E8EAF0;
  --muted:      #6B7280;
  --white:      #FFFFFF;

  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius:     4px;
  --radius-lg:  12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow:     0 20px 60px rgba(0,0,0,0.6);
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ============================================================
   NOISE OVERLAY
============================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 9999;
}

/* ============================================================
   TYPOGRAPHY
============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--white);
}

.display-xl  { font-size: clamp(5rem, 12vw, 12rem); letter-spacing: -0.02em; }
.display-lg  { font-size: clamp(3rem, 7vw, 7rem); }
.display-md  { font-size: clamp(2rem, 4vw, 4rem); }
.section-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ============================================================
   LAYOUT UTILITIES
============================================================ */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
}

.section { padding: clamp(5rem, 10vw, 10rem) 0; }

/* ============================================================
   HEADER & NAV
============================================================ */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1.5rem 0;
  transition: background var(--transition), padding var(--transition);
}

#site-header.scrolled {
  background: rgba(8, 10, 15, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.1em;
  color: var(--white);
}
.site-logo span { color: var(--accent); }

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

.main-nav a {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--transition);
  font-family: var(--font-mono);
}
.main-nav a:hover { color: var(--white); }

.nav-cta {
  background: var(--accent) !important;
  color: var(--bg) !important;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600 !important;
  transition: opacity var(--transition) !important;
}
.nav-cta:hover { opacity: 0.85; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  transition: var(--transition);
}

/* ============================================================
   HERO
============================================================ */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 6rem;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 60% 40%, rgba(200,255,0,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(0,212,255,0.05) 0%, transparent 60%),
    linear-gradient(180deg, transparent 50%, var(--bg) 100%);
}

.hero-video-bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  opacity: 0.25;
  pointer-events: none;
}

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

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.hero-eyebrow::before {
  content: '';
  display: block;
  width: 3rem; height: 1px;
  background: var(--accent);
}

.hero-title { margin-bottom: 2rem; }
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line-outline {
  -webkit-text-stroke: 1px rgba(255,255,255,0.3);
  color: transparent;
}

.hero-meta {
  display: flex;
  gap: 3rem;
  margin-bottom: 3rem;
}
.hero-stat strong {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--accent);
}
.hero-stat span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}
.btn-primary:hover { background: #d4ff20; transform: translateY(-2px); box-shadow: 0 10px 30px rgba(200,255,0,0.3); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--text); background: rgba(255,255,255,0.05); transform: translateY(-2px); }

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  right: clamp(1.5rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  writing-mode: vertical-rl;
}
.scroll-line {
  width: 1px; height: 4rem;
  background: linear-gradient(to bottom, var(--muted), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(0.6); }
}

/* ============================================================
   GALLERY SECTION
============================================================ */
#gallery { background: var(--bg); }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 3rem;
  gap: 2rem;
  flex-wrap: wrap;
}
.section-header .left { display: flex; flex-direction: column; gap: 0.5rem; }

.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.filter-btn {
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(200,255,0,0.05);
}

/* ============================================================
   MASONRY GALLERY
============================================================ */
.gallery-grid {
  columns: 3;
  column-gap: 0.75rem;
}
@media (max-width: 1100px) { .gallery-grid { columns: 2; } }
@media (max-width: 560px)  { .gallery-grid { columns: 1; } }

.gallery-item {
  break-inside: avoid;
  margin-bottom: 0.75rem;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}

/* Anchor wraps the whole card */
.gallery-item a {
  display: block;
  position: relative;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  border-radius: var(--radius);
}

/* Natural dimensions — no forced aspect ratio, no cropping */
.gallery-item a img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  vertical-align: bottom; /* kills phantom bottom gap */
}
.gallery-item:hover a img { transform: scale(1.05); }

/* Hover overlay */
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8,10,15,0.88) 0%, transparent 55%);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
  pointer-events: none;
}
.gallery-item:hover .gallery-item-overlay { opacity: 1; }

.gallery-item-info h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--white);
  margin-bottom: 0.2rem;
}
.gallery-item-info span {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Zoom badge */
.gallery-item-zoom {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  width: 2.25rem; height: 2.25rem;
  background: rgba(200,255,0,0.92);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: all var(--transition);
  color: var(--bg);
  pointer-events: none;
}
.gallery-item:hover .gallery-item-zoom {
  opacity: 1;
  transform: scale(1);
}



/* ============================================================
   PHOTOSWIPE THEME OVERRIDES
============================================================ */
.pswp { --pswp-bg: #080A0F; }

.pswp__button {
  background: rgba(20,24,32,0.85) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 50% !important;
  backdrop-filter: blur(8px);
  transition: background 0.2s ease, border-color 0.2s ease !important;
}
.pswp__button:hover { background: var(--accent) !important; border-color: var(--accent) !important; }
.pswp__button:hover svg { fill: var(--bg) !important; }

.pswp__caption__center {
  font-family: var(--font-display) !important;
  font-size: 1.1rem !important;
  letter-spacing: 0.05em !important;
  color: var(--white) !important;
  text-align: center !important;
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem 2rem !important;
  background: linear-gradient(to top, rgba(8,10,15,0.95), transparent) !important;
}

.pswp__counter {
  font-family: var(--font-mono) !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.15em !important;
  color: var(--muted) !important;
  padding: 1.5rem !important;
}
.pswp__preloader__icn { color: var(--accent) !important; }

/* ============================================================
   VIDEO SECTION
============================================================ */
#videos { background: var(--bg2); }

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.5rem;
}
@media (max-width: 480px) { .video-grid { grid-template-columns: 1fr; } }

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.video-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  border-color: rgba(200,255,0,0.2);
}

.video-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  cursor: pointer;
}
.video-thumb img, .video-thumb video {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.video-card:hover .video-thumb img { transform: scale(1.05); }

.video-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8,10,15,0.3);
  transition: background var(--transition);
}
.video-card:hover .video-play-btn { background: rgba(8,10,15,0.1); }

.play-circle {
  width: 5rem; height: 5rem;
  background: rgba(200,255,0,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  transform: scale(0.9);
}
.play-circle svg { margin-left: 4px; }
.video-card:hover .play-circle { transform: scale(1); box-shadow: 0 0 40px rgba(200,255,0,0.4); }

.video-duration {
  position: absolute;
  bottom: 0.75rem; right: 0.75rem;
  background: rgba(8,10,15,0.8);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
}

.video-info { padding: 1.25rem 1.5rem 1.5rem; }
.video-category {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 0.4rem;
}
.video-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--white);
  margin-bottom: 0.5rem;
}
.video-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }

/* Video Modal */
#video-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(4,5,8,0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#video-modal.active { opacity: 1; visibility: visible; }

.video-modal-inner {
  position: relative;
  width: min(900px, 95vw);
}
.video-modal-close {
  position: absolute;
  top: -3.5rem; right: 0;
  width: 2.5rem; height: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.video-modal-close:hover { background: var(--accent); color: var(--bg); }

.video-modal-player {
  aspect-ratio: 16/9;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg);
  box-shadow: var(--shadow);
}
.video-modal-player iframe,
.video-modal-player video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ============================================================
   ABOUT SECTION
============================================================ */
#about {
  background: var(--bg);
  overflow: hidden;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
}
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; gap: 3rem; } }

.about-image-wrap {
  position: relative;
}
.about-image-wrap img {
  width: 100%;
  border-radius: var(--radius-lg);
  filter: grayscale(30%);
}
.about-image-accent {
  position: absolute;
  bottom: -1.5rem; left: -1.5rem;
  width: 60%; height: 60%;
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0.4;
}

.about-content .section-tag { margin-bottom: 1rem; }
.about-content h2 { margin-bottom: 1.5rem; }
.about-content p { color: var(--muted); line-height: 1.8; margin-bottom: 1.5rem; }

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.skill-tag {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 2rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ============================================================
   CONTACT SECTION
============================================================ */
#contact { background: var(--bg2); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: start;
}
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; gap: 3rem; } }

.contact-form { display: flex; flex-direction: column; gap: 1rem; }

.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.form-group input,
.form-group textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition);
  resize: none;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { min-height: 140px; }

.contact-info { display: flex; flex-direction: column; gap: 2rem; }
.contact-item-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.contact-item-value { font-size: 1.1rem; color: var(--text); }

.social-links { display: flex; gap: 1rem; }
.social-link {
  width: 2.5rem; height: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all var(--transition);
}
.social-link:hover { border-color: var(--accent); color: var(--accent); background: rgba(200,255,0,0.05); }

/* ============================================================
   FOOTER
============================================================ */
#site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-copy { font-size: 0.8rem; color: var(--muted); font-family: var(--font-mono); }

/* ============================================================
   PAGE TRANSITIONS
============================================================ */
.page-enter { animation: pageIn 0.6s ease forwards; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .main-nav.open {
    display: flex;
    position: fixed;
    inset: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
  }
  .main-nav.open ul { flex-direction: column; text-align: center; gap: 2rem; }
  .main-nav.open a { font-size: 1.5rem; }
  .hamburger { display: flex; z-index: 1001; }

  .lightbox-nav { display: none; }
  .lightbox-inner { padding: 4rem 1rem; }
}

/* ============================================================
   WP ALIGNMENT CLASSES
============================================================ */
.alignleft  { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { margin: 0 auto 1rem; display: block; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.8rem; color: var(--muted); text-align: center; margin-top: 0.4rem; }
.screen-reader-text { clip: rect(1px,1px,1px,1px); position: absolute !important; height: 1px; width: 1px; overflow: hidden; }
