/* ========================================
   Keynes Portfolio - Main Stylesheet
   ======================================== */

/* CSS Variables */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #ffffff;
  --bg-secondary: #f9fafb;
  --border-color: #e5e7eb;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --max-width: 1200px;
  --transition: all 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

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

/* ========================================
   Navigation
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  padding: 1rem 2rem;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
}

.nav-logo:hover {
  color: var(--primary-color);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-color);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

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

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

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

/* Mobile Menu Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-color);
  border-radius: 2px;
  transition: var(--transition);
}

/* ========================================
   Main Content
   ======================================== */
main {
  padding-top: 80px;
  flex: 1;
}

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

section {
  padding: 4rem 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-color);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 2px;
}

/* ========================================
   About Hero Section (Two-Column Layout)
   ======================================== */
.about-hero {
  padding-top: 2rem;
}

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

/* Left Sidebar - Profile Info */
.profile-sidebar {
  position: sticky;
  top: 100px;
  text-align: left;
}

.profile-photo-wrapper {
  margin-bottom: 1.5rem;
}

.profile-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-color);
  box-shadow: var(--shadow-lg);
  background: var(--border-color);
}

.profile-sidebar h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text-color);
}

.profile-sidebar .pronunciation {
  font-size: 0.95rem;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 1rem;
}

.profile-sidebar .credentials {
  font-size: 1rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.profile-sidebar .degree {
  font-size: 0.9rem;
  color: var(--text-color);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.profile-sidebar .location {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-sidebar .location::before {
  content: '📍';
}

.contact-links {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  width: fit-content;
}

.contact-link.email {
  background: var(--primary-color);
  color: white;
}

.contact-link.email:hover {
  background: var(--primary-dark);
  color: white;
}

.contact-link.linkedin {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.contact-link.linkedin:hover {
  background: var(--primary-color);
  color: white;
}

/* ========================================
   About Section (Right Column)
   ======================================== */
.about-content {
  max-width: 100%;
}

.about-content .section-title {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.about-content p {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-color);
}

.about-content p:last-child {
  margin-bottom: 0;
}

/* ========================================
   Project Cards
   ======================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.project-image {
  width: 100%;
  height: 200px;
  background: var(--bg-secondary);
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.project-content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.project-content p {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tag {
  padding: 0.25rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.project-links {
  display: flex;
  gap: 1rem;
  margin-top: auto;
}

.project-link {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Project Course Label */
.project-course {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(37, 99, 235, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Project Filter Buttons */
.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.filter-btn {
  padding: 0.6rem 1.25rem;
  border: 2px solid var(--border-color);
  background: var(--bg-color);
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color);
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.filter-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* Hidden state for filtered projects */
.project-card.hidden {
  display: none;
}

/* Clickable project cards */
.project-card {
  cursor: pointer;
}

/* ========================================
   Project Modal
   ======================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  overflow-y: auto;
  padding: 2rem;
}

.modal.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.modal-content {
  background: var(--bg-color);
  border-radius: 16px;
  max-width: 800px;
  width: 100%;
  margin: 2rem auto;
  padding: 2.5rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  align-self: flex-start;
  height: fit-content;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
}

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

.modal-course {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(37, 99, 235, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#modal-body h2 {
  font-size: 1.75rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
  padding-right: 2rem;
}

.modal-date {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.modal-bullets {
  list-style: disc;
  padding-left: 1.25rem;
  margin-bottom: 2rem;
}

.modal-bullets li {
  color: var(--text-color);
  line-height: 1.7;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.modal-bullets li:last-child {
  margin-bottom: 0;
}

.modal-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border-radius: 8px;
  font-weight: 500;
  transition: var(--transition);
}

.modal-link:hover {
  background: var(--primary-dark);
  color: white;
}

@media (max-width: 768px) {
  .modal {
    padding: 1rem;
  }

  .modal-content {
    padding: 1.5rem;
    margin: 1rem auto;
  }

  #modal-body h2 {
    font-size: 1.35rem;
  }

  .modal-bullets li {
    font-size: 0.9rem;
  }
}

/* ========================================
   Coursework Section
   ======================================== */
.coursework-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr auto;
  gap: 2rem;
}

.course-category {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.course-category:nth-child(4) {
  /* Pasadena City College - full width */
  grid-column: 1 / -1;
}

.course-category:nth-child(5) {
  /* Technical Skills - full width below Pasadena */
  grid-column: 1 / -1;
}

.course-category h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.course-dates {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  font-style: italic;
}

.course-list {
  list-style: none;
}

.course-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
}

.course-list li:last-child {
  border-bottom: none;
}

/* Skills Grid */
.skills-category {
  /* Inherits span 2 from nth-child(5) above */
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  padding: 0.5rem 1rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-color);
  transition: var(--transition);
}

.skill-tag:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ========================================
   Creative Work / Gallery
   ======================================== */
.creative-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.creative-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--bg-secondary);
}

.creative-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.creative-item:hover img {
  transform: scale(1.05);
}

.creative-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  opacity: 0;
  transition: var(--transition);
}

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

.creative-overlay h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.creative-overlay p {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* ========================================
   Modal Wide Variant (Vision Gallery)
   ======================================== */
.modal-content--wide {
  max-width: 1100px;
}

/* ========================================
   Magazine Card (Vision Is Key)
   ======================================== */
.magazine-card {
  display: flex;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  max-width: 900px;
}

.magazine-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.magazine-cover {
  width: 260px;
  flex-shrink: 0;
  overflow: hidden;
}

.magazine-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.magazine-info {
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.magazine-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.magazine-info > p {
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* Vision Gallery Toggle */
.vision-toggle {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0 1.25rem;
}

.vision-toggle-btn {
  padding: 0.4rem 1.1rem;
  border: 2px solid var(--border-color);
  background: var(--bg-color);
  border-radius: 25px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-color);
  cursor: pointer;
  transition: var(--transition);
}

.vision-toggle-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.vision-toggle-btn:hover:not(.active) {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Scroll view */
.vision-scroll-view {
  overflow-x: auto;
  padding-bottom: 0.75rem;
  -webkit-overflow-scrolling: touch;
}

.vision-scroll-track {
  display: flex;
  gap: 0;
  width: max-content;
}

.vision-scroll-track img {
  height: 380px;
  width: auto;
  border-radius: 0;
  object-fit: cover;
  display: block;
}

/* Slideshow view */
.vision-slideshow {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.5rem;
}

.vision-slideshow.active {
  display: flex;
}

.slideshow-nav-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.slideshow-img-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.slideshow-img-wrap img {
  height: 460px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.slideshow-btn {
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-color);
}

.slideshow-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.slideshow-counter {
  font-size: 0.8rem;
  color: var(--text-light);
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .magazine-card {
    flex-direction: column;
  }
  .magazine-cover {
    width: 100%;
    height: auto;
  }
  .magazine-cover img {
    height: auto;
    object-fit: contain;
  }
  .slideshow-img-wrap img {
    height: 300px;
  }
  .vision-scroll-track img {
    height: 260px;
  }
}

/* ========================================
   Culture & Live Production Cards
   ======================================== */
.culture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.culture-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.culture-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.culture-card-image {
  width: 100%;
  height: 200px;
  background: var(--bg-secondary);
  overflow: hidden;
}

.culture-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.culture-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.culture-role {
  font-size: 0.75rem;
  color: var(--primary-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
  display: block;
}

.culture-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.culture-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
  .culture-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Footer
   ======================================== */
.footer {
  background: var(--text-color);
  color: white;
  padding: 2rem;
  text-align: center;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer p {
  opacity: 0.8;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.footer-links a {
  color: white;
  opacity: 0.8;
}

.footer-links a:hover {
  opacity: 1;
  color: white;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 968px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .course-category:nth-child(4),
  .course-category:nth-child(5) {
    grid-column: 1 / -1;
  }

  .profile-sidebar {
    position: static;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
  }

  .profile-photo {
    width: 180px;
    height: 180px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    flex-direction: column;
    padding: 1rem 2rem;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

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

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  .profile-sidebar h1 {
    font-size: 1.5rem;
  }

  .projects-grid,
  .creative-grid {
    grid-template-columns: 1fr;
  }

  .coursework-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .course-category:nth-child(4),
  .course-category:nth-child(5) {
    grid-column: 1;
  }

  section {
    padding: 3rem 0;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 1rem;
  }

  .container {
    padding: 0 1rem;
  }

  .profile-sidebar h1 {
    font-size: 1.35rem;
  }

  .profile-photo {
    width: 150px;
    height: 150px;
  }

  .about-content p {
    font-size: 0.95rem;
  }
}
