:root {
  --forest-green: #1E2D24;
  --limestone: #E8E5DF;
  --graphite: #3E3E3E;
  --moss-green: #6F8F7A;
  --sand: #D4CFC6;
  --white: #FFFFFF;
  --black: #000000;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--graphite);
  background-color: var(--limestone);
  line-height: 1.7;
  font-size: 18px;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  color: var(--forest-green);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

p {
  margin-bottom: 1.5rem;
  max-width: 65ch;
}

a {
  color: var(--forest-green);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--moss-green);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

header {
  background-color: var(--limestone);
  padding: 2rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--sand);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--forest-green);
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.burger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
}

.burger span {
  width: 25px;
  height: 2px;
  background-color: var(--forest-green);
  transition: all 0.3s ease;
}

.burger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.burger.active span:nth-child(2) {
  opacity: 0;
}

.burger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

footer {
  background-color: var(--forest-green);
  color: var(--limestone);
  padding: 4rem 0 2rem;
  margin-top: 6rem;
}

footer a {
  color: var(--limestone);
}

footer a:hover {
  color: var(--moss-green);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-section h3 {
  color: var(--limestone);
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.75rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(232, 229, 223, 0.2);
  font-size: 0.9rem;
}

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: var(--forest-green);
  color: var(--limestone);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 999;
  transition: all 0.3s ease;
  opacity: 0.8;
}

.back-to-top:hover {
  opacity: 1;
  transform: translateY(-3px);
}

.back-to-top.visible {
  display: flex;
}

.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background-color: var(--forest-green);
  color: var(--limestone);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.9rem;
  font-weight: 500;
  border: 2px solid var(--forest-green);
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn:hover {
  background-color: transparent;
  color: var(--forest-green);
}

.btn-outline {
  background-color: transparent;
  color: var(--forest-green);
  border-color: var(--forest-green);
}

.btn-outline:hover {
  background-color: var(--forest-green);
  color: var(--limestone);
}

form {
  max-width: 600px;
}

.form-group {
  margin-bottom: 2rem;
}

form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--forest-green);
  font-size: 0.95rem;
}

form input,
form textarea,
form select {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--sand);
  background-color: var(--white);
  color: var(--graphite);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

form input:focus,
form textarea:focus,
form select:focus {
  outline: none;
  border-color: var(--moss-green);
}

form textarea {
  min-height: 150px;
  resize: vertical;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  margin-top: 0.25rem;
}

.checkbox-group label {
  margin-bottom: 0;
  font-weight: normal;
  font-size: 0.9rem;
}

/* 768px and below */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: var(--limestone);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-bottom: 1px solid var(--sand);
  }

  .nav-links.active {
    transform: translateX(0);
  }

  .burger {
    display: flex;
  }

  .container {
    padding: 0 1.5rem;
  }

  body {
    font-size: 16px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
  }

  /* Force single column layouts */
  section[style*="grid-template-columns"],
  div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  
  section[style*="display: grid"] > div[style*="grid-template-columns"],
  div[style*="display: grid"][style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  
  section[style*="display: flex"],
  div[style*="display: flex"] {
    flex-direction: column !important;
  }

  /* Responsive typography */
  h1 {
    font-size: clamp(2rem, 6vw, 3rem) !important;
  }
  
  h2 {
    font-size: clamp(1.75rem, 5vw, 2.5rem) !important;
  }

  h3 {
    font-size: clamp(1.5rem, 4vw, 2rem) !important;
  }

  /* Responsive spacing */
  section[style*="padding:"] {
    padding: 4rem 0 !important;
  }

  /* Hero sections */
  section.hero,
  section[style*="height: 90vh"],
  section[style*="height: 90%"] {
    height: auto !important;
    min-height: 60vh;
  }

  /* Image containers */
  img {
    width: 100%;
    height: auto;
  }

  /* Buttons */
  .btn {
    padding: 0.875rem 2rem;
    font-size: 0.85rem;
    width: 100%;
    text-align: center;
  }

  /* Form adjustments */
  form {
    max-width: 100%;
  }

  /* Text alignment */
  p {
    font-size: 1rem;
    line-height: 1.7;
  }

  /* Projects page article responsiveness at 768px */
  article {
    display: grid !important;
  }

  article[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }

  article[style*="grid-template-columns"] > div[style*="padding-top"] {
    padding-top: 0 !important;
    margin-top: 1.5rem;
  }
}

/* 320px and below */
@media (max-width: 320px) {
  .container {
    padding: 0 1rem;
  }

  header {
    padding: 1rem 0;
  }

  .logo {
    font-size: 1rem;
  }

  .nav-links {
    top: 60px;
    padding: 1.5rem;
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.85rem;
  }

  body {
    font-size: 14px;
  }

  h1 {
    font-size: 1.75rem !important;
    margin-bottom: 1rem;
  }
  
  h2 {
    font-size: 1.5rem !important;
    margin-bottom: 0.875rem;
  }

  h3 {
    font-size: 1.25rem !important;
    margin-bottom: 0.75rem;
  }

  section[style*="padding:"] {
    padding: 2.5rem 0 !important;
  }

  .footer-content {
    gap: 1.5rem;
  }

  .footer-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .footer-section ul li {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.8rem;
  }

  .back-to-top {
    width: 40px;
    height: 40px;
    bottom: 1rem;
    right: 1rem;
    font-size: 1rem;
  }

  /* Stack all content */
  div[style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  div[style*="grid-template-columns: repeat(2"] {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  /* Image adjustments */
  section[style*="position: relative"] img {
    width: 100%;
    height: auto;
  }

  /* Hero text overlay */
  div[style*="position: absolute"] {
    position: relative !important;
    max-width: 100% !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    top: auto !important;
    padding: 1.5rem !important;
    margin: 1rem 0 !important;
  }

  /* Process timeline adjustments */
  div[style*="display: grid"][style*="grid-template-columns: 100px"] {
    grid-template-columns: 50px 1fr !important;
    gap: 1.5rem !important;
  }

  div[style*="width: 100px"][style*="height: 100px"] {
    width: 50px !important;
    height: 50px !important;
    font-size: 1.25rem !important;
  }

  /* Projects page article responsiveness */
  article {
    display: grid !important;
  }

  article[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  article[style*="grid-template-columns"] > div[style*="padding-top"] {
    padding-top: 0 !important;
    margin-top: 1rem;
  }

  article h2 {
    font-size: 1.75rem !important;
    margin-bottom: 1rem !important;
  }

  article p {
    font-size: 0.95rem !important;
    line-height: 1.7 !important;
    margin-bottom: 1rem !important;
  }
}

