/*
 * Global styles for the portfolio site.
 *
 * This stylesheet aims for a clean, modern aesthetic inspired by Huge Design.
 * It employs generous white space, a restrained colour palette and clear typography.
 */

:root {
  --primary-font: 'Montserrat', sans-serif;
  --text-color: #1a1a1a;
  --muted-color: #767676;
  --accent-color: #e8652e; /* warm orange accent reminiscent of the Stratus device */
  --background-color: #ffffff;
  --card-bg: #f7f7f7;
  --border-radius: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--primary-font);
  color: var(--text-color);
  background: var(--background-color);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

/* Container utility to constrain content width */
.container {
  width: 90%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  /* Apply 0.5 inch horizontal padding to provide consistent margins on each side */
  padding-left: 0.5in;
  padding-right: 0.5in;
}

/* Header */
.site-header {
  /* Frosted glass effect for the header using a semi-transparent background and backdrop blur */
  /* Make the navigation bar translucent and blurry rather than solid white */
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  /* Place the header on top of the slideshow with a fixed position so it overlays the hero section */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo {
  font-weight: 600;
  font-size: 1.4rem;
  text-decoration: none;
  color: var(--text-color);
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.2s ease;
}

.main-nav a:hover {
  /* On hover, use a lighter gray rather than the accent colour */
  color: #b3b3b3;
}

/* Dropdown menu for the Work tab */
/* Position the list items relative so the submenu can position absolute */
.main-nav ul li {
  position: relative;
}

/* Hide the dropdown menus by default */
.main-nav .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  list-style: none;
  padding: 0.5rem 0;
  z-index: 1000;
}

/* Show the dropdown on hover */
.main-nav li:hover > .dropdown-menu {
  display: block;
}

/* Style the links inside the dropdown */
.dropdown-menu li a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-color);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.dropdown-menu li a:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/*
 * Highlight the active navigation tab and logo by increasing the font weight
 * rather than changing the colour. The `active` class is applied in the HTML
 * to whichever page is currently selected. Keeping the colour consistent
 * maintains a calm, cohesive look while still providing clear feedback to
 * visitors. When the site logo has the `active` class (home page), it will
 * also appear bolder.
 */
.main-nav a.active {
  /* Make active navigation items noticeably bold. Weight 700 stands out from the default 500 */
  font-weight: 700;
  color: var(--text-color);
}

.logo.active {
  font-weight: 700;
  color: var(--text-color);
}

/* Hero section */
/*
 * Hero section on the homepage. Add a top margin to accommodate the sticky header
 * so that the heading doesn't end up hidden behind the nav when scrolling.
 */
.hero {
  /* Large top padding for visual breathing room */
  padding: 6rem 0 4rem;
  background: var(--background-color);
  text-align: left;
  /* Additional margin top ensures the sticky header doesn't overlap the hero
     when navigating between pages. Adjust this value if header height changes. */
  margin-top: 3.5rem;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.2rem;
  max-width: 600px;
  color: var(--muted-color);
}

/* Work section */
.work-section {
  padding: 4rem 0;
}

.section-title {
  /* Responsive sizing for section headings */
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: 2rem;
  text-align: left;
}

.project-grid {
  display: grid;
  /* Increase the minimum width of each card so project images appear larger */
  /* Raise the minimum width again so the gallery cards appear larger */
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: none;
  text-decoration: none;
  color: var(--text-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.12);
}

.project-card .card-image {
  background-size: cover;
  background-position: center;
  /* Make the project cards taller to better showcase the artwork */
  padding-top: 75%;
}

.project-card .card-content {
  /* Position the text overlay at the bottom of the card image */
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.project-card h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  margin-bottom: 0.25rem;
}

.project-card .card-subtitle {
  color: var(--muted-color);
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  background: #f5f5f5;
  padding: 2rem 0;
  margin-top: 4rem;
  font-size: 0.9rem;
}

.site-footer .footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.site-footer .social-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.site-footer .social-links a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.2s ease;
}

.site-footer .social-links a:hover {
  /* On hover, keep social links a neutral gray instead of the accent colour */
  color: #b3b3b3;
}

/* Image styling for the about page portrait */
.about-photo {
  width: 100%;
  /* Allow the portrait to scale within its flex container */
  border-radius: var(--border-radius);
  /* When used within a flex layout the margins are controlled by the container */
  display: block;
  margin: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Sticky footer support on the contact page. Use flexbox to push the footer to the bottom when content is short */
.contact-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.contact-page main {
  flex: 1 0 auto;
}

.contact-page .site-footer {
  margin-top: auto;
}

/* About page layout: align text and image side by side on larger screens */
.about-section {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  margin-top: 1.5rem;
}

.about-section .about-text {
  /* Allocate slightly more space to the text to ensure both columns fit alongside one another */
  flex: 1 1 55%;
}

.about-section .about-image {
  flex: 1 1 40%;
}

.about-section .about-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* Project pages */
.project-hero {
  position: relative;
  width: 100%;
  /* Make project hero sections fill the viewport for a dramatic full‑bleed presentation */
  height: 100vh;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  color: #fff;
  padding: 2rem;
  /* Remove corner rounding so images bleed edge to edge */
  border-radius: 0;
  overflow: hidden;
  /* Allow the hero image to sit beneath the header */
  margin-top: 0;
}

/*
 * Slideshow styles for the home page hero. The slideshow uses absolute
 * positioning and opacity transitions to cycle through background images.
 */
.slideshow-container {
  position: relative;
  width: 100%;
  /* Responsive hero height: scales between 55% and 90% of viewport height based on viewport width */
  height: clamp(55vh, 70vw, 90vh);
  overflow: hidden;
  /* Allow slides to sit underneath the header for a full‑bleed effect */
  margin-top: 0;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Remove background image properties; images are inserted via <img> to avoid cropping */
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

/* Ensure slide images maintain their aspect ratio without cropping */
.slide img {
  width: 100%;
  height: 100%;
  /* Fill the slide container while preserving aspect ratio. Some cropping may occur */
  object-fit: cover;
  object-position: center;
  display: block;
}

.slide.active {
  opacity: 1;
  z-index: 1;
}

/* Gradient overlay on slides to improve legibility of overlaid text */
.slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.0) 60%);
}

/* Text overlay inside slides */
.slide-content {
  position: absolute;
  bottom: 20%;
  left: 5%;
  color: #fff;
  z-index: 2;
  /* Frosted glass panel behind slide text for better legibility */
  background: rgba(255, 255, 255, 0.25);
  padding: 1.5rem 2rem;
  border-radius: var(--border-radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.slide-content h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.slide-content p {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: #e0e0e0;
  max-width: 600px;
}

@media (max-width: 768px) {
  .slideshow-container {
    height: 50vh;
  }
  .slide-content h1 {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
  }
}

.project-hero::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(0deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.0) 60%);
  z-index: 0;
}

.project-hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.project-hero h1 {
  /* Responsive font sizing for project titles */
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.project-hero .meta {
  font-size: 0.9rem;
  color: #e0e0e0;
}

.project-body {
  padding: 3rem 0 4rem;
}

.project-body p {
  margin-bottom: 1.25rem;
  max-width: 800px;
}

.project-body ul {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--muted-color);
}

.project-body ul li {
  margin-bottom: 0.5rem;
}

/* Simple gallery layout for project pages */
.project-gallery {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0;
}

.project-gallery img {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Statement section below the slideshow */
.statement-section {
  padding: 4rem 0;
  background: var(--background-color);
  /* Ensure the statement does not sit directly beneath the sticky header */
  margin-top: 2rem;
  /* Left align content within the statement section */
  text-align: left;
}

.statement-section h2 {
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.statement-section p {
  max-width: 700px;
  /* Align the paragraph directly under the heading without centering */
  margin: 0 0 2rem 0;
  line-height: 1.6;
  font-size: 1.1rem;
  color: var(--muted-color);
}

/* Button style used in the statement section */
.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  /* Use a light gray background to match the site's muted palette */
  background-color: #f0f0f0;
  color: var(--text-color);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.button:hover {
  background-color: #e0e0e0;
}

/*
 * Provide generous spacing for stand-alone pages (about and contact). Without a hero
 * section these pages can feel cramped under the sticky header and close to the footer.
 * Adding top and bottom margins ensures the content breathes on the page.
 */
.page-content {
  margin-top: 5rem;
  margin-bottom: 6rem;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.4rem;
  }
  .project-hero {
    height: 40vh;
    padding: 1.5rem;
  }
  .project-hero h1 {
    font-size: 2rem;
  }
}