@font-face {
  font-family: "Rodchenko";
  src: url("fonts/Rodchenko-Condensed.ttf") format("truetype");
  font-display: block;
}

/* === General Reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Layout === */
body {
  background-color: #000;
  color: #f4e6cc; /* cream color */
  font-family: "Rodchenko", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh; /* fit screen height */
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: space-between;
  height: 100vh;
  width: 90%;
  max-width: 1000px;
}

/* === Title === */
/* base title (invisible main copy - we rely on pseudo layers) */
.title {
  margin-top: 1.5rem;
  position: relative;
  display: inline-block;
  font-size: 6rem;
  letter-spacing: 3px;
  margin-bottom: 1.0rem;
  text-transform: uppercase;
  color: transparent;                      /* make main text transparent */
  -webkit-text-fill-color: transparent;
  will-change: opacity, background-position;
  line-height: 1.1;
}

/* === Title Effect === */
/* shared rules for the two text-layers (::before = Phase A, ::after = Phase B) */
.title::before,
.title::after {
  content: attr(data-text);                /* duplicate the text */
  position: absolute;
  inset: 0;                                /* fill the parent */
  left: 0;
  top: 0;
  display: inline-block;
  width: 100%;
  height: 100%;
  white-space: nowrap;                     /* prevent unexpected wrapping */
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  background-size: 210% 210%;              /* extra room for sweeping */
  pointer-events: none;
}

/* Layer A: red --> cream sweep (phase A) */
.title::before {
  z-index: 1;
  background-image: linear-gradient(135deg, #f5deb3 52%, #e53935 52%);
  animation: phaseA 8s ease-in-out infinite forwards;
}

/* Layer B: cream --> red sweep (phase B) */
.title::after {
  z-index: 2;
  background-image: linear-gradient(135deg, #e53935 52%, #f5deb3 52%);
  animation: phaseB 8s ease-in-out infinite forwards;
}

/* === KEYFRAMES ===
   Total cycle = 8s. The percentage mapping:
   0% - 37.5%  => 0 - 3s      (initial pause)
   37.5% - 62.5% => 3s - 5s   (sweep 2s)
   62.5% - 75% => 5s - 6s     (pause 1s)
   75% - 100% => 6s - 8s      (swapped sweep 2s)
*/

/* Phase A timeline: visible & sweeping during 0s→5s, then hidden */
@keyframes phaseA {
  /* 0% -> 37.5% : hold initial red state (visible) */
  0%   { background-position: 100% 100%; opacity: 1; }
  37.5%{ background-position: 100% 100%; opacity: 1; }

  /* 37.5% -> 62.5% : sweep red -> cream */
  62.5%{ background-position: 0% 0%; opacity: 1; }

  /* 62.6% -> 100% : hide layer A so layer B can take over */
  62.6%{ opacity: 0; }
  100% { opacity: 0; }
}

/* Phase B timeline: hidden initially, appear at cream-rest, then sweep cream->red */
@keyframes phaseB {
  /* 0% -> 62.5% : hidden */
  0%    { background-position: 100% 100%; opacity: 0; }
  62.4% { opacity: 0; }

  /* 62.5% : instantly show (cream full state) */
  62.5% { background-position: 100% 100%; opacity: 1; }

  /* 62.5% -> 75% : hold full cream (rest) */
  75%   { background-position: 100% 100%; opacity: 1; }

  /* 75% -> 100% : sweep cream -> red */
  100%  { background-position: 0% 0%; opacity: 1; }
}

/* Optional: smoothing on low-end devices */
.title::before,
.title::after {
  -webkit-font-smoothing: antialiased;
  backface-visibility: hidden;
}

/* === Description === */
.description {
  font-size: 2.4rem;
  max-width: 760px;
  color: #f4e6cc;
  text-align: justify;
  text-align-last: center;
  text-justify: inter-word;
  line-height: 0.9;
}

.description::after {
  content: "";
  display: inline-block;
  width: 100%;
}

.highlight {
  font-size: 3.0rem;
  color: #e53935; /* red */
  line-height: 0;
}

/* === GIF Grid === */
.gif-grid {
  display: grid;
  grid-template-columns: repeat(2, auto); /* columns fit GIF width */
  row-gap: 0.9rem;
  column-gap: 0.9rem;
  justify-content: center;  /* centers grid as a block */
  align-items: center;      /* vertical centering within each cell */
  margin: 1rem auto;
  max-width: 760px;         /* optional: keep layout balanced on wide screens */
}

.gif-grid img {
  width: 100%;
  height: auto;
  /* border: 2px solid #e53935; */
  border-radius: 4px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  object-fit: contain;        /* ensures the whole GIF fits inside */
}

/* --- Hover Interactions --- */
.gif-grid:hover img {
  transform: scale(0.975);        /* shrink all when hovering grid */
  opacity: 0.85;                 /* slightly fade others */
}

.gif-grid img:hover {
  transform: scale(1.06);       /* enlarge hovered one */
  opacity: 1;                   /* bring it to full opacity */
  z-index: 2;                   /* bring it to the front */
}

/* === Subscribe Section === */
.subscribe-section {
  width: 100%;
  max-width: 760px;
}

.subscribe-text {
  font-size: 1.4rem;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.subscribe-form {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.subscribe-form input[type="email"] {
  font-family: inherit;
  font-size: 1.4rem;
  flex: 1;
  padding: 14px 16px 10px;
  border: none;
  border-radius: 4px;
  outline: none;
  background-color: #f4e6cc;
  letter-spacing: 1px;
  line-height: 1.1;
}

.subscribe-form input::placeholder {
  opacity: 0.7;
  letter-spacing: 1px;
}

.subscribe-form button {
  font-family: inherit; 
  font-size: 1.4rem;
  font-weight: normal;
  background-color: #e53935;
  color: #f4e6cc;
  border: none;
  padding: 14px 24px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 1px;
  line-height: 1.1;
}

.subscribe-form button:hover {
  background-color: #c62828;
  transform: scale(1.05);
}

.thankyou-message {
  display: none;
  font-size: 1.4rem;
  color: #f5deb3;
  animation: fadeIn 0.6s ease;
  padding: 14px 16px 10px;
  line-height: 1.1;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === Mobile Responsive === */
@media (max-width: 760px) {
  .title {
    font-size: 4.5rem;
  }

  .description {
    max-width: 350px;
    font-size: 1.72rem;
  }

  .highlight {
    font-size: 2.15rem;
  }

  .gif-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .gif-grid:hover img {
    transform: scale(1);
    opacity: 1;
  }

  .gif-grid img:hover {
    transform: scale(1);
    opacity: 1;
  }

  .subscribe-form {
    flex-direction: column;
  }

  .subscribe-form input,
  .subscribe-form button {
    width: 100%;
  }
}

/* === Vertical Responsive === */
@media (max-height: 900px) {
  .container {
    max-width: 500px;
  }
}
