/* Homepage-only visual refinement. Preserve the established TingRui blue and orange identity. */
body.home-page {
  --home-navy: #13345d;
  --home-orange: #ee8738;
  --home-blue: #4874cb;
  --home-paper: #f6f8fc;
  --home-wash: #eaf0f8;
  --home-line: #d8e0e9;
  background: var(--home-paper) !important;
  color: var(--home-navy) !important;
}

body.home-page nav {
  height: 86px !important;
  background: rgba(255,255,255,.97) !important;
  border-bottom-color: var(--home-line) !important;
}

body.home-page nav .brand {
  width: 156px !important;
  height: 56px !important;
  flex-basis: 156px !important;
}

body.home-page nav .brand img {
  max-height: 56px !important;
}

body.home-page nav .cta {
  background: var(--home-navy) !important;
  border-color: var(--home-navy) !important;
  color: #fff !important;
}

body.home-page .hero-film {
  height: min(78svh, 820px) !important;
  min-height: 650px !important;
  background: var(--home-navy) !important;
}

body.home-page .hero-film .film-layer {
  left: 39% !important;
  right: 0 !important;
  width: 61% !important;
  height: 100% !important;
  isolation: isolate;
  background: var(--home-navy) !important;
  animation: homeHeroFade 30s steps(1, end) infinite !important;
  will-change: opacity;
}

body.home-page .hero-film .film-layer::before {
  content: "";
  position: absolute;
  inset: -26px;
  z-index: -1;
  background: var(--home-scene) center / cover no-repeat;
  filter: blur(22px) brightness(.48) saturate(.8);
  transform: scale(1.08);
}

body.home-page .hero-film .film-layer img {
  position: relative !important;
  z-index: 1;
  content: normal !important;
  animation: none !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: var(--home-image-fit, contain) !important;
  object-position: center right !important;
  filter: brightness(1.06) drop-shadow(0 20px 32px rgba(4,17,35,.32)) !important;
  transform: scale(var(--home-product-scale, 1));
  transform-origin: center center;
}

/* Slide 1 is the approved warm cylindrical lamp reference: do not change it. */
body.home-page .hero-film .film-layer:nth-child(1) { --home-scene: url("assets/catalogue-exhibition/ry-03/detail-1.jpeg"); --home-product-scale: 1.28; animation-delay: 0s !important; }
/* Restore only the cylinder's navy-to-photo blend. Its asset and all image geometry
   remain unchanged. Cover the protruding photograph's left edge before fading out
   ahead of the lamp, rather than tinting the complete scene blue. */
body.home-page .hero-film .film-layer:nth-child(1)::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -39vw;
  right: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, #13345d 0%, #13345d var(--cylinder-fade-start, 39vw), rgba(19,52,93,.8) var(--cylinder-fade-quarter, 43vw), rgba(19,52,93,.3) var(--cylinder-fade-soft, 49vw), rgba(19,52,93,0) var(--cylinder-fade-end, 55vw));
}
/* The remaining product scenes use optical, per-source corrections so their products
   read at a comparable size without cropping the supplied imagery. */
body.home-page .hero-film .film-layer:nth-child(2) { --home-scene: url("assets/home-carousel/order-02.jpg"); --home-product-scale: 1; animation-delay: 5s !important; }
body.home-page .hero-film .film-layer:nth-child(3) { --home-scene: url("assets/hero-selected/hero-selected-07-round-fabric-alarm.jpg"); --home-product-scale: .58; animation-delay: 10s !important; }
body.home-page .hero-film .film-layer:nth-child(4) { --home-scene: url("assets/hero-selected/hero-selected-06-rgb-sphere-alarm.png"); --home-product-scale: 1; animation-delay: 15s !important; }
/* These two source scenes must fill the photograph area rather than sit inside a
   small square. Their positions retain the complete product silhouette. */
body.home-page .hero-film .film-layer:nth-child(5) { --home-scene: url("assets/home-carousel/order-05.png"); --home-product-scale: 1; --home-image-fit: cover; animation-delay: 20s !important; }
body.home-page .hero-film .film-layer:nth-child(6) { --home-scene: url("assets/hero-selected/hero-selected-03-wall-clock.jpg"); --home-product-scale: 1; --home-image-fit: cover; animation-delay: 25s !important; }

/* A photograph must fill its scene before optical product sizing. The previous
   contain + shrunken rectangle exposed an unrelated blurred duplicate at its edges.
   Keep the approved first scene's original rules untouched. */
body.home-page .hero-film .film-layer:nth-child(n+2) { overflow: hidden; }
body.home-page .hero-film .film-layer:nth-child(n+2)::before { display: none; }
body.home-page .hero-film .film-layer:nth-child(n+2)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, #13345d 0%, rgba(19,52,93,.76) 12%, rgba(19,52,93,0) 38%);
}
body.home-page .hero-film .film-layer:nth-child(n+2) img {
  object-fit: cover !important;
  object-position: center !important;
  transform: none;
  filter: brightness(1.06) !important;
}
body.home-page .hero-film .film-layer:nth-child(3) img { object-position: center bottom !important; }
body.home-page .hero-film .film-layer:nth-child(4) img { transform: scale(1.3); transform-origin: center; }
/* The wide wall-clock silhouette needs a clear gap from the headline. Its original
   square scene stays full height at the far right; only the plain wall's outermost
   edge is blended. No product pixel is cropped or redrawn. */
body.home-page .hero-film .film-layer:nth-child(6) img {
  position: absolute !important;
  top: 0;
  right: 0;
  width: auto !important;
  height: 100% !important;
  max-width: 100%;
  object-fit: contain !important;
  object-position: center right !important;
  mask-image: linear-gradient(90deg, transparent 0%, #000 4%, #000 100%);
  background: linear-gradient(rgb(97,60,41), rgb(99,61,40));
}
body.home-page .hero-film .film-layer:nth-child(6)::after {
  background: linear-gradient(90deg, #13345d 0%, rgba(19,52,93,.6) 5%, rgba(19,52,93,0) 18%);
}
/* Extend only the source wall behind the contained scene. This anchors the
   navy-to-wall fade before the clock instead of fading against an empty navy
   rectangle; the original product and its weekday column stay untouched. */
body.home-page .hero-film .film-layer:nth-child(6) {
  background: linear-gradient(180deg, rgb(97,60,41), rgb(99,61,40)) !important;
}
/* Local review fragments freeze one scene for reproducible screenshots.
   With no fragment, the existing six-scene order and 30-second timing are unchanged. */
body.home-page .hero-film .film-layer[id] { scroll-margin-top: 86px; }
body.home-page .hero-film:has(.film-layer:target) .film-layer { animation: none !important; opacity: 0 !important; }
body.home-page .hero-film:has(.film-layer:target) .film-layer:target { opacity: 1 !important; }

@keyframes homeHeroFade {
  0%, 16.66% { opacity: 1; }
  16.67%, 100% { opacity: 0; }
}

body.home-page .hero-film .film-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(90deg, #13345d 0%, #13345d 32%, rgba(19,52,93,.8) 36%, rgba(19,52,93,.25) 40%, rgba(19,52,93,0) 43%, rgba(19,52,93,0) 100%) !important;
}

body.home-page .film-copy {
  z-index: 3;
  top: 50%;
  bottom: auto !important;
  transform: translateY(-50%);
  left: max(32px, calc((100vw - 1240px)/2)) !important;
  max-width: 620px !important;
  color: #fff;
}

body.home-page .film-copy h1 {
  max-width: 620px !important;
  margin: 0 0 20px !important;
  font-size: clamp(48px, 5.4vw, 76px) !important;
  line-height: .99 !important;
  letter-spacing: -.035em !important;
  text-wrap: balance;
}

body.home-page .film-copy > p {
  max-width: 470px !important;
  margin: 0 0 26px !important;
  color: #e5edf7 !important;
  font-size: 17px !important;
  line-height: 1.55;
}

body.home-page .film-copy .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

body.home-page .film-copy .button.primary {
  background: var(--home-orange) !important;
  border-color: var(--home-orange) !important;
  color: var(--home-navy) !important;
}

body.home-page .film-copy .button.primary:hover {
  background: #ff9a4d !important;
  border-color: #ff9a4d !important;
}

body.home-page .film-copy .button:not(.primary) {
  color: #fff !important;
  border-color: rgba(255,255,255,.72) !important;
  background: rgba(19,52,93,.28) !important;
}

body.home-page .featured-products {
  padding: 96px 0 104px !important;
  background: var(--home-paper) !important;
  color: var(--home-navy) !important;
}

/* User-confirmed company facts, 2026-10-16. This row immediately follows the hero. */
body.home-page .company-strength { padding: 0; background: #faf9f6; border-bottom: 1px solid #d8e0e9; }
body.home-page .strength-grid { display: grid; grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr)); }
body.home-page .strength-intro { padding: 38px 28px 38px 0; }
body.home-page .strength-intro h2 { margin: 0 0 14px; font-size: 26px; line-height: 1.12; letter-spacing: -.03em; }
body.home-page .strength-intro p { margin: 0; color: #637187; font-size: 14px; line-height: 1.55; }
body.home-page .strength-item { padding: 38px 22px; border-left: 1px solid #d8e0e9; }
body.home-page .strength-item svg { width: 38px; height: 38px; margin: 0 0 23px; fill: none; stroke: #ee8738; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body.home-page .strength-item h3 { margin: 0; font-size: 21px; line-height: 1.2; letter-spacing: -.02em; color: #13345d; }
body.home-page .strength-item strong { display: block; margin-bottom: 8px; font-size: 32px; line-height: 1; letter-spacing: -.035em; white-space: nowrap; }
@media(max-width:980px) { body.home-page .strength-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } body.home-page .strength-intro { grid-column: 1 / -1; padding: 28px 0; } body.home-page .strength-item { padding: 26px 18px; } body.home-page .strength-item:nth-child(2) { border-left: 0; } }
@media(max-width:780px) { body.home-page .strength-grid { grid-template-columns: 1fr 1fr; } body.home-page .strength-item { border-top: 1px solid #d8e0e9; } body.home-page .strength-item:nth-child(4) { border-left: 0; } body.home-page .strength-item strong { font-size: 28px; } }

body.home-page .section-intro {
  max-width: 800px;
  margin: 0 0 36px;
}

body.home-page .section-intro h2 {
  max-width: 760px;
  margin: 0 0 17px;
  color: var(--home-navy);
  font-size: clamp(36px, 4.2vw, 58px);
  line-height: 1.04;
  letter-spacing: -.035em;
  text-wrap: balance;
}

body.home-page .section-intro > p:last-child {
  max-width: 660px;
  margin: 0;
  color: #52657e;
  font-size: 17px;
  line-height: 1.6;
}

body.home-page .featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

body.home-page .feature-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--home-line);
  border-radius: 14px;
  background: #fff !important;
  color: var(--home-navy);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

body.home-page .feature-card:hover {
  transform: translateY(-3px);
  border-color: #adc0da;
  box-shadow: 0 12px 28px rgba(19,52,93,.1);
}

body.home-page .feature-image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #e6edf6 !important;
}

body.home-page .feature-image img {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  object-position: center;
}

body.home-page .feature-image img { transform: none !important; }

body.home-page .feature-card > div:last-child {
  min-height: 116px;
  padding: 22px 23px 24px !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

body.home-page .feature-card h3 {
  margin: 0 !important;
  color: var(--home-navy);
  font-size: clamp(21px, 2vw, 27px);
  line-height: 1.08;
  letter-spacing: -.025em;
}

body.home-page .feature-card .textlink {
  color: #315b95;
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: rgba(49,91,149,.35);
  text-underline-offset: 4px;
}

body.home-page .feature-card:hover .textlink {
  color: var(--home-orange);
  text-decoration-color: currentColor;
}

body.home-page .project-cta {
  padding: 76px 0 !important;
  background: var(--home-navy) !important;
  color: #fff !important;
}

body.home-page .project-cta .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 42px;
}

body.home-page .project-cta h2 {
  max-width: 680px;
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.02;
  letter-spacing: -.035em;
  text-wrap: balance;
}

body.home-page .project-cta p {
  max-width: 610px;
  margin: 0;
  color: #e0e8f2;
  font-size: 16px;
  line-height: 1.6;
}

body.home-page .project-cta .button.primary {
  flex: 0 0 auto;
  background: var(--home-orange) !important;
  border-color: var(--home-orange) !important;
  color: var(--home-navy) !important;
  padding: 14px 20px;
}

body.home-page .full-footer {
  padding: 58px 0 20px !important;
  background: #fff !important;
  color: var(--home-navy) !important;
  border-top: 1px solid var(--home-line) !important;
}

body.home-page .full-footer .foot-grid {
  grid-template-columns: 1.05fr .95fr .8fr 1.5fr !important;
  gap: 34px !important;
  border-bottom-color: var(--home-line) !important;
}

body.home-page .full-footer .brand {
  display: inline-flex !important;
  width: 144px !important;
  height: 54px !important;
  align-items: center;
}

body.home-page .full-footer .brand img {
  width: 144px !important;
  max-height: 54px !important;
}

body.home-page .full-footer .foot-grid h4 {
  margin: 3px 0 15px !important;
  color: #315b95 !important;
  letter-spacing: .07em;
}

body.home-page .full-footer .foot-grid a,
body.home-page .full-footer .foot-grid p,
body.home-page .full-footer .foot-grid address {
  color: #52657e !important;
  font-size: 13px !important;
  line-height: 1.55;
}

body.home-page .full-footer .foot-grid address {
  margin: 13px 0 0;
  font-style: normal;
}

body.home-page .full-footer .foot-grid a:hover {
  color: var(--home-orange) !important;
}

body.home-page .full-footer .footer-contact p {
  margin: 0 0 6px !important;
}

body.home-page .full-footer .foot-bottom {
  padding-top: 18px !important;
  color: #687b92 !important;
}

body.home-page :focus-visible {
  outline: 3px solid var(--home-orange) !important;
  outline-offset: 3px;
}

@media (max-width: 980px) {
  body.home-page .links { gap: 14px; font-size: 11px; }
  body.home-page nav .brand { width: 136px !important; flex-basis: 136px !important; }
  body.home-page .full-footer .foot-grid { grid-template-columns: 1fr 1fr !important; }
}

@media (max-width: 780px) {
  body.home-page nav { height: 72px !important; padding: 0 20px; }
  body.home-page nav .brand { width: 124px !important; height: 46px !important; flex-basis: 124px !important; }
  body.home-page nav .brand img { max-height: 46px !important; }
  body.home-page .hero-film { height: 780px !important; min-height: 0 !important; max-height: calc(100svh - 72px); }
  body.home-page .hero-film .film-layer { left: 0 !important; width: 100% !important; height: 56% !important; }
  body.home-page .hero-film .film-layer img { object-position: center !important; }
  body.home-page .hero-film .film-shade { background: linear-gradient(180deg, rgba(19,52,93,.03) 0%, rgba(19,52,93,.2) 35%, rgba(19,52,93,.96) 57%, var(--home-navy) 100%) !important; }
  body.home-page .film-copy { top: auto !important; bottom: 32px !important; left: 22px !important; right: 22px !important; transform: none !important; max-width: none !important; }
  body.home-page .film-copy h1 { max-width: 560px !important; font-size: clamp(39px, 10.5vw, 56px) !important; line-height: 1.02 !important; margin-bottom: 15px !important; }
  body.home-page .film-copy > p { max-width: 460px !important; font-size: 15px !important; margin-bottom: 20px !important; }
  body.home-page .film-copy .actions { gap: 10px; }
  body.home-page .film-copy .button { padding: 12px 14px; }
  body.home-page .featured-products { padding: 68px 0 74px !important; }
  body.home-page .section-intro { margin-bottom: 27px; }
  body.home-page .section-intro h2 { font-size: clamp(34px, 9vw, 48px); }
  body.home-page .section-intro > p:last-child { font-size: 15px; }
  body.home-page .featured-grid { grid-template-columns: 1fr; gap: 15px; }
  body.home-page .feature-image { aspect-ratio: 1 / 1; }
  body.home-page .feature-card > div:last-child { min-height: 98px; padding: 19px 20px 21px !important; }
  body.home-page .feature-card h3 { font-size: 24px; }
  body.home-page .project-cta { padding: 58px 0 !important; }
  body.home-page .project-cta .wrap { align-items: flex-start; flex-direction: column; gap: 24px; }
  body.home-page .project-cta h2 { font-size: clamp(34px, 9vw, 46px); }
  body.home-page .full-footer { padding-top: 44px !important; }
  body.home-page .full-footer .foot-grid { grid-template-columns: 1fr 1fr !important; gap: 27px 20px !important; }
  body.home-page .full-footer .foot-grid > div:first-child { grid-column: 1 / -1; }
  body.home-page .full-footer .footer-contact { grid-column: 1 / -1; }
  body.home-page .full-footer .foot-grid address { max-width: 54ch; }
}

@media (max-width: 420px) {
  body.home-page .hero-film { height: 760px !important; max-height: calc(100svh - 72px); }
  body.home-page .hero-film .film-layer { height: 52% !important; }
  body.home-page .film-copy { bottom: 24px !important; }
  body.home-page .film-copy .actions { align-items: stretch; flex-direction: column; max-width: 260px; }
  body.home-page .film-copy .actions .button { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  body.home-page .hero-film .film-layer { animation: none !important; }
  body.home-page .hero-film .film-layer:first-child { opacity: 1 !important; }
  body.home-page .feature-card { transition: none; }
}
