/* ─────────────────────────────────────────────────────────────
   1. CUSTOM FONT LOADING (Self-Hosted Nasalization)
   ───────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Nasalization';
  /* Ensure 'Nasalization.otf' is in your assets folder. 
     If it is .ttf, change this to .ttf */
  src: url('assets/Nasalization.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

/* ─────────────────────────────────────────────────────────────
   2. CUSTOM SCROLLBAR (Floating Pill)
   ───────────────────────────────────────────────────────────── */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
}

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #ffffff;
}

/* ─────────────────────────────────────────────────────────────
   3. GLOBAL VARIABLES & RESET
   ───────────────────────────────────────────────────────────── */
:root {
  --bg-color: #000000;       /* Pure Black */
  --text-main: #ffffff;      /* Pure White */
  --text-muted: #cccccc;     /* Light Grey for subtext */
  --accent-color: #ffffff;   /* Solid White Accents */
  --card-bg: #111111;        /* Very dark grey for cards */
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 { color: var(--text-main); }
p { color: var(--text-main); }

a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-color);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Add a dark grey background to images while they load (Lazy Loading Fix) */
.header-bg, .project-image, .project-figure img, .iteration-img {
  background-color: #222222; 
}

/* ─────────────────────────────────────────────────────────────
   4. NAVIGATION (Fixed & Transparent)
   ───────────────────────────────────────────────────────────── */
nav {
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.5); 
  padding: 0.75rem; 
  z-index: 1000;
  display: flex;
  justify-content: center;
  flex-wrap: wrap; 
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); 
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav a {
  margin: 0.5rem 1rem; 
  font-weight: bold;
  font-size: 0.95rem; 
}

nav a:hover {
  color: var(--accent-color);
}

/* ─────────────────────────────────────────────────────────────
   5. HEADER & BANNER
   ───────────────────────────────────────────────────────────── */
header {
  position: relative;
  height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  padding: 0 20px;
  background-color: black;
  z-index: 0; 
}

/* --- BACKGROUND IMAGES --- */
.header-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('assets/Earth-Mars.webp'); 
  background-size: cover;
  background-position: center;
  z-index: 1; 
  opacity: 1; 
  filter: brightness(1.3) contrast(1.1); 
}

.header-bg[style*="background-image"] {
  opacity: 0.8 !important; 
  filter: none !important; 
}

/* --- VIGNETTE MASK --- */
.vignette-mask {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%; 
  background: linear-gradient(to bottom, transparent 0%, black 100%);
  z-index: 2; 
  pointer-events: none;
}

/* --- LOGO --- */
header img {
  width: 120px; 
  position: relative;
  z-index: 10; 
  filter: drop-shadow(0 0 10px rgba(0,0,0,0.8));
  margin-bottom: 0.5rem; 
}

/* --- TYPOGRAPHY --- */
header h1 {
  font-family: 'Nasalization', sans-serif;
  font-size: 3.5rem;
  font-weight: normal; 
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0; 
  line-height: 1.1; 
  position: relative;
  z-index: 10; 
  text-shadow: 0 4px 8px rgba(0,0,0,1); 
}

header p {
  font-size: 1.2rem;
  font-weight: normal; 
  color: #ffffff;   
  letter-spacing: 1px;
  margin-top: 0.5rem;
  position: relative;
  z-index: 10;
  text-shadow: 0 2px 4px rgba(0,0,0,1);
}

/* ─────────────────────────────────────────────────────────────
   6. HOME PAGE: PROJECT CARDS
   ───────────────────────────────────────────────────────────── */
section {
  max-width: 900px;
  margin: 4rem auto;
  padding: 0 2rem;
}

.project-card {
  display: flex;
  background-color: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
  transition: transform 0.6s ease, box-shadow 0.6s ease;
  border: 1px solid #222;
  position: relative; 
}

.project-card:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(255,255,255,0.1);
  border-color: var(--accent-color);
}

.project-image {
  flex: 0 0 40%;
  position: relative;
  background-size: cover;
  background-position: center;
  min-height: 200px; 
}

.project-image::after {
  content: "";
  position: absolute;
  top: 0; left: 25%;
  width: 75%; height: 100%;
  background: linear-gradient(to right, rgba(30,30,30,0) 0%, var(--card-bg) 100%);
  pointer-events: none;
}

/* Specific Project Images */
.project-image-heatpump {
  background-image: url('assets/3DHeatPump.webp');
}

.project-image-rpet {
  background-image: url('assets/rPET-Banner.webp');
}

.project-image-placeholder {
  background-image: url('assets/PlaceHolder.webp');
}

/* FIXED ALIGNMENT */
.project-content {
  flex: 1;
  position: relative;
  z-index: 2;
  margin-left: -40px; 
  padding: 1rem 1.5rem 1.5rem 1.5rem; 
  display: block; 
}

.project-content h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  color: var(--text-main);
  line-height: 1.3;
}

.project-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;      
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.6em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.project-card:hover .project-description {
  -webkit-line-clamp: unset;
}

/* ─────────────────────────────────────────────────────────────
   7. PROJECT PAGE CONTENT
   ───────────────────────────────────────────────────────────── */
.content-section {
  max-width: 900px;
  margin: 4rem auto;
  padding: 0 2rem;
  color: var(--text-main);
}

.content-section h2 {
  font-size: 2rem;
  border-bottom: 2px solid #333;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.content-section h3 {
  font-size: 1.4rem;
  margin-top: 2rem;
  color: var(--text-muted);
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 1rem;
}

.grid-item {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #333;
}

.grid-item h3 {
  margin-top: 0;
  font-size: 1.2rem;
  color: var(--text-main);
  border-bottom: 1px solid #333;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.highlight-box {
  background-color: #111;
  border: 1px solid #333;
  border-left: 5px solid var(--accent-color);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 4px;
  color: var(--text-main);
  font-style: italic;
}

.timeline {
  margin-top: 3rem;
  margin-left: 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.2); 
  padding-left: 2.5rem; 
}

.timeline-item {
  margin-bottom: 3rem;
  position: relative;
  color: var(--text-muted);
}

.timeline-item strong {
  color: var(--text-main);
  display: block;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-2.5rem - 6px); 
  top: 5px;
  width: 11px;
  height: 11px;
  background-color: #000000;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.timeline-item:hover::before {
  background-color: #ffffff;
  transform: scale(1.2);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

.iteration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
  gap: 1.5rem;
  margin-top: 3rem;
  padding-bottom: 1rem;
}

.iteration-card {
  text-align: center;
  background: var(--card-bg);
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid #333;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.iteration-card:hover {
  transform: translateY(-5px);
  border-color: #555;
}

.iteration-img {
  width: 100%;
  aspect-ratio: 1 / 1; 
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  filter: grayscale(40%);
  transition: filter 0.3s ease;
}

.iteration-card:hover .iteration-img {
  filter: grayscale(0%);
}

.iteration-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.5rem;
  font-weight: bold;
}

.project-figure {
  margin: 3rem 0;
  text-align: center;
}
.project-figure img {
  border-radius: 8px;
  border: 1px solid #333;
}
.project-figure figcaption {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.5rem;
  font-style: italic;
}

.styled-list { list-style: none; padding: 0; }
.styled-list li { margin-bottom: 1rem; padding-left: 1.5rem; position: relative; color: var(--text-muted); }
.styled-list li strong { color: var(--text-main); }
.styled-list li::before {
  content: '➤';
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-size: 0.8rem;
  top: 4px;
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #333;
  margin-top: 1.5rem;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ─────────────────────────────────────────────────────────────
   8. DOWNLOAD CARD (New)
   ───────────────────────────────────────────────────────────── */
.download-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--card-bg);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 3rem 2rem;
  margin-top: 1.5rem;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
  text-decoration: none; /* Removes underline */
  cursor: pointer;
}

.download-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
  background-color: #1a1a1a;
  box-shadow: 0 6px 16px rgba(255,255,255,0.05);
}

.download-card h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.download-card p {
  color: var(--text-muted);
  margin: 0;
  font-size: 1rem;
}

.download-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  fill: var(--text-main);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.download-card:hover .download-icon {
  opacity: 1;
}

/* ─────────────────────────────────────────────────────────────
   9. FOOTER
   ───────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
  font-size: 0.9rem;
  border-top: 1px solid #111;
  margin-top: 4rem;
  background-color: black;
}

/* ─────────────────────────────────────────────────────────────
   10. MOBILE OPTIMIZATION
   ───────────────────────────────────────────────────────────── */
@media screen and (max-width: 768px) {
  
  nav {
    flex-wrap: nowrap;         
    overflow-x: auto;          
    justify-content: flex-start; 
    padding: 0.5rem 0;         
    -webkit-overflow-scrolling: touch; 
    scrollbar-width: none;  
    -ms-overflow-style: none;  
  }
  
  nav::-webkit-scrollbar { 
    display: none; 
  }

  nav a {
    flex: 0 0 auto;           
    margin: 0 0.75rem;        
    font-size: 0.85rem;       
    white-space: nowrap;      
  }
  
  nav a:first-child {
    margin-left: 1rem;
  }
  
  nav a:last-child {
    margin-right: 1rem;
  }

  header {
    height: 50vh; 
  }
  
  header h1 {
    font-size: 2rem; 
  }
  
  .tagline {
    font-size: 1rem;
    padding: 0 1rem; 
  }
}
