:root {
  color-scheme: light;
  --forest: #173f35;
  --leaf: #2f7d5a;
  --cream: #f7f3e9;
  --mist: #eaf1eb;
  --paper: #fffefa;
  --ink: #1d2722;
  --muted: #66726c;
  --border: #d7e1da;
  --focus: #d99a2b;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 280px;
  background: var(--cream);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--ink);
  font-family: "Noto Sans Thai", "Leelawadee UI", system-ui, sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
}

.redirect-page {
  background:
    radial-gradient(circle at 18% 8%, rgb(47 125 90 / 16%), transparent 28rem),
    radial-gradient(circle at 88% 92%, rgb(217 154 43 / 13%), transparent 24rem),
    linear-gradient(145deg, var(--cream), var(--mist));
}

.redirect-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-content: center;
  gap: 18px;
  width: min(100% - 32px, 520px);
  margin-inline: auto;
  padding-block: 28px;
}

.redirect-card {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 7vw, 38px);
  border: 1px solid rgb(23 63 53 / 13%);
  border-radius: 24px;
  background: rgb(255 254 250 / 94%);
  box-shadow:
    0 26px 70px rgb(23 63 53 / 13%),
    inset 0 1px 0 rgb(255 255 255 / 88%);
}

.redirect-card::after {
  position: absolute;
  right: -44px;
  bottom: -58px;
  width: 150px;
  height: 150px;
  border: 26px solid rgb(47 125 90 / 7%);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.redirect-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.redirect-brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: var(--forest);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 1.45rem;
  font-weight: 800;
}

.redirect-brand span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.redirect-brand strong {
  color: var(--forest);
  font-size: 1.05rem;
}

.redirect-brand small {
  margin-top: 5px;
  color: var(--leaf);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.redirect-progress {
  height: 5px;
  margin: 28px 0 30px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ebe6;
}

.redirect-progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--leaf), #66a47e);
  transform-origin: left;
  animation: countdown-progress 3s linear forwards;
}

.redirect-kicker {
  margin: 0 0 7px;
  color: var(--leaf);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

h1 {
  margin: 0;
  color: var(--forest);
  font-size: clamp(2rem, 8vw, 3.25rem);
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.redirect-status {
  min-height: 3.2em;
  margin: 13px 0 22px;
  color: var(--muted);
  font-size: 1rem;
}

.countdown {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 22px;
  color: var(--forest);
}

.countdown span {
  min-width: 1ch;
  font-size: clamp(3.5rem, 16vw, 5.4rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 0.9;
}

.countdown small {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.destination {
  display: grid;
  gap: 3px;
  margin-bottom: 15px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f7faf7;
}

.destination span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.destination a {
  position: relative;
  z-index: 1;
  color: var(--forest);
  font-size: 0.88rem;
  font-weight: 750;
  overflow-wrap: anywhere;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.redirect-button {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 50px;
  place-items: center;
  width: 100%;
  padding: 11px 18px;
  border: 1px solid var(--forest);
  border-radius: 13px;
  background: var(--forest);
  box-shadow: 0 10px 24px rgb(23 63 53 / 18%);
  color: #fff;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.redirect-button:hover {
  background: var(--leaf);
  box-shadow: 0 13px 28px rgb(23 63 53 / 22%);
  transform: translateY(-1px);
}

.redirect-button:focus-visible,
.destination a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.redirect-note,
.redirect-noscript,
.redirect-footer {
  color: var(--muted);
  font-size: 0.78rem;
}

.redirect-note {
  position: relative;
  z-index: 1;
  margin: 17px 0 0;
}

.redirect-noscript {
  margin: 12px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--focus);
  background: #fff8e8;
}

.redirect-footer {
  padding-inline: 12px;
  text-align: center;
}

@keyframes countdown-progress {
  to {
    transform: scaleX(0);
  }
}

@media (max-width: 420px) {
  .redirect-shell {
    width: min(100% - 20px, 520px);
    padding-block: 10px;
  }

  .redirect-card {
    border-radius: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
