/*
 * Author: Martin <lmccc.dev@gmail.com>
 * Co-Author: AI Assistant
 * Description: Official site section styles — origin, pillars, ontology, platform, governance,
 *              evolution + role, work loop, closing band. Tokens come from site.css.
 *              官网各区块样式——起源、理念、本体、平台、治理、演进与角色、工作循环、页尾。token 见 site.css。
 */

/* ============ Origin ============ */
.origin-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 72px;
  align-items: start
}

.origin-body p {
  margin-bottom: 20px;
  color: var(--text-2);
  font-size: var(--site-fs-lead);
  line-height: var(--site-lh-loose)
}

.origin-body p:last-child {
  margin-bottom: 0
}

.origin-body strong {
  color: var(--text);
  font-weight: 600
}

/* ============ Pillars ============ */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px
}

.pillar .num {
  margin-bottom: 18px;
  font-size: var(--site-fs-h2);
  line-height: 1;
  color: var(--star)
}

.pillar h3 {
  margin-bottom: 14px;
  font-size: var(--site-fs-h3)
}

.pillar p {
  color: var(--text-2)
}

/* ============ Ontology ============ */
.onto-grid {
  display: grid;
  grid-template-columns: .92fr 1.08fr;
  gap: 64px;
  align-items: center
}

.onto-points {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 32px
}

.onto-point {
  padding-left: 18px;
  border-left: 1px solid var(--line-strong)
}

.onto-point b {
  display: block;
  margin-bottom: 4px;
  font-weight: 700
}

.onto-point p {
  color: var(--text-2)
}

.onto-flow {
  display: flex;
  align-items: stretch
}

.onto-stage {
  flex: 1;
  padding: 22px 14px 18px;
  text-align: center
}

.onto-stage .idx-mono {
  display: block;
  margin-bottom: 8px
}

.onto-stage h4 {
  margin-bottom: 12px
}

.stage-items {
  text-wrap: balance;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: var(--site-fs-small);
  line-height: 2
}

.stage-items b {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap
}

/* Direction is a hairline that brightens toward its target, with a light travelling along it (motion.css).
   方向用一条朝目标渐亮的细线表达，光点沿线移动（见 motion.css），不画箭头。 */
.onto-arrow {
  align-self: center;
  flex: none;
  width: 36px;
  height: 1px;
  margin: 0 6px;
  background: linear-gradient(90deg, var(--line), var(--star))
}

.onto-note {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: var(--site-fs-small);
  text-align: center
}

.onto-note b,
.ce-note b,
.layer .note b {
  color: var(--star);
  font-weight: 500
}

.onto-note .keep {
  white-space: nowrap
}

/* ============ Platform ============ */
.layer-stack {
  border-top: 1px solid var(--line)
}

.layer {
  position: relative;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  padding: 28px 0 28px 22px;
  border-bottom: 1px solid var(--line);
}

.layer::before {
  content: "";
  position: absolute;
  left: 0;
  top: 28px;
  bottom: 28px;
  width: 2px;
  background: var(--lc)
}

.layer.l-domain {
  --lc: var(--star)
}

.layer.l-ai {
  --lc: var(--text)
}

.layer.l-platform {
  --lc: var(--text-3)
}

.layer h3 {
  font-size: var(--site-fs-h3)
}

.layer .idx-mono {
  display: block;
  margin-top: 4px
}

.layer-tag {
  display: block;
  margin-top: 10px;
  color: var(--text-2);
  font-size: var(--site-fs-small)
}

.layer-body p {
  color: var(--text-2)
}

.layer .note {
  margin-top: 10px;
  color: var(--text-3);
  font-size: var(--site-fs-small)
}

.ce-panel {
  margin-top: 48px;
  padding: 32px
}

.ce-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--text-2);
  font-size: var(--site-fs-small);
  font-weight: 600
}

.ce-title::before {
  content: "";
  flex: none;
  width: 24px;
  height: 1px;
  background: var(--star)
}

.ce-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 22px;
  align-items: center
}

.ce-side {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--site-radius-sm);
  background: var(--bg)
}

.ce-side .head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  font-weight: 700
}

.ce-desc {
  margin-bottom: 14px;
  color: var(--text-2);
  font-size: var(--site-fs-small)
}

.ce-devices,
.int-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

.ce-middle {
  display: grid;
  grid-template-columns: 56px max-content;
  column-gap: 12px;
  row-gap: 12px;
  align-items: center
}

.ce-arrow {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
  color: var(--text-3);
  font-size: var(--site-fs-small);
  white-space: nowrap
}

.ce-arrow.up,
.ce-arrow.down {
  color: var(--star)
}

.ce-arrow .lbl {
  color: var(--text-3);
  line-height: 1.4
}

.ce-note {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: var(--site-fs-small);
  text-align: center
}

/* English headquarters labels are too long for a partial row.
   英文指挥中枢标签较长，装不下一整行时改成等宽竖排，避免两枚并排、第三枚单独掉行。 */
html[lang="en"] .ce-side {
  container-type: inline-size;
  container-name: ceside
}

@container ceside (max-width: 450px) {
  .ce-devices:has(> .chip:nth-child(3):last-child) {
    flex-direction: column;
    align-items: stretch
  }

  .ce-devices:has(> .chip:nth-child(3):last-child) .chip {
    text-align: center
  }

  .ce-devices:has(> .chip:nth-child(5)) {
    display: grid;
    grid-template-columns: repeat(3, 1fr)
  }

  .ce-devices:has(> .chip:nth-child(5)) .chip {
    text-align: center
  }
}

@container ceside (max-width: 280px) {
  .ce-devices:has(> .chip:nth-child(5)) {
    grid-template-columns: repeat(2, 1fr)
  }
}

/* ============ Governance ============ */
.gov-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 48px
}

.gov-item .idx-mono {
  display: block;
  margin-bottom: 10px
}

.gov-item h4 {
  margin-bottom: 8px
}

.gov-item p {
  color: var(--text-2)
}

/* ============ Evolution + role ============ */
.evo-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px
}

.evo-track::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-strong)
}

.evo-node {
  position: relative;
  padding-top: 30px
}

.evo-node::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  border: 1px solid var(--star);
  border-radius: 50%;
  background: var(--bg);
}

.evo-node:last-child::before {
  background: var(--star)
}

.evo-node .idx-mono {
  display: block;
  margin-bottom: 6px
}

.evo-node h3 {
  margin-bottom: 10px;
  font-size: var(--site-fs-h3)
}

.evo-node p {
  color: var(--text-2)
}

.evo-chain-lead {
  margin-top: 64px;
  color: var(--text-2);
  font-size: var(--site-fs-small)
}

/* ============ Journey: the nebula in the name to the team at the end ============ */
.journey {
  position: relative;
  margin-top: 12px
}

.journey-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 140px;
  overflow: visible;
  transform-origin: left center
}

.journey-line polyline {
  fill: none;
  stroke: url(#journey-grad);
  stroke-width: 1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke
}

.journey-line stop:first-of-type {
  stop-color: var(--text-3)
}

.journey-line stop:last-of-type {
  stop-color: var(--star)
}

.journey-list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0;
  padding: 0;
  list-style: none
}

.journey-list li {
  position: relative;
  padding: 156px 6px 0;
  text-align: center
}

.journey-list li:nth-child(1) {
  --y: 100px;
  --s: 72px
}

.journey-list li:nth-child(2) {
  --y: 74px;
  --s: 11px
}

.journey-list li:nth-child(3) {
  --y: 84px;
  --s: 13px
}

.journey-list li:nth-child(4) {
  --y: 50px;
  --s: 15px
}

.journey-list li:nth-child(5) {
  --y: 30px;
  --s: 16px
}

.journey .mark {
  position: absolute;
  top: var(--y);
  left: 50%;
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  border: 1px solid var(--text-3);
  border-radius: 50%;
  background: var(--bg)
}

.journey li:nth-child(3) .mark {
  border-color: var(--text-2)
}

.journey li:nth-child(4) .mark {
  border-color: var(--text)
}

/* The start is the nebula itself: the same photograph as the hero, cropped to its core. */
.journey li:nth-child(1) .mark {
  border-color: var(--star);
  background: var(--bg) url('/assets/hero-nebula.webp?v=vista2') 50% 50% / auto 300% no-repeat;
  outline: 1px solid var(--line-strong);
  outline-offset: 5px
}

/* The end is a small cluster: gold dots are AI, white dots are people (drawn as gradients, no shadows). */
.journey li.now .mark {
  border: 0;
  background: var(--star)
}

.journey li.now .mark::before {
  content: "";
  position: absolute;
  inset: -22px;
  background:
    radial-gradient(circle at 6px 39px, var(--text) 2.5px, transparent 3px),
    radial-gradient(circle at 52px 41px, var(--star) 2.5px, transparent 3px),
    radial-gradient(circle at 21px 10px, var(--star) 2.5px, transparent 3px),
    radial-gradient(circle at 45px 11px, var(--text) 2.5px, transparent 3px)
}

.journey li.now .mark::after {
  content: "";
  position: absolute;
  inset: -22px;
  border: 1px dashed var(--line-strong);
  border-radius: 50%
}

.jn-txt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px
}

.journey b {
  color: var(--text);
  font-size: var(--site-fs-body);
  font-weight: 600
}

.journey small {
  color: var(--text-2);
  font-size: var(--site-fs-small);
  text-wrap: balance
}

.journey li.now b {
  color: var(--star)
}

.role-block {
  margin-top: 96px;
  padding-top: 64px;
  border-top: 1px solid var(--line)
}

.role-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px
}

/* "Not X but Y": the old name is struck through above, the new one is set large. Same meaning as the copy, no arrow.
   「不是 X，而是 Y」：旧称划线在上，新称加大在下，与正文同义，不画箭头。 */
.role-path {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px
}

.role-path h4 {
  color: var(--text-3);
  font-size: var(--site-fs-small);
  font-weight: 500;
  text-decoration: line-through;
  text-decoration-color: var(--text-3);
  text-decoration-thickness: 1px
}

.role-path h4.to {
  color: var(--text);
  font-size: var(--site-fs-lead);
  font-weight: 700;
  text-decoration: none
}

.role-row p {
  color: var(--text-2)
}

.int-panel {
  margin-top: 64px
}

.int-title {
  margin-bottom: 10px;
  font-size: var(--site-fs-h3)
}

.int-lead {
  max-width: 780px;
  margin-bottom: 28px;
  color: var(--text-2)
}

.int-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px
}

.int-card h4 {
  margin-bottom: 10px
}

.int-card p {
  margin-bottom: 16px;
  color: var(--text-2)
}

/* ============ Work loop ============ */
.loop-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr)
}

.loop-step {
  position: relative;
  padding: 24px 20px 0 0;
  border-top: 1px solid var(--line-strong)
}

.loop-step::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 1px;
  height: 9px;
  background: var(--star)
}

.loop-step .idx-mono {
  display: block;
  margin-bottom: 10px
}

.loop-step h4 {
  margin-bottom: 6px
}

.loop-step p {
  color: var(--text-2);
  font-size: var(--site-fs-small);
  text-wrap: balance
}

.loop-note {
  max-width: 760px;
  margin-top: 36px;
  color: var(--text-2)
}

.loop-note b {
  color: var(--star);
  font-weight: 600
}

/* ============ Closing band ============ */
.cta {
  padding: 120px 0;
  text-align: center
}

.cta .en-line {
  font-size: var(--site-fs-h2)
}

.cta p {
  max-width: 560px;
  margin: 20px auto 0;
  color: var(--text-2);
  font-size: var(--site-fs-lead)
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 36px
}

.cta-domain {
  display: inline-flex;
  align-items: baseline;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: var(--site-fs-body);
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1;
}

/* ============ Responsive (sections) ============ */
@media (max-width: 960px) {

  .origin-grid,
  .onto-grid {
    grid-template-columns: 1fr;
    gap: 40px
  }

  .pillars-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    max-width: 600px
  }

  .layer {
    grid-template-columns: 1fr;
    gap: 12px
  }

  .role-rows,
  .int-grid {
    grid-template-columns: 1fr;
    gap: 32px
  }

  .evo-track {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-left: 30px
  }

  .evo-track::before {
    top: 6px;
    right: auto;
    bottom: 6px;
    left: 5px;
    width: 1px;
    height: auto
  }

  .evo-node {
    padding-top: 0
  }

  .evo-node::before {
    top: 5px;
    left: -30px
  }

  .loop-steps {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 28px
  }

  .ce-flow {
    grid-template-columns: 1fr;
    gap: 12px
  }

  .ce-middle {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-self: center;
    gap: 10px;
    width: max-content;
    max-width: 100%;
    grid-template-columns: none
  }

  .ce-arrow {
    display: flex;
    grid-column: auto;
    grid-template-columns: none;
    gap: 8px;
    white-space: normal;
    justify-content: flex-start;
    text-align: left
  }

  .ce-arrow .lbl br {
    display: none
  }

}

@media (max-width: 560px) {
  .onto-flow {
    flex-direction: column;
    gap: 6px
  }

  .onto-arrow {
    width: 1px;
    height: 28px;
    margin: 0;
    background: linear-gradient(180deg, var(--line), var(--star))
  }

  .ce-panel {
    padding: 24px 18px
  }

  .gov-grid {
    grid-template-columns: 1fr;
    gap: 32px
  }

  .journey-line {
    display: none
  }

  .journey-list::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: linear-gradient(180deg, var(--text-3), var(--star));
    transform-origin: top center
  }

  .journey-list {
    display: block
  }

  .journey-list li {
    display: grid;
    grid-template-columns: 1fr 76px 1fr;
    align-items: center;
    min-height: 84px;
    padding: 0
  }

  .journey-list li:nth-child(1),
  .journey-list li:nth-child(5) {
    min-height: 108px
  }

  .journey-list li:nth-child(1) {
    --s: 64px
  }

  .journey .mark {
    position: relative;
    top: auto;
    left: auto;
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    margin: 0
  }

  .jn-txt {
    grid-column: 3;
    grid-row: 1;
    align-items: flex-start;
    text-align: left
  }

  .journey-list li:nth-child(even) .jn-txt {
    grid-column: 1;
    align-items: flex-end;
    text-align: right
  }

  .loop-steps {
    grid-template-columns: 1fr 1fr
  }

  .cta {
    padding: 88px 0
  }

  .origin-body p {
    margin-bottom: 12px;
    line-height: 1.65
  }
}

@media (max-width: 360px) {
  .jn-txt b {
    font-size: var(--site-fs-small)
  }
}
