/* General resets and layout */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  font-family: Arial, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  position: relative;
  background-image: url('Images/Screenshot.png');
  background-size: cover;
  background-position: 50% 35%;
  color: white;
  text-align: center;
  padding: 8em;
  min-height: 150px;
}

header .logo {
  position: absolute;
  top: 50%;
  left: 1em;
  transform: translateY(-50%);
  height: 120px;
  width: auto;
  border-radius: 15px;
}

.text-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1em;
  width: 100%;
}

.title-bg {
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 0.3em 2em;
  display: block;
  border-radius: 8px;
  text-shadow: 1px 1px 3px black;
  font-weight: bold;
  font-size: 2em;
  margin: 0.5em auto 0.25em auto;
  max-width: 90%;
  width: fit-content;
  line-height: 1.3;
}

.slogan-bg {
  background-color: rgba(0, 77, 64, 0.8);
  color: white;
  padding: 0.5em 1em;
  display: block;
  border-radius: 8px;
  text-shadow: 1px 1px 2px black;
  font-weight: bold;
  font-size: 1.1em;
  margin: 0.25em auto 1em auto;
  max-width: 90%;
  width: fit-content;
  line-height: 1.3;
}

/* Navigation */
nav {
  background-image: url('Images/chainlink2.png');
  background-size: 150% auto;
  background-position: center;
  background-repeat: no-repeat;
  padding: 2em 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1em;
  text-align: center;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  padding: 0.5em 1em;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-shadow: 1px 1px 3px black;
  transition:
    background-color 0.3s,
    color 0.3s,
    border-color 0.3s,
    box-shadow 0.3s;
  white-space: nowrap;
}

nav a:hover {
  color: white;
  background: #06402B;
  border-color: white;
  box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

/* Main container with background image */
.container {
  position: relative;
  flex: 1;
  min-height: 400px;
  background-image: url('Images/about.png');
  background-size: cover;
  background-position: center 5%;
  background-repeat: no-repeat;
  padding: 6em 1em;
  display: flex;
  align-items: flex-start; /* Align content to top */
  justify-content: center; /* Center horizontally */
}

/* Dark overlay */
.container::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

/* ✅ Static text box, part of layout */
.container .text-box {
  position: relative;  /* stays in normal flow */
  z-index: 2;
  background-color: rgba(255, 255, 255, 0.85);
  padding: 2em;
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  margin-left: auto;   /* Pushes box to the right */
  margin-right: 0;     /* Aligns it to the right edge */
  color: #000;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  line-height: 1.5;
}





/* Footer */
footer {
  background-color: #004d40;
  color: white;
  text-align: center;
  padding: 1em;
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
}

/* Responsive */
@media (max-width: 600px) {
  /* Adjust the title text */
  .title-bg {
    font-size: 1.4em;
    padding: 0.3em 0.6em;
    margin: -2em auto 2em auto;
    position: relative;
    top: -4px;
  }

  /* Adjust the slogan under the title */
  .slogan-bg {
    font-size: 0.9em;
    padding: 0.3em 0.8em;
    margin: 1em auto -1em auto;
  }

  /* Shrink the header and reposition background image */
  header {
    background-position: center top;
    height: 200px;
    padding: 0;
  }

  /* Resize and center logo */
  header .logo {
    position: static;
    height: 70px;
    margin: 3.5em auto 3em auto;
    display: block;
    transform: none;
  }

  /* Stack nav links vertically and add spacing */
  nav {
    padding: 1em;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5em;
  }

  /* Make nav links touch-friendly */
  nav a {
    font-size: 0.9em;
    padding: 0.4em 0.8em;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Adjust main container and reposition background image */
  .container {
    padding: 2em 1em;                      /* Reduced padding */
    background-position: center 30%;      /* Shift background slightly upward */
  }

  /* ✅ Responsive, scroll-safe, smaller text box */
  .container .text-box {
    position: relative;                   /* Keeps it in normal flow */
    margin: 1em auto;                     /* Center it */
    width: 100%;                          /* Full width */
    max-width: 90vw;                      /* Max width: 90% of screen */
    padding: 1em;                         /* Smaller padding */
    font-size: 0.9em;                     /* Slightly smaller text */
    max-height: 65vh;                     /* Limit height to 65% of screen */
    overflow-y: auto;                     /* Add scroll if content too tall */
    box-sizing: border-box;               /* Includes padding in width */
    border-radius: 10px;                  /* Keep rounded edges */
    background-color: rgba(255, 255, 255, 0.85);  /* Same background */
  }
}
