@font-face {
  font-family: "Qinghe Vision";
  src: url("assets/vision-serif.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --paper: #faf9f6;
  --cool: #f6fafa;
  --ink: #303636;
  --body: #4a4a4a;
  --muted: #6e6e6e;
  --accent: #306f6c;
  --rule: #dbe6e3;
  --gutter: clamp(24px, 6vw, 96px);
  --edge: max(var(--gutter), calc((100% - 1200px) / 2));
  --desktop-header-height: 84px;
  --desktop-banner-height: 264px;
  --portrait-columns: 5;
  --portrait-gap: 18px;
  --system: system-ui, "Microsoft YaHei UI", sans-serif;
  --serif: "Qinghe Vision", "Source Han Serif SC", "Songti SC", SimSun, serif;
}
html:lang(en) { --serif: Georgia, serif; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--body); background: var(--paper); font: 400 16px/1.75 var(--system); }
h1, h2, h3, p, ul { margin: 0; }
h1, h2 { color: var(--ink); font-family: var(--serif); }
h2 { font-size: 32px; font-weight: 400; line-height: 44px; letter-spacing: 1px; }
h3 { color: var(--ink); font: 500 18px/28px var(--system); }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; }
button:enabled { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip { position: absolute; top: 0; left: 16px; transform: translateY(-110%); z-index: 9; background: white; padding: 8px 16px; }
.skip:focus { transform: none; }
.wrap { width: min(1200px, calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.section { padding-block: 72px; }
.section--cool { background: var(--cool); }
.section-title { margin-bottom: 24px; }


.vision-banner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  min-height: var(--desktop-banner-height);
  background: radial-gradient(ellipse at 62% 95%, #41746b 0%, transparent 50%),
    linear-gradient(100deg, #1b4943, #244d49 35%, #14323b 72%, #0d2430);
  color: #fff;
}
.vision-banner h1 { color: inherit; font: 500 42px/60px var(--serif); }
.banner-copy { position: relative; padding-block: 30px; pointer-events: none; }
.banner-subtitle { margin-top: 6px; font: 500 12px/18px var(--system); letter-spacing: 2px; }
.banner-media {
  position: absolute;
  inset-inline-end: max(42px, calc((100% - 1220px) / 2));
  top: 50%;
  width: clamp(435px, 35vw, 520px);
  aspect-ratio: 16 / 9;
  transform: translateY(-50%);
  mix-blend-mode: screen;
  mask-image: linear-gradient(90deg, transparent, #000 25%, #000 78%, transparent),
    linear-gradient(transparent, #000 12%, #000 88%, transparent);
  mask-composite: intersect;
  pointer-events: none;
}
.banner-media > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-motion { visibility: hidden; }
.banner-motion.is-visible { visibility: visible; }

.featured {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
  gap: clamp(36px, 5.5vw, 78px);
  padding-block: 48px 72px;
}
.featured-copy h2 { max-width: 12em; }
.featured-topic { display: block; }
html:lang(en) .featured-copy h2 { max-width: 17em; text-wrap: balance; }
html:lang(en) .featured-topic { display: inline; }
.metadata, .duration, .featured-error { color: var(--muted); font: 400 13px/20px var(--system); }
.featured-copy .metadata, .featured-error { margin-top: 12px; }
.featured-error a { color: var(--accent); }
.play-glyph {
  display: inline-block;
  width: 0;
  height: 0;
  border: 4.5px solid transparent;
  border-left: 7.2px solid currentColor;
  border-right: 0;
}
.cover-link, .tile-link { display: block; text-decoration: none; }
.tile-link:hover .tile-title { color: var(--accent); }
.cover {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 2px;
  aspect-ratio: 16 / 9;
  background: #d7e5e1;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}
.featured-media > .cover-link, .featured-media > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.featured-media > video { display: block; background: #080e10; object-fit: contain; }
.featured-media > :focus-visible { outline-offset: -4px; }
.cover-link:hover img, .tile-link:hover img { transform: scale(1.035); }
.play-mark {
  position: absolute;
  inset: 12px 12px auto auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: hsl(0 0% 90% / 15%);
  box-shadow: inset 0 0 5px rgb(255 255 255 / 50%);
  backdrop-filter: blur(8px);
  color: #fff;
}
.play-mark .play-glyph { margin-left: 2.5px; }
.featured .play-mark {
  inset: 50% auto auto 50%;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%);
}
.featured .play-glyph { margin-left: 3px; border-width: 6px 0 6px 9px; }
.tile-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: 9px;
}
.duration { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.tile-title { color: var(--ink); font: 500 16px/24px var(--system); overflow-wrap: anywhere; }

.rail-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.rail-controls { display: flex; gap: 8px; }
.rail-controls button {
  min-height: 36px;
  padding: 3px 10px;
  border: 1px solid #c0d4cf;
  background: transparent;
  color: #2b6662;
  font-size: 13px;
  white-space: nowrap;
}
.rail-controls button:enabled:hover { background: #e6f2ee; }
.rail-controls button:disabled { color: #667775; opacity: .65; }
.rail-controls--arrows button {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}
.rail-controls--arrows button::before, .rail-controls--arrows button::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "";
}
.rail-controls--arrows button::before {
  width: 14px;
  height: 1px;
  transform: translate(-50%, -50%);
  background: currentColor;
}
.rail-controls--arrows button::after {
  width: 6px;
  height: 6px;
  transform: translate(-20%, -50%) rotate(45deg);
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
}
.rail-controls--arrows [data-previous]::after { transform: translate(-80%, -50%) rotate(-135deg); }
.rail {
  --track-gap: 24px;
  display: grid;
  grid-auto-flow: column;
  align-items: start;
  gap: var(--track-gap);
  overflow-x: auto;
  margin: 0;
  padding: 4px var(--edge) 12px;
  list-style: none;
  scroll-padding-inline: var(--edge);
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #8faeaa transparent;
  overscroll-behavior-inline: contain;
}
.rail > li { min-width: 0; scroll-snap-align: start; }
.rail--products {
  grid-auto-columns: clamp(240px, 25vw, 365px);
  scrollbar-width: none;
}
.rail--products::-webkit-scrollbar { display: none; }
.rail--use {
  --track-gap: var(--portrait-gap);
  grid-auto-columns: calc((100% - var(--portrait-gap) * (var(--portrait-columns) - 1)) / var(--portrait-columns));
}

.scenes {
  display: grid;
  grid-template-columns: repeat(var(--portrait-columns), minmax(0, 1fr));
  gap: 18px var(--portrait-gap);
  padding: 0;
  list-style: none;
}
.rail--use .cover, .scenes .cover { aspect-ratio: 9 / 16; }
.forum-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding: 0;
  list-style: none;
}

html:has(.player[open]) { overflow: hidden; }
.player {
  width: min(960px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: #102224;
  color: #fff;
}
.player::backdrop { background: rgb(6 19 22 / 80%); }
.player-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 20px;
}
.player-title { color: inherit; font: 500 16px/24px var(--system); }
.player-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgb(216 243 240 / 44%);
  background: transparent;
  color: inherit;
  font-size: 23px;
  line-height: 1;
}
.player-close:hover { background: #2c4c4e; }
.player video { display: block; width: 100%; max-height: calc(100dvh - 112px); aspect-ratio: 16 / 9; background: #080e10; object-fit: contain; }
.player--portrait { width: min(480px, calc(100% - 32px)); }
.player--portrait video { aspect-ratio: 9 / 16; }
.player-error { padding: 14px 20px; font-size: 14px; }
.player :focus-visible { outline-color: #fff; }

@media (min-width: 901px) {
  .featured {
    --featured-height: calc(100svh - var(--desktop-header-height) - var(--desktop-banner-height));
    --featured-padding: clamp(16px, calc((100svh - 660px) / 7), 48px);
    --featured-gap: clamp(36px, 4vw, 60px);
    --cover-width: calc((var(--featured-height) - 2 * var(--featured-padding)) * 16 / 9);
    --featured-media-limit: calc(100% - var(--featured-gap) - 240px);
    min-height: var(--featured-height);
    padding-block: var(--featured-padding);
    gap: var(--featured-gap);
    grid-template-columns:
      minmax(0, min(var(--featured-media-limit), clamp(420px, var(--cover-width), 900px)))
      minmax(0, 1fr);
  }
  html:lang(en) .featured { --featured-media-limit: 61%; }
}

@media (min-width: 901px) and (max-width: 1070px) {
  html:lang(en) .featured { --featured-media-limit: 58%; }
  html:lang(en) .featured-copy h2 { font-size: 28px; line-height: 38px; letter-spacing: 0; }
}

@media (max-width: 900px) {
  :root { --portrait-columns: 3; }
  h2 { font-size: 24px; font-weight: 500; line-height: 34px; }
  .section { padding-block: 48px; }
  .featured { padding-block: 36px 48px; gap: 30px; }
  .vision-banner { min-height: 224px; }
  .vision-banner h1 { font-size: 34px; line-height: 48px; }
  .rail { --track-gap: 18px; }
  .rail--products { grid-auto-columns: clamp(218px, 48vw, 330px); }
}

@media (max-width: 600px) {
  :root { --gutter: 24px; --portrait-columns: 2; --portrait-gap: 15px; }
  body { font-size: 15px; line-height: 26px; }
  .vision-banner { min-height: 184px; }
  .vision-banner h1 { font-size: 30px; line-height: 42px; }
  .banner-copy { padding-block: 18px 46px; }
  .banner-media {
    top: 44%;
    width: 264px;
    inset-inline-end: -28px;
    mask-image: linear-gradient(90deg, transparent 10%, #000 47%),
      linear-gradient(transparent, #000 16%, #000 78%, transparent);
  }
  .featured { grid-template-columns: 1fr; gap: 18px; }
  .featured-copy h2 { max-width: none; }
  .featured-copy .metadata { margin-top: 6px; }
  .section-title, .rail-header { margin-bottom: 18px; }
  .rail--products { grid-auto-columns: 77%; }
  .rail-controls { gap: 5px; }
  .rail-controls:not(.rail-controls--arrows) button { padding-inline: 6px; }
  html:lang(en) :is(.rail--use, .scenes) .tile-caption { display: grid; gap: 2px; }
  .forum-grid { grid-template-columns: 1fr; gap: 18px; }
  .player-head { padding-left: 12px; }
}

@media (max-width: 360px) {
  html:lang(en) .banner-media { opacity: .72; }
  html:lang(en) .featured-copy h2 { font-size: 22px; line-height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .cover img { transition: none; }
}
