/* reset */

* { 
  box-sizing: border-box;
}

p, ul, ol, h1, h2, h3, blockquote {
  margin: 0;
  padding: 0;
}

nav ul, nav ol {
  list-style-type: none;
}

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

a {
  text-decoration: none;
  font-size: 1.2em;
}

/* end reset */

body {
  width: 100%;
  max-width: 1166px;
  margin: auto;
  font-family: "Jersey 25", sans-serif;
  font-size: 18px;
  line-height: 1;
  background-color: rgb(249, 246, 242);
}

#team-body {
  overflow-x: hidden;
}

header, footer {
  background: #0C0C3F;
}

header nav, footer nav {
  padding: 10px 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

header nav img, footer nav img {
  height: 70px;
}

header nav ul, footer nav ul {
  display: flex;
  gap: 3vw;
}

header nav a, footer nav a {
  color: white;
}

#main-header img {
  opacity: 0;
}

.cta {
  padding: 5px 15px;
  color: #0C0C3F;
  background-color: white;
}

#hero, #about-hero {
  position: relative;
}

#hero #logo, #about-hero #logo {
  position: absolute;
  width: 50%;
  top: 55%;
  left: 3%;
}

#hero div, #about-hero div {
  position: absolute;
  top: 60%;
  margin-left: 36px;
} 

#hero h1, #about-hero h1, #team-hero h1 {
  display: inline-block;
  padding: 10px;
  font-family: Chuck;
  font-size: 2em;
  background-color: white;
  rotate: 10deg;
}

#about-hero div nav ul {
  /* position: relative; */
  margin-top: 4%;
  display: flex;
  gap: 7px;
}

#about-hero div nav a {
  /* padding: 10px;
  padding: 10px 25px; */
  display: grid;
  place-content: center;
  width: 150px;
  height: 50px;
  border: 2px black solid;
  font-size: 1.1em;
  color: black;
  background-color: #FFECD4;
}

#about-hero li {
  position: relative;
}

#about-hero #links-a {
  rotate: 4deg;
}

#about-hero #dockside-a {
  top: -5px;
  rotate: -4deg;
}

#about-hero #mutual-a {
  top: -9px;
  rotate: 6deg;
}

#about-hero #working-a {
  top: -1px;
  rotate: -6deg;
}

#team-hero {
  position: relative;
}

#team-hero div {
  position: absolute;
  bottom: -2%;
  /* display: grid; */
  /* place-content: center; */
  /* top: 30%; */
  width: 100%;
  margin-left: 36px;
} 

#team-hero p {
  width: 90%;
  max-width: 700px;
  padding: 24px;
  margin: 24px 0 0 24px;
  border: 2px solid #000;
  font-size: 20px;
  background-color: rgba(255, 255, 255, 0.7);
}

main {
  padding: 0 100px;
  border: 2px solid #000;
  font-size: 1.3em;
}

main section {
  margin: 25px 0;
}

main div.num, main div.content {
  display: flex;
  gap: 20px;
}

main div.num p, main section.image-left div.content div:last-of-type, main section.image-right div.content div:first-of-type {
  width: 63%;
  }

main div.num h2, main section.image-left div.content div:first-of-type, main section.image-right div.content div:last-of-type {
  width: 37%;
}

main div.num h2 {
  position: relative;
  top: 15px;
  margin-left: 10px;
  font-size: 4em;
  font-weight: normal;
}

main h3 {
  font-weight: normal;
  margin-bottom: 10px;
}

main #links p {
  margin: 1.1em 0;
  font-family: "Inconsolata", monospace;
  font-size: .8em;
  line-height: 1.5em; /* 180% */
}

main section.image-right div.content div:first-of-type, main section.image-left div.content div:last-of-type {
  align-self: center;
}

#index-main section a, #about-main section a {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 25px;
  border: 1px black solid;
  font-size: 1.1em;
  color: black;
  background-color: #FCDEB7;
}

#index-main section img {
  border: 3px solid #000;
}

main section.info {
  font-family: "Jersey 15", sans-serif;
  font-size: .8em;
}

main section.info h3 {
  font-size: 1.5em;
}

main section.info div.backstory, main section.info div.resources {
  margin: 18px 0;
  padding: 12px;
  border: 2px solid #000;
  display: flex;
  gap: 24px;
  align-items: center;
}

main section.dockside-info div.backstory, main section.working-info div.backstory {
  background: #FFD788;
}

main section.mutual-info div.backstory {
  background: #C2E6FB;
}

main section.info div.backstory p, main section.info div.resources ol {
  align-self: self-start;
}

main section.dockside-info div.resources, main section.working-info div.resources {
  background: #FFCFAF;
}

main section.mutual-info div.resources {
  background: #C8DEFF;
}

main section.info div.resources div {
  width: 50%;
}

main section.info div.resources ol {
  /* margin-left: 48px; */
}

main section.dockside-info div.resources {
  background: #FFCFAF;
}

main section.info .backstory p{
  width: 75%;
}

#team-main {
  padding: 0 24px;
  background-color: white;
}

/* ---------- Layout ---------- */
.team-grid {
  --g: clamp(12px, 2vw, 24px);   /* gap */
  display: flex;
  flex-wrap: wrap;
  gap: var(--g);
  justify-content: center;       /* centers each wrapped line (so rows of 2 or 3 are centered) */
  align-content: flex-start;     /* keep rows packed from the top */
}

/* Tiles: 4 → 3 → 2 → 1 columns */
.team-member {
  flex: 0 0 calc((100% - 3 * var(--g)) / 4);   /* 4 columns */
  max-width: calc((100% - 3 * var(--g)) / 4);
  min-width: 0;                                 /* prevents overflow with long names */
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;                          /* square cards; remove for natural ratios */
  overflow: hidden;
}


/* ---------- Image / Overlay Swap ---------- */
.team-member img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play {
  transition: opacity .25s ease;
}

.paused {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility 0s .25s; /* delay hiding to avoid flicker */
}

.team-member:hover .play,
.team-member:focus-within .play {
  opacity: 0;
}

.team-member:hover .paused,
.team-member:focus-within .paused {
  opacity: 1;
  visibility: visible;
  transition: opacity .25s ease; /* show immediately when active */
}

/* Centered overlay text on the still image */
.team-member-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  color: #fff;
  z-index: 1;
}

.team-member-info::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .35); /* subtle darken for readability */
  z-index: -1;
}

/* Typography */
.team-member-info h3 {
  margin: 0 0 .25rem;
  font-size: clamp(1rem, 1.2vw + .6rem, 1.25rem);
  font-weight: 700;
  line-height: 1.2;
}

.team-member-info p {
  margin: 0;
  font-size: clamp(.9rem, 1vw + .5rem, 1.05rem);
  font-weight: 500;
  opacity: .95;
}

#contact {
  margin-top: 50px;
  padding: 50px 0;
  border: 3px solid #000;
  text-align: center;
  background: linear-gradient(90deg, #FFAB6F 0.48%, #C95E11 97.36%);  
}

#contact a {
  position: relative;
  color: black; 
}

#contact a::before {
  content: "";
  transition: content 0.2s;
}

#contact a:hover::before {
  content: "--> ";
}

#contact a:hover::after {
  content: " <--";
}

@media (max-width: 1200px) {                    /* 3 columns */
  .team-member {
    flex-basis: calc((100% - 2 * var(--g)) / 3);
    max-width: calc((100% - 2 * var(--g)) / 3);
  }

  .team-member-info h3 {
    font-size: clamp(1.2rem, 1.4vw + .6rem, 1.45rem);
  }
  
  .team-member-info p { 
    /* font-size: clamp(1.1rem, 1.2vw + .5rem, 1.25rem); */
  }
}
/* -------------------------------- FIRST BREAK */
@media (max-width: 800px) {      

  main {
    padding: 0 50px;
    border: 0;
  }

  header {
    padding: 10px;
  }
  
  header nav, footer nav {
    padding: 10px 20px;
  }

  header nav ul, footer nav ul {
    flex-direction: column;
    gap: 1vw;
  }

  header nav ul li:last-of-type, footer nav ul li:last-of-type {
    margin: 10px 0 10px -10px;
  }

  header section img:last-of-type, footer section img:last-of-type {
    min-width: 200px;
    height: auto;
  }

  #hero h1, #about-hero h1, #team-hero h1 {
    font-size: 1.75em;
  }

  #about-hero div {
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
  } 

  #about-hero div nav ul {
    display: block;
  }

  /* 2 columns */
  .team-member {
    flex-basis: calc((100% - 1 * var(--g)) / 2);
    max-width: calc((100% - 1 * var(--g)) / 2);
  }
  .team-member-info h3 {
    font-size: clamp(1.4rem, 16vw + .6rem, 1.65rem);
  }
  
  .team-member-info p { 
    font-size: clamp(1.1rem, 1.2vw + .5rem, 1.25rem);
  }

}

/* -------------------------------- SECOND BREAK */

@media (max-width: 630px) {  

  main div.num, main div.content {
    display: block;
    /* flex-direction: column; */
    gap: 20px;
  }

  main div.num p, main section.image-left div.content div:last-of-type, main section.image-right div.content div:first-of-type {
    width: 100%;
    }
  
  main div.num h2, main section.image-left div.content div:first-of-type, main section.image-right div.content div:last-of-type {
    width: 100%;
  }

  #index-main section img {
    width: 100%;
    margin: 20px 0;
    border: 3px solid #000;
  }

  header nav {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
  } 

  header nav ul, footer nav ul {
    flex-direction: row;
    gap: 3vw;
  }

  header nav ul li:last-of-type, footer nav ul li:last-of-type {
    margin: 0;
  }

  /* 1 column */
  .team-member {
    flex-basis: 100%;
    max-width: 100%;
  }

  .team-member-info h3 {
    font-size: clamp(1.8rem, 20vw + .6rem, 2.05rem);
  }
  
  .team-member-info p { 
    font-size: clamp(1.5rem, 1.7vw + .5rem, 1.65rem);
  }

  footer nav {
    padding: 10px;
  }

}

/* -------------------------------- THIRD BREAK */

@media (max-width: 510px) {  
  main {
    /* background-color: red; */
  }

  header nav a, footer nav a {
    font-size: 1em;
  }

  #about-hero div nav a {
    /* padding: 10px;
    padding: 10px 25px; */
    display: grid;
    place-content: center;
    width: auto;
    height: auto;
    padding: 11px;
    border: 2px black solid;
    font-size: .9em;
    color: black;
    background-color: #FFECD4;
  }

  footer nav img {
    height: 50px;
  }

}

/* -------------------------------- FOURTH BREAK */

@media (max-width: 400px) {  
  main section.info div.backstory, main section.info div.resources {
    flex-direction: column;
  }

  main section.info .backstory p, main section.info div.resources div  {
    width: 100%;
}

.resources ol {
  margin-left: 10px;
}

main section.info div.backstory, main section.info div.resources  {
  gap: 10px;
  /* background-color: purple; */
}

footer img {
  display: none;
}

}


/* ---------- Motion Preference ---------- */
@media (prefers-reduced-motion: reduce) {
  .play, .paused { transition: none; }
}