* {
  box-sizing: border-box;
}

img,
video {
  max-width: 100%;
  height: auto;
}

body {
  margin: 0;
  padding: clamp(1rem, 3vw, 2rem);
  min-height: 100vh;
  display: grid;
  place-items: center;
  background-image: url('https://images.pexels.com/photos/248159/pexels-photo-248159.jpeg?auto=compress&w=1350&q=80');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow-x: hidden;
  width: 100%;
  font-family: 'Merriweather', 'Georgia', serif;
  text-align: center;
  color: #fff;
}

#main {
  width: min(100%, 44rem);
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  justify-items: center;
}

.site-header {
  width: min(100%, 42rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
  gap: 1rem;
  padding: clamp(1rem, 2.5vw, 1.25rem) clamp(1rem, 3vw, 1.5rem);
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(6px);
}

.brand-block h1 {
  margin: 0;
  color: #fff;
  text-shadow: 1px 2px 8px #1a237e;
  font-size: clamp(2rem, 5vw, 2.75rem);
}

.brand-block p {
  margin: 0.35rem 0 0;
  color: #fff;
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
}

.site-nav {
  display: flex;
  justify-content: center;
  align-items: center;
}

.site-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background-color: rgba(0, 123, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus {
  background-color: #003366;
  color: #ffd700;
  transform: translateY(-2px);
}

.quote-box {
  width: min(100%, 42rem);
  display: grid;
  gap: 1rem;
  justify-items: center;
}

.quote-box blockquote {
  background-color: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: clamp(1.25rem, 3vw, 2rem);
  width: 100%;
  min-height: clamp(12rem, 28vh, 16rem);
  margin: 0;
  transition: box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.quote-box blockquote:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

#quote {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: #222;
  margin: 0;
  line-height: 1.5;
  font-family: 'Merriweather', 'Georgia', serif;
}

#author {
  margin-top: 1rem;
  font-size: clamp(0.95rem, 2vw, 1rem);
  color: #555;
  font-weight: bold;
  letter-spacing: 0.02em;
  font-family: 'Merriweather', 'Georgia', serif;
}

#new-quote {
  background-color: #007bff;
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: clamp(1rem, 2.3vw, 1.1rem);
  width: min(100%, 15rem);
  transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  outline: none;
}

#new-quote:hover,
#new-quote:focus {
  background-color: #003366;
  color: #ffd700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px) scale(1.04);
}

#quote,
#author {
  opacity: 1;
  transition: opacity 0.5s ease;
}

.fade-out {
  opacity: 0;
}

.fade-in {
  opacity: 1;
}

footer {
  color: #fff;
  text-shadow: 1px 2px 8px rgba(26, 35, 126, 0.7);
  font-weight: bold;
  font-size: clamp(0.85rem, 2vw, 1rem);
  width: 100%;
}

@media (max-width: 640px) {
  body {
    background-attachment: scroll;
    padding: 1rem;
  }

  .site-header {
    justify-items: center;
    text-align: center;
  }

  .site-nav {
    width: 100%;
  }

  #new-quote {
    width: 100%;
  }
}