/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
  --color-primary: #000000;
  --color-text: #3f3f3f;
  --color-text-light: #555555;
  --color-bg: #ffffff;
  --color-border: #e0e0e0;

  /* Fonts */
  --font-heading: "Michroma", sans-serif;
  --font-body: "Saira", sans-serif;

  /* Font Sizes */
  --fs-hero: clamp(24px, 3vw, 36px);      /* h1 */
  --fs-sub: clamp(15px, 3vw, 26px);       /* h2, h3 */
  --fs-nav: clamp(16px, 3vw, 19px);       /* nav */
  --fs-body: clamp(14px, 1.2vw, 18px);    /* p */
  --fs-small: clamp(12px, 0.8vw, 14px);   /* footer */

  /* Spacing System */
  --space-xs: clamp(0.25rem, 0.5vw, 0.75rem);
  --space-sm: clamp(0.75rem, 1.5vw, 1.5rem);
  --space-md: clamp(1.5rem, 3vw, 3rem);
  --space-lg: clamp(2rem, 5vw, 6rem);     /* Hero spacing */
  --space-xl: clamp(4rem, 8vw, 8rem);     /* Section spacing */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: Arial, sans-serif; /* Fallback */
  line-height: 1.6;
  color: #222;
  background-color: var(--color-bg);
  /* Sticky Footer Setup */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  margin: 0 auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  max-width: 1600px;
  width: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================================
   2. TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4, p, a, li { color: var(--color-text); }

h1 {
  font-family: var(--font-heading);
  font-size: var(--fs-hero);
  margin-bottom: 1rem;
}

h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

h3 {
  font-family: var(--font-body);
  font-size: var(--fs-sub);
  margin-bottom: 1rem;
  text-transform: uppercase;
  font-weight: 700;
}

p, li {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  margin-bottom: 1rem;
}

a { text-decoration: none; color: inherit; }

/* Text Control Utilities (Limits width for reading) */
.text-control {
  max-width: 700px !important;
  margin: 0 auto;
  text-align: center;
}
.text-control p { color: var(--color-text-light); font-size: 1.1rem; }

.split-text-control {
  max-width: 550px;
  width: 100%;
  text-align: left;
}
.split-text-control p { color: var(--color-text-light); font-size: 1.1rem; }

.name-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 40px; margin-bottom: 1rem; }
.name { white-space: nowrap; font-family: var(--font-body); }

/* Scramble Text Container */
.scramble {
    font-family: var(--font-heading); /* 'Michroma' looks great for this */
    font-size: clamp(20px, 4vw, 32px);
    font-weight: 400;
    color: var(--color-primary);
    min-height: 40px; /* Prevents layout jump when text changes */
    margin-bottom: 1.5rem;
}
/* The random characters (glitch effect) */

.scramble-desc {
  /* 1. Back to your preferred font */
  font-family: "Saira", sans-serif;
  font-size: 1.1rem; /* Saira is smaller than Space Mono, so we bump size slightly */
  color: var(--color-text);
  line-height: 1.6;

  /* 2. THE CAGE (Layout Stability) */
  display: block; 
  
  /* Lock the Width: Prevents horizontal layout shifts affecting the page */
  width: 100%;
  max-width: 650px; /* Adjust this to fit your longest paragraph */
  
  /* Lock the Height: Prevents the "About" button from jumping */
  /* You might need to tweak this number (e.g. 180px or 220px) depending on your screen */
  height: 100px; 
  overflow: hidden; /* Ensures if text glitches longer, it doesn't push the button */
  
  /* 3. Positioning */
  margin-bottom: 2rem;
  /* If you want the text centered physically: */
  margin-left: auto;
  margin-right: auto;
  
  /* Note: With Saira, Left Align causes less "visual vibration" than Center Align */
  text-align: left; 
}

/* Optional: Make the glitch characters lighter to reduce visual noise */
.dud {
  color: #ccc; 
  opacity: 0.5;
}
/* =========================================
   3. NAVIGATION
   ========================================= */
.navbar {
  background-color: rgba(255, 255, 255, 0.95);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.navbar .container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-logo {
  font-family: var(--font-body);
  color: var(--color-primary);
  font-size: var(--fs-nav);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: color 0.3s ease;
}

.brand-logo:hover { color: var(--color-text-light); }

/* =========================================
   4. LAYOUT: SPLIT SECTIONS (About / Projects)
   ========================================= */
/* Generic Split Section (50/50 Layout) */
.split-section, #hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  min-height: 60vh;
  width: 100%;
  padding: 4rem 0;
  overflow: hidden;
}

.split-section.reverse { flex-direction: row-reverse; }

.split-content, .hero-content-wrapper {
  flex: 1;
  width: 50%;
  padding: 0 4rem; 
  padding-left: 12%; 
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.split-section.reverse .split-content {
  padding-left: 4rem;
  padding-right: 12%;
}

.split-image, .hero-image-container {
  flex: 1;
  width: 50%;
  padding: 0 4rem;
  padding-right: 12%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;
}

.split-section.reverse .split-image {
  padding-right: 4rem;
  padding-left: 12%;
}

.split-image img, .hero-image-container img {
  width: 100%;
  max-width: 800px;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

/* Variant: Small/Stacked Images */
.split-image-s {
  flex: 1;
  width: 50%;
  padding: 0 2rem; 
  padding-right: 8%;
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* Aligns toward text if text is on left */
  justify-content: center;
  gap: 30px;
}
.split-image-s img {
  width: 100%;
  max-width: 400px;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

.wide-image-container {
  width: 100%;
  max-width: 1200px; 
  margin: 4rem auto; 
  padding: 0; 
  text-align: center;
}
.wide-image-container img { width: 100%; height: auto; display: block; }

/* =========================================
   5. LAYOUT: CENTERED & GALLERIES
   ========================================= */
.center-section {
  padding-top: var(--space-lg);
  padding-bottom: var(--space-xl);
  text-align: center;
  width: 100%;
}

.center-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero-image-big, .center-content > img {
  width: 100%;
  max-width: 1000px;
  margin-top: 4rem;
  height: auto;
}

/* Gallery System */
.center-content2, .center-content3 {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  margin: 3rem auto 0 auto;
}

.center-content2 img, .center-content3 img {
  flex: 1 1 300px; 
  max-width: 48%;  
  height: 400px;   
  object-fit: cover;
  border-radius: 4px;
}

.center-content2 img {
  height: 300px;
  object-fit: contain;
}

/* =========================================
   6. SKILLS & CARDS
   ========================================= */
#skills, #features { padding: var(--space-xl) 0; }
.section-title {
  font-size: 2rem;
  font-family: var(--font-heading);
  text-align: center;
  margin-bottom: 3rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.skill-card {
  padding: 25px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-align: left;
  background-color: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}
.skill-card:hover { transform: translateY(-3px); }
.skill-card h3 {
  font-size: var(--fs-sub);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.skill-card ul { list-style: none; padding: 0; }
.skill-card li { margin-bottom: 0.5rem; font-size: 1rem; }
.skill-card img {
  margin-top: auto;
  max-height: 300px;
  object-fit: contain;
}
/* Update the container to ensure top alignment */
/* 1. The Container (Crucial for Side-by-Side) */
.palette-container {
  display: flex;            /* This makes them sit in a row */
  justify-content: center;  /* Centers them */
  align-items: flex-start;  /* Aligns them at the top */
  gap: 20px;                /* Space between them */
  flex-wrap: wrap;          /* allows wrapping on mobile */
  margin-top: 4rem;
  margin-bottom: 4rem;
  width: 100%;
}

/* 2. Individual Column */
.palette-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* Give them a bit more width to accommodate the wide circle */
  width: 280px; 
  max-width: 100%;
}

/* 3. The Image Fix */
.circle-wrapper {
  /* We define a box size for alignment */
  width: 100%;
  height: 180px; 
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.circle-wrapper img {
  /* "contain" ensures the WHOLE image shows, never cutting edges */
  object-fit: contain; 
  width: 100%;
  height: 100%;
  
  /* IMPORTANT: Remove border-radius: 50%. 
     If your PNG is already a circle, you don't need CSS to cut it again. 
     This prevents the wide overlapping circles from becoming an oval. */
  border-radius: 0; 
}

/* Typography */
.palette-item h4 {
  font-family: var(--font-subheading);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #000;
  text-transform: uppercase;
}

.palette-item p {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text-light);
  line-height: 1.4;
}
/* =========================================
   7. UTILITIES: VIDEO & ICONS
   ========================================= */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* This creates the 16:9 ratio */
  height: 0;              /* CHANGE THIS: Must be 0 so padding controls the height */
  width: 100%;
  max-width: 1000px;
  margin: 2rem auto;
  overflow: hidden;
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  border: 0;
}
/* PTC Feature Icons Only */
.icon-wrapper {
  height: 200px; width: 100%;
  display: flex; justify-content: center; align-items: center;
  margin-bottom: 15px;
}
.icon-wrapper img {
  width: 100% !important; height: 200px !important;
  object-fit: contain; margin: 0 !important;
  filter: invert(1);
}
/* Social media */
.social-row {
    display: flex;       /* Aligns items side-by-side */
    gap: 20px;           /* Adds space between the icons */
    margin-top: 1.5rem;  /* Adds space above the whole row */
}

/* Individual Icon Style */
.social-icon {  
    width: 40px;         
    height: auto;
    /* margin-top: 1.5rem; <--- REMOVED (The row handles this now) */
    opacity: 0.8;       
    transition: opacity 0.3s ease;
    display: block;      /* Removes any weird tiny gaps below images */
}

.social-icon:hover {
    opacity: 1;         
    cursor: pointer;
}
/* =========================================
   8. FOOTER
   ========================================= */
footer {
  font-family: var(--font-body);
  text-align: center;
  padding: 2rem;
  font-size: var(--fs-small);
  color: var(--color-primary);
  margin-top: auto;
  border-top: 1px solid rgba(0,0,0,0.05);
}

/* =========================================
   9. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 900px) {
  .split-section, .split-section.reverse, #hero {
    flex-direction: column-reverse;
    min-height: auto;
    padding: 2rem 0;
  }
  .split-content, .split-image,
  .hero-content-wrapper, .hero-image-container {
    width: 100%; padding: 1rem 5%; text-align: center;
  }
  .split-text-control { text-align: center; margin: 0 auto; }
  .skills-grid { grid-template-columns: 1fr; }
  .center-content2 img, .center-content3 img {
    max-width: 100%; height: auto; min-width: unset;
  }
  .projects-grid { grid-template-columns: 1fr; } /* Stack index projects */

  .scramble-desc {
    height: auto; /* Let it grow naturally on phones */
    min-height: 250px; /* Give it enough space so it doesn't jump too much */
    margin-bottom: 3rem; /* Extra space above the button just in case */
  }
}

/* =========================================
   10. INDEX PAGE STYLES (NEW)
   ========================================= */

/* Hero Section override for Index */
.index-hero {
    display: flex;
    flex-direction: row;
    align-items: center; 
    min-height: 70vh;    
    width: 100%;
    background-color: #ffffff;
    overflow: hidden;
}

/* Wrapper specifically for Index Hero to allow full width */
.index-hero-wrapper {
    width: 100%;
    max-width: 1200px; 
    margin: 0 auto;
    padding-left: 2rem; 
    padding-right: 2rem;
    display: flex;
    justify-content: flex-start; /* Align left */
    flex: none; /* Override the 'flex:1' from generic hero */
}

.hero-text {
    max-width: 600px;
    text-align: left;
}

.hero-text p {
    font-size: 1.2rem;
    color: #3f3f3f;
    margin-bottom: 2rem;
}
/* =========================================
  Buttons
   ========================================= */
.hero-btn {
    display: inline-block;
    padding: 12px 32px;
    border: 1px solid #3f3f3f; 
    background-color: transparent;
    color: #000000;
    text-decoration: none;
    font-family: "Saira", sans-serif;
    font-size: var(--fs-small);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    font-weight: 700;
}
.hero-btn:hover {
    background-color: #000000;
    color: #ffffff;
}
.nav-btn {
    display: inline-block;
    margin: 10px;  /* <--- ADD THIS LINE (Adds space all around) */
    padding: 12px 32px;
    border: 1px solid #3f3f3f; 
    background-color: transparent;
    color: #000000;
    text-decoration: none;
    font-family: "Saira", sans-serif;
    font-size: var(--fs-small);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    font-weight: 700;
}
.nav-btn:hover {
    background-color: #000000;
    color: #ffffff;
}
/* --- PROJECT GRID (Overlay Style) --- */
.projects-grid {
    display: grid;
    /* 500px min-width creates a nice 2-column layout */
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    width: 100%;
    padding-bottom: 6rem;
}

/* Clickable container */
.project-item {
    position: relative;
    display: block; 
    width: 100%;
    aspect-ratio: 16 / 9; /* Widescreen */
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none; 
}

/* Image styling */
.project-image { width: 100%; height: 100%; }

.project-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.4s ease, transform 0.4s ease;
    display: block;
}

/* Text Overlay */
.project-content {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 90%;
    z-index: 2;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.4s ease;
}

.project-item h3 {
    color: #ffffff;
    font-size: 2rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    margin-bottom: 0.5rem;
    border-bottom: none; /* Remove border from generic H3 */
}

/* Hover Effects */
.project-item:hover .project-content { opacity: 1; }
.project-item:hover img {
    filter: brightness(0.4);
    transform: scale(1.05);
}