/* Building a Button — Custom Stylesheet */


/* ----------------------------------------------------------
   HEADER
   Fixed, full-width, 200px tall, gradient sky background
   ---------------------------------------------------------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 200px;
  background: linear-gradient(to bottom, #000000 40%, #0560aa 80%, #7cd4ef 100%);
}


/* ----------------------------------------------------------
   BODY
   Push content down so the fixed header doesn't overlap it
   ---------------------------------------------------------- */
body {
  padding-top: 200px;
}


/* ----------------------------------------------------------
   .launch-button  —  BASE STATE
   Absolutely centered in the header (left/top 50% + translate)
   Button-y appearance, padding opens space on right for rocket
   Transitions for smooth state changes
   ---------------------------------------------------------- */
.launch-button {
  position: absolute;
  left: 50%;
  top: 75%;
  transform: translate(-50%, -50%);

  /* Button styles */
  text-decoration: none;
  background-color: #aa0000;
  color: white;
  font-size: 20px;
  padding: 15px 60px 15px 30px; /* Extra right padding leaves room for rocket */
  border-radius: 10px;

  /* Transitions */
  transition: transform 0.5s, background-color 0.1s, padding 0.5s, box-shadow 0.1s;
}


/* ----------------------------------------------------------
   .launch-button  —  HOVER STATE
   Lighter red + red glow
   ---------------------------------------------------------- */
.launch-button:hover {
  background-color: #cc0000;
  box-shadow: 0 0 8px #ff0000;
}


/* ----------------------------------------------------------
   .launch-button  —  ACTIVE STATE
   Dark red + faint glow; button scales back and shifts down;
   padding collapses to hide the now-gone rocket space
   ---------------------------------------------------------- */
.launch-button:active {
  background-color: #750000;
  box-shadow: 0 0 2px #750000;
  transform: translate(-50%, -20%) scale(0.7);
  padding: 15px 30px; /* Collapse right gap when rocket has launched */
}


/* ----------------------------------------------------------
   .launch-button .label  —  TEXT SPAN
   Uppercase tracked label; turns orange on hover with glow
   ---------------------------------------------------------- */
.launch-button .label {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: white;
  transition: color 0.2s, text-shadow 0.2s;
}

.launch-button:hover .label {
  color: orange;
  text-shadow: 0 0 3px rgb(251, 255, 0, 0.5);
}


/* ----------------------------------------------------------
   .launch-button .rocket  —  ROCKET CONTAINER
   Absolutely positioned; becomes positioning-parent for icons;
   sits 40px from right edge, vertically centred in button
   Scales up on hover; launches on active
   ---------------------------------------------------------- */
.launch-button .rocket {
  position: absolute;
  top: 50%;
  right: 40px;
  transition: transform 0.5s;
}

.launch-button:hover .rocket {
  transform: scale(1.3);
}

.launch-button:active .rocket {
  transform: rotate(-15deg) translate(60px, -140px) scale(3.5);
}


/* ----------------------------------------------------------
   .launch-button .rocket i  —  BOTH ICONS
   Stack both icons at the same position (top: 0, left: 0)
   ---------------------------------------------------------- */
.launch-button .rocket i {
  position: absolute;
  top: 0;
  left: 0;
}


/* ----------------------------------------------------------
   .launch-button .fa-rocket
   Centred in container + rotated to point straight up
   ---------------------------------------------------------- */
.launch-button .fa-rocket {
  transform: translate(-50%, -50%) rotate(-45deg);
}


/* ----------------------------------------------------------
   .launch-button .fa-burn  —  FLAME ICON
   Orange; centred horizontally, lower vertically;
   rotated 180° and scaled small (engine off by default).
   Gets bigger on hover and even bigger + shifted on active.
   ---------------------------------------------------------- */
.launch-button .fa-burn {
  color: orange;
  transform: translate(-50%, -15%) rotate(180deg) scale(0.1); /* Engine off */
  transition: transform 0.4s;
}

.launch-button:hover .fa-burn {
  transform: translate(-50%, -15%) rotate(180deg) scale(0.4); /* Engine warming */
}

.launch-button:active .fa-burn {
  transform: translate(-50%, 25%) rotate(180deg) scale(0.8); /* Full thrust */
}


/* ----------------------------------------------------------
   KEYFRAMES  —  burn
   Wobbles the flame's ::before pseudo-element side to side
   ---------------------------------------------------------- */
@keyframes burn {
  from { transform: rotate(-7deg); }
  33%  { transform: rotate(4deg); }
  66%  { transform: rotate(-4deg); }
  to   { transform: rotate(7deg); }
}


/* ----------------------------------------------------------
   .launch-button:active .fa-burn::before
   Applies the burn animation to the inner icon glyph only,
   so it shakes independently of the parent transform
   ---------------------------------------------------------- */
.launch-button:active .fa-burn::before {
  display: block;
  transform-origin: center bottom;
  animation-name: burn;
  animation-duration: 0.1s;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}