/* ========================================
  Global Styles & Variables
  ========================================
*/
:root {
  --base: ##F2F5EA; /* Grey */
  --primary: #19647E; /* Slate Blue/Grey */
  --accent: #FF8C61;  /* Coral */
  --text-light: #f8f9fa;
  --text-dark: #212529;
  --success: #2a9d8f;
  --error: #e76f51;
  --input-border: #ced4da;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--base);
  margin: 0;
  color: var(--primary);
  overscroll-behavior: none; 
}

/* ========================================
  Header & Navigation
  ========================================
*/
header#main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  transition: background-color 0.4s ease-in-out, box-shadow 0.4s ease-in-out;
}

header#main-header.pinned {
    background-color: rgba(44, 62, 80, 0.95);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

header nav {
  padding: 1rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s ease;
}

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

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

.page-title {
  text-align: center;
  margin-top: 2rem;
  font-size: 2rem;
}

/* ========================================
  Landing Page Styles
  ========================================
*/
#hero {
    height: 200vh;
    color: var(--text-light);
    position: relative;
}
#hero-sticky-container {
    height: 100vh;
    width: 100%;
    position: sticky;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://sawyerm.ca/assets/images/WorkingBack.webp');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
#hero-text {
    font-size: clamp(2.5rem, 10vw, 6rem);
    font-weight: 900;
    margin: 0;
    padding: 1rem;
    color: white;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
    line-height: 1.1;
    transition: font-size 0.4s ease-out, background-color 0.4s ease-out, padding 0.4s ease-out, color 0.4s ease-out;
}
#hero-text.hero-text-locked {
    position: fixed;
    left: 0;
    width: 100%;
    z-index: 999;
    background-color: var(--primary);
    font-size: 1.25rem;
    padding: 0.5rem 1rem;
    text-shadow: none;
    opacity: 1;
    transform: translateY(0);
}
#changing-word {
    display: inline-block;
    color: var(--accent);
    min-width: 4em; 
    text-align: left;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    will-change: opacity, transform;
}
#content {
    background-color: var(--base);
    position: relative;
    z-index: 5;
    padding: 5rem 2rem;
}
.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}
.content-wrapper h2 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    margin-bottom: 1.5rem;
}
.content-wrapper p {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 650px;
    margin: 0 auto 1.5rem auto;
}
.cta-buttons {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.cta-primary, .cta-secondary {
    text-decoration: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}
.cta-primary {
    background-color: var(--accent);
    color: white;
    cursor: pointer;
}
.cta-primary:hover {
    background-color: #d16a50;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.cta-secondary {
    background-color: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.cta-secondary:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* ========================================
  Contact Form Styles
  ========================================
*/
.contact-page-main {
    padding-top: 100px; /* Offset for the fixed header */
    padding-bottom: 4rem;
}

.contact-form-container {
    max-width: 700px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-header h1 {
    font-size: clamp(1.8rem, 5vw, 2.2rem);
    margin: 0;
}

.form-header p {
    font-size: 1.1rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

.form-group {
    position: relative;
    margin-bottom: 2rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 10px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group label {
    position: absolute;
    top: 13px;
    left: 10px;
    color: #6c757d;
    pointer-events: none;
    transition: all 0.2s ease;
    background-color: #f8f9fa;
    padding: 0 5px;
}

/* Floating label effect */
.form-group input:focus + label,
.form-group textarea:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -10px;
    left: 8px;
    font-size: 0.85rem;
    color: var(--primary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(226, 125, 96, 0.2);
}

.contact-form button.cta-primary {
    width: 100%;
    font-size: 1.1rem;
    padding: 0.9rem 2rem;
    border: none;
}

/* Success Message Toast */
.form-success {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--success);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 1001;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease, transform 0.5s ease;
}

.form-success.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(20px);
}

.form-success p {
    margin: 0;
    font-weight: bold;
}


/* ========================================
  Other Page Styles (Work/About)
  ========================================
*/
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
}
.project-tile {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}
.project-tile img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.project-tile:hover img {
  transform: scale(1.05);
}
.project-tile .overlay {
  position: absolute;
  inset: 0;
  background: rgba(44, 62, 80, 0.8);
  color: white;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.project-tile:hover .overlay {
  opacity: 1;
}
.overlay h3, .overlay p, .overlay span {
  margin: 0.2rem 0;
}
.about-section {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}
.about-section article {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}
@media (min-width: 768px) {
    .about-section article {
        grid-template-columns: 1fr 1fr;
    }
    .about-section.alt article {
        grid-template-columns: 1fr 1fr;
    }
    .about-section.alt article > *:first-child {
        order: 2;
    }
}
.about-section img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* ========================================
  Footer
  ========================================
*/
footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--primary);
    color: var(--base);
}
/* Text + Image beside each other */
.text-image-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-top: 2rem;
}

.text-image-block .text-side {
  flex: 1;
}

.text-image-block .image-side {
  flex: 1;
  display: flex;
  justify-content: center;
}

.text-image-block img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* Side-by-side on desktop */
@media (min-width: 768px) {
  .text-image-block {
    flex-direction: row;
    align-items: flex-start;
  }
  .text-image-block .text-side {
    text-align: left;
  }
}

