/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --saddle-brown: #8B4513;
  --terracotta: #E86B30;
  --chocolate: #D2691E;
  --beige: #F3E5D1;
  --white: #FFFDF9;
  --dark-brown: #3E2110;
  --light-text: #FFFDF9;
  --shadow: rgba(62, 33, 16, 0.12);
  --radius: 8px;
  --transition: 0.3s ease;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  color: var(--dark-brown);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--terracotta);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--chocolate);
}

h1, h2, h3, h4 {
  color: var(--saddle-brown);
  line-height: 1.2;
}

/* ===== Utility ===== */
.container {
  width: 90%;
  max-width: 1140px;
  margin: 0 auto;
}

.section {
  padding: 5rem 0;
}

.section--beige {
  background: var(--beige);
}

.text-center {
  text-align: center;
}

/* ===== Navigation ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #1a1a1a;
  box-shadow: 0 2px 8px var(--shadow);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar__logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--light-text);
  letter-spacing: 0.5px;
}

.navbar__logo:hover {
  color: var(--beige);
}

.navbar__logo-img {
  height: 36px;
  width: auto;
}

.navbar__links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.navbar__links a {
  color: var(--beige);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}

.navbar__links a:hover,
.navbar__links a.active {
  color: var(--light-text);
  border-bottom-color: var(--terracotta);
}

.navbar__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.navbar__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--light-text);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url('../images/excavata topo.png') center/cover no-repeat;
  color: var(--light-text);
  padding: 6rem 0;
  text-align: center;
}

.hero .container {
  position: relative;
}

.hero h1 {
  font-size: 3rem;
  color: var(--light-text);
  margin-bottom: 1rem;
}

.hero__logo-img {
  height: 64px;
  width: auto;
  margin-bottom: 0.5rem;
}

/* Home page hero: logo positioned right */
.hero--home .hero__logo-img {
  margin: 0 auto 1.5rem;
  height: 80px;
}

.hero p {
  font-size: 1.2rem;
  max-width: 640px;
  margin: 0 auto 2rem;
  opacity: 0.92;
}

.hero__buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero--home .hero__buttons {
  justify-content: center;
}

/* ===== Feature Dropdowns ===== */
.feature-dropdowns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.feature-dropdown {
  position: relative;
}

.feature-dropdown__toggle {
  background: rgba(255, 255, 255, 0.15);
  color: var(--light-text);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  font-family: inherit;
}

.feature-dropdown__toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.feature-dropdown__arrow {
  margin-left: 0.4rem;
  font-size: 0.75rem;
  display: inline-block;
  transition: transform var(--transition);
}

.feature-dropdown__toggle[aria-expanded="true"] .feature-dropdown__arrow {
  transform: rotate(180deg);
}

.feature-dropdown__content {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  z-index: 50;
  min-width: 700px;
  color: var(--dark-brown);
  text-align: left;
}

.feature-dropdown__content.open {
  display: block;
}

.feature-dropdown__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.feature-dropdown__col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--terracotta);
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

.feature-dropdown__col h4:first-child {
  margin-top: 0;
}

.feature-dropdown__col ul {
  list-style: none;
  padding: 0;
}

.feature-dropdown__col ul li {
  font-size: 0.8rem;
  padding: 0.2rem 0;
  color: #6B4226;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition), transform var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--terracotta);
  color: var(--light-text);
}

.btn--primary:hover {
  background: #d45e28;
  color: var(--light-text);
}

.btn--outline {
  background: transparent;
  color: var(--light-text);
  border-color: var(--light-text);
}

.btn--outline:hover {
  background: var(--light-text);
  color: var(--saddle-brown);
}

.btn--dark {
  background: var(--saddle-brown);
  color: var(--light-text);
}

.btn--dark:hover {
  background: var(--dark-brown);
  color: var(--light-text);
}

/* ===== Feature Cards Grid ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 2px 12px var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px var(--shadow);
}

.feature-card__icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.95rem;
  color: #6B4226;
}

/* ===== Feature Sections (alternating layout) ===== */
.feature-section {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 4rem 0;
}

.feature-section:nth-child(even) {
  flex-direction: row-reverse;
}

.feature-section__content {
  flex: 1;
}

.feature-section__content h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.feature-section__content p {
  margin-bottom: 1rem;
  color: #6B4226;
}

.feature-section__content ul {
  list-style: none;
  padding: 0;
}

.feature-section__content ul li {
  padding: 0.35rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: #6B4226;
}

.feature-section__content ul li::before {
  content: "●";
  color: var(--terracotta);
  position: absolute;
  left: 0;
  font-size: 0.6rem;
  top: 0.55rem;
}

.feature-section__image {
  flex: 1;
}

/* ===== Placeholder Image ===== */
.placeholder-img {
  width: 100%;
  min-height: 240px;
  border: 2px dashed var(--chocolate);
  border-radius: var(--radius);
  background: var(--beige);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--saddle-brown);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  padding: 1rem;
}

/* ===== Platforms ===== */
.platforms {
  text-align: center;
}

.platforms h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.platforms p {
  max-width: 600px;
  margin: 0 auto 2.5rem;
  color: #6B4226;
}

.platforms__grid {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.platform-item {
  text-align: center;
}

.platform-item__icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
}

.platform-item span {
  display: block;
  font-weight: 600;
  color: var(--saddle-brown);
}

.platform-item__icon svg {
  stroke: var(--terracotta);
}

/* ===== About Page ===== */
.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-content h2 {
  font-size: 1.75rem;
  margin: 2.5rem 0 1rem;
}

.about-content h2:first-child {
  margin-top: 0;
}

.about-content p {
  margin-bottom: 1rem;
  color: #6B4226;
}

.methodology-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.methodology-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 2px 12px var(--shadow);
  border-top: 3px solid var(--terracotta);
}

.methodology-card h3 {
  margin-bottom: 0.5rem;
}

.methodology-card p {
  font-size: 0.95rem;
}

.tech-badges {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.tech-badge {
  background: var(--saddle-brown);
  color: var(--light-text);
  padding: 0.5rem 1.25rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===== Contact Form ===== */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--saddle-brown);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #C9B99A;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(232, 107, 48, 0.15);
}

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

.contact-info h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.contact-info p {
  margin-bottom: 1rem;
  color: #6B4226;
}

.contact-info__links {
  list-style: none;
  margin-top: 1.5rem;
}

.contact-info__links li {
  padding: 0.5rem 0;
  font-size: 1rem;
}

.contact-info__links a {
  font-weight: 500;
}

/* ===== Footer ===== */
.footer {
  background: #1a1a1a;
  color: var(--beige);
  padding: 3rem 0 1.5rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer__logo-img {
  height: 32px;
  width: auto;
  margin-bottom: 0.5rem;
}

.footer__brand h3 {
  color: var(--light-text);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.footer__brand p {
  font-size: 0.9rem;
  opacity: 0.8;
  max-width: 300px;
}

.footer h4 {
  color: var(--light-text);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.footer__links {
  list-style: none;
}

.footer__links li {
  margin-bottom: 0.4rem;
}

.footer__links a {
  color: var(--beige);
  font-size: 0.9rem;
  opacity: 0.8;
  transition: opacity var(--transition);
}

.footer__links a:hover {
  opacity: 1;
  color: var(--terracotta);
}

.footer__bottom {
  border-top: 1px solid rgba(243, 229, 209, 0.15);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ===== Video ===== */
.video-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 2px 12px var(--shadow);
  max-width: 900px;
  margin: 0 auto;
}

.video-card h2 {
  margin-bottom: 0.5rem;
}

.video-wrapper {
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

.video-wrapper video {
  display: block;
  width: 100%;
}

/* ===== Scroll Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .navbar__links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #1a1a1a;
    padding: 1rem 5%;
    gap: 0.5rem;
    box-shadow: 0 4px 12px var(--shadow);
  }

  .navbar__links.open {
    display: flex;
  }

  .navbar__toggle {
    display: block;
  }

  .navbar__toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .navbar__toggle.open span:nth-child(2) {
    opacity: 0;
  }

  .navbar__toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1.05rem;
  }

  .hero--home .container {
    text-align: center;
  }

  .hero--home .hero__logo-img {
    position: static;
    margin: 0 auto 0.5rem;
    height: 64px;
  }

  .hero--home .hero__buttons {
    justify-content: center;
  }

  .feature-dropdowns {
    justify-content: center;
  }

  .feature-dropdown__content {
    min-width: 0;
    width: 90vw;
    left: 50%;
    transform: translateX(-50%);
  }

  .feature-dropdown__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-section,
  .feature-section:nth-child(even) {
    flex-direction: column;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .section {
    padding: 3.5rem 0;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 4rem 0;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .hero__buttons {
    flex-direction: column;
    align-items: center;
  }
}
