/*************************************************************
 * 1. RESET & GLOBAL VARIABLES
 *************************************************************/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
}

:root {
  --primary-color: #000;
  --secondary-color: #fff;
  --accent-color: #ff5500;
  --font-sans: 'Inter', Arial, sans-serif;
  --font-serif: 'Courier Prime', 'Courier New', monospace;
  --side-nav-width: 250px;
  --unselected-grey: rgba(255, 255, 255, 0.5);
}

/*************************************************************
 * 2. BASE ELEMENTS
 *************************************************************/
body {
  font-family: var(--font-sans);
  color: var(--secondary-color);
  background-color: var(--primary-color);
  line-height: 1.6;
  margin-top: 40px;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 700;
}

button {
  color: var(--secondary-color);
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  transition: opacity 0.3s;
}

button:hover {
  opacity: 0.8;
}

.container {
  margin: 0 auto;
  padding: 20px;
}

/*************************************************************
 * 3. TOP NAV (FIXED, RESPONSIVE HAMBURGER)
 *************************************************************/
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 10px 20px;
}

.top-nav h1 {
  color: #fff;
  margin: 0;
  white-space: nowrap;
  font-family: 'Courier Prime', monospace;
  font-weight: 300;
}


.top-nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.top-nav ul li {
  display: inline;
}

.top-nav ul li a {
  text-decoration: none;
  color: var(--unselected-grey);
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 18px;
  padding: 8px 12px;
  transition: transform 0.3s ease, color 0.3s ease;
  border-radius: 5px;
  display: inline-block;
}

.top-nav ul li a:hover {
  color: rgb(255, 255, 255);
  transform: scale(1.1);
}

.top-nav ul li a.active {
  color: rgba(255, 255, 255, 1);
  transform: scale(1.2);
}

.menu-toggle {
  display: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background: #fff;
  border-radius: 2px;
}

/*************************************************************
 * 4. SIDE NAV
 *************************************************************/
.side-nav {
  position: fixed;
  left: 0;
  top: 50px;
  width: 240px;
  height: calc(100vh - 50px);
  color: var(--unselected-grey);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background-color: black;
  z-index: 998;
}

.side-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.side-nav ul li {
  font-size: 18px;
  transition: transform 0.3s ease, color 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.side-nav ul li a {
  text-decoration: none;
  color: inherit;
  font-family: var(--font-serif);
  font-weight: 300;
}

.side-nav ul li:hover {
  transform: scale(1.1);
  color: rgb(255, 255, 255);
}

.side-nav ul li.active {
  font-size: 22px;
  font-weight: bold;
  color: rgb(255, 255, 255);
}

.main-side-nav {
  margin-left: 240px;
  margin-right: 5%;
  margin-top: 30px;
}

section {
  margin-bottom: 50px;
  scroll-margin-top: 60px;
}

/*************************************************************
 * 5. FOOTER
 *************************************************************/
footer {
  position: relative;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  background: none;
}

#footer-home {
  position: fixed;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1;
}

.footer-content {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: center;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 10px 0;
  width: 100%;
}

.social-links a {
  display: inline-block;
  width: 30px;
  height: 30px;
}

.social-links img {
  width: 100%;
  height: auto;
  transition: transform 0.3s ease-in-out;
}

.social-links img:hover {
  transform: scale(1.1);
}

.footer-text {
  font-size: 14px;
  font-family: var(--font-serif);
}

/*************************************************************
 * 6. UTILITY CLASSES
 *************************************************************/
.invert-image {
  filter: invert(100%);
}

/*************************************************************
 * 8. CAROUSEL (HOME PAGE)
 *************************************************************/
.carousel {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-text {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform: translate(-50%, 50%);
  background-color: rgba(0, 0, 0, 0.2);
  color: #fff;
  padding: 20px;
  text-align: center;
  width: 80%;
  max-width: 800px;
  border-radius: 5px;
}

.lightbox-arrow {
  position: absolute;
  scale: .4;
  top: 45%;
  background-color: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  font-size: 2em;
  cursor: pointer;
  border-radius: 50%;
  z-index: 10;
}

.carousel-arrow-left,
.lightbox-arrow.left {
  left: 10px;
}

.carousel-arrow-right,
.lightbox-arrow.right {
  right: 10px;
}

/*************************************************************
 * 9. HOME PAGE
 *************************************************************/
.home-page {
  margin: 0;
  padding: 0;
}

.home-page .carousel-slide {
  filter: saturate(0);
}

.carousel-tagline {
  position: absolute;
  bottom: 60px;
  right: 30px;
  z-index: 5;
}

.carousel-tagline p {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 300;
  color: #fff;
  letter-spacing: 0.05em;
  line-height: 1.6;
  /* text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7); */
}

.carousel::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 200px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
  pointer-events: none;
  z-index: 4;
}

/*************************************************************
 * 10. ABOUT PAGE
 *************************************************************/
.about-page main.container {
  margin-top: 60px;
  margin-left: 200px;
  padding-bottom: 45vh;
}

.about-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 0;
  line-height: 1.75;
  font-family: Arial, sans-serif;
}

.about-page .side-nav {
  top: 60px;
  width: 200px;
  background-color: #000;
  z-index: 1000;
}

.section {
  margin-bottom: 50px;
}

.section-heading {
  font-size: 1.4em;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 25px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--secondary-color);
}

.section-content {
  padding-left: 5px;
}

.experience-item {
  margin-bottom: 30px;
}

.experience-item:last-child {
  margin-bottom: 0;
}

.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  gap: 20px;
}

.experience-item h3 {
  margin: 0;
  font-size: 1.15em;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-family: var(--font-serif);
}

.experience-item h4 {
  margin: 0;
  font-size: 1.05em;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.experience-item .details {
  font-size: 0.9em;
  font-style: normal;
  color: #999;
  margin: 0;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-align: right;
}

.experience-item ul {
  margin: 0 150px 0 22px;
  padding: 0;
}

.experience-item ul li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.experience-item ul li:last-child {
  margin-bottom: 0;
}

.experience-item ul ul {
  margin-right: 0;
}

.experience-item .sub-section {
  margin: 25px 0 0 0;
  padding-left: 20px;
  border-left: 3px solid rgba(255, 255, 255, 0.2);
}

.experience-item .sub-section h4 {
  margin-top: 0;
}

.experience-item .sub-section + .sub-section {
  margin-top: 20px;
}

#skills .section-content ul {
  padding-left: 0;
  margin-left: 22px;
  list-style-position: outside;
}

#skills .section-content ul li {
  margin-bottom: 12px;
}

/*************************************************************
 * 11. PORTFOLIO PAGE
 *************************************************************/
.portfolio-page {
  display: flex;
  flex-direction: column;
}

.portfolio-page .main-side-nav img {
  width: 100%;
  max-width: 1920px;
  display: block;
  margin: auto;
}

/*************************************************************
 * 12. PHOTOS PAGE
 *************************************************************/
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 20px;
}

.photo-grid img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.photo-grid img:hover {
  transform: scale(1.08);
  z-index: 1;
  position: relative;
}

.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 99999;
  display: none;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-image {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  transition: opacity 0.2s ease;
}

.lightbox-image.switching {
  opacity: 0;
}

/*************************************************************
 * 13. VIDEOS PAGE
 *************************************************************/
.videos-page h1,
.videos-page h2,
.videos-page h3 {
  text-align: center;
}

.videos-page .container > h3 {
  font-size: 1.4em;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 25px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--secondary-color);
}

.videos-page p {
  margin-bottom: 30px;
  font-family: var(--font-serif);
}

.video-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 30px;
  padding: 0 10%;
}

.video-container iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.yt-facade {
  position: relative;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  overflow: hidden;
  border-radius: 10px;
}

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

.yt-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease;
}

.yt-play-btn::after {
  content: "";
  display: block;
  margin-left: 26px;
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent #fff;
}

.yt-facade:hover .yt-play-btn {
  background: rgba(255, 0, 0, 0.85);
}

.video-item {
  text-align: center;
  transition: transform 0.3s ease;
}

.video-item:hover {
  transform: scale(1.03);
}

.video-item video {
  width: 100%;
  border-radius: 10px;
}

.vertical-videos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 30px;
}

.video-section-heading {
  margin-top: 30px;
}

.subscribe {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  padding-bottom: 2rem;
  gap: 1rem;
  color: #fff;
  margin-bottom: 30px;
}

.subscribe p {
  margin: 0;
  font-size: 1.2rem;
}

/*************************************************************
 * 14. CONTACT PAGE
 *************************************************************/
.contact-page {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  justify-content: center;
}

.contact-page a {
  color: var(--secondary-color);
}

.contact-page .container {
  width: 90%;
  max-width: 425px;
  text-align: center;
  background: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 10px;
}

.contact-page .container h2 {
  font-size: 1.4em;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 25px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--secondary-color);
}

.contact-page .contact-info {
  margin-bottom: 20px;
}

.contact-page form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  font-family: var(--font-serif);
  font-weight: 300;
}

.contact-page label,
.contact-page input,
.contact-page textarea,
.contact-page button,
.contact-page p {
  font-family: var(--font-serif);
  font-weight: 300;
}

.contact-page input,
.contact-page textarea {
  width: 100%;
  max-width: 375px;
  padding: 6px;
  border: 1px solid var(--secondary-color);
  border-radius: 5px;
  font-size: 14px;
  background: var(--primary-color);
  opacity: 50%;
  color: var(--secondary-color);
  box-shadow: none;
}

.contact-page textarea {
  height: 100px;
  resize: none;
}

.contact-page button {
  background-color: rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 375px;
  color: var(--secondary-color);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 8px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 5px;
}

.contact-page header {
  width: 100%;
  padding: 5px;
}

.contact-page label {
  text-align: left;
  width: 100%;
  max-width: 375px;
}

.contact-page footer {
  align-self: stretch;
}

.contact-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.contact-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*************************************************************
 * 15. RESPONSIVE BREAKPOINTS (widest first, narrowest last)
 *************************************************************/

/* ---- Tablet landscape / small desktop (<=992px) ---- */
@media (max-width: 992px) {

  /* Top nav collapses to hamburger */
  .menu-toggle {
    display: flex;
    position: absolute;
    top: 10px;
    right: 20px;
  }

  #nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 0 15px;
    border-radius: 0;
    width: 160px;
    z-index: 1000;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
  }

  #nav-links.show-links {
    max-height: 500px;
    padding: 15px;
  }

  /* Carousel text scales down */
  .carousel-text {
    width: 90%;
    padding: 10px;
    font-size: 14px;
  }
}

/* ---- Tablet portrait / large phone (<=768px) ---- */
@media (max-width: 768px) {

  /* Hide ALL side navs and reclaim the space */
  .side-nav {
    display: none !important;
  }

  .main-side-nav {
    margin-left: 5% !important;
    margin-right: 5% !important;
  }

  .about-page main.container {
    margin-left: 0 !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .about-container {
    padding: 15px;
  }

  /* Experience list: remove giant right margin */
  .experience-item ul {
    margin-right: 0;
  }

  /* Videos: single column for horizontal, 2-col for vertical */
  .video-container {
    grid-template-columns: 1fr;
    padding: 0 5%;
  }

  .vertical-videos {
    grid-template-columns: repeat(2, 1fr);
    margin: 20px;
  }
}

/* ---- Phone (<=480px) ---- */
@media (max-width: 480px) {

  /* Top nav: smaller text */
  .top-nav h1 {
    font-size: 0.9em;
  }

  .top-nav ul li a {
    font-size: 16px;
    padding: 6px 10px;
  }

  /* About: stack experience headers vertically */
  .experience-header {
    flex-direction: column;
    gap: 4px;
  }

  .experience-item .details {
    text-align: left;
    white-space: normal;
  }

  .experience-item ul {
    margin: 0 0 0 18px;
  }

  .about-container {
    padding: 10px;
  }

  .section-heading {
    font-size: 1.2em;
  }

  /* Videos: single column for everything */
  .vertical-videos {
    grid-template-columns: 1fr;
    margin: 15px;
  }

  .video-container {
    padding: 0 3%;
  }

  .subscribe {
    flex-direction: column;
    text-align: center;
  }

  /* Carousel */
  .carousel-tagline {
    right: 15px;
    bottom: 70px;
  }

  .carousel-tagline p {
    font-size: 12px;
  }

  .carousel-text h2 {
    font-size: 1.1em;
  }

  .carousel-text p {
    font-size: 0.85em;
  }

  /* Photos: smaller grid cells, no hover zoom on touch */
  .photo-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 6px;
    padding: 10px;
  }

  .photo-grid img {
    height: 100px;
  }

  .photo-grid img:hover {
    transform: none;
  }

  /* Lightbox arrows smaller */
  .lightbox-arrow {
    scale: .3;
  }
}
