/* ==============================
   1. CSS CUSTOM PROPERTIES
   ============================== */
:root {
  --color-primary: #000000;
  --color-primary-light: #1a1a1a;
  --color-bg-dark: #000000;
  --color-bg-light: #ffffff;
  --color-bg-alt: #f7f7f7;
  --color-text-dark: #111111;
  --color-text-light: #ffffff;
  --color-text-muted: #666666;
  --color-border: #e0e0e0;
  --color-accent: #333333;

  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Karla', sans-serif;
  --font-accent: 'Lora', serif;

  --container-max: 1140px;
  --section-padding: 5rem 0;
  --transition-fast: 0.2s ease;
  --transition-medium: 0.4s ease;
  --header-height: 72px;
}

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

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-dark);
  background: var(--color-bg-light);
  -webkit-font-smoothing: antialiased;
}

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

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

ul {
  list-style: none;
}

/* ==============================
   3. TYPOGRAPHY
   ============================== */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-light);
  opacity: 0.8;
  margin-top: -2rem;
  margin-bottom: 2.5rem;
  font-family: var(--font-accent);
  font-style: italic;
}

/* ==============================
   4. LAYOUT
   ============================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: var(--section-padding);
}

.section-light {
  padding: var(--section-padding);
  background: var(--color-bg-light);
  color: var(--color-text-dark);
}

.section-dark {
  padding: var(--section-padding);
  background: var(--color-bg-dark);
  color: var(--color-text-light);
}

.section-dark .section-title {
  color: var(--color-text-light);
}

/* ==============================
   5. BUTTONS
   ============================== */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 2px solid var(--color-primary);
  background: var(--color-primary);
  color: var(--color-text-light);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.btn:hover {
  background: transparent;
  color: var(--color-primary);
}

.section-dark .btn {
  border-color: var(--color-text-light);
  background: var(--color-text-light);
  color: var(--color-primary);
}

.section-dark .btn:hover {
  background: transparent;
  color: var(--color-text-light);
}

/* ==============================
   6. HEADER / NAV
   ============================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background var(--transition-medium), box-shadow var(--transition-medium);
}

.header-scrolled {
  background: var(--color-bg-dark);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo-img {
  height: 28px;
  width: auto;
}

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

.nav-link {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-light);
  position: relative;
  padding: 0.25rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-text-light);
  transition: width var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 10;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-light);
  transition: all var(--transition-fast);
}

.hamburger {
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

.nav-toggle.active .hamburger {
  background: transparent;
}

.nav-toggle.active .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle.active .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ==============================
   7. HERO
   ============================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--color-bg-dark);
  color: var(--color-text-light);
  padding-top: var(--header-height);
  overflow: hidden;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 4rem;
  padding: 3rem 1.5rem;
}

.hero-image {
  flex: 0 0 auto;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hero-headshot {
  width: 100%;
  filter: grayscale(100%);
}

.hero-text {
  flex: 1;
}

.hero-signature {
  max-width: 180px;
  margin-top: 1rem;
  opacity: 0.9;
}

.hero-logos {
  margin-top: 2.5rem;
  justify-content: flex-start;
}

.hero-tagline {
  font-family: var(--font-accent);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-style: italic;
  opacity: 0.85;
  margin-top: 1rem;
  line-height: 1.6;
}

/* ==============================
   8. ABOUT
   ============================== */
.about-content {
  max-width: 720px;
  margin: 0 auto 3rem;
  text-align: center;
}

.about-content p {
  margin-bottom: 1.25rem;
  color: var(--color-text-muted);
}

.about-content .btn {
  margin-top: 0.5rem;
}

.client-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  opacity: 0.5;
}

.client-logos-label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  opacity: 0.8;
}

.client-logo {
  height: 32px;
  width: auto;
  filter: grayscale(100%);
}

/* ==============================
   9. SERVICES
   ============================== */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.service-card {
  text-align: center;
  padding: 2.5rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.service-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-4px);
}

.service-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.25rem;
  filter: invert(1);
  opacity: 0.8;
}

.service-card h3 {
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.service-card p {
  font-size: 0.925rem;
  opacity: 0.75;
  line-height: 1.65;
}

/* ==============================
   10. PORTFOLIO
   ============================== */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.portfolio-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: 4px;
}

.portfolio-cover {
  width: 100%;
  height: 280px;
  object-fit: cover;
  transition: transform var(--transition-medium);
}

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

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

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

.portfolio-view {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-light);
  border: 2px solid var(--color-text-light);
  padding: 0.6rem 1.5rem;
}

/* ==============================
   11. LIGHTBOX
   ============================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-medium);
}

.lightbox-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--color-text-light);
  font-size: 2.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
  z-index: 10;
  line-height: 1;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text-light);
  font-size: 3rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  line-height: 1;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

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

.lightbox-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

.lightbox-video {
  width: 80vw;
  height: 45vw;
  max-width: 960px;
  max-height: 540px;
}

.lightbox-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--color-text-light);
  opacity: 0.5;
  letter-spacing: 0.1em;
}

/* ==============================
   12. STATS
   ============================== */
.section-stats {
  padding: 3.5rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-label {
  font-size: 0.825rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
}

/* ==============================
   13. FAQ / ACCORDION
   ============================== */
.accordion {
  max-width: 720px;
  margin: 0 auto;
}

.accordion-item {
  border-bottom: 1px solid var(--color-border);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.25rem 0;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.accordion-header::-webkit-details-marker {
  display: none;
}

.accordion-header::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  margin-left: 1rem;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.accordion-item[open] .accordion-header::after {
  content: '\2212';
}

.accordion-body {
  padding: 0 0 1.25rem;
}

.accordion-body p {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ==============================
   14. CONTACT FORM
   ============================== */
.contact-form {
  max-width: 640px;
  margin: 0 auto;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  width: 100%;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--color-text-light);
  transition: border-color var(--transition-fast);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group {
  margin-bottom: 0;
}

.contact-form .form-group:last-of-type {
  margin-bottom: 1.5rem;
}

.btn-submit {
  width: 100%;
}

.form-success {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 3rem 2rem;
}

.form-success h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--color-text-light);
}

.form-success p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.05rem;
}

/* ==============================
   15. FOOTER
   ============================== */
.footer {
  background: var(--color-primary-light);
  color: var(--color-text-light);
  padding: 3rem 0 2rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.footer-logo-img {
  height: 24px;
  width: auto;
  opacity: 0.7;
}

.social-links {
  display: flex;
  gap: 1.25rem;
}

.social-links a {
  color: var(--color-text-light);
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.social-links a:hover {
  opacity: 1;
}

.footer-resume {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.footer-resume:hover {
  opacity: 1;
}

.footer-copyright {
  font-size: 0.8rem;
  opacity: 0.35;
}

/* ==============================
   16. ANIMATIONS
   ============================== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger service cards */
.service-card.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.service-card.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.service-card.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.service-card.animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.service-card.animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }
.service-card.animate-on-scroll:nth-child(7) { transition-delay: 0.6s; }
.service-card.animate-on-scroll:nth-child(8) { transition-delay: 0.7s; }
.service-card.animate-on-scroll:nth-child(9) { transition-delay: 0.8s; }

/* Stagger portfolio cards */
.portfolio-card.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.portfolio-card.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.portfolio-card.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.portfolio-card.animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.portfolio-card.animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }

/* ==============================
   17. RESPONSIVE
   ============================== */

/* Tablet */
@media (min-width: 768px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-content {
    padding: 4rem 1.5rem;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--color-bg-dark);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transform: translateX(100%);
    transition: transform var(--transition-medium);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
  }

  .nav-links.nav-open {
    transform: translateX(0);
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
    padding: 2rem 1.5rem;
  }

  .hero-image {
    max-width: 260px;
    align-items: flex-end;
  }

  .hero-logos {
    justify-content: center;
  }

  .client-logos {
    gap: 1.5rem;
  }

  .client-logo {
    height: 24px;
  }

  .portfolio-cover {
    height: 220px;
  }

  .lightbox-prev,
  .lightbox-next {
    font-size: 2rem;
  }

  .lightbox-video {
    width: 95vw;
    height: 53vw;
  }
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
