/*!-----------------------------------------------------------*/
/*! Copy-pasted from https://necolas.github.io/normalize.css/ */
/*!-----------------------------------------------------------*/

/* Document
   ========================================================================== */

/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in iOS.
 */

html {
  line-height: 1.15;
  /* 1 */
  -webkit-text-size-adjust: 100%;
  /* 2 */
}

/* Sections
   ========================================================================== */

/**
 * Remove the margin in all browsers.
 */

body {
  margin: 0;
}

/**
 * Render the `main` element consistently in IE.
 */

main {
  display: block;
}

/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Firefox, and Safari.
 */

h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

/* Grouping content
   ========================================================================== */

/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Show the overflow in Edge and IE.
 */

hr {
  box-sizing: content-box;
  /* 1 */
  height: 0;
  /* 1 */
  overflow: visible;
  /* 2 */
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

pre {
  font-family: monospace, monospace;
  /* 1 */
  font-size: 1em;
  /* 2 */
}

/* Text-level semantics
   ========================================================================== */

/**
 * Remove the gray background on active links in IE 10.
 */

a {
  background-color: transparent;
}

/**
 * 1. Remove the bottom border in Chrome 57-
 * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
 */

abbr[title] {
  border-bottom: none;
  /* 1 */
  text-decoration: underline;
  /* 2 */
  text-decoration: underline dotted;
  /* 2 */
}

/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */

b,
strong {
  font-weight: bolder;
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

code,
kbd,
samp {
  font-family: monospace, monospace;
  /* 1 */
  font-size: 1em;
  /* 2 */
}

/**
 * Add the correct font size in all browsers.
 */

small {
  font-size: 80%;
}

/**
 * Prevent `sub` and `sup` elements from affecting the line height in
 * all browsers.
 */

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* Embedded content
   ========================================================================== */

/**
 * Remove the border on images inside links in IE 10.
 */

img {
  border-style: none;
}

/* Forms
   ========================================================================== */

/**
 * 1. Change the font styles in all browsers.
 * 2. Remove the margin in Firefox and Safari.
 */

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  /* 1 */
  font-size: 100%;
  /* 1 */
  line-height: 1.15;
  /* 1 */
  margin: 0;
  /* 2 */
}

/**
 * Show the overflow in IE.
 * 1. Show the overflow in Edge.
 */

button,
input {
  /* 1 */
  overflow: visible;
}

/**
 * Remove the inheritance of text transform in Edge, Firefox, and IE.
 * 1. Remove the inheritance of text transform in Firefox.
 */

button,
select {
  /* 1 */
  text-transform: none;
}

/**
 * Correct the inability to style clickable types in iOS and Safari.
 */

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
}

/**
 * Remove the inner border and padding in Firefox.
 */

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

/**
 * Restore the focus styles unset by the previous rule.
 */

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

/**
 * Correct the padding in Firefox.
 */

fieldset {
  padding: 0.35em 0.75em 0.625em;
}

/**
 * 1. Correct the text wrapping in Edge and IE.
 * 2. Correct the color inheritance from `fieldset` elements in IE.
 * 3. Remove the padding so developers are not caught out when they zero out
 *    `fieldset` elements in all browsers.
 */

legend {
  box-sizing: border-box;
  /* 1 */
  color: inherit;
  /* 2 */
  display: table;
  /* 1 */
  max-width: 100%;
  /* 1 */
  padding: 0;
  /* 3 */
  white-space: normal;
  /* 1 */
}

/**
 * Add the correct vertical alignment in Chrome, Firefox, and Opera.
 */

progress {
  vertical-align: baseline;
}

/**
 * Remove the default vertical scrollbar in IE 10+.
 */

textarea {
  overflow: auto;
}

/**
 * 1. Add the correct box sizing in IE 10.
 * 2. Remove the padding in IE 10.
 */

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box;
  /* 1 */
  padding: 0;
  /* 2 */
}

/**
 * Correct the cursor style of increment and decrement buttons in Chrome.
 */

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

/**
 * 1. Correct the odd appearance in Chrome and Safari.
 * 2. Correct the outline style in Safari.
 */

[type="search"] {
  -webkit-appearance: textfield;
  /* 1 */
  outline-offset: -2px;
  /* 2 */
}

/**
 * Remove the inner padding in Chrome and Safari on macOS.
 */

[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

/**
 * 1. Correct the inability to style clickable types in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */

::-webkit-file-upload-button {
  -webkit-appearance: button;
  /* 1 */
  font: inherit;
  /* 2 */
}

/* Interactive
   ========================================================================== */

/*
 * Add the correct display in Edge, IE 10+, and Firefox.
 */

details {
  display: block;
}

/*
 * Add the correct display in all browsers.
 */

summary {
  display: list-item;
}

/* Misc
   ========================================================================== */

/**
 * Add the correct display in IE 10+.
 */

template {
  display: none;
}

/**
 * Add the correct display in IE 10.
 */

[hidden] {
  display: none;
}
/* ----- Variables ----- */

:root {
  --c-grayish-blue: hsl(237, 18%, 59%);
  --c-soft-red: hsl(345, 95%, 68%);
  --c-white: hsl(0, 0%, 100%);
  --c-dark-destaurated-blue: hsl(236, 21%, 26%);
  --c-dark-blue: hsl(235, 16%, 14%);
  --c-blackish-blue: hsl(234, 17%, 12%);
}

/* ----- Typography ----- */

body {
  font-family: "Red Hat Text", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-white);
  text-transform: uppercase;
}

.countdown__title {
  font-size: 1.5rem;
  letter-spacing: 0.4rem;
}

.timer__card-label {
  font-size: clamp(0.5rem, 1vw, 1rem);
  letter-spacing: 0.2rem;
}

/* ----- Global styles ----- */

html {
  background: linear-gradient(180deg, #191a24 17%, #1e1f29 51%, #2b212d 83%);
  z-index: -20;
}

body {
  min-height: 100vh;
  background-image: url(../ahh-imgs/pattern-hills.svg);
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: 200% 20%;
  position: relative;
  animation: raiseUp 1.5s ease-in-out forwards;
}

.countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10rem;
  padding: 8rem 1rem 0rem 1rem;
}

#canvas {
  background-color: transparent;
  position: absolute;
  inset: 0;
  z-index: -10;
  height: 100%;
  width: 100%;
}

.countdown__title {
  margin: 0 auto;
  width: 98%;
  text-align: center;
  position: relative;
}

.countdown__title:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #191a24;
  animation: reveal 0.7s ease-in-out forwards;
}

.sr-only:not(:focus):not(:active) {
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  position: absolute;
  white-space: nowrap;
  overflow: hidden;
}

.timer {
  display: flex;
  justify-content: space-between;
  height: 200px;
  margin-top: 80px;
  animation: fadeIn 2.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.timer__card-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 19.2vw;
  height: 9.1vw;
  perspective: 200px;
  color: var(--c-soft-red);
}

.timer__card {
  font-size: clamp(2.3rem, 7.4vw, 6rem);
}

.timer__card-shadow {
  background-color: var(--c-blackish-blue);
  height: 200%;
  width: 17vw;
  position: absolute;
  top: 5px;
  left: 1.1vw;
  border-radius: 5px;
}

.timer__card:before {
  content: attr(data-back);
  display: flex;
  justify-content: center;
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  line-height: 0;
  overflow: hidden;
}

.timer__card:after {
  content: attr(data-back);
  display: flex;
  justify-content: center;
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  line-height: 0;
  overflow: hidden;
}

.timer__card--front:before {
  content: attr(data-front);
  align-items: flex-end;
  top: 0;
  background: url(../ahh-imgs/card-top.svg);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  transform-origin: center bottom;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  z-index: 3;
}

.timer__card--front:after {
  content: attr(data-front);
  top: 100%;
  background: url(../ahh-imgs/card-bottom.svg);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  z-index: 1;
}

.timer__card--back:before {
  bottom: 0;
  align-items: flex-end;
  background: url(../ahh-imgs/card-top.svg);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  z-index: 1;
}

.timer__card--back:after {
  top: 100%;
  background: url(../ahh-imgs/card-bottom.svg);
  background-size: 100% 100%;
  transform-origin: top center;
  transform: rotateX(0.5turn);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  z-index: 2;
}

.timer__card-wrapper.running .timer__card--front:before {
  animation: frontFlipDown 0.6s ease-in-out;
}

.timer__card-wrapper.running .timer__card--back:after {
  animation: backFlipDown 0.6s ease-in-out;
}

.timer__card-label {
  position: absolute;
  display: flex;
  justify-content: center;
  top: 230%;
  width: 100%;
  text-transform: uppercase;
  color: var(--c-grayish-blue);
}

.countdown__socials {
  /* display: flex; */
  display: none;
  gap: 2rem;
  animation: fadeIn 2.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.fa {
  color: var(--c-grayish-blue);
  font-size: 2rem;
  width: 100%;
  transition: 0.5s color cubic-bezier(0.39, 0.575, 0.565, 1);
}

.countdown__socials-link:hover .fa {
  color: var(--c-soft-red);
}

.countdown__socials-link:focus {
  outline: 2px dotted var(--c-soft-red);
  outline-offset: 4px;
}

.countdown__socials-link:focus:not(:focus-visible) {
  outline: none;
}

/* ----- Animations ----- */

@keyframes frontFlipDown {
  to {
    transform: rotateX(-0.5turn);
  }
}

@keyframes backFlipDown {
  to {
    background-image: url(../ahh-imgs/card-bottom.svg);
    transform: rotateX(0turn);
  }
}

@keyframes reveal {
  to {
    height: 0%;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes raiseUp {
  from {
    background-size: 200% 0%;
  }

  to {
    background-size: 200% 20%;
  }
}

/* ----- Media Queries ----- */

/* Screen widths 500px to 768px */

@media (min-width: 500px) {
  .countdown__container {
    width: 100%;
    max-width: 530px;
  }

  .timer__card-wrapper {
    width: 22%;
    height: 45px;
    max-width: 100px;
  }

  .timer__card-shadow {
    top: 8px;
    left: 1px;
    width: calc(100% - 2px);
  }
}

/* Screen widths 768px to 1200px */

@media (min-width: 768px) {
  body {
    background-position: bottom center;
    background-size: 100% 20%;
  }

  .countdown__container {
    max-width: 650px;
  }

  .timer__card-wrapper {
    width: 20%;
    height: 61px;
    max-width: 200px;
  }

  .timer__card {
    font-size: clamp(2.3rem, 4.5rem, 6rem);
  }

  .timer__card-label {
    font-size: 0.8rem;
  }

  @keyframes raiseUp {
    from {
      background-size: 100% 0%;
    }

    to {
      background-size: 100% 20%;
    }
  }
}

/* Screen widths 1200px and above */

@media (min-width: 1200px) {
  .countdown {
    gap: 13rem;
  }

  .countdown__container {
    max-width: 660px;
    outline: none;
  }

  .timer__card-wrapper {
    width: 20%;
    height: 63px;
    max-width: 220px;
  }

  .timer__card {
    font-size: 4.7rem;
  }

  .timer__card-label {
    font-size: 0.9rem;
  }
}

/* If user prefers reduced motion */

@media (prefers-reduced-motion) {
  body,
  .timer,
  .timer__card-wrapper.running .timer__card--front:before,
  .timer__card-wrapper.running .timer__card--back:after,
  .countdown__socials {
    animation: none;
  }

  html {
    background-image: url(../ahh-imgs/bg-stars.svg),
      linear-gradient(180deg, #191a24 17%, #1e1f29 51%, #2b212d 83%);
  }

  .countdown__title::before,
  #canvas {
    display: none;
  }
}




/* Curtain */
.curtainContainer {
    position: absolute;
    display: flex;
    top: -10%;
    width: 100%;
    height: 110%;
    margin: auto;
    transform-style: preserve-3d;
    overflow: hidden;
    transition: transform 6s ease;
}
.curtainContainer:nth-child(1) {
    transform-origin: -120% top;
    justify-content: flex-start;
    transform: translatex(-5vw);
}
.curtainContainer:nth-child(2) {
    transform-origin: 120% top;
    justify-content: flex-end;
    transform: translatex(15vw);
}
.rollLeft {
    transform: translatex(-150vw) scaleX(0);
}
.rollRight {
    transform: translatex(150vw) scaleX(0);
}
.curtainBody:hover .curtainContainer:nth-child(1) {
    /* transform: translatex(-150vw) scaleX(0); */
}
.curtainBody:hover .curtainContainer:nth-child(2) {
    /* transform: translatex(150vw) scaleX(0); */
}
.unCurtain {
    display: inline-block;
    width: 15vw;
    margin: 0;
    padding: 0;
    height: 120vh;
    background-size: 100% 100%;
    background: repeating-linear-gradient(to left, #dd3232 4vw, #911818 12vw, #ec8989 15vw);
    transform-origin: 0 0%;
    transform: rotate(3deg);
    transition: transform 4s ease;
    animation: swing 2s ease infinite;
}
@keyframes swing {
    50% {
        transform: rotate(-3deg);
   }
}
.unCurtain:nth-child(2) {
    margin-left: -10vw;
    animation-delay: -0.1s;
}
.unCurtain:nth-child(3) {
    margin-left: -10vw;
    animation-delay: -0.2s;
}
.unCurtain:nth-child(4) {
    margin-left: -10vw;
    animation-delay: -0.3s;
}
.unCurtain:nth-child(5) {
    margin-left: -10vw;
    animation-delay: -0.4s;
}
.unCurtain:nth-child(6) {
    margin-left: -10vw;
    animation-delay: -0.5s;
}
.unCurtain:nth-child(7) {
    margin-left: -10vw;
    animation-delay: -0.6s;
}
.unCurtain:nth-child(8) {
    margin-left: -10vw;
    animation-delay: -0.7s;
}
.unCurtain:nth-child(9) {
    margin-left: -10vw;
    animation-delay: -0.8s;
}
.unCurtain:nth-child(10) {
    margin-left: -10vw;
    animation-delay: -0.9s;
}
.unCurtain:nth-child(11) {
    margin-left: -10vw;
    animation-delay: -1s;
}
.unCurtain:nth-child(12) {
    width: 10vw;
    background: repeating-linear-gradient(to left, #dd3232 4vw, #911818 8vw, #ec8989 10vw);
    margin-left: -10vw;
    animation-delay: -1.1s;
}
.curtainBody {
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    overflow: hidden;
}
.overlay {
    display: block;
    position: absolute;
    color: white;
    top: 0%;
    left: 0%;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to top, rgba(2, 2, 2, 0) 0vh, #000 100vh);
    transition: opacity 3s ease;
}
.curtainBody:hover .overlay {
    opacity: 0;
}
