/* =========================================================
   ENTER CORE
   MOBILE RESPONSIVE OVERRIDE V2
   Desktop remains untouched.
   ========================================================= */

@media (max-width: 800px) {

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
  }

  body {
    -webkit-text-size-adjust: 100%;
  }

  main {
    width: 100%;
    max-width: 100%;
    overflow: clip;
  }

  .container {
    width: calc(100% - 32px) !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* =======================================================
     HERO
     ======================================================= */

  .hero {
    min-height: auto !important;
    padding-top: 108px !important;
    padding-bottom: 82px !important;
    align-items: flex-start !important;
  }

  .hero-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 38px !important;
  }

  .hero-copy,
  .hero-product {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .hero h1 {
    width: 100% !important;
    max-width: 100% !important;
  }

  .hero h1 .brand-gradient {
    font-size: 28px !important;
  }

  .hero h1 strong {
    display: block !important;
    max-width: 100% !important;
    font-size: clamp(42px, 11.5vw, 54px) !important;
    line-height: .98 !important;
    letter-spacing: -.052em !important;
    white-space: normal !important;
    word-break: normal !important;
  }

  .hero-lead {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 15px !important;
    line-height: 1.65 !important;
  }

  .hero-actions {
    width: 100% !important;
    max-width: 380px !important;
  }

  .product-shell {
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
  }

  .product-columns {
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: 0 !important;
  }

  .pcol {
    width: 100% !important;
    min-width: 0 !important;
    padding: 20px !important;
  }

  .incoming,
  .engine {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line) !important;
  }

  .engine-item {
    width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: 40px minmax(0, 1fr) !important;
    gap: 14px !important;
    align-items: start !important;
    padding: 17px 0 !important;
  }

  .engine-item > * {
    min-width: 0 !important;
  }

  .engine-item em {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
  }

  .engine-item strong {
    grid-column: 2 !important;
    justify-self: start !important;
    margin-top: 5px !important;
  }

  .engine-item b {
    font-size: 13px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  .engine-item small {
    font-size: 10px !important;
    line-height: 1.5 !important;
    white-space: normal !important;
  }

  .salescase {
    display: none !important;
  }

  /* ugly multi-line IDENTITY / MEMORY rail on mobile */
  .product-rail {
    display: none !important;
  }

  /* =======================================================
     GLOBAL SECTION TYPOGRAPHY
     ======================================================= */

  .statement,
  .assistant,
  .knowledge,
  .autonomy {
    padding-top: 92px !important;
    padding-bottom: 92px !important;
  }

  .statement h2,
  .story h2,
  .control h2,
  .assistant h2,
  .knowledge h2,
  .autonomy h2,
  .final h2 {
    width: 100% !important;
    max-width: 100% !important;
    font-size: clamp(38px, 9.8vw, 46px) !important;
    line-height: 1.015 !important;
    letter-spacing: -.048em !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    text-wrap: balance;
  }

  .statement h2 span,
  .story h2 span,
  .control h2 span,
  .assistant h2 span,
  .knowledge h2 span,
  .autonomy h2 span,
  .final h2 span {
    white-space: normal !important;
  }

  .statement h2 br,
  .story h2 br,
  .control h2 br,
  .assistant h2 br,
  .knowledge h2 br,
  .autonomy h2 br,
  .final h2 br {
    display: none !important;
  }

  .section-index {
    max-width: 100% !important;
    font-size: 10px !important;
    line-height: 1.5 !important;
    letter-spacing: .17em !important;
  }

  .section-lead {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 15px !important;
    line-height: 1.7 !important;
  }

  /* =======================================================
     ORDINARY AI vs ENTER CORE
     ======================================================= */

  .contrast-block {
    padding: 18px 0 95px !important;
  }

  .contrast-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }

  .contrast-card {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 22px !important;
  }

  .simple-chain {
    height: auto !important;
    min-height: 130px !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }

  .simple-chain span {
    font-size: 11px !important;
  }

  .simple-chain i {
    width: 18px !important;
  }

  .contrast-card > p {
    position: static !important;
    margin: 28px 0 0 !important;
    font-size: 14px !important;
    line-height: 1.65 !important;
  }

  .context-stack {
    margin-top: 38px !important;
    max-width: 100% !important;
    gap: 8px !important;
  }

  .context-stack span {
    font-size: 11px !important;
    padding: 9px 11px !important;
  }

  .core-result {
    position: static !important;
    display: block !important;
    margin-top: 30px !important;
    padding-top: 20px !important;
  }

  .core-result small {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    margin-bottom: 11px !important;
    white-space: nowrap !important;
    word-break: normal !important;
  }

  .core-result b {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    font-size: clamp(25px, 7vw, 32px) !important;
    line-height: 1.12 !important;
  }

  /* =======================================================
     HOW ENTER WORKS / STORY
     ======================================================= */

  .story {
    padding: 92px 0 110px !important;
  }

  .story-title {
    width: calc(100% - 32px) !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 34px !important;
  }

  .story-grid {
    display: block !important;
    grid-template-columns: none !important;
    width: calc(100% - 32px) !important;
    max-width: none !important;
  }

  .story-steps {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;

    width: 100% !important;

    margin: 0 0 22px !important;
    padding: 0 !important;

    overflow: visible !important;
  }

  .story-step,
  .story-step:last-child {
    grid-column: auto !important;

    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;

    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 12px !important;

    padding: 15px 16px !important;

    border: 1px solid rgba(148, 164, 220, .10) !important;
    border-radius: 15px !important;

    background: rgba(12, 15, 23, .64) !important;

    opacity: .54 !important;
  }

  .story-step.active {
    opacity: 1 !important;
    border-color: rgba(111, 95, 255, .24) !important;
    background:
      linear-gradient(
        145deg,
        rgba(71, 91, 255, .08),
        rgba(104, 59, 255, .045)
      ) !important;
  }

  .story-step > small {
    padding-top: 3px !important;
    font-size: 10px !important;
  }

  .story-step h3 {
    margin: 0 !important;
    max-width: 100% !important;

    font-size: 21px !important;
    line-height: 1.12 !important;

    white-space: normal !important;
    word-break: normal !important;
  }

  .story-step p {
    display: none !important;

    max-width: 100% !important;

    margin-top: 8px !important;

    font-size: 13px !important;
    line-height: 1.55 !important;
  }

  .story-step.active p {
    display: block !important;
  }

  .story-stage {
    position: relative !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .stage-frame {
    position: relative !important;

    top: auto !important;

    width: 100% !important;
    max-width: 100% !important;

    height: 520px !important;
    min-height: 0 !important;

    border-radius: 20px !important;
  }

  .stage-head {
    height: 50px !important;
    padding: 0 14px !important;

    font-size: 8px !important;
    line-height: 1.35 !important;
  }

  .stage-head b {
    font-size: 8px !important;
  }

  .channel-node {
    left: 4% !important;

    width: 96px !important;

    padding: 0 10px !important;

    font-size: 9px !important;
  }

  .identity-core {
    left: 61% !important;

    width: 154px !important;
    height: 154px !important;
  }

  .identity-core small {
    font-size: 8px !important;
  }

  .identity-core b {
    font-size: 15px !important;
    text-align: center !important;
  }

  .identity-core span {
    font-size: 9px !important;
  }

  .stage-caption {
    left: 16px !important;
    right: 16px !important;
    bottom: 17px !important;

    gap: 12px !important;

    padding-top: 13px !important;
  }

  .stage-caption b {
    max-width: 52% !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
  }

  .stage-caption span {
    max-width: 45% !important;
    font-size: 10px !important;
    line-height: 1.45 !important;
  }

  .source-chip {
    min-width: 92px !important;
    padding: 9px !important;
    font-size: 9px !important;
  }

  .sc1,
  .sc3 {
    left: 3% !important;
  }

  .sc2,
  .sc4 {
    right: 3% !important;
  }

  .decision-flow {
    left: 16px !important;
    right: 16px !important;
    top: 13% !important;

    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .decision-flow i {
    display: none !important;
  }

  .decision-flow span {
    padding: 8px 6px !important;
    text-align: center !important;
    font-size: 8px !important;
  }

  .decision-card {
    left: 16px !important;
    right: 16px !important;
    top: 35% !important;

    padding: 17px !important;
  }

  .decision-card > b {
    font-size: 16px !important;
  }

  .decision-card > p {
    font-size: 11px !important;
  }

  .handoff-card {
    left: 16px !important;
    right: 16px !important;
  }

  /* =======================================================
     CONTROL CENTER
     ======================================================= */

  .control {
    padding: 90px 0 110px !important;
  }

  .control-copy {
    width: 100% !important;
    max-width: 100% !important;
  }

  .browser-wrap {
    margin-top: 38px !important;
  }

  .browser {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 16px !important;
  }

  .browserbar {
    height: 38px !important;
    padding: 0 12px !important;
  }

  .browserbar small {
    font-size: 8px !important;
  }

  .browser img {
    width: 100% !important;
    height: auto !important;
  }

  .browser aside {
    display: none !important;
  }

  /* =======================================================
     ASSISTANT / KNOWLEDGE / OTHER 2-COLUMN AREAS
     ======================================================= */

  .split {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 38px !important;
  }

  .split > * {
    min-width: 0 !important;
  }

  .knowledge-diagram {
    min-height: 0 !important;

    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .kpipes {
    display: none !important;
  }

  .kstudio {
    min-height: 165px !important;
  }

  .kresult {
    border-left: 0 !important;
    border-top: 1px solid rgba(109, 224, 177, .15) !important;
  }

  /* =======================================================
     FOOTER / FINAL
     ======================================================= */

  .final {
    padding: 125px 0 115px !important;
  }

  .final-copy {
    width: 100% !important;
    max-width: 100% !important;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 24px !important;
  }

  .footer-legal-links {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px 18px !important;
  }
}


/* =========================================================
   SMALL PHONE
   ========================================================= */

@media (max-width: 540px) {

  .container {
    width: calc(100% - 28px) !important;
  }

  .story-title,
  .story-grid {
    width: calc(100% - 28px) !important;
  }

  .hero h1 strong {
    font-size: clamp(40px, 11vw, 47px) !important;
  }

  .statement h2,
  .story h2,
  .control h2,
  .assistant h2,
  .knowledge h2,
  .autonomy h2,
  .final h2 {
    font-size: clamp(36px, 9.7vw, 41px) !important;
  }

  .section-lead {
    font-size: 14px !important;
  }

  .contrast-card {
    padding: 20px !important;
  }

  .context-stack span {
    padding: 8px 10px !important;
    font-size: 10px !important;
  }

  .stage-frame {
    height: 500px !important;
  }

  .story-step h3 {
    font-size: 20px !important;
  }

  .pcol {
    padding: 17px !important;
  }
}


/* =========================================================
   ENTER MOBILE V2.1
   headline line-break repair + stable system map
   ========================================================= */

@media (max-width: 800px) {

  /* -------------------------------------------------------
     Restore intentional headline breaks.
     V2 incorrectly hid <br>, causing words to concatenate.
     ------------------------------------------------------- */

  .statement h2 br,
  .story h2 br,
  .control h2 br,
  .assistant h2 br,
  .knowledge h2 br,
  .autonomy h2 br,
  .final h2 br {
    display: block !important;
  }

  .statement h2 span,
  .story h2 span,
  .control h2 span,
  .assistant h2 span,
  .knowledge h2 span,
  .autonomy h2 span,
  .final h2 span {
    display: block !important;
  }

  /* Story title needs a little more restraint on phones */
  .story-title h2 {
    font-size: clamp(36px, 9.4vw, 43px) !important;
    line-height: 1.04 !important;
    letter-spacing: -.045em !important;
  }

  .story-title h2 > span {
    margin-top: 3px !important;
  }

  /* Final CTA: long Russian word "взаимодействие" must fit */
  .final h2 {
    font-size: clamp(35px, 9vw, 42px) !important;
    line-height: 1.04 !important;
    letter-spacing: -.044em !important;
  }

  .final h2 > span {
    margin-top: 4px !important;
  }

  /* -------------------------------------------------------
     Story steps: readable even when desktop JS changes active
     ------------------------------------------------------- */

  .story-step {
    opacity: 1 !important;
  }

  .story-step h3 {
    color: rgba(238, 240, 246, .78) !important;
  }

  .story-step > small {
    color: rgba(133, 145, 168, .72) !important;
  }

  .story-step.active {
    opacity: 1 !important;
  }

  .story-step.active h3 {
    color: #f0f1f5 !important;
  }

  /* -------------------------------------------------------
     Mobile LIVE SYSTEM MAP
     Freeze on the clearest identity example.
     Desktop remains fully animated.
     ------------------------------------------------------- */

  .story-stage .stage-panel {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: none !important;
    pointer-events: none !important;
  }

  .story-stage .stage-panel[data-stage="identity"] {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }

  .stage-frame {
    height: 500px !important;
    min-height: 500px !important;
  }

  .stage-head {
    padding: 0 15px !important;
  }

  .stage-head > span {
    max-width: 64% !important;
    font-size: 8px !important;
    line-height: 1.35 !important;
  }

  .stage-head > b {
    flex-shrink: 0 !important;
    font-size: 8px !important;
  }

  /* Better composition for Anna / channel identity diagram */

  .channel-node {
    left: 5% !important;
    width: 104px !important;
    height: 42px !important;
    font-size: 10px !important;
  }

  .identity-core {
    left: 62% !important;
    top: 47% !important;

    width: 160px !important;
    height: 160px !important;
  }

  .identity-core small {
    font-size: 8px !important;
  }

  .identity-core b {
    max-width: 135px !important;
    margin-top: 9px !important;

    font-size: 16px !important;
    line-height: 1.15 !important;
    text-align: center !important;
  }

  .identity-core span {
    font-size: 9px !important;
  }

  .stage-caption {
    left: 17px !important;
    right: 17px !important;
    bottom: 18px !important;

    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
    align-items: end !important;
  }

  .stage-caption b {
    max-width: none !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
  }

  .stage-caption span {
    max-width: none !important;
    font-size: 10px !important;
    line-height: 1.4 !important;
    text-align: right !important;
  }
}


@media (max-width: 540px) {

  .story-title h2 {
    font-size: clamp(35px, 9.2vw, 40px) !important;
  }

  .final h2 {
    font-size: clamp(34px, 8.8vw, 39px) !important;
  }

  .stage-frame {
    height: 480px !important;
    min-height: 480px !important;
  }

  .identity-core {
    left: 63% !important;
    width: 150px !important;
    height: 150px !important;
  }

  .channel-node {
    width: 98px !important;
    font-size: 9px !important;
  }
}


/* =========================================================
   ENTER MOBILE V2.2
   crisp live map + restore real stage switching
   ========================================================= */

@media (max-width: 800px) {

  /*
   * V2.1 froze identity while desktop JS continued
   * changing .visible. That exposed the desktop blur state.
   *
   * V2.2 restores normal five-panel switching on mobile,
   * but never blurs panels.
   */

  .story-stage .stage-panel,
  .story-stage .stage-panel[data-stage="identity"] {
    display: block !important;

    opacity: 0 !important;
    visibility: hidden !important;

    transform: none !important;

    filter: none !important;
    -webkit-filter: none !important;

    pointer-events: none !important;

    transition:
      opacity .24s ease,
      visibility .24s ease !important;
  }

  .story-stage .stage-panel.visible,
  .story-stage .stage-panel[data-stage="identity"].visible {
    display: block !important;

    opacity: 1 !important;
    visibility: visible !important;

    transform: none !important;

    filter: none !important;
    -webkit-filter: none !important;
  }

  /*
   * Do not let a parent introduce optical blur.
   */
  .story-stage,
  .stage-frame {
    filter: none !important;
    -webkit-filter: none !important;
  }

  /*
   * Active/inactive step distinction.
   * Non-active steps stay readable, but clearly secondary.
   */

  .story-step {
    opacity: .58 !important;

    transition:
      opacity .28s ease,
      border-color .28s ease,
      background .28s ease !important;
  }

  .story-step h3 {
    color: rgba(220, 225, 236, .60) !important;
    transition: color .28s ease !important;
  }

  .story-step > small {
    color: rgba(121, 133, 155, .58) !important;
  }

  .story-step.active {
    opacity: 1 !important;

    border-color:
      rgba(111, 95, 255, .28) !important;

    background:
      linear-gradient(
        145deg,
        rgba(70, 91, 255, .08),
        rgba(107, 60, 255, .045)
      ) !important;
  }

  .story-step.active h3 {
    color: #f2f3f7 !important;
  }

  .story-step.active > small {
    color: rgba(157, 169, 194, .92) !important;
  }

  /*
   * The expanded copy belongs only to the step
   * the user has actually reached.
   */

  .story-step p {
    display: none !important;
  }

  .story-step.active p {
    display: block !important;
  }
}
