:root {
  --ivory: #f4efe6;
  --muted-ivory: rgba(244, 239, 230, 0.74);
  --line: rgba(244, 239, 230, 0.26);
  --shadow: rgba(0, 0, 0, 0.42);
  --design-width: min(100vw, calc(100vh * 1.7777778));
  --design-height: min(100vh, calc(100vw * 0.5625));
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #01050a;
  color: var(--ivory);
  font-family: Georgia, "Times New Roman", serif;
}

.countdown-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  isolation: isolate;
}

.background {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image: 
        radial-gradient(circle at 50% 37%, rgba(4, 12, 25, 0.08), rgba(0, 0, 0, 0.42) 66%, rgba(0, 0, 0, 0.82) 100%),
        url("background.png");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}


.background::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.16) 45%, rgba(0, 0, 0, 0.38));
  pointer-events: none;
}

.design-frame {
  position: relative;
  width: var(--design-width);
  height: var(--design-height);
  min-height: 100svh;
}

.brand-mark,
.chapter-mark,
.est-mark {
  position: absolute;
  left: 50%;
  display: block;
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 8px 26px var(--shadow));
  user-select: none;
}

.brand-mark {
  top: 14.03%;
  width: 29.8%;
  max-width: 520px;
}

.est-mark {
  top: 26.26%;
  width: 35.83%;
  max-width: 640px;
}

.chapter-mark {
  top: 34.52%;
  width: 37.14%;
  max-width: 650px;
}

.countdown {
  position: absolute;
  top: 52%;
  left: 50%;
  display: grid;
  width: min(56%, 760px);
  min-width: 560px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  transform: translateX(-50%);
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.62);
}

.time-cell {
  display: grid;
  min-width: 0;
  min-height: clamp(92px, calc(var(--design-height) * 0.145), 132px);
  place-items: center;
  padding: 18px 10px 16px;
}

.time-value {
  font-size: clamp(2.35rem, calc(var(--design-width) * 0.039), 4rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1;
}

.time-label {
  color: var(--muted-ivory);
  font-size: clamp(0.72rem, calc(var(--design-width) * 0.0105), 1rem);
  font-style: italic;
  line-height: 1;
  text-transform: lowercase;
  white-space: nowrap;
}

@media (max-width: 760px) {
  body {
    overflow-y: auto;
  }

  .countdown-page {
    min-height: 100svh;
    place-items: stretch;
  }

  .design-frame {
    width: 100vw;
    height: 100svh;
    min-height: 620px;
  }

  .brand-mark {
    top: 12%;
    width: min(78vw, 430px);
  }

  .est-mark {
    top: 28%;
    width: min(72vw, 460px);
  }

  .chapter-mark {
    top: 35%;
    width: min(82vw, 510px);
  }

  .countdown {
    top: 52%;
    width: min(86vw, 440px);
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .time-cell {
    min-height: 104px;
  }

}

@media (max-width: 390px) {
  .time-value {
    font-size: 2.1rem;
  }

  .time-cell {
    min-height: 96px;
    padding-inline: 6px;
  }
}
