/* CSS Design System for Carter Wells Portfolio */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Space+Grotesk:wght@600;700&display=swap');

:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --text-muted: #555555;
  --border-color: #000000;
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --header-height: 170px;
  --header-height-scrolled: 150px;
  --max-width: 1400px;
  --transition-speed: 0.4s;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
}

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

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

/* Header & Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 1000;
  transition: all var(--transition-speed) var(--ease);
}

header.scrolled {
  height: var(--header-height-scrolled);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  background-color: rgba(255, 255, 255, 0.95);
}

.header-container {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 140px;
  width: auto;
  display: block;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.logo-img:hover {
  opacity: 0.8;
}

nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

nav a {
  text-decoration: none;
  color: var(--text-color);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
  padding: 8px 0;
  transition: color 0.3s ease;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--text-color);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease);
}

nav a:hover::after,
nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Mobile Menu Button */
.burger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1010;
}

.burger-menu span {
  width: 100%;
  height: 2px;
  background-color: var(--text-color);
  transition: all 0.3s ease;
}

/* Main Content Area */
main {
  margin-top: var(--header-height);
  padding: 60px 0;
  min-height: calc(100vh - var(--header-height) - 150px);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}

/* Page Intro/Header */
.page-title {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 40px;
  text-align: left;
  animation: fadeIn 0.8s var(--ease);
}

/* Portfolio Grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  animation: fadeIn 1s var(--ease);
}

.portfolio-item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  text-decoration: none;
  background-color: #f7f7f7;
}

.portfolio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed) var(--ease), filter var(--transition-speed) var(--ease);
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  opacity: 0;
  transition: opacity var(--transition-speed) var(--ease);
  text-align: center;
}

.portfolio-title {
  font-family: var(--font-heading);
  color: var(--text-color);
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  transform: translateY(20px);
  transition: transform var(--transition-speed) var(--ease);
}

.portfolio-category {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transform: translateY(20px);
  transition: transform var(--transition-speed) var(--ease);
  transition-delay: 0.05s;
}

/* Hover States */
.portfolio-item:hover .portfolio-img {
  transform: scale(1.05);
  filter: grayscale(30%);
}

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

.portfolio-item:hover .portfolio-title,
.portfolio-item:hover .portfolio-category {
  transform: translateY(0);
}

/* Client Logo Marquee */
.marquee-section {
  padding: 80px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background-color: #fafafa;
  overflow: hidden;
  margin: 60px 0;
}

.marquee-title {
  font-family: var(--font-heading);
  text-align: center;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.marquee-container {
  display: flex;
  width: 200%;
}

.marquee-wrapper {
  display: flex;
  width: 50%;
  justify-content: space-around;
  align-items: center;
  animation: marquee 25s linear infinite;
}

.marquee-logo {
  height: 50px;
  max-width: 150px;
  object-fit: contain;
  filter: grayscale(100%) contrast(0.8);
  opacity: 0.6;
  transition: all 0.3s ease;
}

.marquee-logo:hover {
  filter: none;
  opacity: 1;
}

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

/* Footer Section */
footer {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 60px 0 40px 0;
  background-color: #ffffff;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
}

.footer-brand h3 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

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

.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}

.contact-btn {
  display: inline-block;
  text-decoration: none;
  color: #ffffff;
  background-color: #000000;
  padding: 14px 28px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid #000000;
  transition: all 0.3s ease;
}

.contact-btn:hover {
  background-color: transparent;
  color: #000000;
}

.email-link {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.email-link:hover {
  color: var(--text-muted);
}

.social-links {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}

.social-links a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1.3rem;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: var(--text-muted);
}

.footer-bottom {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 120px;
    --header-height-scrolled: 100px;
  }

  .header-container {
    padding: 0 20px;
  }

  .logo-img {
    height: 95px;
  }

  .page-title {
    font-size: 2.5rem;
    margin-bottom: 30px;
  }
  
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Touch devices have no hover — reveal the project label as the tile
     scrolls through the center of the screen (see .in-view toggle in main.js).
     A bottom gradient scrim keeps the gif visible underneath. */
  .portfolio-overlay {
    background: linear-gradient(to top,
      rgba(0, 0, 0, 0.8) 0%,
      rgba(0, 0, 0, 0.45) 35%,
      rgba(0, 0, 0, 0) 68%);
    justify-content: flex-end;
    align-items: flex-start;
    text-align: left;
    padding: 22px;
    opacity: 0;
  }

  .portfolio-title {
    color: #ffffff;
    font-size: 1.4rem;
    margin-bottom: 4px;
  }

  .portfolio-category {
    color: rgba(255, 255, 255, 0.85);
  }

  .portfolio-item.in-view .portfolio-overlay {
    opacity: 1;
  }

  .portfolio-item.in-view .portfolio-title,
  .portfolio-item.in-view .portfolio-category {
    transform: translateY(0);
  }

  .burger-menu {
    display: flex;
  }
  
  nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background-color: #ffffff;
    flex-direction: column;
    justify-content: center;
    gap: 40px;
    padding-bottom: 80px;
    transform: translateX(100%);
    transition: transform var(--transition-speed) var(--ease);
  }
  
  nav.open {
    transform: translateX(0);
  }
  
  .footer-content {
    flex-direction: column;
    gap: 30px;
    align-items: flex-start;
  }
  
  .footer-contact {
    align-items: flex-start;
  }
}
