/* BASE */
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #222;
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
}

html {
    overflow-x: hidden;
}

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

/* HERO */
.hero {
  height: 25vh;
  min-height: 200px; /* Prevents the hero from getting too squashed */
  background-size: cover;
  background-position: center;
  position: relative;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.hero-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
  
  /* min gap: 8px, scales with 1% of viewport height, max gap: 24px */
  gap: clamp(0.5rem, 1vh, 1.5rem); 
}

.hero h1 {
  font-size: 3rem;
  margin: 0; /* Remove the vh margins */
}

.hero-subtitle {
  letter-spacing: 2px;
  font-size: 1rem;
  margin: 0; /* Remove the vh margins */
  order: -1; /* This keeps the subtitle ABOVE the H1 if that was your goal */
}

/* Projects Grid Layout */
/* Add this to tighten the start of the projects section */
#projects.section {
    padding-top: 0rem; /* Reduced from 4rem */
}
/* Center the entire project block to match the timeline width */
.projects-wrapper {
    max-width: 1100px; /* Exact match to your .timeline-container */
    margin: 0 auto;    /* Centers the block on the page */
    padding: 0 40px;   /* Matches the timeline gutter padding */
    box-sizing: border-box;
}

/* Center the Title specifically */
.projects-wrapper h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 35px;
    width: 100%;
}

/* Individual Project Styles Per Page */
.project-page-hero {
  height: 15vh;
  background-image: url("../assets/images/hero.jpeg");
  background-size: cover;
  background-position: center;
  position: relative;
}

.project-page-hero-subtitle {
  letter-spacing: 2px;
  font-size: 1rem;
  margin-top: -3vh;
}

/* Individual Project Styles */
.project-detail-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.project-row {
    display: flex !important;
    flex-direction: row !important; /* Keep it standard row */
    align-items: center;
    gap: 40px;
    margin-bottom: 40px;
    width: 100%;
}

/* We force the internal divs to be exactly 50% */
.project-text, .project-image {
    flex: 1 !important;
    width: 50% !important;
}

.project-image img,
.project-image video {
    width: 100%;
    display: block;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.disclaimer-text {
    text-align: center;
    font-size: 0.85rem;
    font-style: italic;
    color: #666;
    border-bottom: 1px solid #b8b8b8;
    padding-bottom: 15px;
    margin-bottom: 40px;
}

.accent-text {
    color: #ff2d55; /* Matches your "Read More" pink/red */
    font-weight: bold;
}

/* Experience Cards */
.experience-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 50px 0;
}

.experience-card {
  background: #f3f4f6;
  border: 1.5px solid #4aa3df;
  border-radius: 12px;
  padding: 26px 28px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.05);
}

.experience-card h4 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
  color: #4aa3df;
}

.experience-card p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: #444;
}

.tags {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags span {
  font-size: 12.5px;
  padding: 5px 10px;
  background: #e8f3fb;
  color: #2c6fa6;
  border-radius: 20px;
  font-weight: 500;
}

/* Skills Section */
.skills-section {
    padding-top: 20px;  /* Adds space so the border is visible */
    border-top: 1px solid #b8b8b8;
    margin-bottom: 40px;
    text-align: center;
}

/* An .experience-section already ends in its own rule, so a border-top here
   would draw a second line a few rems below the first. Pages that reach the
   skills block straight from a .project-row keep their divider. */
.experience-section + .skills-section {
    border-top: none;
}

.skills-section-lsdo {
    margin-bottom: 40px;
    text-align: center;
}

.skills-header {
    background: #222;
    color: white;
    padding: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.skill-tag {
    background: #333;
    color: white;
    padding: 10px;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* FOOTER */
/* Footer Bar Styling */
.footer-bar {
  background-color: #f4f4f4; /* Light grey background bar */
  padding: 1.5rem 0;
  width: 100%;
  border-top: 1px solid #ddd; /* Subtle line to separate from content */
}

.footer-container {
  max-width: 1300px; /* Matches your site's content width */
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between; /* Pushes content to the far left and right */
  align-items: center;
}

.footer-item {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

/* LinkedIn Specific Styling */
.linkedin-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #000;
  font-weight: 500;
}

.linkedin-icon {
  height: 24px;
  width: auto;
}

/* Email Specific Styling */
.email-link {
  text-decoration: none;
  color: #007bff;
  font-weight: 500;
  transition: color 0.2s ease;
}

.email-link:hover {
  color: #0056b3; /* Changes to your accent blue on hover */
}

.footer-copyright {
  font-size: 0.85rem;
  color: #666;
  font-weight: 400;
}

.footer-icon {
  height: 18px;
  width: auto;
}

/* Modal Background */
.modal {
  display: none; 
  position: fixed; 
  z-index: 1000; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  background-color: rgba(0, 0, 0, 0.8); /* Dims the background */
  backdrop-filter: blur(5px);
}

/* Modal Content Box */
.modal-content {
  position: relative;
  background-color: #fff;
  margin: 2% auto; 
  padding: 3px;
  width: 85%;
  height: 90vh; /* Takes up 90% of screen height */
  border-radius: 8px;
}

/* Close Button (X) */
.close-btn {
  position: absolute;
  top: -41px;
  right: 0;
  color: white;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
}

.close-btn:hover {
  color: var(--accent-blue);
  transform: scale(1.1); /* Slightly enlarge */
  transition: transform 0.2s ease;
}

.project-section {
  max-width: 1100px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.quadrotor-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

.quadrotor-pair figure {
  margin: 0;
  background: #f7f7f7;
  border-radius: 12px;
  overflow: hidden;
}

.quadrotor-pair img,
.quadrotor-pair video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.quadrotor-caption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: #555;
  text-align: center;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}


/* ===== EXPERIENCE STRUCTURE ===== */

.experience-section {
  margin: 1.5rem 0;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #b8b8b8;
}

.experience-section:last-of-type {
  border-bottom: none;
}

.experience-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
  color: #111;
}

/* Tighten rows within sections */
.experience-section .project-row {
  margin-bottom: 1.5rem;
}

.experience-section .project-row:last-child {
  margin-bottom: 0;
}

/* Improve text readability */
.project-text p {
  margin-bottom: 1rem;
  font-size: 1.02rem;
}

/* ===== QUADROTOR COMPARISON ===== */

.quadrotor-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
}

.quadrotor-pair figure {
  margin: 0;
  background: #f7f7f7;
  border-radius: 10px;
  overflow: hidden;
}

.quadrotor-pair img,
.quadrotor-pair video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.quadrotor-caption {
  font-size: 0.95rem;
  color: #555;
  text-align: center;
  margin-bottom: 1rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== IMAGE POLISH ===== */

.project-image img,
.project-image video {
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  border-radius: 6px;
}

.figure-caption {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  font-style: italic;
  color: #666;
  text-align: center;
  line-height: 1.4;
}


/* ===== 2over1 Image Layout ===== */
/* Two-column layout */
.project-row-two-column {
  display: flex;
  gap: 2rem; /* space between text and images */
  flex-wrap: wrap; /* for responsiveness */
}

.project-column {
  flex: 0 0 50%;
}

/* Right column: 2-over-1 images */
.project-images-2over1 {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-images-2over1 .top-row {
  display: flex;
  gap: 1rem;
}

.project-images-2over1 .top-row figure,
.project-images-2over1 .bottom-row figure {
  flex: 1;
  margin: 0;
}

.project-images-2over1 .bottom-row figure {
  width: 100%;
}

.project-images-2over1 img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}


/* ===== BACK TO PORTFOLIO ===== */

/* Hidden by default and revealed by js/subpage.js only when the page is the
   top-level document. Inside the homepage modal iframe the link would load
   the whole site into a 90vh window, so it stays hidden there. */
.back-home {
  display: none;
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 50;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  /* No backdrop-filter here. It promotes the pill to its own compositing
     layer, which drops subpixel antialiasing and leaves the label looking
     soft. An opaque fill renders crisply and reads the same. */
  background: #141a24;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.back-home.is-standalone {
  display: inline-flex;
}

.back-home:hover {
  background: #1f2733;
  border-color: rgba(255, 255, 255, 0.8);
}

.back-home:focus-visible {
  outline: 2px solid #7fd4ff;
  outline-offset: 2px;
}

/* Inline SVG rather than a glyph: the arrow character is hinted differently
   across platforms and renders soft at this size. */
.back-home-arrow {
  display: block;
  width: 15px;
  height: 15px;
  flex: none;
  transition: transform 0.2s ease;
}

.back-home-arrow path {
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.back-home:hover .back-home-arrow {
  transform: translateX(-2px);
}

/* Past the hero the page turns white, so the light-on-dark pill needs to
   invert or it disappears. js/subpage.js toggles this on scroll. */
.back-home.on-light {
  background: #ffffff;
  border-color: #cfcfcf;
  color: #1b1b1b;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
}

.back-home.on-light:hover {
  background: #f2f4f7;
  border-color: #8d8d8d;
}


/* ===== RESPONSIVE ===== */

@media (max-width: 820px) {
  /* The row layout is set with !important, so the stack has to match it. */
  .project-row,
  .project-row-two-column {
    flex-direction: column !important;
    gap: 22px;
    margin-bottom: 30px;
  }

  .project-text,
  .project-image,
  .project-column {
    width: 100% !important;
    flex: 1 1 auto !important;
  }

  /* Images first reads better than a wall of text on a narrow screen. */
  .project-row .project-image {
    order: -1;
  }

  .project-detail-container,
  .project-section {
    padding: 0 18px;
  }

  .experience-strip,
  .quadrotor-pair,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .project-images-2over1 .top-row {
    flex-direction: column;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-subtitle,
  .project-page-hero-subtitle {
    font-size: 0.85rem;
    letter-spacing: 1px;
  }

  /* 15vh is unreadably short on a phone in landscape and too cramped for a
     wrapped title in portrait. */
  .project-page-hero {
    height: auto;
    min-height: 150px;
    padding: 58px 16px 22px;
  }

  .project-page-hero .hero-content {
    height: auto;
  }

  .project-page-hero h1 {
    font-size: 1.6rem;
    margin: 0;
  }

  .project-page-hero-subtitle {
    margin-top: 0.4rem;
  }

  .footer-container {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .back-home {
    top: 12px;
    left: 12px;
    padding: 8px 14px 8px 11px;
    font-size: 0.82rem;
  }

  .experience-card {
    padding: 20px;
  }

  .project-text p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .skills-header {
    font-size: 0.8rem;
    letter-spacing: 1px;
  }

  .skill-tag {
    font-size: 0.78rem;
    padding: 9px 8px;
  }

  .project-page-hero h1 {
    font-size: 1.35rem;
  }
}

