/* Color Variables */
:root {
  --accent: #567248;           /* Green */
  --accent-strong: #434B24;    /* Darker green */
  --highlight: #C9A24D;        /* Gold */
  --text: #3A3A3A;             /* Charcoal */
  --background: #FAF9F6;       /* Cream/off-white */
  --background-alt: color-mix(in srgb, var(--background) 97%, var(--accent) 3%);
  --definition-bg: color-mix(in srgb, white 20%, var(--accent) 80%);

  /* Collapsible animation timings */
  --collapse-timing: 1s;       /* Closing animation duration */
  --expand-timing: 0.6s;       /* Opening animation duration */
}

/* Basic Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Source Sans Pro", Helvetica, sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.75;
}

/* Italic text spacing */
em, i {
  margin-right: 0.1em;
}

/* Paragraph Spacing */
p {
  margin-bottom: 1em;
}

/* Section Headings */
section h2 {
  font-family: Raleway, Helvetica, sans-serif;
  text-align: center;
  text-transform: uppercase;
  margin-top: 0;
  margin-bottom: 1.75rem;
}

/* Subsection Headings */
section h3 {
  text-transform: uppercase;
}

/* Add padding below subsection titles in About My Work */
#about-my-work h3 {
  margin-bottom: 1rem;
}

/* About My Work collapsible sections */
#about-my-work details {
  margin-bottom: 1.5em;
}

#about-my-work summary {
  cursor: pointer;
  padding: 0.5em 0;
  list-style: none;
  user-select: none;
  color: var(--text);
  font-weight: normal;
}

#about-my-work summary strong {
  color: var(--text);
  font-weight: bold;
}

#about-my-work summary::-webkit-details-marker {
  display: none;
}

#about-my-work summary::before {
  content: '+ ';
  font-weight: bold;
  margin-right: 0.5em;
  color: var(--accent);
  transition: transform 0.3s ease;
  display: inline-block;
}

#about-my-work details[open] summary::before {
  content: '− ';
  color: var(--accent);
}

#about-my-work details summary:hover {
  color: var(--accent);
}

/* Animate About answer expansion and collapse */
.about-answer {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows var(--collapse-timing) ease, opacity var(--collapse-timing) ease;
  opacity: 0;
}

#about-my-work details[open] .about-answer {
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows var(--expand-timing) ease, opacity var(--expand-timing) ease;
}

.about-answer > * {
  min-height: 0;
}

#about-my-work details p {
  margin-top: 0.75em;
  color: var(--text);
}

/* Content Width Constraint */
main section {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 2rem 3rem 1rem;
  scroll-margin-top: 4rem; /* Offset for fixed header on mobile */
}

/* List styling - bullets inside text area with equal padding */
main section ul {
  list-style-position: inside;
  padding-left: 0;
  margin-left: 0;
}

main section li {
  padding-left: 1.5em;
  padding-right: 1.5em;
  margin-bottom: 0.75em;
}

/* Alternating backgrounds for sections */
main section:nth-child(even) {
  background-color: var(--background-alt);
  border-radius: 8px;
}

/* Hero section removed max-width - now handled by content inside */

/* Header - Fixed at Top (Mobile) */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--accent-strong);
  color: var(--background);
  z-index: 100;
}

#header a {
  color: var(--background);
  text-decoration: none;
}

/* Mobile header - hide desktop version */
.header-title-desktop {
  display: none;
}

/* Mobile header dynamic text */
.header-title-mobile {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  gap: 0.5em;
}

.header-title {
  display: inline-flex;
  align-items: center;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.6s ease, opacity 0.6s ease;
}

.header-pipe {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.header-name {
  display: inline-block;
  transition: transform 0.6s ease;
  font-weight: 300;
}

#header.scrolled .header-title {
  max-width: 350px;
  opacity: 1;
}

#header.scrolled .header-pipe {
  opacity: 1;
}

#header.scrolled .header-name {
  transform: translateX(0);
}

/* Hide navigation links and book button on mobile */
.header-nav,
.nav-button-container {
  display: none;
}

/* Show menu toggle on mobile */
.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 1em;
  border: 1px solid var(--background);
  border-radius: 4px;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  transition: background-color 0.2s ease;
}

.menu-toggle:hover {
  background-color: rgba(250, 249, 246, 0.1);
}

.menu-toggle::before {
  content: '☰';
  font-size: 1em;
  line-height: 1;
  display: flex;
  align-items: center;
}

/* Mobile Menu Modal */
#menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: none;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 1rem 1rem 0 0;
}

#menu.visible {
  display: flex;
}

#menu .inner {
  background-color: var(--accent-strong);
  padding: 2rem 2.5rem 1.5rem;
  width: 320px;
  max-width: calc(100vw - 2rem);
  border-radius: 4px;
  border: 1px solid var(--background);
  text-align: center;
  position: relative;
}

#menu h2 {
  color: var(--background);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(250, 249, 246, 0.2);
}

#menu .links {
  list-style: none;
  padding: 0;
  margin: 0;
}

#menu .links li {
  margin-bottom: 0.5rem;
}

#menu .links a {
  display: block;
  color: var(--background);
  text-decoration: none;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 300;
  opacity: 0.75;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

#menu .links a:hover {
  opacity: 1;
  background-color: color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 4px;
}

#menu .close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  color: var(--background);
  text-decoration: none;
  font-size: 2rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#menu .close:hover {
  opacity: 1;
}

/* Blur background when menu is open */
body.menu-visible #header,
body.menu-visible main,
body.menu-visible #hero,
body.menu-visible #signature,
body.menu-visible #footer {
  filter: blur(5px);
}

/* Add padding to body to prevent content from hiding under fixed header */
body {
  padding-top: 0;
}

/* Hero Section */
#hero {
  background-color: var(--accent);
  color: var(--background);
  padding: 5rem 3rem 3rem;
  margin-top: 0;
}

#hero h1 {
  color: var(--background);
  text-transform: uppercase;
}

#hero p {
  color: var(--background);
}

/* Hero Content - Flexbox Layout */
.hero-content {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Constrain hero paragraphs */
#hero > p {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.hero-text {
  text-align: left;
  width: 100%;
}

.hero-text h1 {
  text-align: center;
}

.hero-image {
  margin: 2rem 2rem 0;
}

/* Hero Image - Circular with Gold Border */
.hero-image img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 6px solid var(--highlight);
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* Hero Text Sizing */
.intro-primary {
  font-size: 1.35em;
  line-height: 1.5;
}

.intro-secondary {
  font-size: 0.95em;
  line-height: 1.6;
}

/* Catalyst definition */
.catalyst-definition {
  font-family: 'IM Fell English', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 0.85em;
  color: var(--background);
  font-style: normal;
  font-weight: 400;
  margin-top: 2em;
  margin-left: auto;
  margin-right: auto;
  padding: 1em 1.25em;
  background-color: var(--definition-bg);
  border-radius: 8px;
  line-height: 1.4;
  width: fit-content;
  max-width: 100%;
}

.catalyst-term {
  margin-bottom: 0.5em;
}

.catalyst-term strong {
  font-weight: 700;
  font-style: normal;
  font-variant: small-caps;
  color: var(--background);
  letter-spacing: 0.05em;
}

.catalyst-meaning {
  color: var(--background);
}

/* Desktop: Title left, Image right */
@media (min-width: 737px) {
  .hero-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .hero-text {
    flex: 1;
    text-align: left;
  }

  .hero-text h1 {
    text-align: left;
  }

  .hero-image {
    flex: 0 0 auto;
  }
}

/* FAQ Section */
#faq details {
  margin-bottom: 1em;
  border-bottom: 1px solid rgba(79, 111, 62, 0.2);
  padding-bottom: 0.75em;
}

#faq summary {
  cursor: pointer;
  padding: 0.5em 0;
  list-style: none;
  user-select: none;
  color: var(--text);
  font-weight: bold;
}

#faq summary strong {
  color: var(--text);
  font-weight: bold;
}

#faq summary::-webkit-details-marker {
  display: none;
}

#faq summary::before {
  content: '+ ';
  font-weight: bold;
  margin-right: 0.5em;
  color: var(--accent);
  transition: transform 0.3s ease;
  display: inline-block;
}

#faq details[open] summary::before {
  content: '− ';
  color: var(--accent);
}

#faq details summary:hover {
  color: var(--accent);
}

/* Animate FAQ answer expansion and collapse */
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows var(--collapse-timing) ease, opacity var(--collapse-timing) ease;
  opacity: 0;
}

#faq details[open] .faq-answer {
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows var(--expand-timing) ease, opacity var(--expand-timing) ease;
}

.faq-answer > * {
  min-height: 0;
}

#faq details p {
  margin-top: 0.75em;
  padding-left: 1.5em;
  color: var(--text);
}

/* Signature Section */
#signature {
  text-align: center;
  padding: 2rem 3rem;
}

#signature img {
  max-width: 200px;
  height: auto;
}

/* Footer Section */
#footer {
  background-color: var(--accent);
  color: var(--background);
  padding: 3rem 3rem 2rem;
}

#footer h3 {
  color: var(--background);
  text-transform: uppercase;
  font-size: 0.85rem;
}

#footer p {
  color: var(--background);
}

#footer .legal-text {
  font-size: 0.8rem;
}

#footer .legal-text h3 {
  font-size: 0.85rem;
  text-align: center;
}

#footer .copyright {
  font-size: 0.75rem;
  font-weight: 300;
  opacity: 0.7;
  text-align: center;
}

/* Book Call Button */
.book-call-btn {
  display: inline-block;
  background-color: var(--accent);
  color: var(--background);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--background);
  text-decoration: none;
  font-weight: 600;
  opacity: 1 !important;
  transition: background-color 0.2s ease;
}

.book-call-btn:hover {
  background-color: var(--accent-strong);
  color: var(--background);
  opacity: 1;
}

.button-center {
  text-align: center;
  margin-top: 1.5rem;
}

/* Small mobile screens - 500px and below */
@media (max-width: 500px) {
  /* Reduce header padding */
  #header {
    padding: 0.75rem 1rem;  /* Reduce from 1rem 2rem */
  }

  /* Hide "Menu" text, show only hamburger icon without border */
  .menu-toggle {
    padding: 0.5em;        /* Compact padding */
    font-size: 0;          /* Hide text */
    border: none;          /* Remove border */
  }

  .menu-toggle::before {
    font-size: 1.5rem;     /* Larger icon when no border */
  }

  /* Reduce dynamic header text size if needed */
  .header-title-mobile {
    font-size: 0.8rem;     /* Reduce from 0.9rem */
  }

  /* Adjust scroll offset for smaller header */
  main section {
    scroll-margin-top: 2.5rem;  /* Reduced from 4rem to match smaller header */
  }
}

/* Extra small mobile screens - 340px and below */
@media (max-width: 340px) {
  /* Hide "Relationship Engineer | " part, show only name */
  .header-title,
  .header-pipe {
    display: none !important;  /* Override even when scrolled */
  }
}

/* Desktop Sidebar Navigation (min-width: 900px) */
@media (min-width: 900px) {
  /* Hide mobile header, show desktop */
  .header-title-mobile {
    display: none;
  }

  .header-title-desktop {
    display: block;
  }

  /* Transform header into left sidebar */
  #header {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: auto;
    width: 250px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 2rem 1rem;
    background-color: var(--accent-strong);
  }

  /* Header left content */
  .header-left {
    margin-bottom: 0.75rem;
    padding-bottom: 1rem;
    padding-left: calc(3px + 0.4rem);
    border-bottom: 1px solid rgba(250, 249, 246, 0.2);
    flex-shrink: 0;
  }

  .header-left .title {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.6rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--background);
    opacity: 0.75;
  }

  .header-left .title strong {
    font-weight: 600;
  }

  .header-left .name {
    display: block;
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--background);
    opacity: 0.75;
  }

  /* Show navigation links and book button on desktop */
  .header-nav,
  .nav-button-container {
    display: flex;
  }

  .header-nav {
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    align-items: flex-start;
    flex-shrink: 0;
    margin-top: 0;
  }

  .header-nav a {
    color: var(--background);
    text-decoration: none;
    padding: 0.4rem 0;
    border-left: 3px solid transparent;
    padding-left: 0.4rem;
    font-size: 1rem;
    font-weight: 300;
    opacity: 0.7;
    transition: all 0.2s ease;
  }

  .header-nav a:hover {
    opacity: 1;
    text-decoration: underline;
  }

  /* Active section indicator */
  .header-nav a.active {
    border-left-color: var(--highlight);
    opacity: 1;
    font-weight: 400;
    transform: translateX(4px);
  }

  /* Hide menu toggle and menu on desktop */
  .menu-toggle,
  #menu {
    display: none !important;
  }

  /* Nav button container */
  .nav-button-container {
    margin-top: auto;
    margin-bottom: 2rem;
    width: 100%;
    text-align: center;
  }

  .nav-button-container .book-call-btn {
    width: calc(100% - 1rem);
  }

  /* Adjust body padding for sidebar */
  body {
    padding-top: 0;
    padding-left: 250px;
  }

  /* Reset hero padding on desktop */
  #hero {
    padding: 3rem 3rem;
  }

  /* Remove scroll offset on desktop (no fixed top header) */
  main section {
    scroll-margin-top: 0;
  }
}
