:root {
  color-scheme: light;
  --forest: #174f36;
  --forest-dark: #0c3726;
  --leaf: #47a457;
  --sun: #f6d35d;
  --sun-deep: #e8ae30;
  --cream: #fffdf2;
  --ink: #153329;
  --muted: #5d7067;
  --white: #ffffff;
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 12% 18%, rgb(255 255 255 / 72%) 0 5rem, transparent 5.1rem),
    radial-gradient(circle at 88% 9%, rgb(255 255 255 / 45%) 0 8rem, transparent 8.1rem),
    linear-gradient(155deg, #ffef98 0%, var(--sun) 42%, #dceb8f 100%);
  color: var(--ink);
  margin: 0;
  min-height: 100vh;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  font: inherit;
}

.download-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 1.15rem clamp(1rem, 4vw, 3rem);
}

.header-links,
.footer-links {
  align-items: center;
  display: flex;
  gap: 0.55rem;
}

.header-links > a:not(.play-link) {
  color: var(--forest);
  font-weight: 900;
  padding: 0.65rem;
  text-decoration: none;
}

.mini-brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  gap: 0.7rem;
  text-decoration: none;
}

.mini-brand img {
  border: 3px solid rgb(255 255 255 / 85%);
  border-radius: 17px;
  box-shadow: 0 5px 0 rgb(93 79 28 / 18%);
  height: 52px;
  width: 52px;
}

.mini-brand span {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.mini-brand strong {
  font-size: 1rem;
  font-weight: 950;
}

.mini-brand small {
  color: #577061;
  font-size: 0.78rem;
  font-weight: 800;
  margin-top: 0.16rem;
}

.play-link,
.secondary-play {
  align-items: center;
  border: 2px solid rgb(23 79 54 / 20%);
  border-radius: 999px;
  color: var(--forest);
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 46px;
  padding: 0.65rem 1.1rem;
  text-decoration: none;
}

.play-link:hover,
.secondary-play:hover {
  background: rgb(255 255 255 / 55%);
}

main {
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 clamp(1rem, 4vw, 3rem) 3rem;
}

.download-hero {
  align-items: center;
  display: grid;
  gap: clamp(2.5rem, 7vw, 6rem);
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.96fr);
  min-height: min(690px, calc(100vh - 85px));
  padding: 2.5rem 0 4.2rem;
}

.age-badge {
  background: rgb(255 255 255 / 66%);
  border: 1px solid rgb(255 255 255 / 85%);
  border-radius: 999px;
  color: var(--forest);
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  padding: 0.5rem 0.82rem;
}

h1 {
  color: var(--forest-dark);
  font-size: clamp(2.6rem, 6vw, 5.25rem);
  font-weight: 950;
  letter-spacing: -0.065em;
  line-height: 0.96;
  margin: 1.15rem 0 1.2rem;
  max-width: 760px;
}

.hero-intro {
  color: #3c5c4d;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.55;
  margin: 0;
  max-width: 620px;
}

.download-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.primary-install {
  align-items: center;
  background: var(--forest);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 7px 0 var(--forest-dark), 0 13px 26px rgb(20 66 44 / 24%);
  color: white;
  cursor: pointer;
  display: inline-flex;
  font-weight: 950;
  gap: 0.65rem;
  justify-content: center;
  min-height: 58px;
  padding: 0.85rem 1.35rem;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.primary-install svg {
  fill: none;
  height: 24px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  width: 24px;
}

.primary-install:hover {
  transform: translateY(-2px);
}

.primary-install:active {
  box-shadow: 0 3px 0 var(--forest-dark);
  transform: translateY(4px);
}

.primary-install:disabled {
  background: #71847a;
  box-shadow: 0 5px 0 #4f6258;
  cursor: default;
}

.secondary-play {
  min-height: 58px;
  padding-inline: 1.3rem;
}

.install-status {
  color: #536b5f;
  font-size: 0.94rem;
  line-height: 1.45;
  margin: 1rem 0 0;
}

.benefit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.72rem 1.1rem;
  list-style: none;
  margin: 1.55rem 0 0;
  padding: 0;
}

.benefit-list li {
  align-items: center;
  color: #345848;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 800;
  gap: 0.4rem;
}

.benefit-list span {
  align-items: center;
  background: var(--leaf);
  border-radius: 50%;
  color: white;
  display: inline-flex;
  font-size: 0.72rem;
  height: 21px;
  justify-content: center;
  width: 21px;
}

.app-showcase {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 520px;
  position: relative;
}

.showcase-glow {
  background: rgb(255 255 255 / 45%);
  border-radius: 50%;
  filter: blur(2px);
  height: 430px;
  position: absolute;
  width: 430px;
}

.phone-frame {
  background: #14291f;
  border: 5px solid #0d2018;
  border-radius: 46px;
  box-shadow: 0 28px 65px rgb(41 67 34 / 28%);
  padding: 11px;
  position: relative;
  transform: rotate(3deg);
  width: min(315px, 80vw);
  z-index: 1;
}

.phone-frame::before {
  background: #0d2018;
  border-radius: 999px;
  content: "";
  height: 25px;
  left: 50%;
  position: absolute;
  top: 16px;
  transform: translateX(-50%);
  width: 92px;
  z-index: 3;
}

.phone-screen {
  align-items: center;
  background:
    linear-gradient(rgb(255 255 255 / 10%), rgb(255 255 255 / 12%)),
    url("assets/pinyin-adventure-bg-mobile.png") center / cover;
  border-radius: 32px;
  display: flex;
  flex-direction: column;
  min-height: 510px;
  overflow: hidden;
  padding: 5.2rem 1.25rem 2rem;
  position: relative;
  text-align: center;
}

.phone-screen::after {
  background: linear-gradient(transparent, rgb(22 77 47 / 75%));
  bottom: 0;
  content: "";
  height: 48%;
  left: 0;
  position: absolute;
  right: 0;
}

.app-icon-large,
.phone-screen strong,
.phone-screen span,
.phone-screen a {
  position: relative;
  z-index: 1;
}

.app-icon-large {
  border: 5px solid white;
  border-radius: 28px;
  box-shadow: 0 11px 24px rgb(35 61 42 / 28%);
  height: 130px;
  margin-bottom: auto;
  object-fit: cover;
  width: 130px;
}

.phone-screen strong {
  color: white;
  font-size: 1.42rem;
  font-weight: 950;
  text-shadow: 0 2px 3px rgb(0 0 0 / 18%);
}

.phone-screen span {
  color: #efffe8;
  font-size: 0.88rem;
  font-weight: 800;
  margin-top: 0.35rem;
}

.phone-screen a {
  background: var(--sun);
  border-radius: 999px;
  box-shadow: 0 5px 0 var(--sun-deep);
  color: var(--forest-dark);
  font-weight: 950;
  margin-top: 1.25rem;
  padding: 0.78rem 2.1rem;
  text-decoration: none;
}

.pinyin-token {
  align-items: center;
  background: white;
  border: 4px solid var(--forest);
  border-radius: 18px;
  box-shadow: 0 8px 0 rgb(16 55 36 / 22%);
  color: var(--forest);
  display: flex;
  font-size: 2rem;
  font-weight: 950;
  height: 74px;
  justify-content: center;
  position: absolute;
  width: 74px;
  z-index: 2;
}

.token-one {
  left: 1%;
  top: 18%;
  transform: rotate(-12deg);
}

.token-two {
  right: 0;
  top: 12%;
  transform: rotate(10deg);
}

.token-three {
  bottom: 13%;
  right: 2%;
  transform: rotate(-7deg);
}

.install-guide {
  background: rgb(255 253 242 / 92%);
  border: 2px solid rgb(255 255 255 / 80%);
  border-radius: 34px;
  box-shadow: 0 22px 55px rgb(80 77 39 / 16%);
  padding: clamp(1.4rem, 4vw, 3.5rem);
}

.guide-heading span {
  color: var(--leaf);
  font-size: 0.86rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-heading h2 {
  color: var(--forest-dark);
  font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: -0.045em;
  margin: 0.35rem 0 1.7rem;
}

.device-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.device-card {
  align-items: flex-start;
  background: white;
  border: 2px solid #e4e9dd;
  border-radius: 23px;
  display: grid;
  gap: 1rem;
  grid-template-columns: auto 1fr;
  padding: 1.35rem;
  scroll-margin-top: 1.2rem;
}

.device-card.is-highlighted {
  animation: guide-pulse 900ms ease;
  border-color: var(--leaf);
}

.device-icon {
  align-items: center;
  background: var(--forest-dark);
  border-radius: 15px;
  color: white;
  display: flex;
  font-size: 1rem;
  font-weight: 950;
  height: 54px;
  justify-content: center;
  width: 54px;
}

.android-icon {
  background: var(--leaf);
  font-size: 1.3rem;
}

.mac-icon {
  background: #3b72a8;
  font-size: 0.88rem;
}

.device-card h3 {
  color: var(--forest-dark);
  font-size: 1.12rem;
  margin: 0 0 0.7rem;
}

.device-card ol {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  padding-left: 1.35rem;
}

.device-card li + li {
  margin-top: 0.4rem;
}

.share-row {
  align-items: center;
  background: #eef7df;
  border-radius: 20px;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 1.1rem 1.25rem;
}

.share-row div {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.share-row strong {
  color: var(--forest-dark);
}

.share-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.share-row button {
  background: white;
  border: 2px solid #cfdcc2;
  border-radius: 999px;
  color: var(--forest);
  cursor: pointer;
  font-weight: 900;
  min-height: 44px;
  padding: 0.65rem 1rem;
}

footer {
  align-items: center;
  color: #486254;
  display: flex;
  font-size: 0.9rem;
  font-weight: 800;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 1.5rem clamp(1rem, 4vw, 3rem) 2.4rem;
}

footer a {
  color: var(--forest);
  text-underline-offset: 3px;
}

@keyframes guide-pulse {
  0%, 100% { box-shadow: none; }
  45% { box-shadow: 0 0 0 7px rgb(71 164 87 / 18%); }
}

@media (max-width: 860px) {
  .download-hero {
    grid-template-columns: 1fr;
    padding-top: 2rem;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-intro,
  .benefit-list {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }

  .download-actions {
    justify-content: center;
  }

  .app-showcase {
    min-height: 560px;
  }

  .token-one {
    left: 12%;
  }

  .token-two,
  .token-three {
    right: 12%;
  }

  .device-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mac-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .download-header {
    padding-top: 0.85rem;
  }

  .mini-brand small,
  .play-link {
    display: none;
  }

  .mini-brand img {
    height: 46px;
    width: 46px;
  }

  .download-hero {
    gap: 1.4rem;
    padding: 1.5rem 0 3rem;
  }

  h1 {
    font-size: clamp(2.65rem, 13vw, 4rem);
  }

  .download-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-install,
  .secondary-play {
    width: 100%;
  }

  .benefit-list {
    align-items: center;
    flex-direction: column;
  }

  .app-showcase {
    min-height: 500px;
  }

  .phone-screen {
    min-height: 465px;
  }

  .showcase-glow {
    height: 340px;
    width: 340px;
  }

  .pinyin-token {
    height: 62px;
    width: 62px;
  }

  .token-one { left: -0.3rem; }
  .token-two { right: -0.3rem; }
  .token-three { right: 0; }

  .device-grid {
    grid-template-columns: 1fr;
  }

  .mac-card {
    grid-column: auto;
  }

  .device-card {
    grid-template-columns: 1fr;
  }

  .share-row {
    align-items: stretch;
    flex-direction: column;
    text-align: left;
  }

  footer {
    flex-direction: column;
    gap: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
