/* IA production containment and responsive surface rules. */
html,body{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
}

body>*,header,main,footer,section,.nav,.wrap,.nav-inner,.hero,.hero-text,
.block-grid,.rail,.rail-sticky,.card-grid,.triple-grid,.phase-grid,
.proof-grid,.contact-panel,.contact-links,.nav-right,.hero-meta,
.hero-cta,.packet-wrap{
  min-width:0;
  min-inline-size:0;
  max-width:100%;
  max-inline-size:100%;
}

.nav-inner>*,.nav-right>*,.hero>*,.block-grid>*,.card-grid>*,
.triple-grid>*,.phase-grid>*,.proof-grid>*,.contact-panel>*,
.contact-links>*,.hero-meta>*,.hero-cta>*{
  min-width:0;
  min-inline-size:0;
  max-inline-size:100%;
}

img,svg,canvas{
  max-width:100%;
  max-inline-size:100%;
}

/* Keep the original lift and sheen without permanently promoting every card. */
.card,.phase-card,.proof-card{
  transform:none;
  will-change:auto;
}
@media (hover:hover) and (pointer:fine){
  .card:hover,.phase-card:hover,.proof-card:hover{
    transform:translateY(-8px);
  }
}

/* Section 03: one connected operating circuit instead of isolated cards. */
.cycle-circuit{
  position:relative;
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:0;
  margin-top:30px;
  padding:16px 0 4px;
}
.cycle-circuit::before{
  content:"";
  position:absolute;
  top:41px;
  left:7%;
  right:7%;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(232,201,122,.66) 10%,rgba(159,135,255,.62) 48%,rgba(139,220,255,.58) 82%,transparent);
  box-shadow:0 0 16px rgba(159,135,255,.2);
}
.cycle-node{
  position:relative;
  min-width:0;
  padding:0 14px 10px;
  border:0;
  border-radius:0;
  background:none;
  box-shadow:none;
  overflow:visible;
}
.cycle-node-marker{
  position:relative;
  z-index:2;
  display:flex;
  align-items:center;
  gap:9px;
  margin-bottom:14px;
}
.cycle-node-icon{
  width:50px;
  height:50px;
  flex:0 0 50px;
  display:grid;
  place-items:center;
  border:1px solid rgba(232,201,122,.32);
  border-radius:15px;
  color:var(--gold);
  background:linear-gradient(145deg,rgba(32,28,48,.98),rgba(22,20,36,.98));
  box-shadow:0 12px 30px rgba(0,0,0,.24),0 0 24px rgba(159,135,255,.12);
}
.cycle-node-icon svg{
  width:22px;
  height:22px;
}
.cycle-node-port{
  width:7px;
  height:7px;
  flex:0 0 7px;
  border-radius:2px;
  background:var(--gold);
  box-shadow:0 0 12px rgba(232,201,122,.78);
}
.cycle-node .mini-label{
  display:block;
  color:var(--gold);
  font-size:.72rem;
  font-weight:800;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.cycle-node h3{
  margin-top:6px;
  font-size:1.05rem;
  line-height:1.25;
}
.cycle-node p{
  margin-top:8px;
  color:var(--muted);
  font-size:.94rem;
  line-height:1.55;
}
@media (hover:hover) and (pointer:fine){
  .cycle-node-icon{
    transition:transform .25s ease,border-color .25s ease,box-shadow .25s ease;
  }
  .cycle-node:hover .cycle-node-icon{
    transform:translateY(-3px);
    border-color:rgba(232,201,122,.62);
    box-shadow:0 16px 36px rgba(0,0,0,.3),0 0 28px rgba(159,135,255,.2);
  }
}

@media (max-width:1100px), (pointer:coarse), (hover:none){
  html,body,main{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
  }

  .wrap,.nav-inner{
    width:calc(100% - 24px)!important;
    max-width:calc(100% - 24px)!important;
    margin-inline:auto!important;
    box-sizing:border-box;
  }

  .nav-inner{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    justify-content:stretch;
    align-items:start;
    gap:10px;
    padding:10px 0;
  }
  .nav-right{
    width:100%;
    display:flex;
    flex-wrap:wrap;
    justify-content:flex-end!important;
    justify-self:stretch;
    align-items:center;
    text-align:right;
  }
  .nav-right>:first-child{
    margin-inline-start:auto!important;
  }

  .hero,.block-grid,.contact-panel,
  .card-grid,.triple-grid,.proof-grid{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    width:100%;
    max-width:100%;
  }

  .hero-text,.hero-text>*,.block-grid>div,.block-grid>div>*,
  .card,.proof-card,.quote-card,.contact-panel>*,
  .contact-links>*,.role,.tagline,.section-title,.section-lead{
    width:100%;
    max-width:100%;
    min-width:0;
    box-sizing:border-box;
  }

  .btn,.pill,.packet-wrap,.lang-toggle{
    min-width:0;
    max-width:100%;
  }
  .btn,.pill,.brand,.hero h1,.role,.tagline,.section-title,.section-lead,
  .card h3,.proof-card h3,.card p,.proof-card p,.contact p,a{
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
  }

  /* Preserve the animated orbital as a bounded in-flow illustration. */
  .v4-deco{
    width:100%;
    max-width:360px;
    min-height:300px;
    margin:8px auto 0;
    overflow:hidden;
    place-items:center;
  }
  .v4-deco:before{width:min(330px,88%)}
  .v4-orbital{
    width:min(320px,100%);
    max-width:100%;
    height:auto;
  }

  /* The packet helper is anchored below its own button. */
  .packet-wrap{
    position:relative;
    overflow:visible;
  }
  .packet-tip{
    position:absolute!important;
    top:calc(100% + 10px)!important;
    bottom:auto!important;
    left:0;
    right:auto;
    width:min(430px,calc(100vw - 24px));
    max-width:calc(100vw - 24px);
    transform:translateY(-5px);
  }
  .nav-right .packet-tip{
    left:auto;
    right:0;
  }
  .packet-wrap:hover .packet-tip,
  .packet-wrap:focus-within .packet-tip{
    transform:translateY(0);
  }
  .packet-tip:before{display:none}

  /* Preserve reveal as a real fade without translated mobile layers. */
  .reveal{
    transform:none;
    transition:opacity .72s ease;
  }
  .reveal.show{transform:none}

  .card:hover,.proof-card:hover{transform:none}

  /* The cycle becomes a vertical circuit on narrow screens. */
  .cycle-circuit{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:0!important;
    width:100%;
    max-width:100%;
    margin-top:28px;
    padding:0;
  }
  .cycle-circuit::before{
    top:25px;
    bottom:25px;
    left:25px;
    right:auto;
    width:1px;
    height:auto;
    background:linear-gradient(180deg,rgba(232,201,122,.72),rgba(159,135,255,.62),rgba(139,220,255,.52),transparent);
  }
  .cycle-node{
    width:100%;
    max-width:100%;
    min-height:64px;
    padding:0 0 28px 70px;
  }
  .cycle-node:last-child{
    padding-bottom:0;
  }
  .cycle-node-marker{
    position:absolute;
    top:0;
    left:0;
    margin:0;
  }
  .cycle-node-port{
    display:none;
  }
  .cycle-node h3,.cycle-node p{
    max-width:100%;
    overflow-wrap:anywhere;
  }
}

/* Moon Source proof is injected after the page reveal observer has initialized. */
.moon-source-proof-section.reveal{
  opacity:1!important;
  transform:none!important;
}

/* English desktop labels are longer: keep the production header on one row. */
@media (min-width:1101px) and (max-width:1280px){
  html[lang="en"] .nav-inner{
    width:calc(100% - 20px);
    gap:10px;
  }
  html[lang="en"] .brand,
  html[lang="en"] .nav-right{
    flex:0 0 auto;
  }
  html[lang="en"] .nav-links{
    flex:1 1 auto;
    flex-wrap:nowrap;
    gap:2px;
    min-width:0;
  }
  html[lang="en"] .nav-links a{
    padding:8px 6px;
    font-size:.84rem;
    white-space:nowrap;
  }
  html[lang="en"] .nav-right{
    gap:6px;
  }
  html[lang="en"] .nav-right .packet-wrap,
  html[lang="en"] .nav-right .btn{
    flex:0 0 auto;
    white-space:nowrap;
  }
  html[lang="en"] .nav-right .btn{
    padding-inline:12px;
  }
}
