:root {
  color-scheme: light;
  font-family: "Noto Sans CJK SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  letter-spacing: 0;
}

* { box-sizing: border-box; }

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

body { overflow: hidden; }

.intro {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100svh;
  min-height: 430px;
  overflow: hidden;
  background: #e8f0ec;
  color: #17241f;
  transition: background-color 520ms ease, color 520ms ease;
}

.intro[data-scene="pineapple"] {
  background: #f5e99d;
  color: #1f2b20;
}

.intro[data-scene="phone"] {
  background: #173b35;
  color: #f7f6ed;
}

.intro__header {
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 38px;
}

.brand {
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.brand span { font-weight: 400; }

.skip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease;
}

.skip:hover, .skip:focus-visible {
  background: #17241f;
  color: #fff;
}

.intro[data-scene="phone"] .skip:hover,
.intro[data-scene="phone"] .skip:focus-visible {
  background: #f7f6ed;
  color: #173b35;
}

.skip:focus-visible { outline: 3px solid #e65447; outline-offset: 3px; }

.skip span { font-size: 18px; line-height: 1; }

.stage { position: relative; flex: 1; min-height: 0; }

.scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px 24px 18px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(.96);
  transition: opacity 470ms ease, transform 520ms cubic-bezier(.2,.8,.2,1), visibility 520ms;
}

.scene.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.scene__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-height: 620px;
  gap: 24px;
}

.fruit {
  display: block;
  width: min(32vh, 280px);
  min-width: 145px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(12px 18px 0 rgba(20, 28, 23, .13));
  transform: rotate(-9deg) scale(.8);
  transition: transform 650ms cubic-bezier(.18,1.5,.28,1);
}

.scene.is-active .fruit { transform: rotate(0) scale(1); }

.fruit--pineapple { transform: rotate(8deg) scale(.8); }

h1 {
  margin: 0;
  font-size: 68px;
  font-weight: 900;
  line-height: 1.14;
  text-align: center;
  letter-spacing: 0;
  white-space: nowrap;
}

.scene--apple h1 span { color: #d93932; }
.scene--pineapple h1 span { color: #227349; }
.scene--phone h1 span { color: #f6d451; }

.phone {
  position: relative;
  width: 184px;
  height: 348px;
  padding: 8px;
  border: 7px solid #091b18;
  border-radius: 34px;
  background: #091b18;
  box-shadow: 15px 19px 0 rgba(3, 15, 13, .33);
  transform: translateY(74px) rotate(13deg) scale(.75);
  transition: transform 750ms cubic-bezier(.18,1.3,.27,1);
}

.scene.is-active .phone { transform: translateY(0) rotate(-6deg) scale(1); }

.phone::after {
  position: absolute;
  top: 80px;
  right: -11px;
  width: 4px;
  height: 44px;
  border-radius: 0 3px 3px 0;
  background: #091b18;
  content: "";
}

.phone__camera {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 50%;
  width: 54px;
  height: 12px;
  border-radius: 0 0 10px 10px;
  background: #091b18;
  transform: translateX(-50%);
}

.phone__screen {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  overflow: hidden;
  border-radius: 23px;
  background: #f5d65a;
}

.phone__screen::before {
  position: absolute;
  top: -30px;
  left: -58px;
  width: 105px;
  height: 130%;
  background: #ed6855;
  content: "";
  transform: rotate(21deg);
}

.phone__screen img { position: relative; width: 122px; height: 122px; object-fit: contain; }

.phone__brand {
  position: absolute;
  z-index: 1;
  bottom: 22px;
  left: 50%;
  color: #123e32;
  font-size: 17px;
  font-weight: 900;
  transform: translateX(-50%);
}

.intro__footer { position: relative; z-index: 5; height: 32px; padding: 0 38px 20px; }

.credit {
  position: absolute;
  right: 38px;
  bottom: 25px;
  color: inherit;
  font-size: 10px;
  opacity: .65;
  text-decoration: none;
}

.credit:hover, .credit:focus-visible { opacity: 1; text-decoration: underline; }

.progress { width: 100%; height: 3px; background: rgba(20, 38, 30, .22); }
.intro[data-scene="phone"] .progress { background: rgba(255, 255, 255, .22); }

.progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: #e65447;
  transform: scaleX(0);
  transform-origin: left center;
  animation: progress 6.5s linear forwards;
}

.intro[data-scene="phone"] .progress span { background: #f6d451; }

@keyframes progress { to { transform: scaleX(1); } }

@media (max-width: 600px) {
  .intro__header { min-height: 66px; padding: 0 19px; }
  .brand { font-size: 11px; }
  .skip { min-height: 36px; padding: 0 10px; font-size: 12px; }
  .scene { padding: 8px 16px 12px; }
  .scene__content { gap: 15px; }
  .fruit { width: min(30vh, 220px); min-width: 130px; }
  h1 { font-size: 39px; }
  .phone { width: 146px; height: 282px; border-radius: 29px; }
  .phone__screen { border-radius: 19px; }
  .phone__screen img { width: 102px; height: 102px; }
  .intro__footer { padding: 0 19px 17px; }
  .credit { right: 19px; bottom: 22px; }
}

@media (max-height: 590px) {
  .intro__header { min-height: 52px; }
  .scene__content { gap: 16px; }
  .fruit { width: 136px; min-width: 0; }
  .phone { width: 128px; height: 230px; }
  .phone__screen img { width: 88px; height: 88px; }
  h1 { font-size: 34px; }
  .intro__footer { height: 23px; padding-bottom: 12px; }
}

@media (max-height: 430px) {
  .intro { min-height: 0; }
  .intro__header { min-height: 44px; padding: 0 16px; }
  .intro__footer { height: 18px; padding: 0 16px 10px; }
  .credit { right: 16px; bottom: 25px; font-size: 8px; }
  .scene { padding: 0 18px; }
  .scene__content { flex-direction: row; max-height: none; gap: 22px; }
  .fruit { width: 112px; }
  .phone { width: 105px; height: 186px; flex: none; padding: 5px; border-width: 5px; border-radius: 23px; }
  .phone__screen { border-radius: 15px; }
  .phone__screen img { width: 70px; height: 70px; }
  .phone__camera { top: 5px; width: 36px; height: 9px; }
  .phone__brand { bottom: 12px; font-size: 12px; }
  h1 { font-size: 29px; }
}

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