* {
  box-sizing: border-box;
  font-family: Iowan Old Style, Apple Garamond, Baskerville, Times New Roman, Droid Serif, Times, Source Serif Pro, serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

.bg-image {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: auto;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  background-color: #00030c;
  /* background-image moved to ::before to avoid double painting */
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  position: relative;
  overflow: hidden;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url(./assets/background.svg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  animation: breathe 16s ease-in-out infinite;
  z-index: 0;
  will-change: filter;
}

/* Reduce/disable background animation for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .container::before { animation: none; }
}

/* Tweak or disable heavy filter animation on small screens to improve performance */
@media screen and (max-width: 600px) {
  .container::before { animation: breathe 20s ease-in-out infinite; }
}

.container > * {
  position: relative;
  z-index: 1;
}

.header h3 {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  line-height: 36px;
  color: #e7b148;
}

.header h3 .shine {
  background: linear-gradient(
    -90deg,
    #e7b148 0%,
    #f0c16a 20%,
    #ffffff 30%,
    #e7b148 50%,
    #ffffff 70%,
    #f0c16a 80%,
    #e7b148 100%
  );
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shine 6s linear infinite;
  text-shadow: 0 0 8px rgba(231, 177, 72, 0.4);
  font-weight: 700;
}

.header {
  display: flex;
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0px;
  animation: fadeIn 1s ease-out;
}

.header > h1 {
  font-weight: 600;
  font-size: 48px;
  text-align: center;
  color: #ffffff;
}

.header > h1 .dot {
  color: #e7b148;
}

.header > p {
  font-weight: 400;
  font-size: 24px;
  text-align: center;
  color: #ffffff;
  margin: 16px 0px;
}

.key-word {
  transition: all 0.5s ease;
  position: relative;
  cursor: default;
}

.key-word.overthinking,
.key-word.happiness {
  color: #ffffff;
}

.key-word.overthinking:hover {
  color: #ffffff;
  transform: scale(1.05);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.key-word.overthinking:hover ~ .happiness,
.key-word.dim {  
  color: transparent;
  -webkit-text-stroke: 1px #e7b148;
  text-stroke: 1px #e7b148;
}

.key-word.happiness:hover {
  color: #ffffff;
  transform: scale(1.05);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.options {
  display: flex;
  flex-direction: row;
}

.options > a {
  color: #ffffff;
  text-decoration: underline;
  margin: 0px 8px;
  font-size: 24px;
}

.logo {
  margin-top: 75px;
}

.logo > a > img {
  width: 64px;
  height: auto;
  transform-origin: top center; 
  animation: pendulum 2s ease-in-out infinite;
}

.logo > a > img:hover {
  animation-play-state: paused; 
}

.button-group {
  display: flex;
  gap: 20px;
  margin-top: 78px;
}

.button-group a button {
  background: #e7b148;
  border-radius: 4px;
  border: none;
  width: 150px;
  height: 55px;
  color: #ffffff;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.button-group a button:hover {
  background: #e7b148;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(231, 177, 72, 0.2);
}

.button-group a button:active {
  background: #b88d39;
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

@media screen and (max-width: 1024px) {
  .container {
    background-size: cover;
    background-position: center;
  }
  
  .container::before {
    background-size: cover;
    background-position: center;
  }
}

@media screen and (max-width: 600px) {
  .container {
    background-size: cover;
    background-position: center;
  }
  
  .container::before {
    background-size: cover;
    background-position: center;
  }

  .header > h1 {
    font-size: 28px;
    margin: 0 12px;
  }

  .header > p {
    font-size: 16px;
    margin: 10px 12px;
  }

  .header h3 {
    font-size: 20px;
  }

  .button-group {
    flex-direction: column;
    gap: 24px;
    margin-top: 30px;
    align-items: center;
  }

  .button-group a button {
    width: 40vw;
    max-width: 320px;
    min-width: 80px;
    height: 52px;
    font-size: 16px;
    border-radius: 8px;
  }

  .countdown {
    margin-top: 20px;
    width: 260px;
  }

  .countdown-text {
    font-size: 12px;
  }

  .countdown-number {
    font-size: 18px;
  }

  .countdown-number::after {
    font-size: 14px;
  }

  .logo {
    margin-top: 40px;
  }

  .logo > a > img {
    width: 48px;
  }
}

@media (hover: none) {
  .button-group a button:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }

  .logo > a:active {
    transform: scale(0.9);
  }

  .key-word.overthinking:hover,
  .key-word.happiness:hover {
    transform: none;
    text-shadow: none;
  }

  .logo > a > img:hover {
    animation-play-state: running;
  }
}

@keyframes breathe {
  0% {
    filter: brightness(0.8);
  }
  50% {
    filter: brightness(1.2);
  }
  100% {
    filter: brightness(0.8);
  }
}

@keyframes shine {
  0% {
    background-position: 200% center;
  }
  100% {
    background-position: 0% center;
  }
}

@keyframes progressShine {
  0% {
    background-position: 300% center;
  }
  100% {
    background-position: 0% center;
  }
}

@keyframes pendulum {
  0% {
    transform: rotate(-15deg);
  }
  50% {
    transform: rotate(15deg);
  }
  100% {
    transform: rotate(-15deg);
  }
}

@keyframes waterFlow {
  0% {
    transform: scale(1) translate(0, 0);
  }
  50% {
    transform: scale(1.05) translate(10px, 5px);
  }
  100% {
    transform: scale(1) translate(0, 0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.countdown {
  margin-top: 30px;
  text-align: center;
  color: #ffffff;
  width: 300px;
}

.countdown-text {
  font-size: 16px;
  margin-bottom: 8px;
  color: #e7b148;
}

.countdown-number {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}

.countdown-number::after {
  content: ' seconds';
  font-size: 16px;
  font-weight: 400;
}

.countdown-bar {
  width: 100%;
  height: 4px;
  background: rgba(231, 177, 72, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.countdown-progress {
  height: 100%;
  background: linear-gradient(
    -90deg,
    #e7b148 0%,
    #e7b148 40%,
    #ffffff 50%,
    #e7b148 60%,
    #e7b148 100%
  );
  background-size: 300% auto;
  animation: progressShine 12s linear infinite;
  border-radius: 2px;
  transition: width 1s linear;
}