/* =========================================================
   Tianrun AI homepage
   ========================================================= */

:root {
  --color-text: #161b22;
  --color-copy: #343b45;
  --color-muted: #657080;
  --color-blue: #0b6fc1;
  --color-cyan: #00c9e8;
  --color-pale-blue: #dceeff;
  --color-section: #f7f9fb;
  --color-product: #f5f6f8;
  --color-qualification: #fafafa;
  --color-border: #e2e6eb;
  --container-width: 1200px;
  --page-shell-width: 1680px;
  --section-space: 76px;
  --transition-fast: 280ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  padding-top: 8px;
  overflow-x: hidden;
  color: var(--color-text);
  background: #eef2f6;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.hero,
main,
.site-footer {
  width: min(var(--page-shell-width), calc(100% - clamp(32px, 10.8vw, 204px)));
  margin-inline: auto;
}

main {
  background: #ffffff;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

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

.container {
  width: min(var(--container-width), calc(100% - 48px));
  margin-inline: auto;
}

.section {
  padding: var(--section-space) 0;
}

/* Hero --------------------------------------------------- */

.hero {
  overflow: hidden;
  background: #064f7e;
}

.hero__image {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Shared section title ----------------------------------- */

.section-title {
  position: relative;
  z-index: 1;
  margin: 0 0 68px;
  text-align: center;
  color: #0b0d10;
  font-size: clamp(28px, 2.35vw, 34px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.section-title__text {
  display: inline;
}

.section-title__zh {
  position: relative;
  z-index: 1;
}

.section-title__zh::before {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: -18px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-pale-blue);
  content: "";
  transform: translateY(-50%);
}

/* About us ----------------------------------------------- */

.about-section {
  background: #ffffff;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.94fr);
  align-items: center;
  gap: 66px;
}

.about-copy p {
  margin: 0;
  color: var(--color-copy);
  font-size: 17px;
  line-height: 1.92;
  text-align: justify;
  text-justify: inter-ideograph;
}

.about-figure {
  margin: 0;
}

.about-figure img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Core technology ---------------------------------------- */

.technology-section {
  background-color: var(--color-section);
  background-image: url("../assets/images/technology-bg.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

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

.technology-item {
  min-width: 0;
  text-align: center;
  transition: transform var(--transition-fast);
}

.technology-item__visual {
  display: flex;
  height: 212px;
  align-items: center;
  justify-content: center;
}

.technology-item__visual img {
  width: auto;
  max-width: 245px;
  height: 198px;
  object-fit: contain;
}

.technology-item h3 {
  margin: 22px 0 0;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.35;
}

@media (hover: hover) and (pointer: fine) {
  .technology-item:hover {
    transform: translateY(-5px);
  }
}

/* Core products ------------------------------------------ */

.products-section {
  background: #ffffff;
}

.products-list {
  display: grid;
  gap: 30px;
}

.product-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  overflow: hidden;
}

.product-media {
  position: relative;
  min-width: 0;
  aspect-ratio: 6 / 5;
  overflow: hidden;
  background: #96999d;
}

.product-media > img,
.product-media > video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-media > img {
  transition: transform 420ms ease;
}

.product-video {
  display: block;
  border: 0;
  background: #111822;
}

.product-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 42px 50px 46px;
  background: var(--color-product);
  text-align: center;
}

.product-logo {
  width: 122px;
  height: 86px;
  margin: 0 0 13px;
  object-fit: contain;
}

.product-copy h3 {
  margin: 0 0 18px;
  color: #080a0d;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
}

.product-copy p {
  margin: 0;
  color: var(--color-copy);
  font-size: 16px;
  line-height: 1.9;
  text-align: justify;
  text-justify: inter-ideograph;
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 88px;
  height: 88px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  outline-offset: 5px;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform var(--transition-fast);
}

.play-button:focus-visible {
  outline: 3px solid rgba(0, 207, 237, 0.92);
}

@media (hover: hover) and (pointer: fine) {
  .product-media:hover > img {
    transform: scale(1.018);
  }

  .play-button:hover {
    transform: translate(-50%, -50%) scale(1.08);
  }
}

/* Corporate qualifications ------------------------------ */

.qualifications-section {
  background: var(--color-qualification);
}

.qualifications-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 42px;
}

.qualification-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--color-border);
  background: #ffffff;
}

.qualification-card h3 {
  min-height: 92px;
  margin: 0;
  padding: 29px 32px;
  background:
    linear-gradient(115deg, rgba(221, 231, 240, 0.22), transparent 40%),
    repeating-linear-gradient(105deg, rgba(222, 228, 234, 0.16) 0 2px, transparent 2px 13px);
  color: #15191f;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.65;
}

.qualification-card__visual {
  display: flex;
  min-height: 298px;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 44px 34px 56px;
}

.qualification-card__visual img {
  width: 100%;
  max-width: 435px;
  height: auto;
  object-fit: contain;
}

/* Footer -------------------------------------------------- */

.site-footer {
  position: relative;
  overflow: hidden;
  border-top: 7px solid #20d4c7;
  color: #ffffff;
  background:
    radial-gradient(ellipse at 52% 115%, rgba(0, 122, 201, 0.38), transparent 40%),
    repeating-linear-gradient(90deg, transparent 0 88px, rgba(0, 116, 185, 0.07) 88px 90px),
    linear-gradient(105deg, #020608 0%, #03111d 52%, #020406 100%);
}

.site-footer::after {
  position: absolute;
  right: 20%;
  bottom: -70px;
  left: 31%;
  height: 170px;
  background:
    repeating-linear-gradient(90deg, transparent 0 12px, rgba(0, 198, 239, 0.12) 12px 14px),
    linear-gradient(to top, rgba(0, 119, 204, 0.18), transparent);
  content: "";
  filter: blur(0.2px);
  mask-image: linear-gradient(to top, #000, transparent);
  pointer-events: none;
}

.footer-layout {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 262px;
  align-items: center;
  justify-content: space-between;
  gap: 72px;
  padding-top: 33px;
  padding-bottom: 33px;
}

.site-record {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  padding: 16px clamp(18px, 4vw, 56px);
  color: #858b92;
  background: #ffffff;
  text-align: center;
}

.site-record p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}

.site-record a {
  display: inline-block;
  margin-left: 4px;
  color: #169bd5;
  text-decoration: none;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.site-record a:hover,
.site-record a:focus-visible {
  text-decoration: underline;
}

.contact-list {
  display: grid;
  gap: 20px;
  margin: 0;
  font-style: normal;
}

.contact-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.contact-item__icon {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

.contact-item__label {
  display: block;
  margin-bottom: 5px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  line-height: 1.3;
}

.contact-item p,
.contact-item a {
  margin: 0;
  color: #ffffff;
  font-size: 15px;
  line-height: 1.55;
}

.contact-item a {
  text-underline-offset: 3px;
}

.contact-item__phone {
  color: var(--color-cyan) !important;
  font-size: 25px !important;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.wechat-block {
  flex: 0 0 auto;
  margin-right: 4px;
  text-align: center;
}

.wechat-block img {
  width: 150px;
  height: 150px;
  margin: 0 auto;
  object-fit: contain;
  background: #ffffff;
}

.wechat-block p {
  margin: 17px 0 0;
  font-size: 16px;
}

/* Reveal animation --------------------------------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 520ms ease,
    transform 520ms ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.technology-grid .reveal:nth-child(2),
.qualifications-grid .reveal:nth-child(2) {
  transition-delay: 70ms;
}

.technology-grid .reveal:nth-child(3) {
  transition-delay: 140ms;
}

/* Tablet -------------------------------------------------- */

@media (max-width: 1199px) {
  :root {
    --section-space: 64px;
  }

  .container {
    width: min(var(--container-width), calc(100% - 56px));
  }

  .section-title {
    margin-bottom: 56px;
  }

  .about-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
    gap: 42px;
  }

  .about-copy p {
    font-size: 16px;
    line-height: 1.82;
  }

  .technology-item__visual {
    height: 194px;
  }

  .technology-item__visual img {
    max-width: 220px;
    height: 182px;
  }

  .technology-item h3 {
    margin-top: 18px;
    font-size: 22px;
  }

  .product-copy {
    padding: 32px 34px 36px;
  }

  .product-logo {
    width: 108px;
    height: 78px;
    margin-bottom: 9px;
  }

  .product-copy h3 {
    margin-bottom: 14px;
    font-size: 22px;
  }

  .product-copy p {
    font-size: 15px;
    line-height: 1.78;
  }

  .qualification-card h3 {
    min-height: 88px;
    padding: 24px;
    font-size: 18px;
  }

  .qualification-card__visual {
    min-height: 250px;
    padding: 34px 26px 42px;
  }
}

/* Mobile -------------------------------------------------- */

@media (max-width: 767px) {
  :root {
    --section-space: 52px;
  }

  body {
    padding-top: 6px;
  }

  .container {
    width: calc(100% - 32px);
  }

  .section-title {
    margin-bottom: 38px;
    font-size: clamp(21px, 6vw, 24px);
    line-height: 1.45;
    letter-spacing: -0.025em;
  }

  .section-title__zh::before {
    left: -10px;
    width: 36px;
    height: 36px;
  }

  .section-title__text {
    display: inline-block;
    max-width: 100%;
  }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .about-copy p {
    font-size: 15px;
    line-height: 1.82;
    text-align: left;
  }

  .technology-section {
    background-position: center bottom;
  }

  .technology-section .section-title {
    margin-bottom: 28px;
    font-size: clamp(16px, 4.6vw, 18px);
    line-height: 1.25;
    letter-spacing: -0.035em;
    white-space: nowrap;
  }

  .technology-section .section-title__zh::before {
    left: -8px;
    width: 30px;
    height: 30px;
  }

  .technology-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(4px, 2vw, 10px);
  }

  .technology-item__visual {
    height: clamp(74px, 24vw, 98px);
  }

  .technology-item__visual img {
    width: 100%;
    max-width: 108px;
    height: 100%;
    max-height: none;
  }

  .technology-item h3 {
    margin-top: 10px;
    font-size: clamp(12px, 3.6vw, 15px);
    white-space: nowrap;
  }

  .products-list {
    gap: 20px;
  }

  .product-row {
    grid-template-columns: 1fr;
  }

  .product-media {
    order: 1;
    width: 100%;
  }

  .product-copy {
    order: 2;
    align-items: center;
    padding: 28px 23px 32px;
  }

  .product-logo {
    width: 102px;
    height: 76px;
    margin-bottom: 7px;
  }

  .product-copy h3 {
    margin-bottom: 14px;
    font-size: 21px;
    line-height: 1.45;
    text-align: center;
  }

  .product-copy p {
    font-size: 14.5px;
    line-height: 1.78;
    text-align: left;
  }

  .play-button {
    width: 72px;
    height: 72px;
  }

  .qualifications-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .qualification-card h3 {
    min-height: 0;
    padding: 20px 19px;
    font-size: 16px;
    line-height: 1.55;
  }

  .qualification-card__visual {
    min-height: 0;
    padding: 30px 18px 36px;
  }

  .site-footer {
    border-top-width: 5px;
  }

  .footer-layout {
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 38px;
    padding-top: 42px;
    padding-bottom: 38px;
  }

  .contact-list {
    gap: 24px;
  }

  .contact-item {
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
    gap: 15px;
  }

  .contact-item__icon {
    width: 33px;
    height: 33px;
  }

  .contact-item__label,
  .contact-item p,
  .contact-item a {
    font-size: 14px;
  }

  .contact-item__phone {
    font-size: 22px !important;
  }

  .wechat-block {
    margin-right: 0;
  }

  .wechat-block img {
    width: 140px;
    height: 140px;
  }

  .wechat-block p {
    margin-top: 14px;
    font-size: 15px;
  }
}

@media (max-width: 380px) {
  .section-title {
    font-size: 20px;
  }

  .product-copy h3 {
    font-size: 20px;
  }
}

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

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

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
